function switchmodule(module_id) {
	if (document.getElementById(module_id + '_show').style.display != "none"){
		document.getElementById(module_id + '_show').style.display = "none";
		document.getElementById(module_id + '_hide').style.display = "block";
		document.getElementById(module_id).style.display = "block";
			setcookie(module_id,'block');
	}else{
		document.getElementById(module_id + '_show').style.display = "block";
		document.getElementById(module_id + '_hide').style.display = "none";
		document.getElementById(module_id).style.display = "none";
			setcookie(module_id,'none');
	}
}

function setcookie(name,value){
	Now = new Date();
	Now.setTime(TTL = (24*60*60*1000) + Now.getTime());
	TTL = (Now.toGMTString());
	document.cookie = name + '=' + escape(value) + "; expires="+TTL;
}

/*
document.write('<style type="text/css">');
document.write('#pageloader_position { position: absolute; top: 0px; right: 0px; bottom: 0px; left: 0px; width: auto; height: 1000px; background: #EFEFEF url(images/pageloader.gif) 50% 9% no-repeat; z-index: 10000; }');
document.write('#pageloader_position { filter: alpha(opacity=70); -moz-opacity: 0.7; -khtml-opacity: 0.7; opacity: 0.7; }');
document.write('#pageloader { position: relative; width: 50%; text-align: center; margin: 245px auto; z-index: 10000; }');
document.write('</style>');

document.write('<div id="pageloader_position"><div id="pageloader">&nbsp;</div></div>');
*/
function hideloader() {
	document.getElementById('pageloader').style.display = "none";
	document.getElementById('pageloader_position').style.display = "none";
}

// Getting the available browser width, each step degrades browsers and get's a less accurate number.
function getBrowserWidth(){
	if (window.innerWidth){
		return window.innerWidth;
	}else if (document.documentElement && document.documentElement.clientWidth != 0){
		return document.documentElement.clientWidth;
	}else if(document.body.clientWidth){
		return document.body.clientWidth;
	}else{
		return window.screen.availWidth;
	}
}
function changeWidth(){
	var wAvail = getBrowserWidth();
	if (wAvail < 1000){
		setStylesheet("Low");
	}else{
		setStylesheet("Normal");
	}
}
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;
}

/* Everything else */
	changeWidth();
/* Opera and IE */
	if (window.attachEvent) window.attachEvent("onload", changeWidth);
/* for Mozilla browsers */
	if (document.addEventListener) { document.addEventListener("DOMContentLoaded", changeWidth, null); }
/* If they resize, we'll need to change aswell */
	window.onresize = changeWidth;
/* Finally correct the contain div to correct height */
	window.onload = correctFloat;
