//Menu object creation
oCMenu=new makeCM("oCMenu") //Making the menu object. Argument: menuname

//Menu properties   
oCMenu.pxBetween=6
oCMenu.fromLeft=16
//We also need to "replace" the menu on resize. So:
//oCMenu.onresize="oCMenu.fromLeft=16"
oCMenu.fromTop=100
oCMenu.rows=0
oCMenu.menuPlacement=0
                                                             
oCMenu.onlineRoot="http://www.lehigh.edu/~indrown/" 
oCMenu.resizeCheck=1 
oCMenu.wait=1000 
oCMenu.fillImg="images/spacer.gif"
oCMenu.zIndex=0

//Background bar properties
oCMenu.useBar=0
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=155
oCMenu.level[0].height=22 
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=-10
oCMenu.level[0].offsetY=2
oCMenu.level[0].rows=0
oCMenu.level[0].arrow="/images/menu_arrow.gif"
oCMenu.level[0].arrowWidth=10
oCMenu.level[0].arrowHeight=10
oCMenu.level[0].align="right"

oCMenu.level[0].filter="progid:DXImageTransform.Microsoft.Fade(duration=0.3)" 

//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-2
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=-4
//oCMenu.level[1].offsetY=-2
oCMenu.level[1].borderClass="clLevel1border"



/******************************************
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','','&nbsp;Undergrad. Program','ugrad/index.html')
  oCMenu.makeMenu('sub00','top0','The Major','ugrad/major.html')
  oCMenu.makeMenu('sub01','top0','The Minor','ugrad/minor.html')
  oCMenu.makeMenu('sub02','top0','Courses','ugrad/courses/index.html')

    oCMenu.makeMenu('sub020','sub02','Current Courses','ugrad/courses/fall03.html') 
    oCMenu.makeMenu('sub021','sub02','Past&nbsp;Course&nbsp;Descriptions','ugrad/courses/fall02.html') 
  oCMenu.makeMenu('sub03','top0','Honors in English','ugrad/honors.html')
  oCMenu.makeMenu('sub04','top0','Students','ugrad/students.html')
    oCMenu.makeMenu('sub040','sub04','Student Voices','ugrad/voices.html')
	oCMenu.makeMenu('sub041','sub04','Profiles of English majors','ugrad/profiles/index.html')
	oCMenu.makeMenu('sub042','sub04','Awards and Distinctions','ugrad/awards/index.html')
	  oCMenu.makeMenu('sub0400','sub042','Williams Awards','ugrad/awards/index.html#williams')
	  oCMenu.makeMenu('sub0401','sub042','Lehigh Review','ugrad/awards/index.html#lehigh')
	  oCMenu.makeMenu('sub0402','sub042','Amaranth','ugrad/awards/index.html#amaranth')
    

	
oCMenu.makeMenu('top1','','&nbsp;Graduate Program','grad/index.html')
  oCMenu.makeMenu('sub10','top1','Fields and Interests','grad/interests.html')
 	oCMenu.makeMenu('sub100','sub10','General Statement','grad/interests.html')
	oCMenu.makeMenu('sub101','sub10','By Field','grad/interests.html#field')
	oCMenu.makeMenu('sub102','sub10','By Genre','grad/interests.html#genre')
	oCMenu.makeMenu('sub103','sub10','By Interest','grad/interests.html#interest')
  oCMenu.makeMenu('sub11','top1','Meet the Faculty','people/faculty.html')
    oCMenu.makeMenu('sub110','sub11','Faculty Bios','people/faculty.html')
  oCMenu.makeMenu('sub12','top1','Degrees and Student Life','')
    oCMenu.makeMenu('sub120','sub12','Graduate Student Life','')
      oCMenu.makeMenu('sub1200','sub120','Life in the Lehigh Valley','http://www.bethlehempaonline.com ')
	  oCMenu.makeMenu('sub1201','sub120','Student Accomplishments','grad/achieve.html')
	  oCMenu.makeMenu('sub1202','sub120','Current Graduate Students','grad/students.html')
	  oCMenu.makeMenu('sub1203','sub120','Recent Courses','grad/courses.html')
    oCMenu.makeMenu('sub121','sub12','Master of Arts (M.A.)','grad/ma.html')
    oCMenu.makeMenu('sub122','sub12','Dr. of Philosophy (Ph.D.)','grad/phd.html')
  oCMenu.makeMenu('sub13','top1','Recent Courses','grad/courses.html')
	
oCMenu.makeMenu('top2','','&nbsp;Writing Program','writing/index.html')
  oCMenu.makeMenu('sub20','top2','First-Year Writing','writing/firstyear/index.html')
  	oCMenu.makeMenu('sub200','sub20','The Program','writing/firstyear/program.html')
	oCMenu.makeMenu('sub201','sub20','Students and Teachers','writing/firstyear/students.html')
	oCMenu.makeMenu('sub202','sub20','The Curriculum','writing/firstyear/curriculum.html')
	oCMenu.makeMenu('sub203','sub20','Recognition and Support','writing/firstyear/recognition.html')
	oCMenu.makeMenu('sub204','sub20','Student Voices','writing/firstyear/studentvoices.html')
	oCMenu.makeMenu('sub205','sub20','Contacts','writing/firstyear/contact.html')
  oCMenu.makeMenu('sub21','top2','Creative Writing','writing/creative/index.html')
  	oCMenu.makeMenu('sub210','sub21','Program Description','writing/creative/description.html')
	oCMenu.makeMenu('sub211','sub21','Faculty who Teach','writing/creative/faculty.html')
	oCMenu.makeMenu('sub212','sub21','Drown Writers Series','writing/creative/dws.html')
	oCMenu.makeMenu('sub213','sub21','Amaranth','ugrad/awards/index.html#amaranth')

oCMenu.makeMenu('top3','','&nbsp;People','people/index.html')
  oCMenu.makeMenu('sub30','top3','Faculty','people/faculty.html')
  oCMenu.makeMenu('sub31','top3','Staff','people/staff.html')
  oCMenu.makeMenu('sub32','top3','Students','people/students.html')


//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])
/*  pos = findPos(4)
  oCMenu.m["top4"].b.moveIt(pos[0],pos[1])
*/
  //Setting the fromtop value
  oCMenu.fromTop = pos[1]
}

//Leave this line - it constructs the menu
oCMenu.construct()		

//Setting it to re place the elements after resize - the resize is not perfect though..
oCMenu.onafterresize="placeElements()"

placeElements()