var MenuLink={u1:function(){this.u1_1()},u1_1:function(){MenuLink.href("/Maple.aspx?Part=/News/Notice")},u1_2:function(){MenuLink.href("/Maple.aspx?Part=/News/Update")},u1_3:function(){MenuLink.href("/Maple.aspx?Part=/News/Event")},u2:function(){this.u2_1()},u2_1:function(){MenuLink.href("/Maple.aspx?Part=/Guide/GameIntro/Intro")},u2_2:function(){MenuLink.href("/Maple.aspx?Part=/Guide/GameStart/Preparation")},u2_3:function(){MenuLink.href("/Maple.aspx?Part=/Guide/GameTutorial/Town_ShopUsage")},u3:function(){this.u3_1()},u3_1:function(){MenuLink.href("/Maple.aspx?Part=/Download/GameDownload")},u3_2:function(){MenuLink.href("/Maple.aspx?Part=/Download/FlashGame")},u3_3:function(){MenuLink.href("/Maple.aspx?Part=/Download/Banner")},u3_4:function(){MenuLink.href("/Maple.aspx?Part=/Download/Screenshot/World")},u3_5:function(){MenuLink.href("/Maple.aspx?Part=/Download/Movies")},u3_6:function(){MenuLink.href("/Maple.aspx?Part=/Download/Wallpaper")},u4:function(){this.u4_1()},u4_1:function(){var a="";switch(this.countryCode){case"de":a="http://forum.nexoneu.com/NXEU.aspx?g=topics&f=19";break;case"es":a="http://forum.nexoneu.com/NXEU.aspx?g=topics&f=21";break;case"fr":a="http://forum.nexoneu.com/NXEU.aspx?g=topics&f=20";break;case"nl":a="http://forum.nexoneu.com/NXEU.aspx?g=topics&f=22";break;default:a="http://forum.nexoneu.com/NXEU.aspx?g=topics&f=12";break}MenuLink.href(a)},u4_2:function(){var a="";switch(this.countryCode){case"de":a="http://forum.nexoneu.com/NXEU.aspx?g=topics&f=38";break;case"es":a="http://forum.nexoneu.com/NXEU.aspx?g=topics&f=67";break;case"fr":a="http://forum.nexoneu.com/NXEU.aspx?g=topics&f=56";break;case"nl":a="http://forum.nexoneu.com/NXEU.aspx?g=topics&f=48";break;default:a="http://forum.nexoneu.com/NXEU.aspx?g=topics&f=7";break}MenuLink.href(a)},u4_3:function(){MenuLink.href("/Maple.aspx?Part=/Community/Wedding")},u4_4:function(){MenuLink.href("/Maple.aspx?Part=/Community/MapleStar")},u4_5:function(){MenuLink.href("/Maple.aspx?Part=/Community/Poll")},u5:function(){this.u5_1()},u5_1:function(){MenuLink.href("/Maple.aspx?Part=/Rank/TotRank")},u5_2:function(){MenuLink.href("/Maple.aspx?Part=/Rank/WorldRank")},u5_3:function(){MenuLink.href("/Maple.aspx?Part=/Rank/JobRank")},u5_4:function(){MenuLink.href("/Maple.aspx?Part=/Rank/PopRank")},u6:function(){this.u6_1()},u6_1:function(){MenuLink.href("/Maple.aspx?Part=/CashShop/ItemGallery")},u6_2:function(){MenuLink.href("http://billing.nexoneu.com/PG.aspx?PART=/Charge")},u6_3:function(){MenuLink.href("http://billing.nexoneu.com/NXEU.aspx?PART=/MyAccount/Purchase")},u6_4:function(){MenuLink.href("http://en.nexoneu.com/NXEU.aspx?PART=/Guide/Cash")},u7:function(){this.u5_1()},u7_1:function(){MenuLink.href("/Maple.aspx?Part=/Support/FAQ")},u7_2:function(){MenuLink.href("http://www.nexoneu.com/NXEU.aspx?PART=/Support/EOI")},u7_3:function(){MenuLink.href("/Maple.aspx?Part=/Support/Contact")}};MenuLink.href=function(c,b,a){if(b){window.open(c,b,a)}else{window.location.href=c}};MenuLink.countryCode="en";function MenuComponent(a,b){MenuComponent.$=this;this._xmlURL=(b||{}).xml||"/Menu/XML/en/menu.xml";this._e_subMenuOutTimeOut=null;this._e_subMenuOverTimeOut=null;this._motionSpeed=50;this._motionDelay=0;this._widget=$('<div id="widget">		                    <div id="wrapper">		                        <div id="logoLayer"></div>							    <div id="mainMenuAll"></div>							    <div id="subMenuAll">								    <div id="fadeLayer"></div>								    <div id="subMenuLayer"></div>							    </div>						      </div>						  </div>').appendTo(a);this._wrapper=this._widget.find("div#wrapper");this._logoLayer=this._wrapper.find("div#logoLayer");this._mainMenuAll=this._wrapper.find("div#mainMenuAll");this._subMenuAll=this._wrapper.find("div#subMenuAll");this._fadeLayer=this._wrapper.find("div#fadeLayer");this._subMenuLayer=this._wrapper.find("div#subMenuLayer");this._xml=null;this.init()}MenuComponent.prototype.init=function(){this._xml=this.loadXML();this.bind();this.createMainMenu()};MenuComponent.prototype.bind=function(){this._mainMenuAll.bind("mouseover",function(a){MenuComponent.$.showSubMenu()}).bind("mouseout",function(a){MenuComponent.$.hideSubMenu()});this._subMenuAll.bind("mouseover",function(a){MenuComponent.$.showSubMenu()}).bind("mouseout",function(a){MenuComponent.$.hideSubMenu()});this._logoLayer.bind("click",function(a){window.location.href="/"})};MenuComponent.prototype.loadXML=function(){return NXEU.parseXml(this._xmlURL)};MenuComponent.prototype.showSubMenu=function(){if(this._e_subMenuOutTimeOut){clearTimeout(this._e_subMenuOutTimeOut)}if(!this._subMenuAll.is(":hidden")){return}if(this._e_subMenuOverTimeOut){clearTimeout(this._e_subMenuOverTimeOut)}this._e_subMenuOverTimeOut=setTimeout(function(){MenuComponent.$._subMenuAll.slideDown(MenuComponent.$._motionSpeed)},MenuComponent.$._motionDelay)};MenuComponent.prototype.hideSubMenu=function(){if(this._e_subMenuOverTimeOut){clearTimeout(this._e_subMenuOverTimeOut)}if(this._e_subMenuOutTimeOut){clearTimeout(this._e_subMenuOutTimeOut)}this._e_subMenuOutTimeOut=setTimeout(function(){MenuComponent.$._subMenuAll.slideUp(MenuComponent.$._motionSpeed)},MenuComponent.$._motionDelay*2)};MenuComponent.prototype.createMainMenu=function(){$.each(this._xml.MainMenus,function(a){var b=MenuComponent.$.addMainMenuItem(this);MenuComponent.$.createSubMenu(b,this)});MenuLink.countryCode=this._xml.CommonInfo.countryCode};MenuComponent.prototype.addMainMenuItem=function(b){var a=$('<div class="mainMenu">').css({"background-position":"0px "+(parseInt(b.bgPosition)*39*-2)+"px"}).css({"margin-left":b.margin,width:b.width,height:"39px"}).appendTo(this._mainMenuAll);a.data("mouseover",function(){a.css({"background-position":"0px "+((parseInt(b.bgPosition)*39*-2)-39)+"px"})}).data("mouseout",function(){a.css({"background-position":"0px "+(parseInt(b.bgPosition)*39*-2)+"px"})}).bind("click",this,function(c){MenuLink[b.id]()});a.bind("mouseover",function(c){$(this).data("mouseover")()}).bind("mouseout",function(c){$(this).data("mouseout")()});return a};MenuComponent.prototype.createSubMenu=function(c,b){var a=$('<ul class="subMenu">').css({"margin-left":parseInt(b.margin),width:b.width}).appendTo(this._subMenuLayer).bind("mouseover",function(d){c.data("mouseover")()}).bind("mouseout",function(d){c.data("mouseout")()});$.each(b.SubMenus,function(d){MenuComponent.$.addSubMenuItem(this,a)})};MenuComponent.prototype.addSubMenuItem=function(a,b){$("<li>").append($("<p>").html(a.title)).appendTo(b).bind("click",this,function(c){MenuLink[a.id]()})};
