/*** 
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
oCMenu2=new makeCM("oCMenu2") //Making the menu object. Argument: menuname

//Menu properties   
oCMenu2.pxBetween=0
oCMenu2.fromLeft=5
oCMenu2.fromTop=205 
oCMenu2.rows=0 
oCMenu2.menuPlacement=0

oCMenu2.offlineRoot="" 
oCMenu2.onlineRoot="" 
oCMenu2.resizeCheck=1 
oCMenu2.wait=1000 
oCMenu2.fillImg=""
oCMenu2.zIndex=0

//Background bar properties
oCMenu2.useBar=1
oCMenu2.barWidth="menu"
oCMenu2.barHeight="menu" 
oCMenu2.barClass="aclBar"
oCMenu2.barX="menu"
oCMenu2.barY="menu"
oCMenu2.barBorderX=1
oCMenu2.barBorderY=0
oCMenu2.barBorderClass=""

//Level properties - ALL properties have to be spesified in level 0
oCMenu2.level[0]=new cm_makeLevel() //Add this for each new level
oCMenu2.level[0].width=160
oCMenu2.level[0].height=20
oCMenu2.level[0].regClass="aclLevel0"
oCMenu2.level[0].overClass="aclLevel0over"
oCMenu2.level[0].borderX=0 
oCMenu2.level[0].borderY=1
oCMenu2.level[0].borderClass="aclLevel0border"
oCMenu2.level[0].offsetX=1
oCMenu2.level[0].offsetY=0
oCMenu2.level[0].rows=0
oCMenu2.level[0].align="right" 


//EXAMPLE SUB LEVEL[1] PROPERTIES - You have to spesify the properties you want different from LEVEL[0] - If you want all items to look the same just remove this
oCMenu2.level[1]=new cm_makeLevel() //Add this for each new level (adding one to the number)
oCMenu2.level[1].width=115
oCMenu2.level[1].height=20
oCMenu2.level[1].regClass="aclLevel1"
oCMenu2.level[1].overClass="aclLevel1over"
oCMenu2.level[1].style=""
oCMenu2.level[1].align="right" 
oCMenu2.level[1].offsetX=1
oCMenu2.level[1].offsetY=0
oCMenu2.level[1].borderClass="aclLevel1border"
oCMenu2.level[1].borderX=1 
oCMenu2.level[1].borderY=1
oCMenu2.level[1].rows=0
oCMenu2.level[1].align="right" 

//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
oCMenu2.level[2]=new cm_makeLevel() //Add this for each new level (adding one to the number)
oCMenu2.level[2].width=115
oCMenu2.level[2].height=20
oCMenu2.level[2].offsetX=0
oCMenu2.level[2].offsetY=0
oCMenu2.level[2].regClass="aclLevel2"
oCMenu2.level[2].overClass="aclLevel2over"
oCMenu2.level[2].borderClass="aclLevel2border"

/******************************************
Menu item creation:
myCoolMenu.makeMenu(name, parent_name, text, link, target, width, height, regImage, overImage, regClass, overClass , align, rows, nolink, onclick, onmouseover, onmouseout) 
*************************************/

//State & Local Gov't
 oCMenu2.makeMenu('topa11','','State & Local Government','/state-local-government','',156)
		 oCMenu2.makeMenu('suba31','topa11','Land Cover Mapping','/geocover/geocoverlc/gclcdataproduct/','',200)
		 oCMenu2.makeMenu('suba3101','topa11','Analytical Modeling','/env/gis/supply_modeling','',200)
		 oCMenu2.makeMenu('suba3102','topa11','Surface & Canopy Cover Mapping','/env/sec_pol/land_use','',200)
		 oCMenu2.makeMenu('suba3103','topa11','Vector Data Conflation','/env/end2end','',200)
		 oCMenu2.makeMenu('suba3104','topa11','High Resolution Imagery','/digital-imaging/earthsat-naturalvue/hires-pricing','',200)
		 oCMenu2.makeMenu('suba3105','topa11','Image Base Maps','/digital-imaging/earthsat-naturalvue/','',200)
		 oCMenu2.makeMenu('suba3106','topa11','Satellite Image Processing','/digital-imaging/','',200)
		 oCMenu2.makeMenu('suba3107','topa11','Weather Data','http://www.earthsat.com/misc/data-lookup/','',200)
		 oCMenu2.makeMenu('suba3108','topa11','Energy Weather','/mda-earthsat-weather/earthsat-energy-weather','',200)


 //Federal Gov't
 oCMenu2.makeMenu('topa10','','Federal Government','/federal-government','',156)
		 oCMenu2.makeMenu('suba30','topa10','Land Cover Mapping','/geocover/geocoverlc/gclcdataproduct/','',220)
		 oCMenu2.makeMenu('suba3001','topa10','Surface & Canopy Cover Mapping','/env/sec_pol/land_use','',220)
		 oCMenu2.makeMenu('suba3002','topa10','Satellite Image Processing','/digital-imaging/','',220)
		 oCMenu2.makeMenu('suba3003','topa10','Commercial & Civil Imagery','/digital-imaging/earthsat-naturalvue/highres-pricing','',220)
		 oCMenu2.makeMenu('suba3004','topa10','Resource Management Development','/digital-imaging/resource-management-development/','',220)
		 oCMenu2.makeMenu('suba3005','topa10','Weather Data','http://www.earthsat.com/misc/data-lookup/','',220)



//Business & Orgs.
 oCMenu2.makeMenu('topa12','','Business & Organizations','/commercial','',156)
		 oCMenu2.makeMenu('suba32','topa12','Energy Weather','/mda-earthsat-weather/earthsat-energy-weather','',190)
		 oCMenu2.makeMenu('suba3201','topa12','Geologic Exploration','/geo','',190)
		 oCMenu2.makeMenu('suba3202','topa12','Agriculture Weather','/mda-earthsat-weather/cropcast-ag-services','',190)
		 oCMenu2.makeMenu('suba3203','topa12','Source of Commercial & Civil Imagery','/digital-imaging/earthsat-naturalvue/highres-pricing','',190)
		 oCMenu2.makeMenu('suba3204','topa12','Satellite Processing & Analysis','/digital-imaging/','',190)
	     oCMenu2.makeMenu('suba3205','topa12','Cloud Forecasting','/commercial/cloudcast','',190)


//Leave this line - it constructs the menu
oCMenu2.construct()
