/*** 
This is the menu creation code - place it right after you body tag
Feel free to add this to a stand-alone js file and link it to your page.
**/

//Extra code to find position:
function findPos(){ 
  if(bw.ns4){   //Netscape 4
    x = document.layers.layerMenu.pageX
    y = document.layers.layerMenu.pageY
  }else{ //other browsers
    x=0; y=0; var el,temp
    el = bw.ie4?document.all["divMenu"]:document.getElementById("divMenu");
    if(el.offsetParent){
      temp = el
      while(temp.offsetParent){ //Looping parent elements to get the offset of them as well
        temp=temp.offsetParent; 
        x+=temp.offsetLeft
        y+=temp.offsetTop;
      }
    }
    x+=el.offsetLeft
    y+=el.offsetTop
  }
  //Returning the x and y as an array
  return [x,y]
}

pos = findPos()

//Menu object creation
oCMenu=new makeCM("oCMenu") //Making the menu object. Argument: menuname

//Menu properties   
oCMenu.pxBetween=1
//Using the cm_page object to place the menu ----
oCMenu.fromLeft=pos[0]
oCMenu.fromTop=pos[1]
//We also need to "re place" the menu on resize. So:
oCMenu.onresize="pos = findPos(); oCMenu.fromLeft=pos[0]; oCMenu.fromTop=pos[1]"

oCMenu.rows=2
oCMenu.menuPlacement=0
       

                                                             
oCMenu.offlineRoot="" 
oCMenu.onlineRoot="" 
oCMenu.resizeCheck=1 
oCMenu.wait=1000 
oCMenu.fillImg="cm_fill.gif"
oCMenu.zIndex=0


//Netscape 4 and Opera form work-around !! !! !! !! !!
if(bw.ns4 || bw.op5 || bw.op6){
  oCMenu.onshow="document.layers?document.layers.formLayer.visibility='hidden':document.getElementById('formDiv').style.visibility='hidden';"
  oCMenu.onhide="document.layers?document.layers.formLayer.visibility='visible':document.getElementById('formDiv').style.visibility='visible';"
}

//Background bar properties
oCMenu.useBar=1
oCMenu.barWidth="1"
oCMenu.barHeight="1" 
oCMenu.barClass=""
oCMenu.barX=0 
oCMenu.barY=0
oCMenu.barBorderX=0
oCMenu.barBorderY=0
oCMenu.barBorderClass="clBarborder"



//Level properties - ALL properties have to be spesified in level 0
oCMenu.level[0]=new cm_makeLevel() //Add this for each new level
oCMenu.level[0].width=82
oCMenu.level[0].height=25 
oCMenu.level[0].regClass="clLevel0"
oCMenu.level[0].overClass="clLevel0over"
oCMenu.level[0].borderX=1
oCMenu.level[0].borderY=1
oCMenu.level[0].borderClass=""
oCMenu.level[0].offsetX=0
oCMenu.level[0].offsetY=0
oCMenu.level[0].rows=0
oCMenu.level[0].align="bottom"
oCMenu.level[0].zIndex=50


//EXAMPLE SUB LEVEL[1] PROPERTIES - You have to specify the properties you want different from LEVEL[0] - If you want all items to look the same just remove this
oCMenu.level[1]=new cm_makeLevel() //Add this for each new level (adding one to the number)
oCMenu.level[1].width=oCMenu.level[0].width
oCMenu.level[1].height=25
oCMenu.level[1].regClass="clLevel1"
oCMenu.level[1].overClass="clLevel1over"
oCMenu.level[1].borderX=1
oCMenu.level[1].borderY=1
oCMenu.level[1].align="right" 
oCMenu.level[1].offsetX=0
oCMenu.level[1].offsetY=0
oCMenu.level[1].borderClass="clLevel1border"
oCMenu.level[1].zIndex=5
oCMenu.level[1].arrow="images/arrow.gif"
oCMenu.level[1].arrowWidth=6
oCMenu.level[1].arrowHeight=13


//EXAMPLE SUB LEVEL[2] PROPERTIES - You have to spesify the properties you want different from LEVEL[1] OR LEVEL[0] - If you want all items to look the same just remove this
oCMenu.level[2]=new cm_makeLevel() //Add this for each new level (adding one to the number)
oCMenu.level[2].width=oCMenu.level[1].width
oCMenu.level[2].height=22
oCMenu.level[2].regClass="clLevel1"
oCMenu.level[2].overClass="clLevel1over"
oCMenu.level[1].borderX=1
oCMenu.level[1].borderY=1
oCMenu.level[1].align="right" 
oCMenu.level[1].offsetX=0
oCMenu.level[1].offsetY=0
oCMenu.level[2].borderClass="clLevel1border"
oCMenu.level[2].zIndex=5

