/*** 
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.
**/

//Menu object creation
oCMenu=new makeCM("oCMenu") //Making the menu object. Argument: menuname

//Menu properties   
oCMenu.pxBetween=0
//Using the cm_page object to place the menu ----
oCMenu.fromLeft=0
oCMenu.fromTop=0
oCMenu.rows=1
oCMenu.menuPlacement=0
                                                             
oCMenu.offlineRoot="" 
oCMenu.onlineRoot=""
oCMenu.resizeCheck=1 
oCMenu.wait=250 
oCMenu.fillImg="spacer.gif"
oCMenu.zIndex=0

//Background bar properties
oCMenu.useBar=0

//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="19%"
oCMenu.level[0].height=25 
oCMenu.level[0].regClass="clLevel0"
oCMenu.level[0].overClass="clLevel0over"
oCMenu.level[0].borderX=0
oCMenu.level[0].borderY=0
oCMenu.level[0].borderClass="clLevel0border"
oCMenu.level[0].offsetX=0
oCMenu.level[0].offsetY=0
oCMenu.level[0].rows=0
oCMenu.level[0].arrow=0
oCMenu.level[0].arrowWidth=0
oCMenu.level[0].arrowHeight=0
oCMenu.level[0].align="bottom"


/******************************************
Menu item creation:
myCoolMenu.makeMenu(name, parent_name, text, link, target, width, height, regImage, overImage, regClass, overClass , align, rows, nolink, onclick, onmouseover, onmouseout) 
*************************************/
oCMenu.makeMenu('top0','','','/e3expo/','','69','28','components/images/e3/e3_2005/e3_2005.gif','components/images/e3/e3_2005/e3_2005_over.gif')
  oCMenu.makeMenu('sub00','top0','','','','213','7','components/images/e3/header.gif','','','','','','','GoToURL("http://www.e3expo.com/exhibitors/")')     
  oCMenu.makeMenu('sub01','top0','','','','213','20','components/images/e3/e3_2005/home.gif','components/images/e3/e3_2005/home_over.gif','','','','','','GoToURL("http://www.e3expo.com/e3expo/")')
  oCMenu.makeMenu('sub02','top0','','','','213','20','components/images/e3/e3_2005/registration.gif','components/images/e3/e3_2005/registration_over.gif','','','','','','GoToURL("http://www.e3expo.com/e3expo/registration.asp")')
  oCMenu.makeMenu('sub03','top0','','','','213','20','components/images/e3/e3_2005/conference_program.gif','components/images/e3/e3_2005/conference_program_over.gif','','','','','','GoToURL("/e3expo/conference_calendar.asp")')
  oCMenu.makeMenu('sub04','top0','','','','213','20','components/images/e3/e3_2005/speaker_only.gif','components/images/e3/e3_2005/speaker_only_over.gif','','','','','','GoToURL("http://www.e3expo.com/e3expo/speakers_only.asp")')
  oCMenu.makeMenu('sub05','top0','','','','213','20','components/images/e3/e3_2005/housing_travel.gif','components/images/e3/e3_2005/housing_travel_over.gif','','','','','','GoToURL("http://www.e3expo.com/e3expo/housing_travel.asp")')
  oCMenu.makeMenu('sub06','top0','','','','213','20','components/images/e3/e3_2005/faqs.gif','components/images/e3/e3_2005/faqs_over.gif','','','','','','GoToURL("http://www.e3expo.com/e3expo/faqs.asp")')
  oCMenu.makeMenu('sub07','top0','','','','213','20','components/images/e3/e3_2005/exhibitors_list.gif','components/images/e3/e3_2005/exhibitors_list_over.gif','','','','','','GoToURL("http://www.e3expo.com/exhibitors/exhibitor_list.asp")')
  oCMenu.makeMenu('sub08','top0','','','','213','20','components/images/e3/e3_2005/sponsors.gif','components/images/e3/e3_2005/sponsors_over.gif','','','','','','GoToURL("http://www.e3expo.com/e3expo/sponsors.asp")')
  oCMenu.makeMenu('sub09','top0','','','','213','20','components/images/e3/e3_2005/international.gif','components/images/e3/e3_2005/international_over.gif','','','','','','GoToURL("http://www.e3expo.com/e3expo/international_visitors.asp")')
  oCMenu.makeMenu('sub010','top0','','','','213','20','components/images/e3/e3_2005/floorplans.gif','components/images/e3/e3_2005/floorplans_over.gif','','','','','','GoToURL("http://www.e3expo.com/e3expo/floorplans.asp")')
  oCMenu.makeMenu('sub011','top0','','','','213','20','components/images/e3/e3_2005/vip_retailers.gif','components/images/e3/e3_2005/vip_retailers_over.gif','','','','','','GoToURL("http://www.e3expo.com/e3expo/vip_retailers.asp")')
  oCMenu.makeMenu('sub012','top0','','','','213','20','components/images/e3/footer.gif','','','','','','1')
    
