/* Navigation function */
var vNavToProjCar = ""
var vNavToProjCar
function nav(pUrl){
	if (pUrl!=""){
		if(vNavToProjCar){window.location=vNavToProjCar+pUrl}
		else{window.location=pUrl}}
}
/* SHOW SUB MENU */
var vLayShow = "SubMenu1" // variable to say which layer is showing
var vSubLayShow = "SubSubMenu1"
var aTop = new Array();
var aLeft = new Array();
var aSubTop = new Array();
var aSubLeft = new Array();

function fSSubMenu(mWhich){
/* create array to hold the positions of level 1 menus */
aTop[1]=70;		aLeft[1]=132;
aTop[2]=40;		aLeft[2]=132;
aTop[3]=257;	aLeft[3]=132;
aTop[4]=307;	aLeft[4]=132;
aTop[5]=55;		aLeft[5]=132;
aTop[6]=80;		aLeft[6]=132;
/* create array to hold the positions of level 2 menus */
aSubTop[1]=221;		aSubLeft[1]=244;
aSubTop[2]=246;		aSubLeft[2]=244;
aSubTop[3]=90;		aSubLeft[3]=265;
aSubTop[4]=102;		aSubLeft[4]=265;
aSubTop[5]=117;		aSubLeft[5]=265;
aSubTop[6]=202;		aSubLeft[6]=265;
aSubTop[7]=327;		aSubLeft[7]=265;
aSubTop[8]=277;		aSubLeft[8]=265;
aSubTop[9]=40;		aSubLeft[9]=265;
aSubTop[10]=253;	aSubLeft[10]=265;
aSubTop[11]=239;	aSubLeft[11]=265;
aSubTop[12]=314;	aSubLeft[12]=265;
aSubTop[13]=165;	aSubLeft[13]=265;

// loop round and change the top point
var vinc=112
for (i=1; i<7; i++){
	aTop[i]=aTop[i]+vinc;
}
for (i=1; i<14; i++){
	aSubTop[i]=aSubTop[i]+vinc;
}
//alert (aSubTop[1]);
/* set all the layers to 0 *
for (i=1;i<aTop.length;i++){
	document.all["SubMenu"+i].style.top=0;
	document.all["SubMenu"+i].style.left=0;
}
for (i=1;i<aSubTop.length;i++){
	document.all["SubSubMenu"+i].style.top=0;
	document.all["SubSubMenu"+i].style.left=0;
}
/* hide any layer that is showing */
document.all[vLayShow].style.visibility="hidden";
document.all["SubMenu"+mWhich].style.top=aTop[mWhich];
document.all["SubMenu"+mWhich].style.left=aLeft[mWhich];
document.all["SubMenu"+mWhich].style.visibility="visible";
vLayShow = "SubMenu"+mWhich;
}
function fSSubSubMenu(a,b){
fSSubMenu(b)
document.all[vSubLayShow].style.visibility="hidden";
document.all["SubSubMenu"+a].style.top=aSubTop[a];
document.all["SubSubMenu"+a].style.left=aSubLeft[a];
document.all["SubSubMenu"+a].style.visibility="visible";
vSubLayShow = "SubSubMenu"+a;
}
/* HIDE SUB MENU */
function fHSubMenu(){
document.all[vLayShow].style.visibility="hidden";
document.all[vSubLayShow].style.visibility="hidden";
}
/* CREATE THE CELLS IN THE MENU */
function fBuildMenu(vTitle,vUrl,vStatus,vArrow,vMOver){
	document.write("<TR><TD class=out TITLE='"+vStatus+"' OnMouseOver=\"this.className='over';");
	if(vMOver){document.write(vMOver+";");}
	document.write("window.status='"+vStatus+"!';return true;\"");
	document.write("OnMouseOut=\"this.className='out';");
	if(vMOver){document.write("fHSubMenu();");}
	document.write("window.status='';return true\" OnClick=\"nav('"+vUrl+"')\">");
	if(vArrow){
		if(vNavToProjCar){document.write("<IMG SRC=\""+vNavToProjCar+"../images/arrs.gif\" ALIGN=right>");}
		else{document.write("<IMG SRC=\"../images/arrs.gif\" ALIGN=right>");}}
	document.write(vTitle+"</TD></TR>");
}
function fMenuOpen(pMenName,pClass){
document.write("<DIV ID="+pMenName+" CLASS="+pClass+"><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>");
if (pClass=="m1"){
fadvert()
}
}
function fMenuClose(){
document.write("</TABLE></DIV>");
}
function fadvert(){
document.write("<div style=\"position:relative;\">");
document.write("<a href=\"http://www.moneysupermarket.com/\" alt=\"Moneysupermarket.com\">");
document.write("<div style=\"background-image:url('125screen.gif');background-repeat:no-repeat;width:125px;height:125px;cursor:pointer;display:inline-block;\">");
document.write("</div> </a>");
document.write("<span style=\"position:absolute;left:30px;top:25px;\">");
document.write("<a href=\"http://www.moneysupermarket.com/motor/\" style=\"text-decoration:none;font-family:tahoma;font-size:12px;font-weight:bold;color:#402878;\">car insurance</a>");
document.write("</span>");
document.write("<span style=\"position:absolute;left:30px;top:60px;\">");
document.write("<a href=\"http://www.moneysupermarket.com/loans/ \" style=\"text-decoration:none;font-family:tahoma;font-size:12px;font-weight:bold;color:#402878;\">car loans</a>");
document.write("</span>");
document.write("</div>");
}