/*
JavaScript file for Switching Style Sheets within the Yaletown theme for Wordpress.
*/
function getBrowserWidth() {
	if (screen.width)
		var iWidth = screen.width;
	else
		var iWidth = 800;
	
	if (window.innerHeight) { // All but Explorer
		iWidth = window.innerWidth; 
	} else if (document.documentElement && document.documentElement.clientWidth) { // Explorer 6 Strict Mode 
		iWidth = document.documentElement.clientWidth; 
	} else if (document.body && document.body.clientWidth) { // other Explorers
		iWidth = document.body.clientWidth; 
	}
	return iWidth;
}
function setActiveStyleSheet() {
	if (document.getElementsByTagName) {
		var sTitle = "default";
		if(getBrowserWidth() >= 1000) {
			sTitle = "wide";
		}
		var oElement;
		for(var i = 0; (oElement = document.getElementsByTagName("link")[i]); i++) {
			if (oElement.getAttribute("rel").indexOf("style") != -1 && oElement.getAttribute("title")) {
				oElement.disabled = true;
				if (oElement.getAttribute("title") == sTitle)
					oElement.disabled = false;
			}
		}
	}
}

