function changeImages()
{
	if (document.images)
	{
		document.getElementById(this.o).src = this.oImg;
	}
}

function cancelHide()
{
	if (this.tid) clearTimeout(this.tid);
}

function show()
{
	this.cancelHide();
	
	if (prevMenu && prevMenu!=this.oID)
	{
		eval(prevMenu+"Obj.hideCallback();");
		eval(prevMenu+"Obj.cancelHide();");
	}
	
	prevMenu = this.oID;
	document.getElementById(this.oID).style.display = "";
	this.oImg = "http://www.nelsonirrigation.com/images/" + this.o + "_on.gif";
	this.changeImages();
}

function hide()
{
	this.tid = eval("setTimeout('"+this.oID+"Obj.hideCallback()', 2000);");
}

function hideCallback()
{
	document.getElementById(this.oID).style.display = 'none';
	this.oImg = "http://www.nelsonirrigation.com/images/" + this.o + ".gif";
	this.changeImages();
}

//first object attempt
function menuMaker(oID, o)
{
	//properties
	this.oID = oID;
	this.o = o;
	this.oImg;
	this.tid;
	
	//methods
	this.show = show;
	this.hide = hide;
	this.hideCallback = hideCallback;
	this.cancelHide = cancelHide;
	this.changeImages = changeImages;
}

//when mouseover on non-dropdown buttons
//hide all the dropdowns that might be showing
function hideAll()
{
	document.getElementById('ddnav_profile').style.display = 'none';
	document.getElementById('ddnav_products').style.display = 'none';
	document.getElementById('ddnav_projects').style.display = 'none';
	document.getElementById('ddnav_news').style.display = 'none';
	document.getElementById('nav_profile').src= "http://www.nelsonirrigation.com/images/nav_profile.gif";
	document.getElementById('nav_products').src= "http://www.nelsonirrigation.com/images/nav_products.gif";
	document.getElementById('nav_projects').src= "http://www.nelsonirrigation.com/images/nav_projects.gif";
	document.getElementById('nav_news').src= "http://www.nelsonirrigation.com/images/nav_news.gif";
}


