function getBrowserWidth() {
	var myWidth = 0, myHeight = 0;
	if(( typeof( window.innerWidth ) == 'number' ) && (window.innerWidth > 0)) { //Non-IE
		myWidth = window.innerWidth;
	} else if( document.documentElement && document.documentElement.clientWidth ) { //IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
	} else if( document.body && document.body.clientWidth ) { //IE 4 compatible
		myWidth = document.body.clientWidth;
	} else { // IE 5 MAC
		myWidth = document.documentElement.offsetWidth;
	}
	return myWidth;
}

function getScreenWidth() {
	return screen.width;
}


var curStyle;

if (getScreenWidth() < 800) {
	curStyle = 'handheld';
} else {
	if (getBrowserWidth() <= 900) {
		curStyle = 'small';
	} else {
		curStyle = 'large';
	}
}

document.write('<link href="/'+curStyle+'.css" rel="stylesheet" type="text/css" />\n');
if (curStyle == 'large') { 
	document.write('<!--[if lte IE 6]><link href="/large-iefix.css" rel="stylesheet" type="text/css" /><![endif]-->\n');
} else if (curStyle == 'small') { 
	document.write('<!--[if lte IE 6]><link href="/small-iefix.css" rel="stylesheet" type="text/css" /><![endif]-->\n');
}