oCMenu.makeMenu('top1','','','/exhibitors/','','94','28','components/images/e3/exhibitors/exhibitors.gif','components/images/e3/exhibitors/exhibitors_over.gif')
    oCMenu.makeMenu('sub10','top1','','','','213','7','components/images/e3/header.gif','','','','','','','GoToURL("http://www.e3expo.com/exhibitors/")')     
    oCMenu.makeMenu('sub11','top1','','','','213','20','components/images/e3/exhibitors/home.gif','components/images/e3/exhibitors/home_over.gif','','','','','','GoToURL("http://www.e3expo.com/exhibitors/")')
    oCMenu.makeMenu('sub12','top1','','','','213','20','components/images/e3/exhibitors/exhibitor_list.gif','components/images/e3/exhibitors/exhibitor_list_over.gif','','','','','','GoToURL("/exhibitors/exhibitor_list.asp")')
    oCMenu.makeMenu('sub13','top1','','','','213','20','components/images/e3/exhibitors/sales_prospectus.gif','components/images/e3/exhibitors/sales_prospectus_over.gif','','','','','','GoToURL("/exhibitors/exhibitor_prospectus.asp")')
    oCMenu.makeMenu('sub14','top1','','','','213','20','components/images/e3/exhibitors/request_info.gif','components/images/e3/exhibitors/request_info_over.gif','','','','','','GoToURL("http://www.e3expo.com/exhibitors/request_info.asp")')
    oCMenu.makeMenu('sub15','top1','','','','213','20','components/images/e3/exhibitors/registration.gif','components/images/e3/exhibitors/registration_over.gif','','','','','','GoToURL("http://www.e3expo.com/exhibitors/exhibitor_registration.asp")')
    oCMenu.makeMenu('sub16','top1','','','','213','20','components/images/e3/exhibitors/event_marketing.gif','components/images/e3/exhibitors/event_marketing_over.gif','','','','','','GoToURL("/exhibitors/event_marketing.asp")')
    oCMenu.makeMenu('sub17','top1','','','','213','20','components/images/e3/exhibitors/exhibitor_manual.gif','components/images/e3/exhibitors/exhibitor_manual_over.gif','','','','','','GoToURL("/exhibitors/exhibitor_manual.asp")')
    oCMenu.makeMenu('sub18','top1','','','','213','20','components/images/e3/exhibitors/show_contacts.gif','components/images/e3/exhibitors/show_contacts_over.gif','','','','','','GoToURL("/exhibitors/show_management_contacts.asp")')
    oCMenu.makeMenu('sub19','top1','','','','213','20','components/images/e3/exhibitors/housing_travel.gif','components/images/e3/exhibitors/housing_travel_over.gif','','','','','','GoToURL("/exhibitors/travel_information.asp")')
    oCMenu.makeMenu('sub110','top1','','','','213','20','components/images/e3/exhibitors/faqs.gif','components/images/e3/exhibitors/faqs_over.gif','','','','','','GoToURL("http://www.e3expo.com/exhibitors/faq.asp")')
    oCMenu.makeMenu('sub111','top1','','','','213','20','components/images/e3/exhibitors/booth.gif','components/images/e3/exhibitors/booth_over.gif','','','','','','GoToURL("http://www.e3expo.com/exhibitors/booth_space_sharing.asp")')    
    oCMenu.makeMenu('sub112','top1','','','','213','32','components/images/e3/exhibitors/reciprocal_link.gif','components/images/e3/exhibitors/reciprocal_link_over.gif','','','','','','GoToURL("/exhibitors/reciprocal_link_request.asp")')
    oCMenu.makeMenu('sub113','top1','','','','213','27','components/images/e3/exhibitors/media_relations.gif','components/images/e3/exhibitors/media_relations_over.gif','','','','','','GoToURL("/exhibitors/media_relations.asp")')
    oCMenu.makeMenu('sub114','top1','','','','213','20','components/images/e3/exhibitors/footer.gif','','','','','','1')
    
    
