/***********************************************
* 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
***********************************************/
var ie4=document.all;
var ns6=document.getElementById&&!document.all;

if (ie4||ns6) document.write('<div id="dropmenudiv" style="visibility:hidden;width:165px;background-color:#F4F4F4" 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 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 < dropmenuobj.contentmeasure) edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
  }
  else{
    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) edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
  }
  return edgeoffset
}

function dropdownmenu(obj, e, productid, gallery, manuals, faqshints, hopupsoptional, partslisting, usedin){
  if (window.event) event.cancelBubble=true
  else if (e.stopPropagation) e.stopPropagation()
  clearhidemenu()
  dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
  if (ie4||ns6){
    dropmenuobj.innerHTML=(gallery==1? "<a href='/Products/ProductGallery.aspx?ProdID="+encodeURIComponent(productid)+"' class='moremenu'>Gallery</a><br>" : "") +
		(manuals==1? "<a href='/Products/Support.aspx?ProdID="+encodeURIComponent(productid)+"' class='moremenu'>Manuals</a><br>" : "") +
		(faqshints==1? "<a href='/Products/Support.aspx?ProdID="+encodeURIComponent(productid)+"' class='moremenu'>FAQs/Hints & Tips</a><br>" : "") +
		(hopupsoptional==1? "<a href='/Products/RelatedPartsSummary.aspx?ProdID="+encodeURIComponent(productid)+"' class='moremenu'>Hop-Ups/Optional Parts</a><br>" : "") +
		(partslisting==1? "<a href='/Products/RelatedParts.aspx?ProdID="+encodeURIComponent(productid)+"&Category=Parts%20Listing' class='moremenu'>Parts Listing</a><br>" : "") +
		(usedin==1? "<a href='/Products/RelatedParts.aspx?ProdID="+encodeURIComponent(productid)+"&Category=Used%20In...&SubCategory=' class='moremenu'>Used in...</a><br>" : "")
    dropmenuobj.style.left=dropmenuobj.style.top=-500
    dropmenuobj.widthobj=dropmenuobj.style
    dropmenuobj.widthobj.width='165px'
    dropmenuobj.style.visibility='visible'
    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 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()", 250)
}

function clearhidemenu(){
  if (typeof delayhide!="undefined") clearTimeout(delayhide)
}

