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] != 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 - 2] + "_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 - 2] + "_img", id + "_img_feature"); } function setOnVar() { subOn = true; } function setOffVar() { subOn = false; } function r_on(whichimage) { try { if(eval(whichimage + "_on") != null) { document.images[whichimage].src = eval(whichimage + "_on.src"); } } catch (e) { } finally { } } function r_off(whichimage) { try { if(eval(whichimage + "_on") != null ) { document.images[whichimage].src = eval(whichimage + "_off.src"); } } catch (e) { } finally { } } function featureImg(whichimage, src) { try { if(eval(src) != null) { document.images[whichimage].src = eval(src + ".src"); } } catch (e) { } finally { } } 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.createBackground = function(id, parent, image_top, image_middle, image_bottom, divWidth, divHeight) { eval(id + "_status = ''"); c.addToArray(id, parent); d = c.createBgDiv(id, parent, image_top, image_middle, image_bottom, (0 + dhMenu.fromLeft)+"px", (dhMenu.fromTop+60)+"px", divWidth, divHeight); } dhMenus.prototype.createBgDiv = function(id, parent, image_top, image_middle, image_bottom, left, top, divWidth, divHeight) { visi = "visible"; visi = "hidden"; 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; divElem.style.zIndex = 100; divElem.style.visibility = visi; divElem.style.filter = "alpha(opacity=" + (c.opacity*100) + ")"; // IE divElem.style.MozOpacity = c.opacity; // Mozilla divElem.style.opacity = c.opacity; // Firefox bgMiddleHeight = (divHeight.replace("px", "") - 6 - 6) + "px"; styleTop = "width: 231px; height: 6px; background-image: url(" + c.imageRoot + image_top + "); background-repeat: no-repeat;"; styleMiddle = "width: 231px; height: " + bgMiddleHeight + "; background-image: url(" + c.imageRoot + image_middle + "); background-repeat: repeat-y;"; styleBottom = "width: 231px; height: 6px; background-image: url(" + c.imageRoot + image_bottom + "); background-repeat: no-repeat;"; innerHTML = "
"; innerHTML += "
"; innerHTML += "
"; divElem.innerHTML = innerHTML; document.getElementById( c.parentDiv ).appendChild(divElem); return divElem; } dhMenus.prototype.createMenu = function(id, parent, image_on, image_off, image_feature, divWidth, divHeight, path, image_active, activeCat) { 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, image_active, activeCat); } dhMenus.prototype.createDiv = function(id, parent, image_on, image_off, image_feature, left, top, divWidth, divHeight, path, image_active, activeCat) { 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; divElem.style.zIndex = 200; divElem.style.visibility = visi; divElem.innerHTML = c.createAnchor(id, parent, image_on, image_off, image_feature, divWidth, divHeight, path, image_active, activeCat); document.getElementById( c.parentDiv ).appendChild(divElem); if(image_on == "" && image_off == "" && image_feature != "") { div = document.createElement("div"); div.style.borderStyle = "solid"; div.style.borderWidth = "1px"; div.style.borderColor = "#FFF7A1"; div.style.position = "absolute"; div.style.width = (divWidth.replace("px", "") - 2) + "px"; div.style.height = (divHeight.replace("px", "") - 2) + "px"; div.style.top = "0px"; div.style.left = "0px"; document.getElementById( id ).appendChild(div); } return divElem; } dhMenus.prototype.createAnchor = function(id, parent, image_on, image_off, image_feature, divWidth, divHeight, loc, image_active, activeCat) { onclickVar = ""; onmouseoverVar = ""; if(loc == "") { onclickVar = "return false;" aTag = "
" if( image_on != "" && image_off != "" || image_feature != "") { aTag += c.createImg(id, image_on, image_off, image_feature, divWidth, divHeight, image_active, activeCat); } aTag += "
" } else { aTag = "" if( image_on != "" && image_off != "" || image_feature != "") aTag += c.createImg(id, image_on, image_off, image_feature, divWidth, divHeight, image_active, activeCat); aTag += "" } return aTag; } dhMenus.prototype.createImg = function(id, image_on, image_off, image_feature, divWidth, divHeight, image_active, activeCat) { if (image_active != null) { switch(id) { case "top1" : if (activeCat == "parks") { image_current = image_active; } else { image_current = image_off; } break; case "top2" : if (activeCat == "hotels") { image_current = image_active; } else { image_current = image_off; } break; case "top3" : if (activeCat == "moreMagic") { image_current = image_active; } else { image_current = image_off; } break; default : image_current = image_off; } } else { image_current=image_off; } eval(id + "_img_off = new Image();"); eval(id + "_img_off.src = c.imageRoot + image_current"); 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 = ""; return imgTag; } 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", "")); } xPos += c.subMenuLeftMargin; } 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] == null) { c.arrMenus[id] = new Array(); c.arrParents[c.arrParents.length] = id } } else { 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; } //javascript starts again dhMenu = new dhMenus("dhMenu"); dhMenu.imageRoot = "http://ahongkongdisneyland.disney.go.com/media/hkdl_v0100/zh_CN/"; dhMenu.fromTop = 0; dhMenu.fromLeft = 0; dhMenu.pxBetween = 0; dhMenu.alignWithParent = false; dhMenu.timeOut = 500; dhMenu.parentDiv = "globalNavItems"; dhMenu.subMenuLeftMargin = 18; dhMenu.opacity = .85 // opacity must be 85% to match the tab color dhMenu.createMenu( "top1", "", "_global/modules/navigation/ParksMenuOn.gif", "_global/modules/navigation/ParksMenuOff.gif", "_global/modules/header/ParkGlobalNav.jpg", "66px", "60px", "http://park.hongkongdisneyland.com/hkdl/zh_CN/parks/overview?name=ParkOverviewPage", "_global/modules/navigation/ParksMenuOff.gif", "parks"); dhMenu.createMenu( "sub100", "top1", "", "", "", "197px", "16px", ""); document.getElementById("sub100").style.zIndex = -1; dhMenu.createMenu( "sub101", "top1", "_global/modules/navigation/MainStreetOn.gif", "_global/modules/navigation/MainStreetOff.gif", "_global/modules/header/MainStreetUSAGlobalNav.jpg", "197px", "21px", "http://park.hongkongdisneyland.com/hkdl/zh_CN/parks/landing?name=MainStreetLandingPage"); dhMenu.createMenu( "sub102", "top1", "", "", "", "197px", "4px", ""); document.getElementById("sub102").style.zIndex = -1; dhMenu.createMenu( "sub103", "top1", "_global/modules/navigation/AdventurelandOn.gif", "_global/modules/navigation/AdventurelandOff.gif", "_global/modules/header/AdventurelandGlobalNav.jpg", "197px", "21px", "http://park.hongkongdisneyland.com/hkdl/zh_CN/parks/landing?name=AdventurelandLandingPage"); dhMenu.createMenu( "sub104", "top1", "", "", "", "197px", "4px", ""); document.getElementById("sub104").style.zIndex = -1; dhMenu.createMenu( "sub105", "top1", "_global/modules/navigation/FantasylandOn.gif", "_global/modules/navigation/FantasylandOff.gif", "_global/modules/header/FantasylandGlobalNav.jpg", "197px", "21px", "http://park.hongkongdisneyland.com/hkdl/zh_CN/parks/landing?name=FantasylandLandingPage"); dhMenu.createMenu( "sub106", "top1", "", "", "", "197px", "4px", ""); document.getElementById("sub106").style.zIndex = -1; dhMenu.createMenu( "sub107", "top1", "_global/modules/navigation/TomorrowlandOn.gif", "_global/modules/navigation/TomorrowlandOff.gif", "_global/modules/header/TomorrowlandGlobalNav.jpg", "197px", "21px", "http://park.hongkongdisneyland.com/hkdl/zh_CN/parks/landing?name=TomorrowlandLandingPage"); dhMenu.createMenu( "sub108", "top1", "", "", "", "197px", "4px", ""); document.getElementById("sub108").style.zIndex = -1; dhMenu.createMenu( "sub109", "top1", "", "", "", "197px", "10px", ""); document.getElementById("sub109").style.zIndex = -1; /* the line of dots begin */ dhMenu.createMenu( "sub110", "top1", "", "", "", "197px", "2px", ""); /* the line of dots end */ document.getElementById("sub110").style.backgroundImage = "url(http://ahongkongdisneyland.disney.go.com/media/hkdl_v0100/zh_CN/_global/modules/navigation/GlobalNavHorizontalDots.gif )"; dhMenu.createMenu( "sub111", "top1", "", "", "", "197px", "14px", ""); document.getElementById("sub111").style.zIndex = -1; /* featureMedia begin */ dhMenu.createMenu( "sub112", "top1", "", "_global/modules/navigation/TomorrowlandOff.gif", "_global/modules/header/ParkGlobalNav.jpg", "197px", "68px", ""); /* featureMedia end */ dhMenu.createBackground("sub113", "top1", "_global/modules/navigation/GlobalNavTopPark.gif", "_global/modules/navigation/GlobalNavMiddleAll.gif", "_global/modules/navigation/GlobalNavBottomAll.gif", "231px", "229px"); dhMenu.createMenu( "top1000", "", "_global/modules/navigation/GlobalNavVerticalDots.gif", "_global/modules/navigation/GlobalNavVerticalDots.gif", "", "2px", "60px", ""); dhMenu.createMenu( "top2", "", "_global/modules/navigation/HotelsMenuOn.gif", "_global/modules/navigation/HotelsMenuOff.gif", "_global/modules/header/HotelsGlobalNav.jpg", "61px", "60px", "http://park.hongkongdisneyland.com/hkdl/zh_CN/hotels/overview?name=HotelsOverviewPage", "_global/modules/navigation/HotelsMenuOff.gif", "parks"); dhMenu.createMenu( "sub200", "top2", "", "", "", "197px", "16px", ""); document.getElementById("sub200").style.zIndex = -1; dhMenu.createMenu( "sub201", "top2", "_global/modules/navigation/HongKongDisneylandHotelOn.gif", "_global/modules/navigation/HongKongDisneylandHotelOff.gif", "_global/modules/header/HKDisneylandHotelGlobalNav.jpg", "197px", "21px", "http://park.hongkongdisneyland.com/hkdl/zh_CN/hotels/landing?name=HongKongDisneylandHotelLandingPage"); dhMenu.createMenu( "sub202", "top2", "", "", "", "197px", "4px", ""); document.getElementById("sub202").style.zIndex = -1; dhMenu.createMenu( "sub203", "top2", "_global/modules/navigation/HollywoodHotelOn.gif", "_global/modules/navigation/HollywoodHotelOff.gif", "_global/modules/header/DisneHollywoodHotelGlobalNav.jpg", "197px", "21px", "http://park.hongkongdisneyland.com/hkdl/zh_CN/hotels/landing?name=HollywoodHotelLandingPage"); dhMenu.createMenu( "sub204", "top2", "", "", "", "197px", "4px", ""); document.getElementById("sub204").style.zIndex = -1; dhMenu.createMenu( "sub205", "top2", "", "", "", "197px", "10px", ""); document.getElementById("sub205").style.zIndex = -1; /* the line of dots begin */ dhMenu.createMenu( "sub206", "top2", "", "", "", "197px", "2px", ""); /* the line of dots end */ document.getElementById("sub206").style.backgroundImage = "url(http://ahongkongdisneyland.disney.go.com/media/hkdl_v0100/zh_CN/_global/modules/navigation/GlobalNavHorizontalDots.gif )"; dhMenu.createMenu( "sub207", "top2", "", "", "", "197px", "14px", ""); document.getElementById("sub207").style.zIndex = -1; /* featureMedia begin */ dhMenu.createMenu( "sub208", "top2", "", "_global/modules/navigation/HollywoodHotelOff.gif", "_global/modules/header/HotelsGlobalNav.jpg", "197px", "68px", ""); /* featureMedia end */ dhMenu.createBackground("sub209", "top2", "_global/modules/navigation/GlobalNavTopHotels.gif", "_global/modules/navigation/GlobalNavMiddleAll.gif", "_global/modules/navigation/GlobalNavBottomAll.gif", "231px", "179px"); dhMenu.createMenu( "top2000", "", "_global/modules/navigation/GlobalNavVerticalDots.gif", "_global/modules/navigation/GlobalNavVerticalDots.gif", "", "2px", "60px", ""); dhMenu.createMenu( "top3", "", "_global/modules/navigation/MoreMagicMenuOn.gif", "_global/modules/navigation/MoreMagicMenuOff.gif", "_global/modules/header/MoreMagicGlobalNav.jpg", "100px", "60px", "http://park.hongkongdisneyland.com/hkdl/zh_CN/moreMagic/overview?name=MoreMagicOverviewPage", "_global/modules/navigation/MoreMagicMenuOff.gif", "parks"); dhMenu.createMenu( "sub300", "top3", "", "", "", "197px", "16px", ""); document.getElementById("sub300").style.zIndex = -1; dhMenu.createMenu( "sub301", "top3", "_global/modules/navigation/FunAroundOn.gif", "_global/modules/navigation/FunAroundOff.gif", "_global/modules/header/RecreationGlobalNav.jpg", "197px", "21px", "http://park.hongkongdisneyland.com/hkdl/zh_CN/moreMagic/landing?name=HongKongRecreationPage"); dhMenu.createMenu( "sub302", "top3", "", "", "", "197px", "4px", ""); document.getElementById("sub302").style.zIndex = -1; dhMenu.createMenu( "sub303", "top3", "_global/modules/navigation/FunOnlineOn.gif", "_global/modules/navigation/FunOnlineOff.gif", "_global/modules/header/NewHongKongGlobalNav.jpg", "197px", "21px", "http://park.hongkongdisneyland.com/hkdl/zh_CN/moreMagic/landing?name=FunOnlinePage"); dhMenu.createMenu( "sub304", "top3", "", "", "", "197px", "4px", ""); document.getElementById("sub304").style.zIndex = -1; dhMenu.createMenu( "sub305", "top3", "_global/modules/navigation/WeddingsOn.gif", "_global/modules/navigation/WeddingsOff.gif", "_global/modules/header/WeddingsGlobalNav.jpg", "197px", "46px", "http://park.hongkongdisneyland.com/hkdl/zh_CN/eventPlanning/weddings/overview?name=WeddingsOverviewPage"); dhMenu.createMenu( "sub306", "top3", "", "", "", "197px", "4px", ""); document.getElementById("sub306").style.zIndex = -1; dhMenu.createMenu( "sub307", "top3", "_global/modules/navigation/MeetingsOn.gif", "_global/modules/navigation/MeetingsOff.gif", "_global/modules/header/MeetingsGlobalNav.jpg", "197px", "21px", "http://park.hongkongdisneyland.com/hkdl/zh_CN/eventPlanning/meetings/overview?name=MeetingsOverviewPage"); dhMenu.createMenu( "sub308", "top3", "", "", "", "197px", "4px", ""); document.getElementById("sub308").style.zIndex = -1; dhMenu.createMenu( "sub309", "top3", "", "", "", "197px", "10px", ""); document.getElementById("sub309").style.zIndex = -1; /* the line of dots begin */ dhMenu.createMenu( "sub310", "top3", "", "", "", "197px", "2px", ""); /* the line of dots end */ document.getElementById("sub310").style.backgroundImage = "url(http://ahongkongdisneyland.disney.go.com/media/hkdl_v0100/zh_CN/_global/modules/navigation/GlobalNavHorizontalDots.gif )"; dhMenu.createMenu( "sub311", "top3", "", "", "", "197px", "14px", ""); document.getElementById("sub311").style.zIndex = -1; /* featureMedia begin */ dhMenu.createMenu( "sub312", "top3", "", "_global/modules/navigation/MeetingsOff.gif", "_global/modules/header/MoreMagicGlobalNav.jpg", "197px", "68px", ""); /* featureMedia end */ dhMenu.createBackground("sub313", "top3", "_global/modules/navigation/GlobalNavTopMoreMagic.gif", "_global/modules/navigation/GlobalNavMiddleAll.gif", "_global/modules/navigation/GlobalNavBottomAll.gif", "231px", "254px");