/******************************************
Menu item creation:
myCoolMenu.makeMenu(1name, 2parent_name, 3text, 4link, 5target, 6width, 7height, 8regImage, 9overImage, regClass, overClass , align, rows, nolink, onclick, onmouseover, onmouseout) 
*************************************/
oCMenu.makeMenu('top1','','products','#','','87','41','images/products_01.gif','images/products_02.gif')
	oCMenu.makeMenu('sub10','top1','car insurance','car-insurance.asp','','180','')
	oCMenu.makeMenu('sub11','top1','motorcycle insurance','motorcycle-insurance.asp','','180','')
	oCMenu.makeMenu('sub12','top1','caravan insurance','caravan-insurance.asp','','180','')
	oCMenu.makeMenu('sub13','top1','trailer insurance','trailer-insurance.asp','','180','')
	oCMenu.makeMenu('sub14','top1','watercraft  insurance','watercraft-insurance.asp','','180','')
	oCMenu.makeMenu('sub15','top1','buildings insurance','building-insurance.asp','','180','')
	oCMenu.makeMenu('sub16','top1','home contents insurance','home_contents.asp','','180','')
	oCMenu.makeMenu('sub17','top1','business insurance','business-insurance.asp','','180','')
	oCMenu.makeMenu('sub211','top1','value added products','value-added-products.asp','','180','')
	
	oCMenu.makeMenu('sub212','sub211','personal accident','personal-accident-plan.asp','','150')
    oCMenu.makeMenu('sub213','sub211','protection plan','protection-plan.asp','','150','','','','','')
	oCMenu.makeMenu('sub214','sub211','restore smart','restore_smart.asp','','150','','','','','')
	oCMenu.makeMenu('sub215','sub211','cellphone insurance','cell-phone-insurance.asp','','150','','','','','')
	oCMenu.makeMenu('sub216','sub211','expo-sure','expo-sure.asp','','150','','','','','')
	oCMenu.makeMenu('sub217','sub211','LEGAL & ID THEFT','pdf/Budget-Legal-Id-Theft.pdf','_blank','150','','','','','')
	
	
oCMenu.makeMenu('top5','','eQuote','','','70','41','images/eQuote_01.gif','images/eQuote_02.gif')
	oCMenu.makeMenu('sub50','top5','car & home insurance','equote.asp','','180','')
	oCMenu.makeMenu('sub51','top5','business insurance','business-insurance-quote.asp','','180','')
	oCMenu.makeMenu('sub52','top5','value added products','additional-insurance-quote.asp','','180','')
	oCMenu.makeMenu('sub53','top5','personal accident','personal-accident-insurance-quote.asp','','180','')
	oCMenu.makeMenu('sub54','top5','protection plan','funeral-insurance-quote.asp','','180','')
	oCMenu.makeMenu('sub55','top5','restore smart','dents-and-scratches-insurance-quote.asp','','180','')
	oCMenu.makeMenu('sub56','top5','cellphone insurance','cell-phone-insurance-quote.asp','','180','')
	
oCMenu.makeMenu('top2','','car rental','carrental.asp','','90','41','images/car-rental_01.gif','images/car-rental_02.gif')



oCMenu.makeMenu('top4','','contact us','contact_us.asp','','92','41','images/contact-us_01.gif','images/contact-us_02.gif')
	oCMenu.makeMenu('sub40','top4','experience survey','responsetek.asp','','160','')
	oCMenu.makeMenu('sub41','top4','comments & complaints','feedback.asp','','160','')

oCMenu.makeMenu('top6','','news','#','','60','41','images/news_.01.gif','images/news_02b.gif')
	oCMenu.makeMenu('sub60','top6','premium increases','premium_increases.asp','','140','')
	oCMenu.makeMenu('sub62','top6','towing services','towing.asp','','140','')
	oCMenu.makeMenu('sub63','top6','policy book','pdf/budgetpolicybook.pdf','_blank','140','')

oCMenu.makeMenu('top3','','faq','faq.asp','','56','41','images/faqs_01.gif','images/faqs_02.gif')

//Leave this line - it constructs the menu
oCMenu.construct()		