
var path = window.location.href.substring(0, location.href.lastIndexOf("/") + 1);

if(path.substr(path.length-4,3) == 'com')
{
   fromPage = 'fromDropDownMenuHome';
}
else
{
   fromPage = 'fromDropDownMenuHeader';
}

/***********************************************
* 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
***********************************************/
//alert(location.href);

/******************Menu Content **********************/
var menu1=new Array()
menu1[0]='<a href="/Replacement_Parts/rfq.php?'+fromPage+'" id="rfqLink1" >Request-a-quote &amp; File Upload</a>';
menu1[1]='<a href="/Replacement_Parts/rs.php?'+fromPage+'">Production Time Options</a>';
menu1[2]='<a href="/Replacement_Parts/mss.php?'+fromPage+'">Machining Services</a>';
menu1[3]='<a href="/Replacement_Parts/pl.php?'+fromPage+'">Materials</a>';
menu1[4]='<a href="/Replacement_Parts/howToGetParts.php?'+fromPage+'">How To Get Replacement Parts</a>';

var menu2=new Array()
menu2[0]='<a href="/Prototypes/rfq.php?'+fromPage+'" id="rfqLink2" >Request-a-quote &amp; File Upload</a>';
menu2[1]='<a href="/Prototypes/rs.php?'+fromPage+'">Production Time Options</a>';
menu2[2]='<a href="/Prototypes/prototypes.php?'+fromPage+'">How our prototype system works</a>';
menu2[3]='<a href="/Prototypes/pl.php?'+fromPage+'">Materials</a>';

var menu3=new Array()
menu3[0]='<a href="/Production_Quantities/rfq.php?'+fromPage+'" id="rfqLink3" >Request-a-quote &amp; File Upload</a>';
menu3[1]='<a href="/Production_Quantities/qty.php?'+fromPage+'">Quantities from 10 to 10,000</a>';
menu3[2]='<a href="/Production_Quantities/rs.php?'+fromPage+'">Production Time Options</a>';
menu3[3]='<a href="/Tech_Tools/partSearch.php?'+fromPage+'">From Standard Parts</a>';

var menu4=new Array()
menu4[0]='<a href="/Reverse_Engineering/rfq.php?'+fromPage+'" id="rfqLink4" >Request-a-quote &amp; File Upload</a>';
menu4[1]='<a href="/Reverse_Engineering/reverseengineering.php?'+fromPage+'">Send Us Your Samples or <br>&nbsp; Get an Estimate From Your Photos.</a>';

var red = 'red';
var gray = 'gray';
var subWidth = '250px';
var menu5=new Array()
menu5[0]='<a href="/Tech_Tools/ratio.php?'+fromPage+'">Ratio &amp; Center Distance</a>';
menu5[1]='<a href="/Tech_Tools/horsepower.php?'+fromPage+'">Horsepower Calculator</a>';
menu5[2]='<a href="/Tech_Tools/techupdates.php?'+fromPage+'">Technical Updates</a>';
menu5[3]='<a href="/Tech_Tools/geartalk.php?'+fromPage+'">Gear Talk</a>';
menu5[4]='<a href="/Tech_Tools/geargages.php?'+fromPage+'">Gear Gages</a>';
menu5[5]='<a href="/Tech_Tools/catindex.php?'+fromPage+'">Online Gear Design Guide</a>';
menu5[6]='<a href="/Tech_Tools/partSearch.php?'+fromPage+'">Part Number Search</a>';
menu5[7]='<a href="/Tech_Tools/rfq.php?'+fromPage+'" id="rfqLink5" >Request-a-quote &amp; File Upload</a>';
menu5[8]='<a href="/Tech_Tools/tolerances.php?'+fromPage+'" id="rfqLink5" >Standards &amp; Tolerances</a>';

var submenu5=new Array()
submenu5[0] = '<a href="/Tech_Tools/horsepower.php?'+fromPage+'">Spur Gears &amp; Helical Gears</a>';
submenu5[1] = '<a href="/Tech_Tools/wormGearRation.php?'+fromPage+'">Worm Gears</a>';

var menu6=new Array()
menu6[0]='<a href="/About_Us/rfq.php?'+fromPage+'" id="rfqLink6" >Request-a-quote &amp; File Upload</a>';
menu6[1]='<a href="/About_Us/ch.php?'+fromPage+'">Company History</a>';
menu6[2]='<a href="/About_Us/faq.php?'+fromPage+'">Frequently Asked questions</a>';
menu6[3]='<a href="/About_Us/ai.php?'+fromPage+'">Applications &amp; Industries</a>';
menu6[4]='<a href="/About_Us/pl.php?'+fromPage+'">Product List</a>';
menu6[5]='<a href="/About_Us/rs.php?'+fromPage+'">Production Time Options</a>';
menu6[6]='<a href="/About_Us/mss.php?'+fromPage+'">Machining Services</a>';
menu6[7]='<a href="/About_Us/cl.php?'+fromPage+'">Customer List</a>';
menu6[8]='<a href="/About_Us/contact.php?'+fromPage+'">Contact Us</a>';
menu6[9]='<a href="/About_Us/browsers.php?'+fromPage+'">Compatible Browsers</a>';
menu6[10]='<a href="/About_Us/privacy.php?'+fromPage+'">Privacy Policy</a>';
menu6[11]='<a href="/About_Us/terms.php?'+fromPage+'">Terms and Conditions</a>';
menu6[12]='<a href="/About_Us/tolerances.php?'+fromPage+'">Standards &amp Tolerances</a>';

		
var menuwidth='350px'; //default menu width
var menubgcolor='#CC3333';  //menu bgcolor orig color: #002065
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>')

function getposOffset(changeWhat, offsettype)
{
	var totaloffset=(offsettype=="left") ? changeWhat.offsetLeft : changeWhat.offsetTop;
	var parentEl=changeWhat.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 +'px';
	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)
{
	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(changeWhat)
{
	if (ie4||ns6)
	dropmenuobj.innerHTML=changeWhat.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth)
{
	   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';
	}

}

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)
}

if (hidemenu_onclick=="yes")
	document.onclick=hidemenu

function showBrowsers(e)
{
   if(window.event && window.event.srcElement)
   {
      el = window.event.srcElement;
   }
   if(e && e.target)
   {
      el = e.target;
   }
   if(!el)
   {
      el = 'no el';
   }

   elId = el.id

   showHide('browsers');
}

function hiLiteLink(bColor)
{
   var rfqLink = document.getElementById('rfqLink');
   var newImg  = document.getElementById('newImg');
   if(bColor == 'red')
   {
      newImg.src = '/images/yellowGrayBurst.gif';
   }
   else
   {
      newImg.src = '/images/yellowRedBurst.gif';
   }

}  
      
