

subOn = false;
timer = null;

function dhMenus(selfName)
{
	c = this;
	c.name = selfName;
	c.arrMenus = new Array();
	c.arrParents = new Array();
	return this;
}

function hideElement(id){
	objVisibility = document.getElementById(id).style.visibility;
	if(objVisibility == "visible"){
		document.getElementById(id).style.visibility = "hidden";
	}
}

function showElement(id){
	objVisibility = document.getElementById(id).style.visibility;
	if(objVisibility == "hidden"){
		document.getElementById(id).style.visibility = "visible";
	}
}

function showSubMenus(id)
{
	setOnVar();
	//if(c.arrMenus[id] != undefined){
	if(c.arrMenus[id] != null){
		for(i = 0; i < c.arrMenus[id].length; i++){
			showElement(c.arrMenus[id][i]);
		}
	}
	hideOtherSubs(id);
	r_on(id + "_img");
	featureImg(c.arrMenus[id][c.arrMenus[id].length - 1] + "_img", id + "_img_feature");
}

function hideSubMenus(id)
{
	setOffVar();
	clearTimeout(timer);
	timer = setTimeout("if(!subOn){hideSubs('" + id + "')}", c.timeOut);
}

function hideSubs(id)
{
	for(i = 0; i < c.arrMenus[id].length; i++){
		hideElement(c.arrMenus[id][i]);
	}
	r_off(id + "_img");
}

function hideOtherSubs(id)
{
	for(j = 0; j < c.arrParents.length; j++)
	{
		if(id != c.arrParents[j]){
			hideSubs(c.arrParents[j]);
		}
	}
}

function highlightSubs(id, parent)
{
	setOnVar();
	r_on(id + "_img");
	featureImg(c.arrMenus[parent][c.arrMenus[parent].length - 1] + "_img", id + "_img_feature");
}

function setOnVar()
{
	subOn = true;
}

function setOffVar()
{
	subOn = false;
}

function r_on(whichimage)
{
	if(eval(whichimage + "_on") != null){
		document.images[whichimage].src = eval(whichimage + "_on.src");
	}
}

function r_off(whichimage)
{
	if(eval(whichimage + "_on") != null){
		document.images[whichimage].src = eval(whichimage + "_off.src");
	}
}

function featureImg(whichimage, src)
{
	if(eval(src) != null){
		document.images[whichimage].src = eval(src + ".src");
	}
}

function mouseOver(id, parent)
{
	if(parent == ""){
		mouseOverString = "showSubMenus('" + id + "');";
	}else{
		mouseOverString = "highlightSubs('" + id + "', '" + parent + "');";
	}
	return mouseOverString
}

function mouseOut(id, parent)
{
	if(parent == ""){
		mouseOutString = "hideSubMenus('" + id + "');";
	}else{
		mouseOutString = "hideSubMenus('" + parent + "');r_off('" + id + "_img');";
	}
	return mouseOutString
}

dhMenus.prototype.createDiv = function(id, parent, image_on, image_off, image_feature, left, top, divWidth, divHeight, path)
{
	if(parent != ""){
		visi = "hidden"
	}else{
		visi = "visible"
	}
	divElem = document.createElement("div");
	divElem.id = id;
	divElem.style.position = "absolute";
	divElem.style.left = left;
	divElem.style.top = top;
	divElem.style.width = divWidth;
	divElem.style.height = divHeight;
	//z-index is set at such a high number to account for the multiple divs and z-indeces on the online maps page.
	//menus MUST appear over the top of ALL content on the page (mostly referring to bulleted map features).
	divElem.style.zIndex = 599;
	divElem.style.visibility = visi;
	//divElem.style.filter = "alpha(Opacity=90)";
	divElem.innerHTML = c.createAnchor(id, parent, image_on, image_off, image_feature, divWidth, divHeight, path);
	document.body.appendChild(divElem);
	return divElem;
}

