m1on 	  = new Image(0,0);
m1on.src  = "images/menu1on.gif";
m1off     = new Image(0,0);
m1off.src = "images/menu1.gif";

m2on 	  = new Image(0,0);
m2on.src  = "images/menu2on.gif";
m2off     = new Image(0,0);
m2off.src = "images/menu2.gif";

m3on 	  = new Image(0,0);
m3on.src  = "images/menu3on.gif";
m3off     = new Image(0,0);
m3off.src = "images/menu3.gif";

m4on 	  = new Image(0,0);
m4on.src  = "images/menu4on.gif";
m4off     = new Image(0,0);
m4off.src = "images/menu4.gif";

m5on 	  = new Image(0,0);
m5on.src  = "images/menu5on.gif";
m5off     = new Image(0,0);
m5off.src = "images/menu5.gif";

// Division graphics

dv1on 	  = new Image(0,0);
dv1on.src  = "images/marine_div_on.gif";
dv1off     = new Image(0,0);
dv1off.src = "images/marine_div_off.gif";

dv2on 	  = new Image(0,0);
dv2on.src  = "images/lawngarden_div_on.gif";
dv2off     = new Image(0,0);
dv2off.src = "images/lawngarden_div_off.gif";

dv3on 	  = new Image(0,0);
dv3on.src  = "images/vehicle_div_on.gif";
dv3off     = new Image(0,0);
dv3off.src = "images/vehicle_div_off.gif";

dv4on 	  = new Image(0,0);
dv4on.src  = "images/industrial_div_on.gif";
dv4off     = new Image(0,0);
dv4off.src = "images/industrial_div_off.gif";

dv5on 	  = new Image(0,0);
dv5on.src  = "images/specialproducts_div_on.gif";
dv5off     = new Image(0,0);
dv5off.src = "images/specialproducts_div_off.gif";


function imgOn(imgName)
{
	img = eval(imgName + "on.src");
	document[imgName].src = img;
}

function imgOff(imgName)
{
	img = eval(imgName + "off.src");
	document[imgName].src = img;
}

// Dropdown menu script by Synthetix

var mstatus=false;
var mvisibility=0;
var visTimer;
var global_element='';
var lborder=5;
var rborder=5

menu=new Array();
menu['d1']=new Array(118,"Our Company","our_company.php","Research & Development","research_development.php","Spare Parts/Support","support.php","Warehousing & Distribution","warehousing.php","Training","training.php","Our Heritage","heritage.php","The Innovator","innovator.php");
menu['d2']=new Array(118,"Marine","marine_division.php","Lawn & Garden","lawn_garden_division.php","Vehicle","vehicle_division.php","Industrial","industrial_division.php","Special Products","special_products.php");
menu['d3']=new Array(118,"Forthcoming Events","events.php");
menu['d4']=new Array(118,"Career Info","careers.php");
menu['d5']=new Array(118,"Contact Form","contact_form.php");

function menuOff(val)
{
	for(x=1;x<=5;x++)
	{
		idx="d"+x;
		if(idx!=val)
		{
			imgOff('m'+x);
			document.getElementById(idx).style.visibility = 'hidden';
		}
	}
}

function setOpacity(obj, opacity)
{
  opacity = (opacity == 100)?99.999:opacity;
  obj.style.filter = "alpha(opacity:"+opacity+")";
  obj.style.KHTMLOpacity = opacity/100;
  obj.style.MozOpacity = opacity/100;
  obj.style.opacity = opacity/100;
}

function makeVisible()
{
	clearTimeout(visTimer);
	setOpacity(document.getElementById(global_element),mvisibility);
	if(mvisibility!=90)
	{
		mvisibility+=10;
		visTimer=setTimeout("makeVisible()",30);
	}
}

function showMenu(val)
{
	menuOff(val);
	menucontent="<center><table width="+menu[val][0]+" border=0 cellspacing=3 cellpadding=0>";
	for(x=1;x<menu[val].length-1;x+=2)
		menucontent+="<tr><td width="+lborder+"></td><td><a href='"+menu[val][x+1]+"' class='menulink'>"+menu[val][x]+"</a></td><td width="+rborder+"></td></tr>";
	menucontent+="<tr><td><td height=3></td></tr></table></center>";
	
	if(mstatus==false)
	{
		mstatus=true;
		document.getElementById(val).innerHTML=menucontent;
		document.getElementById(val).style.visibility = 'visible';
		if(val==global_element)
		{
			mvisibility=90;
			setOpacity(document.getElementById(val),90)
		}
		else
			{
				mvisibility=0;
				global_element=val;
				makeVisible();
			}
	}
}

function hideMenu(val)
{
	if(mstatus==true)
	{
		mstatus=false;
		document.getElementById(val).style.visibility = 'hidden';
	}
}
