/*** 
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=20 
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=22
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/menu_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('top0','','home','index.asp','','50','','','')
	
oCMenu.makeMenu('top1','','about us','','','65','','','')
	oCMenu.makeMenu('sub10','top1','Company Profile','','','180','')
	oCMenu.makeMenu('sub11','top1','Value and Culture','','','180','')
	oCMenu.makeMenu('sub12','top1','Achievements and Awards','awards.asp','','180','')
	//oCMenu.makeMenu('sub13','top1','New Territories, New Challenges','','','180','')
	oCMenu.makeMenu('sub14','top1','Directors','directors.asp','','180','')
	
	oCMenu.makeMenu('sub101','sub10','History','company_history.asp','','140','','','','','')
	oCMenu.makeMenu('sub102','sub10','Company Overview','company_overview.asp','','140','','','','','')
	oCMenu.makeMenu('sub103','sub10','Investing in the Future','','','140','','','','','')
	
	oCMenu.makeMenu('sub1031','sub103','Commitment to Transformation','commitment.asp','','200','','','','','')
	oCMenu.makeMenu('sub1032','sub103','Looking after you & the Community','looking_after.asp','','200','','','','','')
	
	oCMenu.makeMenu('sub111','sub11','Our most Valued Asset','asset.asp','','140','','','','','')
	oCMenu.makeMenu('sub112','sub11','Delivering our Promise','promise.asp','','140','','','','','')
	
	//oCMenu.makeMenu('sub131','sub13','Your Homeloan','yourhomeloan.asp','','100','','','','','')
	//oCMenu.makeMenu('sub132','sub13','WhyWalk','whywalk.asp','','100','','','','','')
	
oCMenu.makeMenu('top2','','products','','','65','','','')
	oCMenu.makeMenu('sub20','top2','Vehicle','vehicle_cover.asp','','160','')
	oCMenu.makeMenu('sub21','top2','Motorcycle','products_cycle.asp','','160','')
	oCMenu.makeMenu('sub22','top2','Caravan','products_caravan.asp','','160','')
	oCMenu.makeMenu('sub23','top2','Loose Contents of Caravan','products_caravan_contents.asp','','160','')
	oCMenu.makeMenu('sub24','top2','Trailer','products_trailer.asp','','160','')
	oCMenu.makeMenu('sub25','top2','Watercraft','products_water.asp','','160','')
	oCMenu.makeMenu('sub26','top2','Home Contents','products_home.asp','','160','')
	oCMenu.makeMenu('sub27','top2','Portable Possessions','products_portable.asp','','160','')
	oCMenu.makeMenu('sub28','top2','Buildings','products_buildings.asp','','160','')
	oCMenu.makeMenu('sub29','top2','Personal Policy Book ','pages/A&G_HYP.pdf','_blank','160','')
	oCMenu.makeMenu('sub210','top2','Value Added Products','products_value_added.asp','','160','')
	oCMenu.makeMenu('sub211','top2','Free Assist Products','products_netcare.asp','','160','')
	oCMenu.makeMenu('sub212','top2','young at heart','young.asp','','160','')
	oCMenu.makeMenu('sub213','top2','Cash Back Plus','cashbackplus.asp','','160','')
	oCMenu.makeMenu('sub214','top2','Affordable Car Rental','carrental.asp','','160','')
	oCMenu.makeMenu('sub216','top2','Online shopping','http://www.shop.myautogen.co.za/','_blank','160','')
	oCMenu.makeMenu('sub215','top2','Residential Estates Insurance','estates.asp','','160','')
	
	oCMenu.makeMenu('sub2151','sub215','Competition terms and conditions','estates_comp_terms.asp','','200')
	
	oCMenu.makeMenu('sub200','sub20','Comprehensive','products_comp.asp','','140')
    oCMenu.makeMenu('sub201','sub20','3rd Party, Fire, Theft','products_theft.asp','','140','','','','','')
	oCMenu.makeMenu('sub202','sub20','3rd Party Only','products_third.asp','','140','','','','','')
	oCMenu.makeMenu('sub203','sub20','Off Road Comprehensive','products_offroad.asp','','140','','','','','')

	//oCMenu.makeMenu('sub290','sub210','young at heart','young.asp','','140','','','','','')
	//oCMenu.makeMenu('sub291','sub210','Cash Back Plus','cashbackplus.asp','','140','','','','','')
	//oCMenu.makeMenu('sub292','sub210','Cellphone Cover','cellphonecover.asp','','140','','','','','')
	oCMenu.makeMenu('sub292','sub210','HIV Protection','exposure.asp','','140','','','','','')
	oCMenu.makeMenu('sub293','sub210','Protection Plan','protectionplan.asp','','140','','','','','')
	oCMenu.makeMenu('sub294','sub210','Personal Accident','personalaccident.asp','','140','','','','','')
	oCMenu.makeMenu('sub295','sub210','Cellphone','cellphonecover.asp','','140','','','','','')
	oCMenu.makeMenu('sub296','sub210','Car Touch-Up Policy','touchup.asp','','140','','','','','')
	oCMenu.makeMenu('sub297','sub210','Extended Vehicle cover','autoextend.asp','','140','','','','','')
	oCMenu.makeMenu('sub298','sub210','Mechanical Breakdown','mechanical.asp','','140','','','','','')
	oCMenu.makeMenu('sub299','sub210','Legal & ID Theft','A&G_Legal&ID.pdf','_blank','140','','','','','')
	
	
	

oCMenu.makeMenu('top3','','business','','','65','','','')
	oCMenu.makeMenu('sub30','top3','business insurance','business.asp','','120','')
	oCMenu.makeMenu('sub31','top3','auto & business','businesspage.asp','','120','')
	oCMenu.makeMenu('sub32','top3','auto & office','office.asp','','120','')
	oCMenu.makeMenu('sub33','top3','auto & practice','practise.asp','','120','')
	oCMenu.makeMenu('sub34','top3','auto & professional','professional.asp','','120','')
	oCMenu.makeMenu('sub35','top3','auto & guest','Auto&guest.pdf','_blank','120','')
	
	oCMenu.makeMenu('sub301','sub30','Policy Book','business/A&G%20BI%20Policy%20Book.pdf','_blank','130','','','','','')
	oCMenu.makeMenu('sub302','sub30','Assist Brochure','BI_Assist_09.pdf','_blank','130','','','','','')

oCMenu.makeMenu('top4','','press','','','55','','','')


	oCMenu.makeMenu('sub10111','top4','press releases','press_release_articles.asp','','150','')
	oCMenu.makeMenu('sub41','top4','Super 14 Lions Sponsorship','','','150','')
	oCMenu.makeMenu('sub42','sub41','Competitions','','','130','')
	oCMenu.makeMenu('sub43','sub41','Archives','lions_archive.asp','','130','')
	oCMenu.makeMenu('sub44','sub41','Fan of the match gallery','lions_gamephotos.asp','','130','')
	oCMenu.makeMenu('sub45','top4','Premium Increases','premiums.asp','','150','')
	oCMenu.makeMenu('sub46','top4','Detail Update Prize Winners','prize_winners.asp','','150','')

	//oCMenu.makeMenu('sub421','sub42','dinner with Captain and Coach','dwtc.asp','','180','')
	oCMenu.makeMenu('sub422','sub42','ticket-giveaway competition','terms-and-conditions.asp','','180','')

oCMenu.makeMenu('top5','','faq','faq.asp','','45','','','')	
oCMenu.makeMenu('top6','','customer care','','','90','','','')	

	oCMenu.makeMenu('sub60','top6','Client Services','','','210','')
		oCMenu.makeMenu('sub601','sub60','Information Manual','cust_infomanual.html','_blank','140','','','','','')
	oCMenu.makeMenu('sub61','top6','Policy Amendments','existing_clients.asp','','210','')
	oCMenu.makeMenu('sub62','top6','Online Claims','existing_clients.asp?sid=1','','210','')
	oCMenu.makeMenu('sub63','top6','Consumer Education','','','210','')
		oCMenu.makeMenu('sub602','sub63','SAIA Education Pamphlet','pages/SAIA Pamphlet.pdf','_blank','140','','','','','')
		oCMenu.makeMenu('sub603','sub63','SAIA Education Book','pages/SAIA Book.pdf','_blank','140','','','','','')
	oCMenu.makeMenu('sub64','top6','Client Testimonials','testimonials.asp','','210','')
	oCMenu.makeMenu('sub65','top6','Update your details and win great prizes','update.asp','','210','')

oCMenu.makeMenu('top7','','brokers','https://www.agbroker.co.za/','','60','','','')

oCMenu.makeMenu('top8','','service charter','','','90','','','')
	oCMenu.makeMenu('sub81','top8','Client service charter','service_charter.asp','','130','')
	oCMenu.makeMenu('sub82','top8','2007/2008 results','service_charter_results.asp','','130','')

oCMenu.makeMenu('top9','','contact us','','','60','','','')
	oCMenu.makeMenu('sub400','top9','Experience Survey','responsetek.asp','','120','')
	oCMenu.makeMenu('sub401','top9','Client Services','cust_services.asp','','120','')
	oCMenu.makeMenu('sub402','top9','fraud and ethics line','fraud_ethics.asp','','120','')
	oCMenu.makeMenu('sub403','top9','Advertising Proposals','contact_advertising.asp','','120','')
	//oCMenu.makeMenu('sub403','top10','Webmaster','mailto:andrep@upstream.co.za?Subject=Auto and General','','120','')
	oCMenu.makeMenu('sub404','top9','Talk to us','feedback.asp','','120','')
	oCMenu.makeMenu('sub405','top9','jobs','http://isshrweb.isservices.co.za/OA_HTML//OA.jsp?_rc=IRC_VIS_HOME_PAGE&_ri=800&OAPB=IRC_BRAND&_ti=210601676&language_code=US&p_home_url=/OA_HTML/IrcVisitor.jsp&OASF=IRC_VIS_HOME_PAGE','','120','')

oCMenu.makeMenu('top10','','existing clients','existing_clients.asp','','92.6','','','','menu_exs','menu_exs_over') 


//Leave this line - it constructs the menu
oCMenu.construct()		