/******************************************
Menu item creation:
myCoolMenu.makeMenu(name, parent_name, text, link, target, width, height, regImage, overImage, regClass, overClass , align, rows, nolink, onclick, onmouseover, onmouseout) 
*************************************/

/** Consumer Information start **/
oCMenu.makeMenu('top1','','<div align="center">Consumer Info</div>','consumerinfo/overview.html','',129)
	oCMenu.makeMenu('sub11','top1','BECC Members','Members.html')
	oCMenu.makeMenu('sub12','top1','Home Improvement','consumerinfo/homeimprovement.html')
	oCMenu.makeMenu('sub13','top1','Using Licensed Contractors','consumerinfo/usingcontractors.html')
	oCMenu.makeMenu('sub14','top1','Stop Unlicensed Contractors','consumerinfo/stopcontractors.html')
/** Consumer Information end **/

/** Member Information start **/
oCMenu.makeMenu('top2','','<div align="center">Member Info</div>','memberinfo/buildersexchange.html','',110)
	oCMenu.makeMenu('sub21','top2','What&rsquo;s the Builders Exchange?','memberinfo/buildersexchange.html','','',31)
	oCMenu.makeMenu('sub22','top2','Member Services','memberinfo/memberservices.html')
	oCMenu.makeMenu('sub23','top2','Join the Builders Exchange','memberinfo/joinbuilders.html')
	oCMenu.makeMenu('sub24','top2','Board of Directors','memberinfo/board.html')
	oCMenu.makeMenu('sub25','top2','Members&rsquo; Websites','memberinfo/membersites.html')
	oCMenu.makeMenu('sub26','top2','Golden State Builders Exchanges','news/gstate_exchanges.html','','',31)
	oCMenu.makeMenu('sub27','top2','Industry Links','memberinfo/links.html')
/** Member Information end **/

/** Insurance programs start **/
oCMenu.makeMenu('top3','top3','<div align="center">Insurance Programs</div>','insurance/insurance.html','',158)
		oCMenu.makeMenu('sub32','top3','Group Health Benefits','insurance/insuranceintroduction.html')
 	oCMenu.makeMenu('sub33','top3','Workers&rsquo; Compensation Insurance','insurance/workerscorp.html','','',31)
/** Insurance programs end **/


/** Safety start **/
	oCMenu.makeMenu('top4','','<div align="center">Safety Info</div>','safety/safety.html','',100)
		oCMenu.makeMenu('sub41','top4','Safety Videos Library','safety/safetyvideos.html')
		oCMenu.makeMenu('sub42','top4','How to Stage a Safety Meeting?','safety/tailgateintro.html','','',31)

								/** Tailgate Topics start **/
		oCMenu.makeMenu('sub43','top4','Tailgate Topics','safety/tailgate.html')
			oCMenu.makeMenu('sub431','sub43','Electric Hand Tools','safety/tailgatetools.html')
			oCMenu.makeMenu('sub432','sub43','Horseplay','safety/tailgatehorseplay.html')
			oCMenu.makeMenu('sub433','sub43','Learning First Aid','safety/tailgatelearning.html')
			oCMenu.makeMenu('sub434','sub43','Accident Investigations','safety/tailgateaccident.html')
			oCMenu.makeMenu('sub435','sub43','Violence in the Workplace','safety/tailgateviolence.html')
			oCMenu.makeMenu('sub436','sub43','Defensive Driving','safety/tailgatedefensive.html')
			oCMenu.makeMenu('sub437','sub43','Hearing Protection','safety/tailgatehearing.html')
			oCMenu.makeMenu('sub438','sub43','Trenches & Excavations','safety/tailgatetrenches.html')
			oCMenu.makeMenu('sub439','sub43','Work Site Fire Emergencies','safety/tailgateworksite.html')
			oCMenu.makeMenu('sub4310','sub43','Repetitive Motion Injuries','safety/tailgaterepetitive.html')
			oCMenu.makeMenu('sub4311','sub43','Most Cited OSHA Violations','safety/tailgatemost.html')
			oCMenu.makeMenu('sub4312','sub43','Chemical Hazards','safety/tailgatechemical.html')
			oCMenu.makeMenu('sub4313','sub43','Safety Attitudes & Accidents','safety/tailgatesafety.html')
								/** Tailgate Topics end **/
/** Safety end **/

/** News start **/
oCMenu.makeMenu('top5','','<div align="center">News &amp; Info</div>','news/news.html','',107)
	oCMenu.makeMenu('sub51','top5','BECC Events','news/BECCevents.html')
	oCMenu.makeMenu('sub52','top5','Local Legislation','news/localnews.html')
	oCMenu.makeMenu('sub53','top5','State Legislation','news/statenews.html')
	oCMenu.makeMenu('sub54','top5','Federal Legislation','news/federalnews.html')
	oCMenu.makeMenu('sub55','top5','State Agency Regulations','news/stateagents.html')
	oCMenu.makeMenu('sub56','top5','Construction Related Links','news/links.html')
/** News end **/

/** Construction News start **/
oCMenu.makeMenu('top6','','<div align="center">Construction News</div>','','',154)
	oCMenu.makeMenu('sub61','top6','Projects Out To Bid','projects/','',154)
	oCMenu.makeMenu('sub62','top6','Bid Results','bidresult/','',154)
	oCMenu.makeMenu('sub63','top6','Building Permits','bldgpermit/','',154)
	oCMenu.makeMenu('sub64','top6','Legal Notices','legalnotice/','',154)
/** Construction News end **/

//Leave this line - it constructs the menu
oCMenu.construct()		


//Extra code to find position:
function findPos(num){
  //alert(num)
  if(bw.ns4){   //Netscape 4
    x = document.layers["layerMenu"+num].pageX
    y = document.layers["layerMenu"+num].pageY
  }else{ //other browsers
    x=0; y=0; var el,temp
    el = bw.ie4?document.all["divMenu"+num]:document.getElementById("divMenu"+num);
    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]
}
function placeElements(){
  //Changing the position of ALL top items:
  pos = findPos(1)
  oCMenu.m["top1"].b.moveIt(pos[0],pos[1])
  pos = findPos(2)
  oCMenu.m["top2"].b.moveIt(pos[0],pos[1])
  pos = findPos(3)
  oCMenu.m["top3"].b.moveIt(pos[0],pos[1])
  pos = findPos(4)
  oCMenu.m["top4"].b.moveIt(pos[0],pos[1])
  pos = findPos(5)
  oCMenu.m["top5"].b.moveIt(pos[0],pos[1])
  pos = findPos(6)
  oCMenu.m["top6"].b.moveIt(pos[0],pos[1])
  
  //Setting the fromtop value
  oCMenu.fromTop = pos[1]
}
placeElements()
//Setting it to re place the elements after resize - the resize is not perfect though..
oCMenu.onafterresize="placeElements()"
