// JavaScript Document
var siteWidth;
var thisPage;
function initWidth() {
	siteWidth = getWidth();
	if(siteWidth >= 1220) {
		siteWidth = 1200;
	} else {		
		siteWidth = 900;
	}
}
function checkPage() {
	var newWidth = getWidth();
	if(newWidth >= 1220) {
		newWidth = 1200;
	} else {		
		newWidth = 900;
	}
	if(siteWidth != newWidth) {
		siteWidth = newWidth;
		window.document.location.href = thisPage;
	}
}
function getWidth() {
	if(typeof(window.innerWidth) == 'number') {
   		//Non-IE
    	return window.innerWidth;
	} else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
    	//IE 6+ in 'standards compliant mode'
    	return document.documentElement.clientWidth;
	} else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
    	//IE 4 compatible
    	return document.body.clientWidth;
	}
}
function checkSize() {
	if(siteWidth == 900) {
		document.write('<link rel="stylesheet" type="text/css" href="css/small.css" />\n');
		document.write('<link rel="stylesheet" type="text/css" href="css/small_content.css" />\n');
	}
}
initWidth();
thisPage = window.document.location.href;
window.onresize = checkPage;