oCMenu.makeMenu('top2','','','http://www.e3expo.com/attendees/','','95','28','components/images/e3/attendees/attendees.gif','components/images/e3/attendees/attendees_over.gif')
    oCMenu.makeMenu('sub20','top2','','','','213','7','components/images/e3/header.gif','','','','','','','GoToURL("http://www.e3expo.com/attendees/")') 
    oCMenu.makeMenu('sub21','top2','','','','213','20','components/images/e3/attendees/attendees_home.gif','components/images/e3/attendees/attendees_home_over.gif','','','','','','GoToURL("/attendees/")')    
    oCMenu.makeMenu('sub22','top2','','','','213','20','components/images/e3/attendees/registration.gif','components/images/e3/attendees/registration_over.gif','','','','','','GoToURL("http://www.e3expo.com/attendees/attendee_registration.asp")')
    oCMenu.makeMenu('sub23','top2','','','','213','20','components/images/e3/attendees/pricing.gif','components/images/e3/attendees/pricing_over.gif','','','','','','GoToURL("http://www.e3expo.com/attendees/pricing_information.asp")')
    oCMenu.makeMenu('sub24','top2','','','','213','20','components/images/e3/attendees/industry_id.gif','components/images/e3/attendees/industry_id_over.gif','','','','','','GoToURL("http://www.e3expo.com/attendees/industry_identification.asp")')
    oCMenu.makeMenu('sub25','top2','','','','213','20','components/images/e3/attendees/FAQ.gif','components/images/e3/attendees/FAQ_over.gif','','','','','','GoToURL("http://www.e3expo.com/attendees/FAQ.asp")')
    oCMenu.makeMenu('sub26','top2','','','','213','20','components/images/e3/attendees/housing_travel.gif','components/images/e3/attendees/housing_travel_over.gif','','','','','','GoToURL("/attendees/housing_travel.asp")')
    oCMenu.makeMenu('sub27','top2','','','','213','20','components/images/e3/attendees/floorplans.gif','components/images/e3/attendees/floorplans_over.gif','','','','','','GoToURL("http://www.e3expo.com/e3expo/floorplans.asp")')    
    oCMenu.makeMenu('sub28','top2','','','','213','15','components/images/e3/attendees/vip_retailers.gif','components/images/e3/attendees/vip_retailers_over.gif','','','','','','GoToURL("http://www.e3expo.com/e3expo/vip_retailers.asp")') 
    oCMenu.makeMenu('sub29','top2','','','','213','32','components/images/e3/attendees/footer.gif','','','','','','1') 
      

oCMenu.makeMenu('top3','','','http://www.e3expo.com/media/','','62','28','components/images/e3/media/media.gif','components/images/e3/media/media_over.gif')
	oCMenu.makeMenu('sub30','top3','','','','213','7','components/images/e3/header.gif','','','','','','','GoToURL("http://www.e3expo.com/media/")') 
    oCMenu.makeMenu('sub31','top3','','','','213','20','components/images/e3/media/home.gif','components/images/e3/media/home_over.gif','','','','','','GoToURL("http://www.e3expo.com/media/")')     
    oCMenu.makeMenu('sub32','top3','','','','213','20','components/images/e3/media//registration.gif','components/images/e3/media/registration_over.gif','','','','','','GoToURL("http://www.e3expo.com/media/media_e-registration.asp")')     
    oCMenu.makeMenu('sub33','top3','','','','213','20','components/images/e3/media/housing_travel.gif','components/images/e3/media/housing_travel_over.gif','','','','','','GoToURL("http://www.e3expo.com/media/housing_travel.asp")')     
    oCMenu.makeMenu('sub34','top3','','','','213','20','components/images/e3/media/factsheet.gif','components/images/e3/media/factsheet_over.gif','','','','','','GoToURL("http://www.e3expo.com/media/e3_factsheet.asp")')     
    oCMenu.makeMenu('sub35','top3','','','','213','20','components/images/e3/media/faq.gif','components/images/e3/media//faq_over.gif','','','','','','GoToURL("http://www.e3expo.com/media/media_faq.asp")')     
    oCMenu.makeMenu('sub36','top3','','','','213','20','components/images/e3/media/about_the_esa.gif','components/images/e3/media/about_the_esa_over.gif','','','','','','GoToURL("http://www.e3expo.com/media/about_the_esa.asp")')    
    oCMenu.makeMenu('sub37','top3','','','','213','20','components/images/e3/media/show_news.gif','components/images/e3/media/show_news_over.gif','','','','','','GoToURL("http://www.e3expo.com/media/show_news.asp")')    
    oCMenu.makeMenu('sub38','top3','','','','213','20','components/images/e3/media/exhibitor_news.gif','components/images/e3/media/exhibitor_news_over.gif','','','','','','GoToURL("http://www.e3expo.com/media/exhibitor_news.asp")')    
    oCMenu.makeMenu('sub39','top3','','','','213','20','components/images/e3/media/photos.gif','components/images/e3/media/photos_over.gif','','','','','','GoToURL("http://www.e3expo.com/media/photos_logos.asp")') 
    oCMenu.makeMenu('sub310','top3','','','','213','20','components/images/e3/media/onsite.gif','components/images/e3/media/onsite_over.gif','','','','','','GoToURL("http://www.e3expo.com/media/on-site_services.asp")') 
    oCMenu.makeMenu('sub311','top3','','','','213','28','components/images/e3/media/news_conference.gif','components/images/e3/media/news_conference_over.gif','','','','','','GoToURL("http://www.e3expo.com/media/news_conference_schedule.asp")')     
    oCMenu.makeMenu('sub312','top3','','','','213','31','components/images/e3/media/footer.gif','','','','','','1') 


//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(0)
  oCMenu.m["top0"].b.moveIt(pos[0],pos[1])
  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])
  
  //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()"