checkBrowserWidth();

function checkBrowserWidth()
{
	var theWidth = getBrowserWidth();

	//alert(theWidth);
	
	if (theWidth > 1200)
	{
		setStylesheet("over1200");
	}
	else
	{
		setStylesheet("under1200");
	}
	
	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 setStylesheet(styleTitle)
{
	document.styleSheets[0].disabled = true;
	document.styleSheets[1].disabled = true;
	if (styleTitle == "over1200")
	{
		document.styleSheets[0].disabled = false;
 		document.getElementById('hi').src = '/images/header2.jpg';
 		document.getElementById('footergraphics').src = '/images/footer-graphics2.jpg';
	}
	if (styleTitle == "under1200")
	{
		document.styleSheets[1].disabled = false;
		//var eleTables = document.getElementsByTagName("table");
		//for ( var i=0; i < eleTables.length; i++ )
		//{
			//if (eleTables[i].className == "prod-detail")
			//{
				//alert(eleTables[i].offsetWidth);
			//}
		//}
		var images = document.getElementsByTagName("img");
		for (i = 0; i < images.length; i++)
		{
			var tmpstr = document.getElementsByTagName("img")[i].src;
			if ( tmpstr.match("images/products/display") || tmpstr.match("ProductImages") )
			{
				if ( !tmpstr.match("Thumb") && !tmpstr.match("thumb") )
				{
					document.getElementsByTagName("img")[i].width = "350";
				}
			}
		}
	}
};


