// do we still need this DW artifact? -soward 10/30/2005
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
	if (init==true) with (navigator) {
		if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
			document.MM_pgW=innerWidth; 
			document.MM_pgH=innerHeight; 
			onresize=MM_reloadPage;
		}
	} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) {
		location.reload();
	}
}
MM_reloadPage(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;
	} else {
		return 0;
	}
}

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;
}

function resolution() {

	theWidth = getBrowserWidth();

	//document.getElementById('rez').innerHTML = theWidth;

	if (theWidth > 840) {
		setStylesheet("regular resolution");
	} 
	if (theWidth > 550 && theWidth < 840) {
       	 	setStylesheet("medium resolution");
		return true;
    	} 
	if (theWidth < 550)  {
		setStylesheet("smaller resolution");
	}
	/*
	if (window.onresize) {
		location.reload();
	}
	*/
}
resolution();
window.onresize = resolution;
