// JavaScript Document


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

oCMenu.frames = 0

//Menu properties   
oCMenu.pxBetween=0
//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=1
oCMenu.menuPlacement=0
                                                             
oCMenu.offlineRoot="" 
oCMenu.onlineRoot="/" 
oCMenu.resizeCheck=1 
oCMenu.wait=500 
oCMenu.fillImg="bluedot.gif"
oCMenu.zIndex=1

//Background bar properties
oCMenu.useBar=0
oCMenu.barWidth="700"
oCMenu.barHeight="15" 
oCMenu.barClass="clBar"
oCMenu.barX=0 
oCMenu.barY=0
oCMenu.barBorderX=5
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=90
oCMenu.level[0].height=20
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=3
oCMenu.level[0].offsetY=3
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"

//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+34
oCMenu.level[1].height=20
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"


//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=120
oCMenu.level[2].height=20
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','','','patient_info.htm','','96','11','images/button1.jpg')
  	oCMenu.makeMenu('sub00','top0','&nbsp;Consultation','Consultation.htm')
 	oCMenu.makeMenu('sub01','top0','&nbsp;Scheduling','Scheduling.htm')
	oCMenu.makeMenu('sub02','top0','&nbsp;Financial Policy','Financial.htm')
	oCMenu.makeMenu('sub03','top0','&nbsp;Insurance','Insurance.htm')
	oCMenu.makeMenu('sub04','top0','&nbsp;Privacy Policy','Privacy_Policy.htm')
	oCMenu.makeMenu('sub05','top0','&nbsp;First Visit','First_Visit.htm')
	
	oCMenu.makeMenu('top1','','','meet_us.htm','','68','11','images/button2.jpg')
	oCMenu.makeMenu('sub10','top1','&nbsp;Dr. Ferdowsmakan','Dr_Robert_Ferdowsmakan.htm')
	oCMenu.makeMenu('sub11','top1','&nbsp;Meet the Staff','Staff.htm')
	oCMenu.makeMenu('sub12','top1','&nbsp;Office Tour','Office_Tour.htm')

	oCMenu.makeMenu('top2','','','','','97','11','images/button3.jpg')
	oCMenu.makeMenu('sub20','top2','&nbsp;Dental Implants','Dental_Implants.htm')
	oCMenu.makeMenu('sub21','top2','&nbsp;Bone Grafting','Bone_Grafting.htm')
	oCMenu.makeMenu('sub22','top2','&nbsp;Soft Tissue Grafting','Soft_Tissue_Grafting.htm')
	oCMenu.makeMenu('sub23','top2','&nbsp;Wisdom Teeth','Wisdom_Teeth.htm')
	oCMenu.makeMenu('sub24','top2','&nbsp;Canine Exposure','Canine_Exposure.htm')
	oCMenu.makeMenu('sub25','top2','&nbsp;Orthognathic Surgery','Orthognathic_Surgery.htm')
	oCMenu.makeMenu('sub26','top2','&nbsp;Facial Trauma','Facial_Trauma.htm')
	oCMenu.makeMenu('sub27','top2','&nbsp;Oral Pathology','Oral_Pathology.htm')
	oCMenu.makeMenu('sub28','top2','&nbsp;Sleep Apnea','Sleep_Apnea.htm')
	oCMenu.makeMenu('sub29','top2','&nbsp;Nerve Injury Repair','Nerve_Injury_Repair.htm')
	oCMenu.makeMenu('sub30','top2','&nbsp;General Anesthesia','General_Anesthesia.htm')	

	oCMenu.makeMenu('top3','','','patient_instructions.htm','','103','11','images/button4.jpg')
	oCMenu.makeMenu('sub31','top3','&nbsp;Anesthesia','Instructions_Anesthesia.htm')
	oCMenu.makeMenu('sub32','top3','&nbsp;Dental Implants','Instructions_Dental_Implants.htm')
	oCMenu.makeMenu('sub33','top3','&nbsp;Wisdom Teeth','Instructions_Wisdom_Teeth.htm')
	oCMenu.makeMenu('sub34','top3','&nbsp;Extractions','Instructions_Extractions.htm')
	oCMenu.makeMenu('sub35','top3','&nbsp;Multiple Extractions','Instructions_Multiple_Extractions.htm')
	oCMenu.makeMenu('sub36','top3','&nbsp;Canine Exposure','Instructions_Canine_Exposure.htm')
	oCMenu.makeMenu('sub37','top3','&nbsp;First Visit','First_Visit.htm')
	
	oCMenu.makeMenu('top4','','','Referring_Doctors.htm','','76','11','images/button5.jpg')
	oCMenu.makeMenu('sub41','top4','&nbsp;Referring Doctors','Referring_Doctors.htm')
	oCMenu.makeMenu('sub42','top4','&nbsp;Upcoming Events','events.htm')
	oCMenu.makeMenu('sub43','top4','&nbsp;Links','Links.htm')

	oCMenu.makeMenu('top5','','','contact.htm','','74','11','images/button6.jpg')
	oCMenu.makeMenu('sub51','top5','&nbsp;Contact Us','contact.htm')
	oCMenu.makeMenu('sub52','top5','&nbsp;Directions','Directions.htm')
	oCMenu.makeMenu('sub53','top5','&nbsp;Map','Map.htm')
	
	oCMenu.makeMenu('top6','','','http://torreyhillsoms.com','','45','11','images/button8.jpg')
	
//Leave this line - it constructs the menu
oCMenu.construct()		



