/***********************************************
* 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
***********************************************/
//Contents for menu 1 -- this menu doesn't seem to want to work so just leave it alone
var menu1=new Array()
menu1[0]='<a href="#"><img src="images/dropmenu/drop-menu1.jpg" width="164" height="20" border="0"></a><br>'

//Contents for menu 2, and so on
var menu2=new Array()
// <a href="product-overview.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('menu2','','http://www.delstarinc.com/images/dropmenu/delstar-plastic-mesh_03.jpg',1)"><IMG SRC="../images/dropmenu/delstar-support-netting_03.jpg" name="menu2" WIDTH="112" height="45" border="0"></a></TD>
	menu2[0]='<a href="http://www.delstarinc.com/naltex.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'products1\',\'\',\'http://www.delstarinc.com/images/dropmenu/drop-menu2-1b.jpg\',1)"><img src="http://www.delstarinc.com/images/dropmenu/drop-menu2-1.jpg" name="products1" width="164" height="20" border="0"></a><br>'
menu2[1]='<a href="http://www.delstarinc.com/delnet.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'products2\',\'\',\'http://www.delstarinc.com/images/dropmenu/drop-menu2-2b.jpg\',1)"><img src="http://www.delstarinc.com/images/dropmenu/drop-menu2-2.jpg" name="products2" width="164" height="20" border="0"></a><br>'
menu2[2]='<a href="http://www.delstarinc.com/delpore.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'products3\',\'\',\'http://www.delstarinc.com/images/dropmenu/drop-menu2-3b.jpg\',1)"><img src="http://www.delstarinc.com/images/dropmenu/drop-menu2-3.jpg" name="products3" width="164" height="20" border="0"></a><br>'
menu2[3]='<a href="http://www.delstarinc.com/stratex.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'products4\',\'\',\'http://www.delstarinc.com/images/dropmenu/drop-menu2-4b.jpg\',1)"><img src="http://www.delstarinc.com/images/dropmenu/drop-menu2-4.jpg" name="products4" width="164" height="20" border="0"></a><br>'
menu2[4]='<a href="http://www.delstarinc.com/coretec.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'products5\',\'\',\'http://www.delstarinc.com/images/dropmenu/drop-menu2-5b.jpg\',1)"><img src="http://www.delstarinc.com/images/dropmenu/drop-menu2-5.jpg" name="products5" width="164" height="20" border="0"></a><br>'

//Contents for menu 3, and so on
var menu3=new Array()
menu3[0]='<a href="http://www.delstarinc.com/automotive.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'industry1\',\'\',\'http://www.delstarinc.com/images/dropmenu/drop-menu3-1b.jpg\',1)"><img src="http://www.delstarinc.com/images/dropmenu/drop-menu3-1.jpg" name="industry1" width="164" height="20" border="0"></a><br>'
menu3[1]='<a href="http://www.delstarinc.com/filtration.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'industry2\',\'\',\'http://www.delstarinc.com/images/dropmenu/drop-menu3-2b.jpg\',1)"><img src="http://www.delstarinc.com/images/dropmenu/drop-menu3-2.jpg" name="industry2" width="164" height="20" border="0"></a><br>'
menu3[2]='<a href="http://www.delstarinc.com/food_service.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'industry3\',\'\',\'http://www.delstarinc.com/images/dropmenu/drop-menu3-3b.jpg\',1)"><img src="http://www.delstarinc.com/images/dropmenu/drop-menu3-3.jpg" name="industry3" width="164" height="20" border="0"></a><br>'
menu3[3]='<a href="http://www.delstarinc.com/healthcare.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'industry4\',\'\',\'http://www.delstarinc.com/images/dropmenu/drop-menu3-4b.jpg\',1)"><img src="http://www.delstarinc.com/images/dropmenu/drop-menu3-4.jpg" name="industry4" width="164" height="20" border="0"></a><br>'
menu3[4]='<a href="http://www.delstarinc.com/industrial.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'industry5\',\'\',\'http://www.delstarinc.com/images/dropmenu/drop-menu3-5b.jpg\',1)"><img src="http://www.delstarinc.com/images/dropmenu/drop-menu3-5.jpg" name="industry5" width="164" height="20" border="0"></a><br>'
menu3[5]='<a href="http://www.delstarinc.com/textiles.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'industry6\',\'\',\'http://www.delstarinc.com/images/dropmenu/drop-menu3-6b.jpg\',1)"><img src="http://www.delstarinc.com/images/dropmenu/drop-menu3-6.jpg" name="industry6" width="164" height="20" border="0"></a><br>'
	
var menuwidth='164px' //default menu width
var menubgcolor='#D2E5FF'  //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>')

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
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 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 populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}

//Have divided the menus drop down function for both drop downs due to it not sending the array correctly
function dropdownmenu2(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(menu2)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
//The if statements here fix the left and top offsets of the div.
//They account for the 5px borders on the left and top of the enclosing div.
//The cause of the problem has to do with ie not reporting the complete width
//of the div despite my strict DOCTYPE and the fact that it should be abiding by
//the W3C box model.  I would like to find a better solution for this menu,
//but I don't have the time to research it right now.
if (ie4) {
	dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+5+"px"
} else {
	dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
}
if (ie4) {
	dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+5+obj.offsetHeight+"px"
} else {
	dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")-4+obj.offsetHeight+"px"
}
}

return clickreturnvalue()
}

function dropdownmenu3(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(menu3)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
//The if statements here fix the left and top offsets of the div.
//They account for the 5px borders on the left and top of the enclosing div.
//The cause of the problem has to do with ie not reporting the complete width
//of the div despite my strict DOCTYPE and the fact that it should be abiding by
//the W3C box model.
if (ie4) {
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+5+"px"
} else {
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
}
if (ie4) {
	dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+5+obj.offsetHeight+"px"
} else {
	dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")-4+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)
}

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

