// JavaScript Document
function getBrowserWindowSize()
{
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' )
{
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
}
else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
{
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
}
else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
{
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}

return {width:myWidth, height:myHeight};
}

function changeStyleSheet(url) {
document.getElementById('stylesheet').href = url;
}


function resize() {
	if (document.getElementById("stylesheet")) {
					
		var stylesheetname = document.getElementById("stylesheet").href;
		stylesheetname = stylesheetname.substr(stylesheetname.lastIndexOf("/")+1);
					
		var browserWindowSize = getBrowserWindowSize();
		var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
					
		if ((browserWindowSize.height < 700)&&(!scrolling)&&(typeof document.body.style.maxHeight != "undefined")) {
			scrolling = true;
			document.getElementById("middlewrap").style.paddingTop = "15px";
			document.getElementById("footerwrap").style.position = "relative";
			document.getElementById("headerwrap").style.position = "relative";
			document.getElementById("content_gap").style.display = "none";
			document.getElementById("sidebar_gap").style.display = "none";
		}   
		else if ((browserWindowSize.height > 699)&&(scrolling)&&(typeof document.body.style.maxHeight != "undefined")) {
			scrolling = false;
			document.getElementById("middlewrap").style.paddingTop = "344px";
			document.getElementById("footerwrap").style.position = "fixed";
			document.getElementById("headerwrap").style.position = "fixed";
			document.getElementById("content_gap").style.display = "inline";
			document.getElementById("sidebar_gap").style.display = "inline";
		}   
	} 
}