/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
* ** Modified to have another div in the menu to allow for more complex styling
***********************************************/

//Contents for menu 1
var menu1=new Array()
menu1.push('<a href="neurosurgeons.php" class="bold">Neurosurgeons</a>');
menu1.push('<a href="physiatrists.php" class="bold">Physiatrists</a>');
menu1.push('<a href="nppractitioners.php" class="bold">Non-Physician Practitioners</a>');


//Contents for menu 2, and so on
var menu2=new Array()
menu2.push('<h5>Appointments</h5>');
menu2.push('<a href="PI-appointments1a.php">How to be referred to LNSA</a>');
menu2.push('<a href="PI-appointments1a.php">Which physician will you see?</a>');
menu2.push('<a href="PI-appointments1a.php">Making your appointment</a>');
menu2.push('<a href="PI-appointments-officevisits.php">Office visits</a>');
menu2.push('<a href="PI-appointments-officevisits.php">Second opinion</a>');


menu2.push('<h5>Patient Forms & Surveys</h5>');
menu2.push('<a href="PI-patient-registration.php">Patient registration forms</a>');
menu2.push('<a href="PI-patient-online_surveys.php">Online surveys</a>');


menu2.push('<a href="contact.php" class="boldCaps">Office information</a>');


menu2.push('<h5>Details regarding treatment</h5>');
menu2.push('<a href="PI-treatment-exam-diagnosis.php">Examination and testing</a>');
menu2.push('<a href="PI-treatment-exam-diagnosis.php">Diagnosis</a>');
menu2.push('<a href="PI-treatment-confidentiality.php">Confidentiality</a>');
menu2.push('<a href="PI-treatment-alternatives.php">Treatment alternatives</a>');
menu2.push('<a href="PI-treatment-alternatives.php">When surgery is required</a>');


menu2.push('<a href="PI-prescription-refill.php" class="boldCaps">Prescription refill</a>');


menu2.push('<a href="PI-costs-billing.php" class="boldCaps">Cost Information</a>');


menu2.push('<a href="PI-participating-Insurances.php" class="boldCaps">Participating Insurances</a>');


menu2.push('<a href="PI-support_groups.php" class="boldCaps">Support groups</a>');


var menu3=new Array()
menu3.push('<a href="cpbrain.htm" class="bold">Brain</a>');
menu3.push('<a href="cpspine.htm" class="bold">Spine</a>');
menu3.push('<a href="cpother.htm" class="bold">Other</a>');


var menu5=new Array()
menu5.push('<a href="mainoffice.htm" class="bold">Main office</a>');
menu5.push('<a href="campusoffice.htm" class="bold">Campus office</a>');
/*
oCMenu.makeMenu("top5","","","appointments.htm","",111,30,"images/faq.gif","images/faq_on.gif");
	oCMenu.makeMenu("sub50","top5","Appointments","appointments.htm");
	oCMenu.makeMenu("sub51","top5","Insurance","insurance.htm");
	oCMenu.makeMenu("sub52","top5","Locations/Directions","locations.htm");
	oCMenu.makeMenu("sub53","top5","Neurosurgery","neurosurgery.htm");
//	oCMenu.makeMenu("sub54","top5","Neurology","neurology.htm");
	oCMenu.makeMenu("sub55","top5","Physiatry","physiatry.htm");
	oCMenu.makeMenu("sub56","top5","Referrals","referrals.htm");
	oCMenu.makeMenu("sub57","top5","Support Groups","faqsupportgroups.htm");
	oCMenu.makeMenu("sub58","top5","Related Health Links","faqRelatedLinks.htm");
//	oCMenu.makeMenu("sub58","top5","Stroke","stroke.htm");
	
oCMenu.makeMenu("top6","","","news-desperatepain.htm","",111,30,"images/news.gif","images/news_on.gif");
*/

var menuwidth='165px' //default menu width
var menubgcolor='lightyellow'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"><div id="dropmenuinnerdiv"></div></div>')

function getposOffset(what, offsettype){
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
	while (parentEl!=null){
		totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
		parentEl=parentEl.offsetParent;
	}
	return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
	if (ie4||ns6)
		dropmenuobj.style.left=dropmenuobj.style.top="-500px"
	if (menuwidth!=""){
		dropmenuobj.widthobj=dropmenuobj.style
		dropmenuobj.widthobj.width=menuwidth
	}
	if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
		obj.visibility=visible
	else if (e.type=="click")
		obj.visibility=hidden
}

function iecompattest(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
	// skip this, just show the menu where it should be
	return 0;
	
	var edgeoffset=0
	if (whichedge=="rightedge"){
		var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
		dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
		if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
		edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
	}
	else{
		var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
		var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
		dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
		if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
			edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
			if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
				edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
		}
	}
	return edgeoffset
}

function populatemenu(what){
	var dropmenuinnerobj=document.getElementById? document.getElementById("dropmenuinnerdiv") : dropmenuinnerdiv
	if (ie4||ns6)
		dropmenuinnerobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
	if (window.event) event.cancelBubble=true
	else if (e.stopPropagation) e.stopPropagation()
		clearhidemenu()
	dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
	populatemenu(menucontents)
	
	if (ie4||ns6){
		showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
	
	dropmenuobj.x=getposOffset(obj, "left")
	dropmenuobj.y=getposOffset(obj, "top")
	dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
	dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
	if (ie4||ns6) return false
	else return true
}

function contains_ns6(a, b) {
	while (b.parentNode)
		if ((b = b.parentNode) == a)
			return true;
	return false;
}

function dynamichide(e){
	if (ie4&&!dropmenuobj.contains(e.toElement))
		delayhidemenu()
	else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
		delayhidemenu()
}

function hidemenu(e){
	if (typeof dropmenuobj!="undefined"){
		if (ie4||ns6)
			dropmenuobj.style.visibility="hidden"
	}
}

function delayhidemenu(){
	if (ie4||ns6)
		delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
	if (typeof delayhide!="undefined")
		clearTimeout(delayhide)
}

function forcehidemenu() {
	clearhidemenu();
	hidemenu();
}

if (hidemenu_onclick=="yes")
	document.onclick=hidemenu;
