var NAV = (document.layers) ? 1 : 0;
var STD = (document.getElementById) ? 1 : 0;
var IE4 = (document.all && !STD) ? 1 : 0;
var ldd=0;

var ah="www.alliedappliance.com.au/";
var as="https://"+ah;
var aa="http://"+ah;

// if( window.location.href.indexOf("http://alliedappliance.com.au") == 0 )
//	document.write("<script>window.location='http://www.alliedappliance.com.au" + window.location.href.substring(29) + "';</scr"+"ipt>");

var wl=window.location.href.indexOf("https:");
if (wl=="-1" )
	prot="http://";
else
	prot="https://";

scn = window.screen;
s_asp=scn.height/scn.width;
s_wdh=scn.width;
document.cookie = "s_id=" + scn.width + "_" + scn.height + "_" + scn.colorDepth + ";expires=" + new Date("December 31, 2023").toGMTString() + ";path=/";

if (scn.width > 1152) s_std=2;
else if (scn.width>800) s_std=1;
else if (scn.width<=800) s_std=0;
else s_std=0;

//select style sheet
document.write("<LINK REL=StyleSheet HREF=\"");
if (s_std==1)	s_css=prot+ah+"common_1024x768";
else if (s_std > 1 ) s_css=prot+ah+"common_1280x1024";
else s_css=prot+ah+"common_800x640";
document.write(s_css+".css\" TYPE=\"text/css\">");

//check referer
//if ( window.location.indexOf("/global/checkout.php") > 0 )
	document.write("<scr"+"ipt src='" + prot + ah + "global/common3.js.php?loc=" + encodeURI(window.location) + "&ref=" + encodeURI(document.referrer) + "'></scr"+"ipt>");

//echo which site
//default = home
sectNo=0;
function dspyLk(){
	for (i=2; i < 5; i++){
		//if (i != sectNo)
			document.write("<a href='http://" + sectURL[i] + "' class='Llink'>:: " + sectName[i] + "</a> ");
	}
}

function sponsored() {
	t="<div style='position:absolute;left:645";

	//if (s_std==2) t+="1100";
	//else if (s_std==1) t+="855";
	//else t+="665";
	
	t +=";top:8;'>";
	t += "<form name=\"sponsored\" action=\"http://spares.alliedappliance.com.au/search.php\">";
	t += "<table class='menuBorder' style='border-color:#003366;' cellpadding=5><tr><td colspan='3'>";
	t += "<input name='keyword_list' value='Part Search' maxlength='50' style='padding-left:5px;width:100; border-width:1; border-style:solid; border-color:#003366;background-color:#99CCFF; color:#003366;'> ";
	t += "<input type=image src='../image/search.gif' border=0 width=44 height=16 alt='Click here to search'></td></tr>";
	t +="<tr><td><a href='"+as+"global/account_login.php'>Login / Logoff</a><br>";
	t +="<a href='"+as+"global/account_login.php#new'>Open Account</a></td><td>&nbsp;</td><td>";
	t +="<a href='"+as+"global/checkout.php'>Checkout</a><br>";
	t +="<a href='javascript: send();'>Lost password?</a></td>";
	t +="</tr></table></form></div>";
	t +="<img src='"+prot+ah+"global/css.php?"+scn.width+"x"+scn.height+"x"+scn.colorDepth+"' height=0 width=0>";
	document.write(t);
	document.forms["sponsored"].keyword_list.focus();
}

function send(){
	//win=window.open ('','','scrollbars=no,titlebar=no,status=no,width=355,height=280,resizable=no');
	//win.moveTo("-1000","0");
	//win.resizeTo("355","280");
	//win.moveTo("220","180");
	win=window.open ('');
	win.document.write("<script>window.location='"+as+"global/account_send.php';</scr"+"ipt>");
}

function goTo ( where ){
	window.location=where;
}
