//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=30; 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=15
//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=0
oCMenu.menuPlacement=0
                                                             
oCMenu.offlineRoot="file:///D:/Inetpub/wwwroot/sdm/" 
oCMenu.onlineRoot="/sdm/" 
oCMenu.resizeCheck=1 
oCMenu.wait=1000 
oCMenu.fillImg="cm_fill.gif"
oCMenu.zIndex=0

//Background bar properties
oCMenu.useBar=1
oCMenu.barWidth="menu"
oCMenu.barHeight="menu" 
oCMenu.barClass="clBar"
oCMenu.barX="menu"
oCMenu.barY="menu"
oCMenu.barBorderX=0
oCMenu.barBorderY=0
oCMenu.barBorderClass=""

//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=50
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="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="right"


//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=160
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=-(oCMenu.level[0].width-2)/2+20
oCMenu.level[1].offsetY=0
oCMenu.level[1].borderClass="clLevel1border"
oCMenu.level[1].arrow="images/arrow.gif"
oCMenu.level[0].arrowWidth=8
oCMenu.level[0].arrowHeight=11


//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=160
oCMenu.level[2].height=22
oCMenu.level[2].offsetX=0
oCMenu.level[2].offsetY=0
oCMenu.level[2].regClass="clLevel2"
oCMenu.level[2].overClass="clLevel2over"
oCMenu.level[2].borderClass="clLevel2border"

/******************************************
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','','','Default.asp','','60','55','images/B_Navigation.gif','images/B_Navigation2.gif','','','')
  	oCMenu.makeMenu('sub00','top0','SDM GIS home','Default.asp')
  	oCMenu.makeMenu('sub01','top0','What\'s New & Important','New.asp')
  	oCMenu.makeMenu('sub02','top0','SECTOR PLANS','')
    	oCMenu.makeMenu('sub020','sub02','Disaster Management','sector plans/disaster.asp','')
		oCMenu.makeMenu('sub021','sub02','Environmental Management','sector plans/envman.asp','','',35)
		oCMenu.makeMenu('sub022','sub02','Integrated Development Plans','sector plans/idp.asp','','',35)
    	oCMenu.makeMenu('sub023','sub02','Local Economic Development','sector plans/led.asp','','',35)
		oCMenu.makeMenu('sub024','sub02','Spatial Development Framework','sector plans/sdf.asp','','',35)
		oCMenu.makeMenu('sub025','sub02','Transportation','sector plans/transport.asp','')
    	oCMenu.makeMenu('sub026','sub02','Waste Management','sector plans/waste.asp','')
		oCMenu.makeMenu('sub027','sub02','Water Services Development Plan','sector plans/wsdp.asp','','',35)
  	oCMenu.makeMenu('sub03','top0','GIS product planning','planning/default.asp')
  	oCMenu.makeMenu('sub04','top0','Links','Links.asp')
  	oCMenu.makeMenu('sub05','top0','Downloads','downloads/download.asp')
  	oCMenu.makeMenu('sub06','top0','Support & Feedback','Feedback.asp')
//  	oCMenu.makeMenu('sub07','top0','FAQ','under_construction.asp')
//  	oCMenu.makeMenu('sub08','top0','Site map','under_construction.asp')
  	oCMenu.makeMenu('sub09','top0','Help','help.asp')
	oCMenu.makeMenu('sub010','top0','Contact information','contactinfo.asp')
	
oCMenu.makeMenu('top1','','','Login.asp','','60','55','images/B_Access.gif','images/B_Access2.gif','','','')

oCMenu.makeMenu('top2','','','','','60','55','images/B_Help.gif','images/B_Help2.gif','','','')	
	oCMenu.makeMenu('sub20','top2','How to make a map','docs/HowToMakeAMap.pdf','_blank')
	oCMenu.makeMenu('sub21','top2','Help with access','help.asp')
	oCMenu.makeMenu('sub22','top2','Help with using this site','help.asp')
	oCMenu.makeMenu('sub23','top2','Help with downloads','help.asp')
	oCMenu.makeMenu('sub24','top2','Help with searches','help.asp')
	oCMenu.makeMenu('sub25','top2','Help with information requests','help.asp','','',35)
	oCMenu.makeMenu('sub26','top2','Other Help','help.asp')

oCMenu.makeMenu('top3','','','','','60','55','images/B_Search.gif','images/B_Search2.gif','','','')	
	oCMenu.makeMenu('sub30','top3','Find an erf','')
		oCMenu.makeMenu('sub300','sub30','... by Erf number','search/Erf_number.asp')
		oCMenu.makeMenu('sub301','sub30','... by owner','search/Erf_owner.asp')
		oCMenu.makeMenu('sub302','sub30','... by account number','search/Erf_account.asp')
	oCMenu.makeMenu('sub31','top3','Find Erven','')
		oCMenu.makeMenu('sub311','sub31','... by value','search/Erf_values.asp')
		oCMenu.makeMenu('sub312','sub31','... by size','search/Erf_size.asp')
		oCMenu.makeMenu('sub313','sub31','... by zoning','search/Erf_zoning.asp')
		oCMenu.makeMenu('sub314','sub31','... by land ownership','search/Erf_oship.asp')
	oCMenu.makeMenu('sub32','top3','Count Erven','search/Erf_count.asp')
	oCMenu.makeMenu('sub33','top3','Find census information','')
		oCMenu.makeMenu('sub330','sub33','Search macro level data','search/SearchMacro.asp')
		oCMenu.makeMenu('sub331','sub33','Search sub-place Data','search/SearchSubPlaces.asp')
		oCMenu.makeMenu('sub332','sub33','Search ward data','search/SearchWards.asp')
//	oCMenu.makeMenu('sub34','top3','Pre-sector plans','under_construction.asp')
//	oCMenu.makeMenu('sub35','top3','Find a street','under_construction.asp')

oCMenu.makeMenu('top4','','','','','60','55','images/B_Feedback.gif','images/B_Feedback2.gif','','','')	
	oCMenu.makeMenu('sub40','top4','Request data','Feedback.asp')
	oCMenu.makeMenu('sub41','top4','Request map','Feedback.asp')
	oCMenu.makeMenu('sub42','top4','Customer queries','Feedback.asp')
	oCMenu.makeMenu('sub43','top4','Website queries','Feedback.asp')

oCMenu.makeMenu('top5','','','Metadata.asp','','60','55','images/B_Meta.gif','images/B_Meta2.gif','','','')

oCMenu.construct();
