  /***********************************************
  * AnyLink Vertical Menu- © Dynamic Drive (www.dynamicdrive.com)
  * This notice MUST stay intact for legal use
  * Visit http://www.dynamicdrive.com/ for full source code
  ***********************************************/

  //Contents for Resources Menu
  var res_menu=new Array()
  res_menu[0]='<a href="http://www.nysafp.org/resources/about_nysafp.php">About NYSAFP</a>'
  res_menu[1]='<a href="http://www.nysafp.org/resources/family_health_advocate.php">Family Health Advocate</a>'
  res_menu[2]='<a href="http://www.nysafp.org/resources/colorectal_cancer_webinar.php">Colorectal Cancer Increase Screening Rates</a>'
  res_menu[3]='<a href="http://www.nysafp.org/resources/substance_abuse_resources.php">Substance Abuse Resources</a>'
  res_menu[4]='<a href="http://www.nysafp.org/resources/careers.php">Careers</a>'
  res_menu[5]='<a href="http://www.nysafp.org/resources/foundation.php">NYSAFP Foundation</a>'
  res_menu[6]='<a href="http://www.nysafp.org/resources/nysdiabetescampaign.php">NYS Diabetes Campaign</a>'
  res_menu[7]='<a href="http://www.nysafp.org/resources/pcmh.php">PCMH</a>'

  

  //Contents for Board Menu
  var board_menu=new Array()
  board_menu[0]='<a href="http://www.nysafp.org/board_and_commissions/advocacy.php">Advocacy</a>'
  board_menu[1]='<a href="http://www.nysafp.org/board_and_commissions/education.php">Education</a>'
  board_menu[2]='<a href="http://www.nysafp.org/board_and_commissions/leadership.php">Leadership & Nominations</a>'
  board_menu[3]='<a href="http://www.nysafp.org/board_and_commissions/membership.php">Membership</a>'
  board_menu[4]='<a href="http://www.nysafp.org/board_and_commissions/operations.php">Operations</a>'
  board_menu[5]='<a href="http://www.nysafp.org/board_and_commissions/public.php">Public Health</a>'
  board_menu[6]='<a href="http://www.nysafp.org/board_and_commissions/news_releases.php">News Releases</a>'

  //Contents for CME Menu
  var cme_menu=new Array()
  cme_menu[0]='<a href="http://www.nysafp.org/cme_programs/core_content_review.php">Core Content Review</a>'
	

	//Contents for Congress of Delegates Menu
	var congress_menu=new Array()
	congress_menu[0]='<a href="http://www.nysafp.org/congress_of_delegates/index.php">Summary of 2009 NYSAFP Congress of Delegates</a>'
	congress_menu[1]='<a href="http://www.nysafp.org/congress_of_delegates/actions_of_the_congress.php">Actions of the Congress</a>'

  //Contents for Newsletter Menu
  var news_menu=new Array()
  news_menu[0]='<a href="http://www.nysafp.org/newsletter/archive.php">Archives</a>'

  //Contents for Members Menu
  var members_menu=new Array()
  members_menu[0]='<a href="http://www.nysafp.org/members_only/resolution.php">Resolution</a>'
  members_menu[1]='<a href="http://www.nysafp.org/NYSAFP_Membership_Packet.ppt" target="_blank">NYSAFP Membership Packet (PPT)</a>'
  members_menu[2]='<a href="http://www.nysafp.org/members_only/logout.php">Logout</a>'
	
	var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
  var horizontaloffset=2 //horizontal offset of menu from default location. (0-5 is a good value)

  /////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: 160px" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></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=-500
  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){
  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-obj.offsetWidth < 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 menu up?
  edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
  if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either? (position at top of viewable window then)
  edgeoffset=dropmenuobj.y
  }
  }
  return edgeoffset
  }

  function populatemenu(what){
  if (ie4||ns6)
  dropmenuobj.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")+obj.offsetWidth+horizontaloffset+"px"
  dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"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)
  }