function modRule(myWidth)
{
	//if (!document.styleSheets) return;
	//var thecss = new Array();
	//if (document.styleSheets[0].cssRules)  // Standards Compliant
	//{
	//	thecss = document.styleSheets[0].cssRules;
	//}
	//else
	//{
	//	thecss = document.styleSheets[0].rules;  // IE
	//}
	//alert(document.body.backgroundImage.url);
	//alert(document.body.style);
	if(myWidth > 1200){
		document.body.style.background = "#FFFFFF url(/layout/bg_1600.jpg) no-repeat fixed top";
	} 
	else if(myWidth <= 1024) {
		document.body.style.background = '#FFFFFF url(/layout/bg_1024.jpg) no-repeat fixed top';
	}
	else {
		document.body.style.background = '#FFFFFF url(/layout/bg_1200.jpg) no-repeat fixed top';
	}
	//alert(document.body.style.background);
	//for (i=0;i<thecss.length;i++){
		//alert(thecss[i].selectorText.toLowerCase());
		//if (thecss[i].selectorText.toLowerCase() == '#tinfoil'){
		//	if(myWidth > 1200){
		//		thecss[i].style.width = '1004px';
		//	} 
		//	else if(myWidth < 780) {
		//		thecss[i].style.width = '780px';
		//	}
		//	else {
		//		thecss[i].style.width = '100%';
		//	}
 	  	//}
 	//}
}

function checkWindowSize() {
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  modRule(myWidth);
}