dhMenus.prototype.createAnchor = function(id, parent, image_on, image_off, image_feature, divWidth, divHeight, loc)
{
	onclickVar = "";
	onmouseoverVar = "";
	if(loc == ""){
		onclickVar = "return false;"
		aTag = "<div onmouseover=\"" + mouseOver(id, parent) + "\" onmouseout=\"" + mouseOut(id, parent) + "\" onclick=\"" + onclickVar + "\" target=\"_top\">"
		aTag += c.createImg(id, image_on, image_off, image_feature, divWidth, divHeight);
		aTag += "</div>"
	}else{
		aTag = "<a href=\"" + loc + "\" onmouseover=\"" + mouseOver(id, parent) + "\" onmouseout=\"" + mouseOut(id, parent) + "\" onclick=\"" + onclickVar + "\" target=\"_top\">"
		aTag += c.createImg(id, image_on, image_off, image_feature, divWidth, divHeight);
		aTag += "</a>"
	}
	return aTag;
}

dhMenus.prototype.createImg = function(id, image_on, image_off, image_feature, divWidth, divHeight)
{
	eval(id + "_img_off = new Image();");
	eval(id + "_img_off.src = c.imageRoot + image_off");

	if(image_on == ""){
		eval(id + "_img_on = null")
	}else{
		eval(id + "_img_on = new Image()")
		eval(id + "_img_on.src = c.imageRoot + image_on");
	}

	if(image_feature == ""){
		eval(id + "_img_feature = null")
	}else{
		eval(id + "_img_feature = new Image()")
		eval(id + "_img_feature.src = c.imageRoot + image_feature");
	}

	imgTag = "<img src=\"" + c.imageRoot + image_off + "\" name=" + id +"_img width=" + divWidth + " height=" + divHeight + " border=0>";
	return imgTag;
}

dhMenus.prototype.createMenu = function(id, parent, image_on, image_off, image_feature, divWidth, divHeight, path)
{
	eval(id + "_status = ''");
	c.addToArray(id, parent);
	d = c.createDiv(id, parent, image_on, image_off, image_feature, c.xPos(id, parent), c.yPos(id, parent), divWidth, divHeight, path);
}

dhMenus.prototype.xPos = function(id, parent)
{
	if(parent != ""){
		if(c.alignWithParent == false){
			xPos = c.fromLeft;
		}else{
			displayVals = c.getDisplayVals(parent);
			xPos = parseInt(displayVals[2].replace("px", ""));
		}
	}else{
		objectToLeft = c.getObjectToLeft(id);
		if(objectToLeft != null){
			displayVals = c.getDisplayVals(objectToLeft);
			xPos = parseInt(displayVals[0].replace("px", "")) + parseInt(displayVals[2].replace("px", "")) + c.pxBetween;
		}else{
			xPos = c.fromLeft;
		}
	}
	return xPos + "px";
}

dhMenus.prototype.yPos = function(id, parent)
{
	if(parent != ""){
		objectAbove = c.getObjectAbove(id, parent);
		displayVals = c.getDisplayVals(objectAbove);
		yPos = parseInt(displayVals[1].replace("px", "")) + parseInt(displayVals[3].replace("px", ""));
	}else{
		yPos = c.fromTop;
	}
	return yPos + "px";
}

dhMenus.prototype.addToArray = function(id, parent)
{
	if(parent == "")
	{
		//if(c.arrMenus[id] == undefined){
		if(c.arrMenus[id] == null){
			c.arrMenus[id] = new Array();
			c.arrParents[c.arrParents.length] = id
		}
	}else{
		//if(c.arrMenus[parent] != undefined){
		if(c.arrMenus[parent] != null){
			c.arrMenus[parent][c.arrMenus[parent].length] = id
		}
	}
}

dhMenus.prototype.getObjectAbove = function(id, parent)
{
	if(c.arrMenus[parent].length > 1){
		for(i=0; i< c.arrMenus[parent].length; i++){
			if(c.arrMenus[parent][i] == id){
				return c.arrMenus[parent][i-1];
			}
		}
	}else{
		return parent;
	}
}

dhMenus.prototype.getObjectToLeft = function(id)
{
	if(c.arrParents.length > 1){
		for(i=0; i< c.arrParents.length; i++){
			if(c.arrParents[i] == id){
				return c.arrParents[i-1];
			}
		}
	}else{
		return null;
	}
}

dhMenus.prototype.getDisplayVals = function(id)
{
	displayVals = new Array();
	displayVals[0] = document.getElementById(id).style.width;
	displayVals[1] = document.getElementById(id).style.height;
	displayVals[2] = document.getElementById(id).style.left;
	displayVals[3] = document.getElementById(id).style.top;

	return displayVals;
}

