<!--
function setStyle(style, auto){
	if(auto == 0){
		var exp = new Date( ); var nowPlusOneWeek = exp.getTime( ) + (7 * 24 * 60 * 60 * 1000); exp.setTime(nowPlusOneWeek);	
		document.cookie = "auto=0;expires=" + exp.toGMTString( ) +"";	
	}		
	if(style == "null") return 0;
	oldStyle = getCookie("style");
	if(oldStyle != null){
		if(oldStyle.substr(oldStyle.length -5,5) == "small") small_old = 1;
		else small_old = 0;
	}else{
		small_old = 0;
	}
	if(style.substr(style.length-5,5) == "small") small = 1;
	else small = 0;
	
	var exp = new Date( ); var nowPlusOneWeek = exp.getTime( ) + (7 * 24 * 60 * 60 * 1000); exp.setTime(nowPlusOneWeek);	
	document.cookie = "style="+style+";expires=" + exp.toGMTString( ) +"";		
	if(small_old == small){
		for (var i = 0; i < document.styleSheets.length; i++) {
			// loop through each styleSheet object
			if(small == 0) extra = "";
			else extra = "-small";

			var i, a, main;
			for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
				if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
					a.disabled = true;
					if(a.getAttribute("title") == style) a.disabled = false;
				}
			}			
			document.images[0].src = "/_images/_styles/"+style+"/logo.jpg";
			return(0);	
		}
	}
	if(getCookie("style") == style) document.location = document.location;
}
function getCookie(name) {
    var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + prefix);
    if (begin == -1) { begin = dc.indexOf(prefix); if (begin != 0) return null; } 
	else { begin += 2; }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) { end = dc.length; }
    return unescape(dc.substring(begin + prefix.length, end));
}
window.onload = function(e) {
	if((getCookie("style") == null) || (getCookie("auto") == 1)){
		var myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' ) {
			//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 || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
		}
		if(myWidth <= 970){
			var exp = new Date( ); var nowPlusOneWeek = exp.getTime( ) + (7 * 24 * 60 * 60 * 1000); exp.setTime(nowPlusOneWeek); document.cookie = "auto=1;expires=" + exp.toGMTString( ) +";path=/mopar/"; setStyle("aar-blue-small",1);
		}else{
			if(getCookie("auto")){setStyle("aar-blue",1);}
		}
	}
}
//-->