function $A(B){var D=[];for(var C=0,A=B.length;C<A;++C){D.push(B[C])}return D}Function.prototype.bind=function(){var A=this,C=$A(arguments),B=C.shift();return function(){return A.apply(B,C.concat($A(arguments)))}};function strcmp(B,A){if(B==A){return 0}if(B==null){return -1}if(A==null){return 1}return B<A?-1:1}function $E(A){if(!A){A=event}A._button=A.which?A.which:A.button;A._target=A.target?A.target:A.srcElement;return A}function ge(A){return document.getElementById(A)}function gE(A,B){return A.getElementsByTagName(B)}function ce(A){return document.createElement(A)}function de(A){A.parentNode.removeChild(A)}function ae(A,B){return A.appendChild(B)}function ct(A){return document.createTextNode(A)}function rf(){return false}function tb(){this.blur()}function ac(C){var B=0,A=0;while(C){B+=C.offsetLeft;A+=C.offsetTop;C=C.offsetParent}return[B,A]}function aE(B,C,A){if(Browser.ie){B.attachEvent("on"+C,A)}else{B.addEventListener(C,A,false)}}function sp(A){if(!A){A=event}if(Browser.ie){A.cancelBubble=true}else{A.stopPropagation()}}function sc(F,G,B,D,E){var C=new Date();var A=F+"="+escape(B)+"; ";C.setDate(C.getDate()+G);A+="expires="+C.toUTCString()+"; ";if(D){A+="path="+D+"; "}if(E){A+="domain="+E+"; "}document.cookie=A}function dc(A){sc(A,-1)}function gc(D){var A,E;if(!D){var B=[];E=document.cookie.split("; ");for(var C=0;C<E.length;++C){A=E[C].split("=");B[A[0]]=unescape(A[1])}return B}else{A=document.cookie.indexOf(D+"=");if(A!=-1){if(A==0||document.cookie.substring(A-2,A)=="; "){A+=D.length+1;E=document.cookie.indexOf("; ",A);if(E==-1){E=document.cookie.length}return unescape(document.cookie.substring(A,E))}}}return null}function ns(A){A.onmousedown=A.onselectstart=A.ondragstart=rf}function cO(C,A){for(var B in A){C[B]=A[B]}}var Browser={ie:!!(window.attachEvent&&!window.opera),opera:!!window.opera,safari:navigator.userAgent.indexOf("Safari")!=-1,gecko:navigator.userAgent.indexOf("Gecko")!=-1&&navigator.userAgent.indexOf("KHTML")==-1};Browser.ie6=Browser.ie&&navigator.userAgent.indexOf("MSIE 6.0")!=-1;navigator.userAgent.match(/Gecko\/([0-9]+)/);Browser.geckoVersion=parseInt(RegExp.$1)|0;function pgetWindowSize(){var B=0,A=0;if(typeof window.innerWidth=="number"){B=window.innerWidth;A=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){B=document.documentElement.clientWidth;A=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){B=document.body.clientWidth;A=document.body.clientHeight}}}return[B,A]}function pgetCursorPos(C){if(!C){C=window.event}var A,D;if(window.innerHeight){A=C.pageX;D=C.pageY}else{var B=pgetScroll();A=C.clientX+B[0];D=C.clientY+B[1]}return{x:A,y:D}}function pgetScroll(){var A=0,B=0;if(typeof (window.pageYOffset)=="number"){A=window.pageXOffset;B=window.pageYOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){A=document.body.scrollLeft;B=document.body.scrollTop}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){A=document.documentElement.scrollLeft;B=document.documentElement.scrollTop}}}return[A,B]}function pscrollTo(C,B){var M,K=pgetWindowSize(),L=pgetScroll(),I=K[0],E=K[1],G=L[0],D=L[1];C=$(C);if(B==null){B=[]}else{if(typeof B=="number"){B=[B]}}M=B.length;if(M==0){B[0]=B[1]=B[2]=B[3]=0}else{if(M==1){B[1]=B[2]=B[3]=B[0]}else{if(M==2){B[2]=B[0];B[3]=B[1]}else{if(M==3){B[3]=B[1]}}}}M=ac(C);var A=M[0]-B[3];var H=M[1]-B[0];var J=M[0]+C.offsetWidth+B[1];var F=M[1]+C.offsetHeight+B[2];if(J-A>I||A<G){G=A}else{if(J-I>G){G=J-I}}if(F-H>E||H<D){D=H}else{if(F-E>D){D=F-E}}scrollTo(G,D)}function ptb(){pbm(ge("menu_placer"))}function pbm(E){for(var C=0,A=mbr.length;C<A;++C){var B=ce("a"),D=ce("span");if(mbr[C][2]){B.href=gp(1)+"/x/list/lan/"+gV("lan")+"/s/"+mbr[C][2]}else{B.href="javascript:;";ns(B)}ae(D,ct(mbr[C][1]));ae(B,D);D.style.cursor="pointer";if(mbr[C][3]){D.className="menuarrowd";B.menu=mbr[C][3];B.onmouseover=Menu.show;B.onmouseout=Menu.hide}ae(E,B)}}function gp(C){var B=location.href.split("map");if(B[1]!=null){z1="map"}else{z1="index"}var A=location.href.split(z1);if(C==0){return(A[0]+"/").replace("//","|").replace("//","/").replace("|","//")}if(C==1){return A[0]+z1+".php"}if(C==2){if(A[1]!=null){return A[1].replace(".php","")}else{return""}}}var Menu={divs:[],selection:[],iframes:[],show:function(){try{clearTimeout(Menu.timer);if(Menu.currentLink){Menu._show(this)}else{this.className="open";Menu.timer=setTimeout(Menu._show.bind(0,this),100)}}catch(A){}},_show:function(A){if(Menu.currentLink!=A){var B=ac(A);Menu._hide();Menu.selection=[-1];Menu.currentLink=A;Menu.showDepth(0,A.menu,B[0],B[1]+A.offsetHeight-2,A.offsetHeight+8,0,B[1]);A.className="open"}else{Menu.truncate(0);Menu.clean(0)}},showAtCursor:function(B){B=$E(B);clearTimeout(Menu.timer);Menu._hide();Menu.selection=[-1];Menu.currentLink=null;var A=pgetScroll();Menu.showDepth(0,this.menu,B.clientX+A[0],B.clientY+A[1],0,0,0)},hide:function(){try{clearTimeout(Menu.timer);if(Menu.currentLink){Menu.timer=setTimeout(Menu._hide,333)}else{this.className=""}}catch(A){}},_hide:function(){for(var B=0,A=Menu.selection.length;B<A;++B){Menu.divs[B].style.display="none";Menu.divs[B].style.visibility="hidden";if(Browser.ie6){Menu.iframes[B].style.display="none"}}Menu.selection=[];if(Menu.currentLink){Menu.currentLink.className=""}Menu.currentLink=null},sepOver:function(){var B=this.d;var A=B.i;Menu.clean(A);Menu.selection[A]=-1},elemOver:function(){var C=this.d;var A=C.i;var B=this.i;var E=this.firstChild.className=="menusub";Menu.truncate(A+E);if(E&&B!=Menu.selection[A]){var D=ac(this);Menu.selection[A+1]=-1;Menu.showDepth(A+1,C.menuArray[B][3],D[0],D[1]-2,this.offsetHeight,this.offsetWidth,0)}Menu.clean(A);Menu.selection[A]=B;if(this.className.length){this.className+=" open"}else{this.className="open"}},getIframe:function(A){var B;if(Menu.iframes[A]==null){B=ce("iframe");B.src="javascript:0;";B.frameBorder=0;ae(ge("layers"),B);Menu.iframes[A]=B}else{B=Menu.iframes[A]}return B},getDiv:function(A,B){var C;if(Menu.divs[A]==null){C=ce("div");C.className="menu";ae(ge("layers"),C);Menu.divs[A]=C}else{C=Menu.divs[A]}C.i=A;C.menuArray=B;return C},showDepth:function(X,N,L,K,Y,M,l){var n,c=Menu.getDiv(X,N);while(c.firstChild){de(c.firstChild)}var f=ce("table"),A=ce("tbody"),D=ce("tr"),H=ce("td"),P=ce("div"),F=ce("div");var R=999;var Z=pgetWindowSize(),C=pgetScroll(),I=Z[0],S=Z[1],B=C[0],e=C[1];if((Y>0)&&(Y<29)){if((Y+1)*N.length>S-25-l){for(var V=2;V<4;++V){if(Y/V*N.length+30<S-l){break}}R=Math.floor(N.length/V)}}var G=0;var T=0;for(var V in N){if(N[V][0]==null){var W=ce("span");W.className="separator";ns(W);ae(W,ct(N[V][1]));W.d=c;W.onmouseover=Menu.sepOver;ae(F,W)}else{var g=ce("a");g.d=c;g.i=T++;if(N[V][2]){if(Menu.currentLink&&Menu.currentLink.menuappend){g.href=gp()+"index.php/x/list/lan/"+gV("lan")+"/s/"+N[V][2]+"/type"+Menu.currentLink.menuappend}else{if(typeof N[V][2]=="function"){g.href="javascript:;";g.onclick=N[V][2];ns(g)}else{g.href=gp(1)+"/x/list/lan/"+gV("lan")+"/s/"+N[V][2].replace("=","/type/").replace(".",":")}}}else{g.href="javascript:;";g.style.cursor="default";ns(g)}g.onmouseover=Menu.elemOver;var O=ce("span"),E=ce("span");if(N[V][3]){O.className="menusub"}if(N[V][4]){E.className="menucheck"}ae(E,ct(N[V][1]));ae(O,E);ae(g,O);ae(F,g)}if(G++==R){P.onmouseover=Menu.divOver;P.onmouseout=Menu.divOut;ae(P,F);if(!Browser.ie6){var Q=ce("p");ae(Q,ce("em"));ae(Q,ce("var"));ae(Q,ce("strong"));ae(Q,P);ae(H,Q)}else{ae(H,P)}ae(D,H);H=ce("td");Q=ce("p");P=ce("div");F=ce("div");G=0}}P.onmouseover=Menu.divOver;P.onmouseout=Menu.divOut;ae(P,F);if(!Browser.ie6){if(R!=999){var Q=ce("p");ae(Q,ce("em"));ae(Q,ce("var"));ae(Q,ce("strong"));ae(Q,P);ae(H,Q)}else{ae(c,ce("em"));ae(c,ce("var"));ae(c,ce("strong"));ae(H,P)}}else{ae(H,P)}ae(D,H);ae(A,D);ae(f,A);ae(c,f);c.style.left=c.style.top="-2323px";c.style.display="";var J=f.offsetWidth,U=f.offsetHeight;if(L+M+J+15>I){L=Math.max(0,L-J-3)}else{L+=M}if(K+U>S+e){K=Math.max(e+5,S+e-U-10)}c.style.left=L+"px";c.style.top=K+"px";if(Browser.ie6){n=Menu.getIframe(X);n.style.position="absolute";n.style.background="#e2ca87";n.style.left=L+"px";n.style.top=K+"px";n.style.width=J+"px";n.style.height=U+"px";n.style.display="";n.style.visibility="visible"}c.style.visibility="visible";if(Browser.opera){c.style.display="none";c.style.display=""}},divOver:function(){clearTimeout(Menu.timer)},divOut:function(){clearTimeout(Menu.timer);Menu.timer=setTimeout(Menu._hide,333)},truncate:function(A){var B;while(Menu.selection.length-1>A){B=Menu.selection.length-1;Menu.divs[B].style.display="none";if(Browser.ie6){Menu.iframes[B].style.display="none"}Menu.divs[B].style.visibility="hidden";Menu.selection.pop()}},clean:function(A){for(var B=A;B<Menu.selection.length;++B){if(Menu.selection[B]!=-1){d=gE(Menu.divs[B],"a")[Menu.selection[B]];if(d.className.indexOf("sub")!=-1){d.className="sub"}else{d.className=""}Menu.selection[B]=-1}}},append:function(A,B){A[2]+=B;if(A[3]!=null){Menu._append(A[3],B)}},_append:function(A,C){for(var B=0;B<A.length;++B){A[B][2]+=C;if(A[B][3]){Menu._append(A[B][3],C)}}},fix:function(B,E,C){for(var D=0,A=B.length;D<A;++D){if(E){B[D][2]=C+B[D][0];if(B[D][3]){Menu.fix(B[D][3],E+1,C+B[D][0]+".")}}else{if(B[D][3]){Menu.fix(B[D][3],1,B[D][2]+"=")}}}}};function ksn(A){A=A.name;ks(A)}function ksh(A){p=A.href.split("id=");ks(p[1])}function ksh2(A){p=A.href.split("id/");ks(p[1])}function ks(A){return overlib('<div class="tooltip" style="float: left; padding-top: 1px"><table><tr><td>'+cl[A]+'<th style="background-position: top right"></th></tr><tr><th style="background-position: bottom left"></th><th style="background-position: bottom right"></th></tr></table></div>',FULLHTML)}function cs(A){b="";b1=ge(A);if(b1.getAttributeNode("size").value=="7"){for(i=0;i<b1.options.length;i++){b1.options[i].selected=false}}else{b1.options[0].selected=true}}function ps(A){ge("go").click()}function ps1(A){if(ge("s1").value!=A){ge("s2").value=ge("s1").value;ge("r2").value=ge("r1").value}ge("s1").value=A;if(ge("r1").value=="1"){ge("r1").value=""}else{ge("r1").value="1"}ge("go").click()}function ps2(A){ge("lan").value=A;ge("go").click()}function rs(){var B=gE(document,"input");for(i=0;i<B.length;i++){if(B[i].getAttributeNode("type").value=="text"){B[i].value=""}}var B=gE(document,"select");for(k=0;k<B.length;k++){var A=B[k].getAttributeNode("id").value;cs(A)}}function gV2(G,E){var C=location.href;var A=C.split("?");if(A[1]!=null){if(E==0){var B=location.search.substring(1).replace("&lan=ru","").replace("&lan=en","").replace("&lan=","");this.location.href="?"+B+"&lan="+G}if(E==1){var D=location.search.substring(1).split("&lan=");if((D[1]!=null)&&(D[1].substr(0,2)=="en")){return"en"}else{return"ru"}}}else{if(E==0){var B=location.href.replace("/lan/ru","/lan/REPLACEME").replace("/lan/en","/lan/REPLACEME").replace("/lan//","/lan/REPLACEME/").replace("#","");var H=B.replace("REPLACEME",G);var F=H.split("lan");if(F[1]!=null){this.location.href=B.replace("REPLACEME",G)}else{this.location.href="?&lan="+G}}if(E==1){var D=location.href.split("lan/");if((D[1]!=null)&&(D[1].substr(0,2)=="en")){return"en"}else{return"ru"}}}rf()}function gV(A){return(gV2(0,1))}function _r(A){if(_s[A]!=null){return _s[A]}else{return A}}function MapView(A){if(!A.zone){return }this.zone=A.zone;this.coords=A.coords;if(!A.parent){this.parent=ge("map_map")}else{this.parent=A.parent}this.parent.appendChild(this.s_main=ce("span"));this.parent.appendChild(this.info=ce("span"));_=this.info.style;_.position="absolute";this.parent.onmousemove=this.mCoords.bind(this);_=this.s_main.style;_.position="absolute";_.display="block";_.width="772px";_.height="515px";this.parent.onmouseout=(function(){this.timeout=setTimeout((function(){this.s_coords.style.display="none"}).bind(this),1)}).bind(this);this.parent.onmouseover=(function(){clearTimeout(this.timeout);this.s_coords.style.display=""}).bind(this);this.parent.appendChild(this.s_coords=ce("span"));_=this.s_coords.style;_.position="relative";_.display="block";_.top="495px";_.left="5px";this.render()}MapView.prototype.go=function(A){if(!A.zone){return }this.zone=A.zone;this.Clean();if(A.icon){this.icon=A.icon}else{this.icon=null}if((A.id)&&(ge("map_obj_link"))){ge("map_obj_link").href=gp(0)+"index.php/x/show/lan/"+gV()+"/s/"+A.id;ge("map_obj_link").style.visibility="visible"}this.coords=A.coords;this.names=A.names;this.info2=A.info;if(!A.parent){this.parent=ge("map_map")}else{this.parent=A.parent}this.render()};MapView.prototype.parent;MapView.prototype.s_main;MapView.prototype.s_coords;MapView.prototype.names;MapView.prototype.info;MapView.prototype.info2;MapView.prototype.icon;MapView.prototype.render=function(){this.parent.style.background='url("'+gp(0)+"maps/large/"+this.zone+'.jpg") left center no-repeat';if(this.info2){this.info.innerHTML=this.info2}var C;var A=this.coords;for(var E in A){var B=A[E];var D=B[2];C=this.getPin();C.x=B[0];C.y=B[1];C.style.left=C.x+"%";C.style.top=C.y+"%";C.className="marker";if(D&&D.url){C.a.href=gp(0)+"index.php/x/show/lan/"+gV()+"/s/"+D.url;C.a.target="_blank";C.a.style.cursor="pointer";if(D.loot){C.a.onclick=this.mClick;C.a.loot=D.loot}}if(D&&D.label){C.a.label=D.label}else{C.a.label=C.x.toFixed(1)+", "+C.y.toFixed(1)}this.s_main.appendChild(C)}};MapView.prototype.getPin=function(){var B=ce("div"),A=ce("a");B.className="pin";if(this.icon){if(Browser.ie6){A.style.background="none";A.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=scale,src='"+gp(0)+"maps/markers/"+this.icon+".png') no-repeat"}else{A.style.background="url('"+gp(0)+"maps/markers/"+this.icon+".png') no-repeat"}}A.onmouseover=this.mOver;A.onmouseout=nd;B.appendChild(A);B.a=A;return B};MapView.prototype.CleanInfo=function(){this.info.innerHTML=""};MapView.prototype.Clean=function(){this.s_main.innerHTML="";this.info.innerHTML="";if(ge("map_obj_link")){ge("map_obj_link").style.visibility="hidden"}};MapView.prototype.mOver=function(){return overlib('<div class="tooltip2" id="tooltipcontainer"><table><tbody><tr><td class="tl"></td><td class="t"></td><td class="tr"></td></tr><tr><td class="l"><q></q></td><td class="bg"><div id="toolBox" style="padding:2px;">'+this.label+'</div></td><td class="r"><q></q></td></tr><tr><td class="bl"></td><td class="b"></td><td class="br"></td></tr></tbody></table></div>',FULLHTML,RIGHT)};MapView.prototype.mClick=function(){MapView.info.style.border="1px solid #adadad";MapView.info.style.background="#000";if(this.loot.normal){if(ge("iwanttoseeloot")){ge("iwanttoseeloot").id=""}this.id="iwanttoseeloot";a='<br><a href="javascript:;" onclick="MapView.mShow(\'normal\')" class="q1" style="font-weight:bold;position:relative;left:12px;">- Normal</a><br><a href="javascript:;" onclick="MapView.mShow(\'heroic\')" class="q1" style="position:relative;left:12px;">- Heroic</a>'+this.loot.normal}else{a=""+this.loot.drops}MapView.info.innerHTML='<span style=\'cursor:pointer;position:relative;left:7px;color:red\' onclick=\'MapView.CleanInfo();\'>[x]</span><a class="q" style="position:relative;left:15px;text-decoration:underline;" href="'+this.href+'" target="_blank">'+_r("Click here to view this NPC")+"</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+a;return false};MapView.prototype.mShow=function(A){if(ge("iwanttoseeloot")){s=ge("iwanttoseeloot")}if(A=="heroic"){c_h="font-weight:bold;";c_n=""}else{c_n="font-weight:bold;";c_h=""}a='<br><a href="javascript:;" onclick="MapView.mShow(\'normal\')" class="q1" style="'+c_n+'position:relative;left:12px;">- Normal</a><br><a href="javascript:;" onclick="MapView.mShow(\'heroic\')" class="q1" style="'+c_h+'position:relative;left:12px;">- Heroic</a>'+s.loot[A];MapView.info.innerHTML='<span style=\'cursor:pointer;position:relative;left:7px;color:red\' onclick=\'MapView.CleanInfo();\'>[x]</span><a class="q" style="position:relative;left:15px;text-decoration:underline;" href="'+this.href+'" target="_blank">'+_r("Click here to view this NPC")+"</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+a};MapView.prototype.mPClick=function(){MapView.info.innerHTML="";return false};MapView.prototype.mCoords=function(D){var A=ac(this.s_main);D=$E(D);var E=pgetCursorPos(D);var C=Math.floor((E.x-A[0])/772*1000)/10;var B=Math.floor((E.y-A[1])/515*1000)/10;this.s_coords.innerHTML="("+C.toFixed(1)+", "+B.toFixed(1)+")"};Menu.fix(mbr);