dhMenu = new dhMenus("dhMenu");
dhMenu.imageRoot = "http://adisneyworld.disney.go.com/media/wdwi/images2003/languagespecific/es_US";

dhMenu.fromTop = 83;
dhMenu.fromLeft = 2;
dhMenu.pxBetween = 3;
dhMenu.alignWithParent = false;
dhMenu.timeOut = 500;

dhMenu.createMenu("top1", "", "/global/globalNav/parks_on.gif", "/global/globalNav/parks_off.gif", "/global/globalNav/magickingdom_feature.jpg", 60, 17,"/wdwi/es_US/parks/parkOverview?id=ParkOverviewPage");dhMenu.createMenu("sub10", "top1", "/global/globalNav/on_themeParks.jpg", "/global/globalNav/off_themeParks.jpg", "", 198, 24,"/wdwi/es_US/parks/parkOverview?id=ParkOverviewPage");dhMenu.createMenu("sub11", "top1", "/global/globalNav/magickingdom_on.gif", "/global/globalNav/magickingdom_off.gif", "/global/globalNav/magickingdom_feature.jpg", 198, 17,"/wdwi/es_US/parks/parkLanding?id=MKLandingPage");dhMenu.createMenu("sub12", "top1", "/global/globalNav/epcot_on.gif", "/global/globalNav/epcot_off.gif", "/global/globalNav/epcot_feature.jpg", 198, 17,"/wdwi/es_US/parks/parkLanding?id=EPLandingPage");dhMenu.createMenu("sub13", "top1", "/global/globalNav/dhs_on.jpg", "/global/globalNav/dhs_off.jpg", "/global/globalNav/mgm_feature.jpg", 198, 17,"/wdwi/es_US/parks/parkLanding?id=MGMLandingPage");dhMenu.createMenu("sub14", "top1", "/global/globalNav/animalkingdom_on.gif", "/global/globalNav/animalkingdom_off.gif", "/global/globalNav/animalkingdom_feature.jpg", 198, 31,"/wdwi/es_US/parks/parkLanding?id=AKLandingPage");dhMenu.createMenu("sub15", "top1", "/global/globalNav/on_waterParks.jpg", "/global/globalNav/off_waterParks.jpg", "", 198, 21,"/wdwi/es_US/parks/waterParkOverview?id=WaterParkOverviewPage");dhMenu.createMenu("sub16", "top1", "/global/globalNav/blizzardbeach_on.gif", "/global/globalNav/blizzardbeach_off.gif", "/global/globalNav/blizzardbeach_feature.jpg", 198, 17,"/wdwi/es_US/parks/parkLanding?id=BBLandingPage");dhMenu.createMenu("sub17", "top1", "/global/globalNav/typhoonlagoon_on.gif", "/global/globalNav/typhoonlagoon_off.gif", "/global/globalNav/typhoonlagoon_feature.jpg", 198, 17,"/wdwi/es_US/parks/parkLanding?id=TLLandingPage");dhMenu.createMenu("sub18", "top1", "", "", "",198 ,70,"");dhMenu.createMenu("top2", "", "/global/globalNav/resorts_on.gif", "/global/globalNav/resorts_off.gif", "/global/globalNav/all_resorts_feature.jpg", 56, 17,"/wdwi/es_US/resorts/resortOverview?id=ResortOverviewPage");dhMenu.createMenu("sub28", "top2", "/global/globalNav/all_resorts_on.gif", "/global/globalNav/all_resorts_off.gif", "/global/globalNav/all_resorts_feature.jpg", 198, 25,"/wdwi/es_US/resorts/resortOverview?id=ResortOverviewPage");dhMenu.createMenu("sub29", "top2", "/global/globalNav/deluxe_resorts_on.gif", "/global/globalNav/deluxe_resorts_off.gif", "/global/globalNav/deluxe_resorts_feature.jpg", 198, 17,"/wdwi/es_US/resorts/resortCatListing?id=DeluxeResortListingPage");dhMenu.createMenu("sub210", "top2", "/global/globalNav/moderate_resorts_on.gif", "/global/globalNav/moderate_resorts_off.gif", "/global/globalNav/moderate_resorts_feature.jpg", 198, 17,"/wdwi/es_US/resorts/resortCatListing?id=ModerateResortListingPage");dhMenu.createMenu("sub211", "top2", "/global/globalNav/value_resorts_on.gif", "/global/globalNav/value_resorts_off.gif", "/global/globalNav/value_resorts_feature.jpg", 198, 17,"/wdwi/es_US/resorts/resortCatListing?id=ValueResortListingPage");dhMenu.createMenu("sub212", "top2", "/global/globalNav/home_away_on.gif", "/global/globalNav/home_away_off.gif", "/global/globalNav/home_away_feature.jpg", 198, 17,"/wdwi/es_US/resorts/resortCatListing?id=HomeAwayFromHomeResortListingPage");dhMenu.createMenu("sub213", "top2", "/global/globalNav/Cabins_campground_on.gif", "/global/globalNav/Cabins_campground_off.gif", "/global/globalNav/Cabins_campground_feature.jpg", 198, 17,"/wdwi/es_US/resorts/resortLanding?id=FortWildernessCampgroundResortLandingPage");dhMenu.createMenu("sub214", "top2", "", "", "",198 ,70,"");dhMenu.createMenu("top3", "", "/global/globalNav/more_magic_on.gif", "/global/globalNav/more_magic_off.gif", "/global/globalNav/magickingdom_feature.jpg", 80, 17,"/wdwi/es_US/moreMagic/moreMagicOverview?id=moreMagicOverviewPage");dhMenu.createMenu("sub314", "top3", "/global/globalNav/dtd_on.gif", "/global/globalNav/dtd_off.gif", "/global/globalNav/dtd_feature.jpg", 198, 25,"/wdwi/es_US/moreMagic/moreMagicLanding?id=DTDLandingPage");dhMenu.createMenu("sub315", "top3", "/global/globalNav/Cirque_on.gif", "/global/globalNav/Cirque_off.gif", "/global/globalNav/Cirque_feature.jpg", 198, 17,"/wdwi/es_US/entertainment/entertainmentDetail?id=DTDCirqueEntertainmentPage");dhMenu.createMenu("sub316", "top3", "/global/globalNav/boardwalk_on.gif", "/global/globalNav/boardwalk_off.gif", "/global/globalNav/boardwalk_feature.jpg", 198, 17,"/wdwi/es_US/moreMagic/moreMagicLanding?id=BoardwalkLandingPage");dhMenu.createMenu("sub317", "top3", "/global/globalNav/cruise_on.gif", "/global/globalNav/cruise_off.gif", "/global/globalNav/cruise_feature.jpg", 198, 17,"/wdwi/es_US/cruise/cruiseLanding?id=CruiseLandingPage");dhMenu.createMenu("sub318", "top3", "", "/global/globalNav/recreation_destinations.gif", "", 198, 21,"");dhMenu.createMenu("sub319", "top3", "/global/globalNav/sports_on.gif", "/global/globalNav/sports_off.gif", "/global/globalNav/sports_feature.jpg", 198, 31,"/wdwi/es_US/moreMagic/moreMagicGolfLanding?id=WideWorldOfSportsLandingPage");dhMenu.createMenu("sub320", "top3", "/global/globalNav/golf_on.gif", "/global/globalNav/golf_off.gif", "/global/globalNav/golf_feature.jpg", 198, 17,"/wdwi/es_US/moreMagic/golf/golfHome?id=GolfHomePage");dhMenu.createMenu("sub321", "top3", "/global/globalNav/spas_on.gif", "/global/globalNav/spas_off.gif", "/global/globalNav/spas_feature.jpg", 198, 17,"/wdwi/es_US/moreMagic/moreMagicGolfLanding?id=SpaLandingPage");dhMenu.createMenu("sub322", "top3", "/global/globalNav/other_rec_on.gif", "/global/globalNav/other_rec_off.gif", "/global/globalNav/other_rec_feature.jpg", 198, 17,"/wdwi/es_US/moreMagic/moreMagicOtherRecLanding?id=OtherRecreationLandingPage");dhMenu.createMenu("sub323", "top3", "", "", "",198 ,70,"");

document.write('<div id="navDivider1"></div>');
document.write('<div id="navDivider2"></div>');