function checkBrowserWidth()
{
	var theWidth = getBrowserWidth();

	if (theWidth > 950 )
	{
		setStylesheet("Features 1024 x 768");
	}
	else
	{
		setStylesheet("Features");
	}
	
	return true;
}




function checkFeatureHeights()
{
	var theWidth = getBrowserWidth();
	
	checkBrowserWidth();

	if ((theWidth > 950 && document.getElementById("feature3Inner")) || (theWidth > 0 && document.getElementById("feature3Inner") && !document.getElementById("feature4Inner")))
	{
		setColumnHeights();
	}
	else
	{
		setColumnHeights("auto");
	}
	
	return true;
}




function getBrowserWidth()
{
	if (window.innerWidth)
	{
		return window.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientWidth != 0)
	{
		return document.documentElement.clientWidth;
	}
	else if (document.body)
	{
		return document.body.clientWidth;
	}
	
	return 0;
}




function setColumnHeights(auto)
{
	var theFeature2 = document.getElementById("feature2Inner");
	var theFeature2Title = document.getElementById("feature2Title");
	var theFeature3 = document.getElementById("feature3Inner");
	var theFeature3Title = document.getElementById("feature3Title");
	var theFeature4 = document.getElementById("feature4Inner");
	var theFeature4Title = document.getElementById("feature4Title");
	var theHeight = "auto";
	var theTitleHeight = "auto";

	if (!auto)
	{
		theTitleHeight = parseInt(theFeature2Title.scrollHeight);
		
		if (theFeature3Title && theFeature3Title.scrollHeight > theTitleHeight)
		{
			theTitleHeight = parseInt(theFeature3Title.scrollHeight);
		}

		if (theFeature4Title && theFeature4Title.scrollHeight > theTitleHeight)
		{
			theTitleHeight = parseInt(theFeature4Title.scrollHeight);
		}
		
		theTitleHeight -= 18;
		theTitleHeight += "px";
	}

	if (theFeature2Title)
	{
		theFeature2Title.style.height = theTitleHeight;
	}
	
	if (theFeature3Title)
	{
		theFeature3Title.style.height = theTitleHeight;
	}
	
	if (theFeature4Title)
	{
		theFeature4Title.style.height = theTitleHeight;
	}
	
	if (!auto)
	{
		theHeight = parseInt(theFeature2.scrollHeight);

		if (theFeature3 && theFeature3.scrollHeight > theHeight)
		{
			theHeight = parseInt(theFeature3.scrollHeight);
		}

		if (theFeature4 && theFeature4.scrollHeight > theHeight)
		{
			theHeight = parseInt(theFeature4.scrollHeight);
		}

		theHeight += 15;

		theHeight += "px";
	}

	if (theFeature2)
	{
		theFeature2.style.height = theHeight;
	}
	
	if (theFeature3)
	{
		theFeature3.style.height = theHeight;
	}
	
	if (theFeature4)
	{
		theFeature4.style.height = theHeight;
	}
	
	return true;
}




function setStylesheet(styleTitle)
{
	var currTag;

	if (document.getElementsByTagName)
	{
		for (var i = 0; (currTag = document.getElementsByTagName("link")[i]); i++)
		{
			if (currTag.getAttribute("rel").indexOf("style") != -1 && currTag.getAttribute("title"))
			{
				currTag.disabled = true;

				if(currTag.getAttribute("title") == styleTitle)
				{
					currTag.disabled = false;
				}
			}
		}
	}
	
	return true;
}
