var VSK_VERSION="0.1.5";var VSK_I={name:null};if(window.opera){VSK_I.name="Opera"}else{if(navigator.userAgent){var str=navigator.userAgent;if(str.indexOf("Firefox")!=-1){VSK_I.name="Firefox"}else{if(str.indexOf("Chrome")>0){VSK_I.name="Chrome"}else{if(str.indexOf("Netscape")!=-1){VSK_I.name="Netscape"}else{if(str.indexOf("MSIE")!=-1){VSK_I.name="MSIE"}else{if(str.indexOf("Gecko")!=-1){VSK_I.name="Mozilla"}}}}}}}VSK_I.version=vsk_browser_version();function v(node){return new VSK_Node(node)}function V(id){var n=document.getElementById(id);return(n?v(n):null)}vsk_html_node=vsk_h=function(nodeName,className,parentNode,id){var n=document.createElement(nodeName);if(className){n.className=className}if(parentNode){v(n).dock(parentNode)}if(id){n.id=id}return n};vsk_txt_node=vsk_t=function(text,parentNode){var n=document.createTextNode(text);v(n).dock(parentNode);return n};function vsk_get_mouse(e){if(e.pageX||e.pageY){vskX=e.pageX;vskY=e.pageY}else{if(e.clientX||e.clientY){vskX=e.clientX+document.documentElement.scrollLeft;vskY=e.clientY+document.documentElement.scrollTop}}}function vsk_rel_target(e){if(!e){var e=event}return(e.relatedTarget?e.relatedTarget:(e.type=="mouseover"?e.fromElement:e.toElement))}function pi(str){return parseInt(str)}window.vskpi=parseInt;function in_array(arr,value){var i;for(i=0;i<arr.length;i++){if(arr[i]==value){return true}}return false}function vsk_rand(min,max){return(Math.round(Math.random()*max)+min)}function vsk_browser_version(){var name=VSK_I.name,str,index;if(name=="Mozilla"){name=="rv"}if(!(str=navigator.userAgent)&&!(str=navigator.appVersion)){return 0}if((index=str.indexOf(name))==-1){return 0}return parseFloat(str.substring(index+name.length+1))}function vsk_redirect(url){window.document.location.href=url}function VSK_Node(node){this.control(node)}VSK_Node.prototype.abs_x=function(Parent){if(!this.b){return null}var n=this.b,x=0,o;while(n&&n.parentNode&&n.parentNode.style&&(!Parent||Parent!=n)){if(!n.vsk_ignoreAbsX){x+=n.offsetLeft}if(v(n).s.left===""){n=n.offsetParent}else{n=n.parentNode}if(n==document.body){break}}return x};VSK_Node.prototype.abs_y=function(Parent){if(!this.b){return null}var n=this.b,y=0;while(n&&n.parentNode&&n.parentNode.style&&(!Parent||Parent!=n)){if(!n.vsk_ignoreAbsY){y+=n.offsetTop}if(v(n).s.top===""){n=n.offsetParent}else{n=n.parentNode}if(n==document.body){break}}return y};VSK_Node.prototype.ga=function(name,d){if(!this.b||typeof this.b.getAttribute=="undefined"){return null}var v=this.b.getAttribute(name);return(v!==null?v:d)};VSK_Node.prototype.bbox=function(x,y,w,h){this.b.vskBBox={x:x,y:y,w:w,h:h,r:x+w,b:y+h};return this};VSK_Node.prototype.bbox_tgl=function(b){if(!b&&this.b.vskBBox){this.b.vskBBoxTmp=this.b.vskBBox;this.b.vskBBox=null}else{if(b&&this.b.vskBBoxTmp){this.b.vskBBox=this.b.vskBBoxTmp;this.b.vskBBoxTmp=null}}return this};VSK_Node.prototype.clear=function(node){if(!this.b){return}while(this.b.childNodes[0]){this.b.removeChild(this.b.childNodes[0])}if(node){this.b.appendChild(node)}return this};VSK_Node.prototype.control=function(node){if(!node){return}this.b=node;this.s=node.style;return this};VSK_Node.prototype.dock=function(toNode){if(this.b&&toNode){toNode.appendChild(this.b);this.vsk_event_fire("dock")}return this};VSK_Node.prototype.event_unset=function(eventName,id){if(!this.b||!this.b.vskEvents){return this}var func;if(this.b.vskEvents[eventName]&&(func=this.b.vskEvents[eventName][id])){if(this.b.removeEventListener){this.b.removeEventListener(eventName,func,false)}else{if(this.b.detachEvent){this.b.detachEvent("on"+eventName,func)}}delete this.b.vskEvents[eventName][id]}};VSK_Node.prototype.event_add=function(eventName,func,id){if(!this.b){return this}if(id){this.event_unset(id)}if(this.b.addEventListener){this.b.addEventListener(eventName,func,false)}else{if(this.b.attachEvent){this.b.attachEvent("on"+eventName,func)}}if(!this.b.vskEvents){this.b.vskEvents={}}if(!this.b.vskEvents[eventName]){this.b.vskEvents[eventName]=[]}if(id){this.b.vskEvents[eventName][id]=func}else{this.b.vskEvents[eventName].push(func)}return this};VSK_Node.prototype.events_clear=function(){if(this.b.vskEvents){var i,n,E=this.b.vskEvents;for(i in E){for(n in E[i]){this.event_unset(i,n)}}}return this};VSK_Node.prototype.fade=function(n){if(!this.s){return}if(n>100){var n=100}else{if(n<1){var n=1}}this.s.filter="alpha(opacity="+n+")";this.s.opacity=n/100;this.s.MozOpacity=n/100;return this};VSK_Node.prototype.h=function(o){if(!this.s){return}return(this.s.height&&!o?pi(this.s.height):this.b.offsetHeight)};VSK_Node.prototype.handle=function(eventName){var E=this;this.b["on"+eventName]=function(e){if(!e){var e=event}E.vsk_event_fire(eventName,e)};return this};VSK_Node.prototype.has_parent=function(parentNode){var _p=this.b;if(!_p){return false}while((_p=_p.parentNode)){if(_p==parentNode){return true}}return false};VSK_Node.prototype.hide=function(hide){if(this.s){this.s.visibility=(hide?"hidden":"");this.vsk_event_fire("hide")}return this};VSK_Node.prototype.html_append=function(){if(!this.b){return}var i;for(i=0;i<arguments.length;i++){v(arguments[i]).dock(this.b)}return this.b};VSK_Node.prototype.html_a=VSK_Node.prototype.html_append;VSK_Node.prototype.html_insert_after=function(){if(!this.b||!this.b.parentNode){return this}var i,node=this.b,p=this.b.parentNode;for(i=0;i<arguments.length;i++){if(node.nextSibling){p.insertBefore(arguments[i],node.nextSibling)}else{p.appendChild(arguments[i])}node=arguments[i]}return this};VSK_Node.prototype.html_ia=VSK_Node.prototype.html_insert_after;VSK_Node.prototype.html_insert_before=function(){if(!this.b||!this.b.parentNode){return this}var i;for(i=0;i<arguments.length;i++){this.b.parentNode.insertBefore(arguments[i],this.b)}return this};VSK_Node.prototype.html_ib=VSK_Node.prototype.html_insert_before;VSK_Node.prototype.level=function(z){this.s.zIndex=z;return this};VSK_Node.prototype.move=function(x,y,x2,y2){if(!this.s){return}this.moveable();var B=this.b.vskBBox;if((isNaN(x2)||x2===null)&&!isNaN(x)&&x!==null){if(B){if(B.x>x){var x=B.x;this.vsk_event_fire("bumped_l")}else{if(B.r<(x+this.w())){var x=B.r-this.w();this.vsk_event_fire("bumped_r")}}}this.s.left=x+"px";this.s.right=""}else{if(!isNaN(x2)&&x2!==null){this.s.right=x2+"px";this.s.left=""}}if((isNaN(y2)||y2===null)&&!isNaN(y)&&y!==null){if(B){if(B.y>y){var y=B.y;this.vsk_event_fire("bumped_u")}else{if(B.b<(y+this.h())){var y=B.b-this.h();this.vsk_event_fire("bumped_d")}}}this.s.top=y+"px";this.s.bottom=""}else{if(!isNaN(y2)&&y2!==null){this.s.top="";this.s.bottom=y2+"px"}}this.vsk_event_fire("move");return this};VSK_Node.prototype.move_r=function(x,y){this.move(this.x()+x,this.y()+y);return this};VSK_Node.prototype.padding=function(type){switch(type){default:case"w":return parseInt(this.s.paddingLeft||0)+parseInt(this.s.paddingRight||0);case"h":return parseInt(this.s.paddingTop||0)+parseInt(this.s.paddingBottom||0)}};VSK_Node.prototype.resize=function(w,h){if(!this.s){return}var B=this.b.vskBBox;if(w){if(B){if((this.x()+w)>B.r){var w=B.r-this.x();this.vsk_event_fire("bumped_r")}}this.s.width=(w<1?1:w)+"px"}if(h){if(B){if((this.y()+h)>B.b){var h=B.b-this.y();this.vsk_event_fire("bumped_d")}}this.s.height=(h<1?1:h)+"px"}this.vsk_event_fire("resize");return this};VSK_Node.prototype.resize_like_w=function(Node){this.resize(Node.w());if(this.b.offsetWidth>Node.w()){this.resize(Node.w()-(this.b.offsetWidth-Node.w()))}return this};VSK_Node.prototype.resize_like_h=function(Node){this.resize(null,Node.h());if(this.b.offsetHeight>Node.h()){this.resize(null,Node.h()-(this.b.offsetHeight-Node.h()))}return this};VSK_Node.prototype.resize_like=function(Node){this.resize_like_w(Node).resize_like_h(Node);return this};VSK_Node.prototype.set_pos=function(pos,zIndex){if(pos){this.s.position=pos}if(!isNaN(zIndex)){this.s.zIndex=zIndex}return this};VSK_Node.prototype.set_style=function(style){var i;if(!style){return this}if(!style.indexOf){for(i in style){this.s[i]=style[i]}}else{this.b.className=style}return this.vsk_event_fire("style")};VSK_Node.prototype.set_style_str=function(style){this.b.setAttribute("style",style);this.b.style.cssText=style;return this.vsk_event_fire("style")};VSK_Node.prototype.style_str=function(){return(this.s.cssText||this.ga("style"))};VSK_Node.prototype.moveable=function(){if(this.s.position==""||this.s.position=="static"){this.set_pos("absolute")}return this};VSK_Node.prototype.span=function(x,y,x2,y2){this.moveable();if(this.s){this.s.left=(isNaN(x)||x===null)?"":x+"px";this.s.top=(isNaN(y)||y===null)?"":y+"px";this.s.right=(isNaN(x2)||x2===null)?"":x2+"px";this.s.bottom=(isNaN(y2)||y2===null)?"":y2+"px"}this.vsk_event_fire("move");this.vsk_event_fire("resize");this.vsk_event_fire("span",[x,y,x2,y2]);return this};VSK_Node.prototype.set=function(name,value){if(typeof name!="string"){return this}this.b.setAttribute(name,value);return this};VSK_Node.prototype.t=function(){if(!this.s||this.s.opacity===""){return 100}return(this.s.opacity*100)};VSK_Node.prototype.trim=function(length,reverse){if(!this.b){return}while(this.b.childNodes.length>length){if(!reverse){v(this.b.firstChild).undock()}else{v(this.b.lastChild).undock()}}};VSK_Node.prototype.undock=function(){if(!this.b||!this.b.parentNode){return this}this.b.parentNode.removeChild(this.b);this.vsk_event_fire("undock");return this};VSK_Node.prototype.v=function(){if(!this.s){return}return(this.s.visibility=="hidden"?false:true)};VSK_Node.prototype.vsk_event_add=function(name,func,id){if(!this.b){return this}if(!this.b["vsk_on"+name]){this.b["vsk_on"+name]=new VegUIDynFunc()}var F=this.b["vsk_on"+name];F.add(func,id);return this};VSK_Node.prototype.vsk_event_fire=function(name,argArr){if(!this.b||!this.b["vsk_on"+name]){return this}this.b["vsk_on"+name].execute(this,argArr);return this};VSK_Node.prototype.vsk_event_unset=function(name,id){if(!this.b||!this.b["vsk_on"+name]){return this}this.b["vsk_on"+name].free(id);return this};VSK_Node.prototype.w=function(o){if(!this.s){return}return(this.s.width&&!o?pi(this.s.width):this.b.offsetWidth)};VSK_Node.prototype.x=function(){if(!this.s){return}return(this.s.left!==""?pi(this.s.left):this.b.offsetLeft)};VSK_Node.prototype.x2=function(){if(!this.s){return}return(this.w()+this.x())};VSK_Node.prototype.y=function(){if(!this.s){return}return(this.s.top!==""?pi(this.s.top):this.b.offsetTop)};VSK_Node.prototype.y2=function(){if(!this.s){return}return this.h()+this.y()};VSK_Node.prototype.z=function(){if(!this.s){return}return this.s.zIndex};function VegUIDynFunc(returnVal){this.Funcs={_l:0,_p:function(fn){this[this._l]=fn;this._l++}};this.returnVal=returnVal||false;this.add=function(fn,id){if(id){this.Funcs[id]=fn}else{this.Funcs._p(fn)}};this.execute=function(obj,argArr){var i,returnVal=this.returnVal;for(i in this.Funcs){if(typeof this.Funcs[i]!="function"||i=="_p"){continue}this.Funcs[i](obj,argArr)}return returnVal};this.free=function(id){delete this.Funcs[id]}}function vsk_dbg_start(attachTo,lines,w,h){if(!lines){var lines=100}var c=v(vsk_h("div","",null,"vsk_dbg_console"));c.s.position="absolute";c.s.zIndex=100000;c.s.border="1px #000 solid";c.s.backgroundColor="#fff";c.s.font="10px Verdana, Arial, Helvetica";c.s.overflow="auto";c.b.vskConsoleLines=lines;c.dock(document.body);vsk_dbg_adjust(attachTo,w,h);v(window).event_add("scroll",function(){vsk_dbg_adjust()});v(window).event_add("resize",function(){vsk_dbg_adjust()});c.event_add("mousedown",function(){var c;if(!(c=V("vsk_dbg_console"))){return}switch(c.b.vskConsolePos){case"b":vsk_dbg_adjust("t");break;case"t":vsk_dbg_adjust("ul",w,h);break;case"ul":vsk_dbg_adjust("lr",w,h);break;case"lr":vsk_dbg_adjust("b");break}})}function vsk_dbg_adjust(attachTo,w,h){var c;if(!(c=V("vsk_dbg_console"))){return}if(!attachTo){attachTo=c.b.vskConsolePos}if(!h){var h=100}if(!w){var w=300}var y=vsk_oy(),x=vsk_ox(),wH=vsk_ih(),wW=vsk_iw();switch(attachTo){case"t":c.resize(wW,h).move(0,0+y+10);break;case"b":c.resize(wW,h).move(0,((wH-h)+y)-30);break;case"ul":c.resize(w,h).move(20+x,20+y);break;case"lr":c.resize(w,h).move(((wW-w)+x)-20,((wH-h)+y)-30);break}c.b.vskConsolePos=attachTo}function vsk_dbg_stop(){V("vsk_dbg_console").undock()}function vsk_dbg_print(msg,color){var c;if(!(c=V("vsk_dbg_console"))){return}var d=v(vsk_h("div")).html_append(vsk_t(msg));if(color){d.style.color=color}c.html_append(d);c.trim(c.b.vskConsoleLines);c.b.scrollTop=c.b.scrollHeight-c.b.clientHeight}var vsk_fxInterval;var vsk_Effects=[];var VSK_FX_INTERVAL=25;function vsk_fx_poll(){var i,n;for(i=0;i<vsk_Effects.length;i++){v(vsk_Effects[i]).fx_process()}}VSK_Node.prototype.fx_process=function(){if(!this.b||!this.b.vsk_effects){return null}var i,e;for(i in this.b.vsk_effects){if(typeof this.b.vsk_effects[i].main=="function"){this.b.vsk_effects[i].main()}}return this};VSK_Node.prototype.fx_clear=function(clearEffects){if(clearEffects&&clearEffects.length){var i;for(i=0;i<clearEffects.length;i++){this.fx_halt(clearEffects[i],true)}}};VSK_Node.prototype.fx_start=function(){this.fx_stop();vsk_fxInterval=setInterval(vsk_fx_poll,VSK_FX_INTERVAL);return this};VSK_Node.prototype.fx_stop=function(){vsk_fxInterval=clearInterval(vsk_fxInterval);return this};VSK_Node.prototype.fx_init=function(id,effect,collision){if(this.b){if(!this.b.vsk_effects){this.b.vsk_effects={}}this.b.vsk_effects[id]=effect;if(!in_array(vsk_Effects,this.b)){vsk_Effects.push(this.b)}if(collision){var i=0;for(i=0;i<collision.length;i++){this.fx_halt(collision[i])}}this.fx_start()}return this};VSK_Node.prototype.fx_halt=function(id,silent){if(this.b&&this.b.vsk_effects&&this.b.vsk_effects[id]){var E=this.b.vsk_effects[id];delete this.b.vsk_effects[id];if(E.onhalt&&!silent){E.onhalt(this)}if(E.sequence&&!silent){E.sequence.loop()}if(E._onhalt&&!silent){E._onhalt(this)}}return this};VSK_Node.prototype.fx_active=function(id){if(!this.b||!this.b.vsk_effects){return false}if(this.b.vsk_effects[id]){return true}return false};function VSK_FX_Sequence(n){this.n=n;this.loopMax=0;this.loopCount=0;this.ondone=null}VSK_FX_Sequence.prototype.loop=function(n,ondone){if(typeof n!="undefined"){this.loopMax=n;this.loopCount=0}if(typeof ondone!="undefined"){this.ondone=ondone}if(this.loopMax&&this.loopCount==this.loopMax){if(typeof this.ondone=="function"){this.ondone(this.n)}return}else{if(this.loopMax){this.loopCount++}}if(typeof this.body=="function"&&this.n){this.body(this.n)}};VSK_FX_Sequence.prototype.halt=function(clearEffects){this.n.fx_clear(clearEffects)};VSK_Node.prototype.fx_fade_in=function(n,limit){if(!this.b){return}var N=this.b;var t=(100-this.t());if(!limit){var limit=100}var E={main:function(){var interval=t/(n/VSK_FX_INTERVAL);if(v(N).t()<limit){v(N).fade(v(N).t()+interval)}else{v(N).fx_halt("fade_in")}}};this.fx_init("fade_in",E,["fade_out"]);return E};VSK_Node.prototype.fx_fade_out=function(n,limit){if(!this.b){return}var N=this.b;var t=this.t();if(!limit){var limit=1}var E={main:function(){var interval=t/(n/VSK_FX_INTERVAL);if(v(N).t()>limit){v(N).fade(v(N).t()-interval)}else{v(N).fx_halt("fade_out")}}};this.fx_init("fade_out",E,["fade_in"]);return E};VSK_Node.prototype.fx_morph=function(w,h,x,y,t,s){if(!this.b){return{}}var N=this;var E={type_w:(w<this.w()),type_h:(h<this.h()),type_x:(x<this.x()),type_y:(y<this.y()),w:w,h:h,x:x,y:y,oW:this.w(),oH:this.h(),oX:this.x(),oY:this.y(),iW:0,iH:0,iX:0,iY:0,interval:(t/VSK_FX_INTERVAL),s:typeof s=="undefined"?0:s,main:function(){this.iW+=(Math.abs(this.w-this.oW)/this.interval);this.iH+=(Math.abs(this.h-this.oH)/this.interval);var w=(N.w()==this.w);var h=(N.h()==this.h);var _iw=Math.floor(this.iW);var _ih=Math.floor(this.iH);if((!w&&this.iW>=1)||(!h&&this.iH>=1)){var _uw=(!w?(!this.type_w?N.w()+_iw:N.w()-_iw):null);var _uh=(!h?(!this.type_h?N.h()+_ih:N.h()-_ih):null);N.resize((_uw>-1?_uw:1),(_uh>-1?_uh:1))}if(this.iW>=1){this.iW=(this.iW-_iw)}if(this.iH>=1){this.iH=(this.iH-_ih)}var _w=(!this.type_w?(N.w()>this.w):(N.w()<this.w));var _h=(!this.type_h?(N.h()>this.h):(N.h()<this.h));if(_w||_h){N.resize((_w?this.w:null),(_h?this.h:null))}if(this.x!==null&&this.y!==null){this.iX+=(Math.abs(this.x-this.oX)/this.interval);this.iY+=(Math.abs(this.y-this.oY)/this.interval);var _ix=Math.floor(this.iX);var _iy=Math.floor(this.iY);var x=(N.x()>=(this.x-this.s)&&N.x()<=(this.x+this.s));var y=(N.y()>=(this.y-this.s)&&N.y()<=(this.y+this.s));if((!x&&this.iX>=1)||(!y&&this.iY>=1)){N.move((!x?(this.x>N.x()?N.x()+_ix:N.x()-_ix):null),(!y?(this.y>N.y()?N.y()+_iy:N.y()-_iy):null))}if(this.iX>=1){this.iX-=_ix}if(this.iY>=1){this.iY-=_iy}var _x=(Math.abs(N.x()-this.x)<=(Math.abs(this.oX-this.x)/this.interval));var _y=(Math.abs(N.y()-this.y)<=(Math.abs(this.oY-this.y)/this.interval));if(_x||_y){N.move((_x?this.x:null),(_y?this.y:null))}}else{var x=true,y=true}if(w&&h&&x&&y){N.fx_halt("morph")}}};this.fx_init("morph",E);return E};VSK_Node.prototype.fx_quake=function(m,t){var N=this;if(m<2){var m=2}var E={start:new Date().getTime(),x:N.x(),y:N.y(),min:Math.max(Math.round(m/4),1),max:m,lastDir:0,tClose:Math.round(t*0.5),main:function(){var m=Math.round(this.max);N.bbox(this.x-m,this.y-m,N.w()+(m*2),N.h()+(m*2));var dir=vsk_rand(1,4);while(dir==this.lastDir){dir=vsk_rand(1,4)}switch(dir){case 1:N.move_r(-vsk_rand(this.min,m));break;case 2:N.move_r(vsk_rand(this.min,m));break;case 3:N.move_r(null,-vsk_rand(this.min,m));break;case 4:N.move_r(null,vsk_rand(this.min,m));break}if(new Date().getTime()-this.start>this.tClose){this.max=Math.max((this.max*0.985),this.min)}if(new Date().getTime()-this.start>t){N.fx_halt("quake")}},_onhalt:function(N){N.move(this.x,this.y);N.bbox_tgl(false)}};this.fx_init("quake",E);return E};function vsk_cookie_set(name,value,time,path){if(!name||typeof value=="undefined"){return}if(time){var d=new Date();d.setTime(d.getTime()+time);var v="; expires="+d.toGMTString()}else{var v=""}if(!path){var path="/"}document.cookie=name+"="+value+v+"; path="+path}function vsk_cookie_get(name){var name=name+"=",i,v;var values=document.cookie.split(";");for(i=0;i<values.length;++i){v=values[i];while(v.charAt(0)==" "){v=v.substring(1,v.length)}if(v.indexOf(name)==0){return v.substring(name.length,v.length)}}return null}function vsk_cookie_list(){var values=document.cookie.split(";"),i,v,p;var list={};for(i=0;i<values.length;i++){p=values[i].split("=");list[p[0]]=p[1].substring(0,p[1].length)}return list}function vsk_cookie_unset(name){vsk_cookie_set(name,"",-1000)}var VSK_TTIP_FX_TIME=200;var VSK_TTIP_MAX_WIDTH=200;var VSK_TTIP_FX_TYPE="fade";var VSK_TTIP_USE_SHADOW=false;var VSK_TTIP_SHADOW_TRANSPARENCY=15;var VSK_TTIP_SHADOW_OFFSET_X=5;var VSK_TTIP_SHADOW_OFFSET_Y=5;var VSK_TTIP_SHADOW_COLOR="#000";var VSK_TTIP_NODE=null;var VSK_TTIP={span:true,a:true,p:true};VSK_Node.prototype.ttip_show=function(text){if(!this.b.ttipNode){if(VSK_TTIP_NODE){var t=v(VSK_TTIP_NODE.cloneNode(1))}else{var t=v(vsk_h("div"))}t.s.display="inline";t.s.position="absolute";t.s.zIndex=100000;t.b.className="vsk_tooltip";t.b.innerHTML=text;t.dock(document.body);if(t.w()>VSK_TTIP_MAX_WIDTH){t.resize(VSK_TTIP_MAX_WIDTH)}if(VSK_TTIP_FX_TYPE=="fade"){t.fade(1).fx_fade_in(VSK_TTIP_FX_TIME)}else{if(VSK_TTIP_FX_TYPE=="morph"){t.s.padding="0px";var h=t.h(1),w=t.w(1),n=t.b;if(w>VSK_TTIP_MAX_WIDTH){w=VSK_TTIP_MAX_WIDTH}t.clear().resize(1,1).fx_morph(w,h,null,null,VSK_TTIP_FX_TIME).onhalt=function(){n.innerHTML=text};t.s.padding=""}}this.b.ttipNode=t.b;if(t.fx_shadow&&VSK_TTIP_USE_SHADOW){t.fx_shadow(VSK_TTIP_SHADOW_TRANSPARENCY,VSK_TTIP_SHADOW_COLOR,VSK_TTIP_SHADOW_OFFSET_X,VSK_TTIP_SHADOW_OFFSET_Y)}}else{var t=v(this.b.ttipNode)}t.move(vskX+10,vskY+10)};VSK_Node.prototype.ttip_hide=function(){if(!this.b||!this.b.ttipNode){return}if(VSK_TTIP_FX_TYPE=="fade"){var t=new Date().getTime();var id="vsk_ttip_"+t;this.b.ttipNode.id=id;var n=V(id);n.fx_fade_out(VSK_TTIP_FX_TIME).onhalt=function(){V(id).undock()}}else{v(this.b.ttipNode).undock()}this.b.ttipNode=null};v(window).event_add("load",function(){var t,n,i,e,ttip;for(t in VSK_TTIP){if(!VSK_TTIP[t]){continue}e=document.getElementsByTagName(t);for(i=0;i<e.length;i++){n=e[i];if((ttip=n.getAttribute("vsk_ttip"))){__vsk_ttip_event_show(v(n));__vsk_ttip_event_hide(v(n))}}}});function __vsk_ttip_event_hide(n){n.event_add("mouseout",function(e){var rel=vsk_rel_target(e?e:event);if(!v(rel).has_parent(n.b)&&n.b!=rel){n.ttip_hide()}})}function __vsk_ttip_event_show(n){n.event_add("mousemove",function(e){vsk_get_mouse((e?e:event));n.ttip_show(n.b.getAttribute("vsk_ttip"))})}var VSK_COOLTIP_SPACE_Y=5;var VSK_COOLTIP_INDENT_X=20;var VSK_COOLTIP_PD="bc";var VSK_COOLTIP_FX_TYPE="morph";var VSK_COOLTIP_FX_TIME=150;var VSK_COOLTIP_FADE=100;var VSK_COOLTIP_WIDTH=200;var VSK_COOLTIP_CLOSETIME=1000;var VSK_COOLTIP_GFX_SIZE=[4,4,10,12,-2];var VSK_COOLTIP_LAYOUT_CSS={padding:"5px",font:"11px Verdana, Arial, Helvetica",color:"#fff"};var VSK_COOLTIP_SKIN_CSS={backgroundColor:"#000"};var VSK_COOLTIP_GFX_PATH="/lib/sitekit/";var VSK_COOLTIP_INTERACTIVE=true;var VSK_CTIP={span:true,a:true,p:true};var VSK_COOLTIP_Z=3000;v(window).event_add("load",function(){var t,n,i,e,ctip;for(t in VSK_CTIP){if(!VSK_CTIP[t]){continue}e=document.getElementsByTagName(t);for(i=0;i<e.length;i++){n=v(e[i]);if((ctip=n.ga("vsk_ctip"))){n.cooltip_set(ctip,VSK_COOLTIP_PD)}}}});VSK_Node.prototype.cooltip_set=function(content,pd,holdMouse,toNode,attachInto){if(!this.b){return this}this.b.vskCooltipContent=content;this.b.vskCooltipPD=pd;this.b.vskCooltipTarget=toNode?v(toNode):this;if(!holdMouse){this.handle("mouseover").vsk_event_add("mouseover",function(N,e){var E=ve(e);if(E.rt_valid(N.b)&&(typeof window.VSK_COOLTIP_NODE=="undefined"||E.rt_valid(window.VSK_COOLTIP_NODE.b))){N.b.vskCooltipTarget.cooltip_show(content,pd,attachInto)}N.cooltip_set_close(true)},"cooltip")}else{this.handle("mousedown").vsk_event_add("mousedown",function(N,e){if((holdMouse=="shift"||holdMouse=="alt"||holdMouse=="ctrl")&&!ve(e||event).key_mod(holdMouse)){return}N.b.vskCooltipTarget.cooltip_show(content,pd,attachInto)},"cooltip");this.handle("mouseup").vsk_event_add("mouseup",function(N,e){N.cooltip_set_close()},"cooltip")}this.handle("mouseout").vsk_event_add("mouseout",function(N,e){var E=ve(e);if(E.rt_valid(N.b)&&(!VSK_COOLTIP_INTERACTIVE||typeof window.VSK_COOLTIP_NODE=="undefined"||E.rt_valid(window.VSK_COOLTIP_NODE.b))){N.cooltip_set_close()}},"cooltip");return this};VSK_Node.prototype.cooltip_close=function(){if(typeof window.VSK_COOLTIP_NODE!="undefined"){if(VSK_COOLTIP_FX_TYPE=="morph"){VSK_COOLTIP_NODE.fx_halt("morph").hide(1).set_style({width:""})}else{if(VSK_COOLTIP_FX_TYPE=="fade"){VSK_COOLTIP_NODE.fx_fade_out(VSK_COOLTIP_FX_TIME).onhalt=function(){VSK_COOLTIP_NODE.hide(1).set_style({width:""})}}else{VSK_COOLTIP_NODE.hide(1).set_style({width:""})}}VSK_COOLTIP_NODE.vskCTTarget=null;VSK_COOLTIP_NODE.b.vskCooltipOpening=false}};VSK_Node.prototype.cooltip_set_close=function(halt,customDelay){var N=this;if((!VSK_COOLTIP_CLOSETIME||!VSK_COOLTIP_INTERACTIVE)&&!customDelay){if(!halt){this.cooltip_close()}else{if(typeof window.VSK_COOLTIP_CLOSETIMER!="undefined"){clearTimeout(VSK_COOLTIP_CLOSETIMER)}}return this}if(!halt){VSK_COOLTIP_CLOSETIMER=setTimeout(function(){N.cooltip_close()},customDelay||VSK_COOLTIP_CLOSETIME)}else{if(typeof window.VSK_COOLTIP_CLOSETIMER!="undefined"){clearTimeout(VSK_COOLTIP_CLOSETIMER)}}return this};VSK_Node.prototype.cooltip_show=function(content,pd,attachInto,autoFix){if(typeof window.VSK_COOLTIP_NODE!="undefined"){if(VSK_COOLTIP_NODE.vskCTTarget==this.b){return this}}this.cooltip_close();var N=this;if(this.s.position==""){this.set_pos("relative")}var CT=this.cooltip_node(content),s=VSK_COOLTIP_GFX_SIZE,p=V("vsk_cooltip_pointer");CT.set_style({width:""});CT.vskCTTarget=this.b;CT.hide(1).dock(attachInto?this.b:document.body);if(CT.w()>VSK_COOLTIP_WIDTH){CT.resize(VSK_COOLTIP_WIDTH)}var path=VSK_COOLTIP_GFX_PATH;var absY=attachInto?0:this.abs_y();var absX=attachInto?0:this.abs_x();if(!attachInto){if(absY-(CT.h()+VSK_COOLTIP_SPACE_Y)<0){pd=pd.replace("a","b")}else{if((CT.h()+VSK_COOLTIP_SPACE_Y)+(absY+this.h())>(vsk_ih()+vsk_oy())){pd=pd.replace("b","a")}}if(absX-(CT.w()-VSK_COOLTIP_INDENT_X)<0){pd=pd.replace(/[lc]/g,"r")}else{if((CT.w()-VSK_COOLTIP_INDENT_X)+(absX+this.w())>(vsk_iw()+vsk_ox())){pd=pd.replace(/[rc]/g,"l")}}}switch(pd.charAt(0)){case"a":p.move(null,null,null,-s[3]+-s[4]).set("src",path+"ct_pointer_b.gif");var y=absY-(CT.h()+VSK_COOLTIP_SPACE_Y);break;case"b":p.move(null,(-s[3])-s[4]).set("src",path+"ct_pointer_u.gif");var y=absY+this.h()+VSK_COOLTIP_SPACE_Y+s[3];break}switch(pd.charAt(1)){case"l":var x=absX-(CT.w()-VSK_COOLTIP_INDENT_X);p.move(null,null,VSK_COOLTIP_INDENT_X);break;case"c":var x=absX+(this.w()/2)-(CT.w()/2);p.move(CT.w()/2-s[2]/2);break;case"r":var x=this.x2()-VSK_COOLTIP_INDENT_X;p.move(s[0]*2);break}if(VSK_COOLTIP_FX_TYPE=="morph"){CT.move(x,y);var oldX=CT.x();var oldY=CT.y();var oldW=CT.w();var oldH=CT.h();var C=V("vsk_cooltip_node").undock();p.hide(1);v(vsk_h("div")).span(s[0],s[1],s[0],s[1]).set("id","vsk_cooltip_dummy").dock(CT.b).s.backgroundColor=C.s.backgroundColor;CT.set_style({overflow:"hidden"});CT.b.vskCooltipOpening=true;CT.resize(10,oldH).move(absX+this.w()/2,oldY).hide(0).fx_morph(oldW,oldH,oldX,oldY,VSK_COOLTIP_FX_TIME).onhalt=function(){V("vsk_cooltip_dummy").undock();p.hide(0);CT.set_style({height:"",overflow:""});CT.b.vskCooltipOpening=false;C.dock(CT.b)}}else{if(VSK_COOLTIP_FX_TYPE=="fade"){var oldW=CT.w();CT.fade(1).fx_fade_in(VSK_COOLTIP_FX_TIME).onhalt=function(){};CT.move(x,y).resize(oldW).hide(0)}else{CT.move(x,y).hide(0)}}return this};VSK_Node.prototype.cooltip_node=function(content){if(typeof window.VSK_COOLTIP_NODE=="undefined"){var D,s=VSK_COOLTIP_GFX_SIZE,p=VSK_COOLTIP_GFX_PATH;D=window.VSK_COOLTIP_NODE=v(vsk_h("div"));D.move(0,0).level(VSK_COOLTIP_Z).hide(1).dock(document.body).set_style({paddingLeft:s[0]+"px",paddingRight:s[0]+"px",paddingBottom:s[1]+"px",paddingTop:s[1]+"px",backgroundImage:"url("+p+"ct_bg.gif)"});var S=v(vsk_h("div")).span(0,0,0,0).dock(D.b);v(vsk_h("div")).set_style(VSK_COOLTIP_SKIN_CSS).span(s[0],s[1],s[0],s[1]).dock(VSK_I.name=="Opera"?D.b:S.b).set("id","sawp");v(vsk_h("img")).move(0,0).set("src",p+"ct_ul.gif").resize(s[0],s[1]).level(2).dock(S.b);v(vsk_h("img")).move(null,0,0).set("src",p+"ct_ur.gif").resize(s[0],s[1]).level(2).dock(S.b);v(vsk_h("img")).move(null,null,0,0).set("src",p+"ct_lr.gif").resize(s[0],s[1]).level(2).dock(S.b);v(vsk_h("img")).move(0,null,null,0).set("src",p+"ct_ll.gif").resize(s[0],s[1]).level(2).dock(S.b);v(vsk_h("img")).set("id","vsk_cooltip_pointer").set("src",p+"ct_pointer_b.gif").resize(s[2],s[3]).level(5).dock(S.b);v(vsk_h("div")).span(s[0],0,s[0]).resize(0,s[1]).level(0).set_style({backgroundImage:"url("+p+"ct_u.gif)",backgroundRepeat:"repeat-x"}).dock(S.b);v(vsk_h("div")).span(s[0],null,s[0],0).resize(0,s[1]).level(0).set_style({backgroundImage:"url("+p+"ct_b.gif)",backgroundRepeat:"repeat-x"}).dock(S.b);v(vsk_h("div")).span(0,s[1],null,s[1]).resize(s[1]).set_style({backgroundImage:"url("+p+"ct_l.gif)",backgroundRepeat:"repeat-y"}).dock(S.b);v(vsk_h("div")).span(null,s[1],0,s[1]).resize(s[1]).set_style({backgroundImage:"url("+p+"ct_r.gif)",backgroundRepeat:"repeat-y"}).dock(S.b);S.fade(VSK_COOLTIP_FADE);v(vsk_h("div")).set_pos("relative").level(3).set_style(VSK_COOLTIP_LAYOUT_CSS).set("id","vsk_cooltip_node").dock(D.b);D.event_add("mouseout",function(e){var E=ve(e);if(E.rt_valid(D.b)){D.cooltip_set_close(false,VSK_COOLTIP_INTERACTIVE?200:0)}});if(VSK_COOLTIP_INTERACTIVE){D.event_add("mouseover",function(e){var E=ve(e);if(E.rt_valid(D.b)){D.cooltip_set_close(true)}})}}if(VSK_COOLTIP_NODE.vskCTTarget==this.b){return window.VSK_COOLTIP_NODE}if(typeof content=="function"){var Content=content(this);if(!Content.nodeName){V("vsk_cooltip_node").b.innerHTML=Content}else{V("vsk_cooltip_node").clear(Content)}}else{if(typeof content.match!="undefined"){V("vsk_cooltip_node").b.innerHTML=content}else{V("vsk_cooltip_node").clear(content)}}return window.VSK_COOLTIP_NODE};if(document.documentElement&&document.documentElement.clientHeight){var isIEStrict=true}else{var isIEStrict=false}vsk_iw=function(){if(typeof window.innerWidth!="undefined"){return window.innerWidth}if(isIEStrict){return document.documentElement.clientWidth}else{return document.body.clientWidth}};vsk_ih=function(){if(typeof window.innerHeight!="undefined"){return window.innerHeight}if(isIEStrict){return document.documentElement.clientHeight}else{return document.body.clientHeight}};vsk_ox=function(){if(typeof window.pageXOffset!="undefined"){return window.pageXOffset}if(isIEStrict){return document.documentElement.scrollLeft}else{return document.body.scrollLeft}};vsk_oy=function(){if(typeof window.pageYOffset!="undefined"){return window.pageYOffset}if(isIEStrict){return document.documentElement.scrollTop}else{return document.body.scrollTop}};VSK_Node.prototype.fx_shadow_adjust=function(){if(!this.b||!this.fx_active("shadow")){return this}var E=this.b.vsk_effects.shadow;var n=v(E.node);n.resize(this.w(),this.h()).move(this.x()+E.oX,this.y()+E.oY);if(!n.b.parentNode){n.set_pos("absolute",this.s.zIndex-1);n.hide(1).dock(this.b.parentNode).hide(0)}n.hide(this.v()^1);return this};VSK_Node.prototype.fx_shadow=function(t,c,oX,oY){if(!this.b){return{}}var n=this.b;if(!this.s.zIndex){this.s.zIndex=1}this.vsk_event_add("move",function(b){v(b).fx_shadow_adjust()});this.vsk_event_add("resize",function(b){v(b).fx_shadow_adjust()});this.vsk_event_add("undock",function(b){v(b).fx_halt("shadow")});this.vsk_event_add("hide",function(b){v(b).fx_shadow_adjust()});var E={oX:oX,oY:oY,t:t,c:c,node:vsk_h("div"),main:function(){},_onhalt:function(){v(this.node).undock()}};v(E.node).fade(t).s.backgroundColor=c;this.fx_init("shadow",E);this.fx_shadow_adjust();return E};function vsk_input_validate_required(input){if(!input){return false}n=input.nodeName.toLowerCase();if(n=="input"||n=="textarea"){return(input.value!=="")}else{if(input.type=="select"){return(input.selectedIndex!==null)}}}function vsk_input_validate_numeric(input){return !(new String(input).match(/[^\d-]/))}function vsk_input_validate_email(input){return(new String(input).match(/\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i))}function vsk_input_validate_url(input){return(new String(input).match(/^(ftp|http|https|mailto|file):\/\/([\w\d][\w\d\$\_\.\+\!\*\(\)\,\;\/\?\:\@\&\~\=\-]+)(:(\d+))?(\/[^ ]*)?$/i))}var VSK_FORMCHECK_USE_FX_FADE=1;var VSK_FORMCHECK_FADE_TIME=300;var VSK_FORMCHECK_INIT={vsk_required:{msg:"Input/Selection is required for this field",func:vsk_input_validate_required,useField:true},vsk_numeric:{msg:"Input needs to be numeric for this field",func:vsk_input_validate_numeric},vsk_email:{msg:"This email-address seems to be invalid",func:vsk_input_validate_email},vsk_url:{msg:"This URL seems to be invalid",func:vsk_input_validate_url}};var VSK_FORMCHECK_ERROR_CSS="vsk_frmchk_error";var VSK_FORMCHECK_ERROR_ELEMENT_CSS="vsk_frmchk_error_element";function vsk_formcheck(form,align){var f,i,rv=true;f=v(form);if(!align){var align="r"}var inputs=f.b.getElementsByTagName("input");var textareas=f.b.getElementsByTagName("textarea");var selects=f.b.getElementsByTagName("select");for(i=0;i<inputs.length;i++){if(!vsk_inputcheck(inputs[i],align)){rv=false}}return rv}function vsk_inputcheck(input,align){if(!input){return false}var rv=true,msg=[],i,iN,g,val;if((iN=input.getAttribute("vsk_error"))){iN=V(iN)}for(i in VSK_FORMCHECK_INIT){if(input.getAttribute(i)){g=VSK_FORMCHECK_INIT[i];val=(input.nodeName.toLowerCase()=="select"?input.selectedIndex:input.value);if(!g.useField&&input.value===""){continue}if(!g.func((g.useField?input:val))){msg.push(VSK_FORMCHECK_INIT[i].msg);rv=false}}}if(!rv){if(!input.vskValError){var m=input.vskValError=vsk_h("div",VSK_FORMCHECK_ERROR_CSS);if(!iN||!iN.b){switch(align){case"t":v(input).html_ib(m);break;case"b":v(input).html_ia(m);break}}else{v(m).dock(iN.b)}}else{var m=input.vskValError;v(m).clear()}for(i=0;i<msg.length;i++){var d=v(vsk_h("div"));v(m).html_a(d.html_a(vsk_t(msg[i])))}if(v(m).fx_fade_in&&VSK_FORMCHECK_USE_FX_FADE){v(m).fade(1).fx_fade_in(VSK_FORMCHECK_FADE_TIME)}if(input.className!==VSK_FORMCHECK_ERROR_ELEMENT_CSS){input.oldClass=input.className}input.className=VSK_FORMCHECK_ERROR_ELEMENT_CSS}else{if(input.oldClass){input.className=input.oldClass;if(input.vskValError){v(input.vskValError).undock();input.vskValError=null}}}return rv}var VUI_URL="";function VegUIRequest(req,id,toElement){this.timeCreation=new Date().getTime();this.timeSend=null;this.request=req;this.toElement=toElement;this.process=null;this.id=id}function VegUIBridge(){this.R=this.Request=[];this.maxSendTime=5000;this.maxTimeouts=10;this.conTimeouts=0;this.sendNum=0;this.timeoutNum=0;this.successNum=0;this.PTimer=null;this.denyRequests=false;this.resend=true;this.cleanup=function(vreq){this.R[vreq.id].request.onreadystatechange=function(){return};delete this.R[vreq.id]};this.execute=function(vreq){return true};this.new_request=function(toElement){var req;if(window.XMLHttpRequest){req=new XMLHttpRequest()}else{if(window.ActiveXObject){req=new ActiveXObject("Msxml2.XMLHTTP")}else{req=new ActiveXObject("Microsoft.XMLHTTP")}}if(!req){return null}var vreq=new VegUIRequest(req,this.valid_id(),toElement);this.R[vreq.id]=vreq;return this.R[vreq.id]};this.onmaxtimeouts=function(){alert("Lost connection to the server");return true};this.ontimeout=function(vreq){return true};this.poll_timeouts=function(){var r;var time=new Date().getTime();for(r in this.R){if(time-this.R[r].timeSend>this.maxSendTime){this.ontimeout(this.R[r]);this.R[r].request.abort();if(this.resend){this.send(this.R[r].url,this.R[r].para,this.R[r].method)}this.cleanup(this.R[r]);this.conTimeouts++;this.timeoutNum++}}if(this.conTimeouts>=this.maxTimeouts){this.onmaxtimeouts()}};this.process_request=function(vreq){var req=vreq.request;if(req.readyState==4){if(req.status==200){this.successNum++;this.conTimeouts=0;if(!vreq.process){this.execute(vreq)}else{vreq.process()}}else{this.conTimeouts++;this.ontimeout(vreq)}this.cleanup(vreq)}};this.send=function(url,para,method,pFunc,sync){if(this.denyRequests){return null}var req,vreq,Bridge=this;if(!(vreq=this.new_request())){alert("VegUIBridge: Could not create XMLHttpRequest Object");return}vreq.timeSend=new Date().getTime();vreq.url=url;vreq.para=para;vreq.method=method;vreq.process=pFunc;var req=vreq.request;var method=method?method:"GET";var url=VUI_URL+url+(method=="GET"?"?"+para:"");req.onreadystatechange=function(){Bridge.process_request(vreq)};if(sync){req.open(method,url)}else{req.open(method,url,true)}if(method.toUpperCase()=="POST"){req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");req.send(para)}else{req.send(null)}this.sendNum++};this.valid_id=function(){var id=(Math.round(Math.random()*9999)+1);while(this.R[id]){id=(Math.round(Math.random()*9999)+1)}return id}}var VSK_PMNU_FX_TIME=150;function pmnu_init(smallW,smallH,bigW,bigH,id){var i,menu,n,img;if(!(menu=V(id))){return}var nodes=menu.b.getElementsByTagName("td");for(i=0;i<nodes.length;i++){n=v(nodes[i]);n.s.verticalAlign="middle";n.s.textAlign="center";n.s.padding="0px";n.s.cursor="pointer";img=v(n.b.getElementsByTagName("img")[0]);var preload=new Image();preload.src=img.b.src.replace(/1\.([\w\d]+)$/g,"2.$1");n.b.onmouseover=function(e){var img=this.getElementsByTagName("img")[0];v(img).fx_morph(bigW,bigH,null,null,VSK_PMNU_FX_TIME).onhalt=function(){v(img).b.src=v(img).b.src.replace(/1\.([\w\d]+)$/g,"2.$1")}};n.b.onmouseout=function(e){if(v(vsk_rel_target((e||event))).has_parent(this)){return true}var img=this.getElementsByTagName("img")[0];v(img).fx_morph(smallW,smallH,null,null,VSK_PMNU_FX_TIME).onhalt=function(){v(img).b.src=v(img).b.src.replace(/2\.([\w\d]+)$/g,"1.$1")}};img.resize(smallW,smallH);n.resize(null,bigH)}}var VSK_MENU_TIMER=0;var VSK_MENU_CLOSE_TIME=1000;function ddmnu_init(menus,nMarg,useFx,fxTime,shad,shadX,shadY,shadC,shadT){var i,m,O,o,n;for(i=0;i<menus.length;i++){if(!(m=V(menus[i]))){continue}m.s.visibility="hidden";m.s.display="inline";m.set_pos("absolute",1000);m.b.vskMenuFriends=menus;m.b.onmouseout=function(e){var m=v(this),rt=vsk_rel_target(e||event);if(v(rt).has_parent(m.b)||rt==this){return}m.b.vskMenuFocus=false;if(this.vskParentMenu&&(rt==this.vskParentMenu.b||v(rt).has_parent(this.vskParentMenu.b))){this.vskParentMenu.b.vskMenuFocus=true}if(this.vskOpenMenu&&(v(rt).has_parent(this.vskOpenMenu.b)||rt==this.vskOpenMenu.b)){return}VSK_MENU_TIMER=clearTimeout(VSK_MENU_TIMER);VSK_MENU_TIMER=setTimeout(function(){m.ddmenu_close()},1000)};m.b.onmouseover=function(e){var m=v(this);m.b.vskMenuFocus=true};m.b.vskUseFx=useFx;m.b.vskFxTime=fxTime;m.dock(document.body);if(shad){m.fx_shadow(shadT,shadC,shadX,shadY)}O=m.b.getElementsByTagName("a");for(n=0;n<O.length;n++){o=v(O[n]),c=m.b.className;o.b.vskParentMenu=m;o.s.cursor="pointer";o.s.display="block";o.s.whiteSpace="nowrap";o.b.className=c+"_item";if(o.b.getAttribute("vsk_nested")){o.b.onmouseover=function(){this.className=c+"_item_hover";var M=this.getAttribute("vsk_nested");var y=v(this).y();var a=this.getAttribute("vsk_align")||"r";V(M).b.vskParentMenu=this.vskParentMenu;if(this.vskParentMenu.b.vskOpenMenu){if(this.vskParentMenu.b.vskOpenMenu.b!=V(M).b){this.vskParentMenu.b.vskOpenMenu.ddmenu_close()}else{return}}if(a=="r"){this.vskParentMenu.ddmenu_open(M,"r",-nMarg,y)}else{this.vskParentMenu.ddmenu_open(M,"l",nMarg,y)}this.vskParentMenu.b.vskOpenMenu=V(M)}}else{o.b.onmouseover=function(){this.className=c+"_item_hover"}}o.b.onmouseout=function(){this.className=c+"_item"}}}}VSK_Node.prototype.ddmenu_open=function(id,align,x,y){var m=V(id);if(!m.b){return this}if(m.fx_active("morph")){return this}VSK_MENU_TIMER=clearTimeout(VSK_MENU_TIMER);if(!m.b.vskParentMenu&&m.b.vskMenuFriends){var i;for(i=0;i<m.b.vskMenuFriends.length;i++){if(i==id||V(m.b.vskMenuFriends[i]).b.vskParentMenu){continue}V(m.b.vskMenuFriends[i]).ddmenu_close(1)}}var par=m.b.vskParentMenu;while(par){if(!par.v()){return this}par=par.b.vskParentMenu}if(!x){var x=0}if(!y){var y=0}switch(align){case"b":m.move(this.abs_x()+x,this.abs_y()+this.h()+y);break;case"r":m.move(this.abs_x()+this.w()+x,this.abs_y()+y);break;case"l":m.move((this.abs_x()-m.w())+x,this.abs_y()+y);break;case"t":m.move(this.abs_x()+x,(this.abs_y()-m.h())+y);break}m.s.visibility="visible";if(m.b.vskUseFx){if(m.b.vskUseFx=="fade"){m.fade(1).fx_fade_in(m.b.vskFxTime)}else{if(m.b.vskUseFx=="morph"){m.s.overflow="hidden";m.s.padding="0px";var w=m.w(),h=m.h(),oX=m.x(),oY=m.y();m.resize(1,1).fx_morph(w,h,oX,oY,m.b.vskFxTime).onhalt=function(){m.s.height="";m.s.padding=""}}}}return this};VSK_Node.prototype.ddmenu_close=function(force){VSK_MENU_TIMER=clearTimeout(VSK_MENU_TIMER);var m=this;while(m.b.vskOpenMenu){m=m.b.vskOpenMenu}if(!m){return this}while(m){if(m.b.vskMenuFocus&&!force){break}m.hide(1);if((m=m.b.vskParentMenu)){m.b.vskOpenMenu=null}}return this};function VSK_Tunnel(){this.queue=[]}VSK_Tunnel.prototype.send=function(url,ondone){if(!document.body){return}var iframe=document.createElement("iframe");iframe.style.position="absolute";iframe.style.left="-1000px";iframe.style.top="-1000px";iframe.frameName="vskt_"+(Math.round(Math.random()*99999)+1);iframe.setAttribute("name",iframe.frameName);iframe[(typeof iframe.readyState=="undefined"?"onload":"onreadystatechange")]=function(){if(typeof this.readyState!="undefined"&&this.readyState!="complete"){return}if(ondone){ondone(this)}var iframe=this;setTimeout(function(){document.body.removeChild(iframe)},100)};document.body.appendChild(iframe);iframe.src=url};VSK_Tunnel.prototype.request=function(url,ondone,sync){var script_loaded=function(script){script.parentNode.removeChild(script);if(ondone&&ondone.exec){ondone.exec()}};var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.type="text/javascript";script.onreadstatechange=function(){if(this.readyState=="complete"){script_loaded(this)}};script.onload=function(){script_loaded(this)};script.src=url;if(!sync){head.appendChild(script)}else{if(/Apple/.test(navigator.vendor)){script.appendChild(document.createTextNode(" "))}else{script.text=" "}head.appendChild(script)}};function ve(event){return new VSK_Event(event)}function VSK_Event(e){this.event=e}VSK_Event.prototype.rt=function(){return vsk_rel_target(this.event)};VSK_Event.prototype.rt_valid=function(Node){var rt=this.rt();return(!v(rt).has_parent(Node)&&rt!=Node)};VSK_Event.prototype.delta=function(){if(this.event.wheelDelta){if(VSK_I.name=="Opera"&&VSK_I.version<=9){return -(this.event.wheelDetla/120)}else{return this.event.wheelDelta/120}}else{if(this.event.detail){return -this.event.detail/3}}};VSK_Event.prototype.key_mod=function(modifier){return this.event[modifier+"Key"]?true:false};VSK_Event.prototype.key_code=function(){return(this.event.which?this.event.which:this.event.keyCode)};VSK_Event.prototype.key_char=function(){return String.fromCharCode(this.key_code())};VSK_Event.prototype.button=function(){return(this.event.which?this.event.which:this.event.button)};VSK_Event.prototype.coords=function(){vsk_get_mouse(this.event);return{x:vskX,y:vskY}};VSK_Event.prototype.coords_node=function(){return{x:(isNaN(this.event.offsetX)?this.event.layerX:this.event.offsetX),y:(isNaN(this.event.offsetY)?this.event.layerY:this.event.offsetY)}};VSK_Event.prototype.stop=function(){if(this.event.preventDefault){this.event.preventDefault()}this.event.returnValue=false;return this};VSK_Event.prototype.cancel_bubbling=function(){this.event.cancelBubble=true;if(this.event.stopPropagation){this.event.stopPropagation()}return this};VSK_Event.prototype.t=function(){if(this.event.target){return this.event.target}else{if(this.event.srcElement){return this.event.srcElement}else{return null}}};v(window).event_add("load",function(){vsk_drag_load()});function vsk_drag_load(){if(typeof window.VSK_DRAG_LOADED=="undefined"&&document.body){v(document.body).event_add("mouseup",function(e){var E=ve(e||event),t;if(window.VSK_DRAG_NODE){var DN=window.VSK_DRAG_NODE;if(!DN.b.vskDragMode){DN.dragmode(false)}else{if(DN.b.vskDropNode){DN.drop(DN.b.vskDropNode)}else{if(DN.b.vskDragMode==1){DN.dragcancel()}else{if(DN.b.vskDragMode==2){DN.dragmode(false)}}}}}});window.VSK_DRAG_LOADED=true}}VSK_DRAG_NODE=null;VSK_DRAG_CLONE=null;VSK_DROP_TARGETS={};var VSK_DRAG_Z=100000;var VSK_DRAG_SHADOW_TRANSPARENCY=50;var VSK_DRAG_FRAME_STYLE={border:"1px black solid"};var VSK_DRAG_FRAME_TRANSPARENCY=50;var VSK_DRAG_DROP_SENSITIVITY=25;VSK_Node.prototype.drag_restore=function(){var id,N,DT;if(this.b.vskDropGroup){for(id in this.b.vskDropGroup){for(DT in VSK_DROP_TARGETS[id]){if(VSK_DROP_TARGETS[id][DT]==this){delete VSK_DROP_TARGETS[id][DT]}}}}if((id=this.b.vskDragGroup)){this.vsk_event_unset("mousedown","_priv_draginit");this.b.vskDragGroup=null;this.b.vskDropGroup=null;if(VSK_DRAG_NODE&&VSK_DRAG_NODE.b==this.b){VSK_DRAG_NODE=null;if((N=this.b.vskDragNode)){N.undock();this.b.vskDragNode=null}}}return this};VSK_Node.prototype.dropinit=function(groupId){var Node=this;if(!this.b.vskDropGroup){this.b.vskDropGroup={}}this.b.vskDropGroup[groupId]=true;this.b.vskDropSensitivity=VSK_DRAG_DROP_SENSITIVITY;if(!VSK_DROP_TARGETS[groupId]){VSK_DROP_TARGETS[groupId]=[]}VSK_DROP_TARGETS[groupId].push(this);return this};VSK_Node.prototype.dragprep=function(){if(!this.b.vskDragGroup){this.b.vskDragGroup={}}this.b.vskLastDragX=null;this.b.vskLastDragY=null;this.b.onselectstart=function(){return false};this.b.ondragstart=function(){return false}};VSK_Node.prototype.draginit=function(groupId,mode,type,lockX,lockY,keyMod,target,truePos){this.handle("mousedown").vsk_event_add("mousedown",function(Node,e){if(keyMod&&!ve(e||event).key_mod(keyMod)){return}if(target){var T=v(typeof target!="function"?target:target(Node))}else{var T=Node}T.dragprep();T.b.vskDragInitNode=Node;if(groupId&&typeof groupId.join=="undefined"){T.b.vskDragGroup[groupId]=true}else{if(groupId){for(n=0;n<groupId.length;n++){T.b.vskDragGroup[groupId[n]]=true}}}if(truePos){var coords={x:Node.abs_x(),y:Node.abs_y()}}else{var coords=ve(e||event).coords()}T.dragmode(true,mode,type,lockX,lockY,coords);ve(e||event).stop()},"_priv_draginit");return this};VSK_Node.prototype.drop=function(Target){var i,n,f=false;for(i in this.b.vskDragGroup){if(Target.b.vskDropGroup[i]){f=true;break}}if(!f){return this.dragcancel()}var InitNode=this.b.vskDragInitNode;InitNode.vsk_event_fire("dropped",Target);Target.vsk_event_fire("drop",InitNode);Target.vsk_event_fire("dropdeselect",InitNode);return this.dragmode(false)};VSK_Node.prototype.dragcancel=function(){switch(this.b.vskDragType){case 0:var P=this.b.vskDragParent;this.set_style_str(this.b.vskDragStyle).dock(P);break}this.dragmode(0)};VSK_Node.prototype.drag_x=function(){var N;if((N=this.b.vskDragNode)){return N.x()}else{return this.x()}};VSK_Node.prototype.drag_y=function(){var N;if((N=this.b.vskDragNode)){return N.y()}else{return this.y()}};VSK_Node.prototype.dragmode=function(b,mode,type,lockX,lockY,mouse){var Node=this;this.b.vskDrag=b;if(b){window.VSK_DRAG_NODE=this;this.b.vskDragType=type;this.b.vskDragMode=mode;this.b.vskDragParent=this.b.parentNode;this.b.vskDragStyle=this.style_str();if(!this.b.vskDragInitNode){this.b.vskDragInitNode=this}var IN=(this.b.vskDragInitNode.b==this.b);if(IN&&mode){switch(type){case 0:this.move(this.abs_x(),this.abs_y()).set_pos("absolute",VSK_DRAG_Z).dock(document.body);break;case 1:Node=v(this.b.cloneNode(1)).move(this.abs_x(),this.abs_y()).set_pos("absolute",VSK_DRAG_Z).dock(document.body);break;case 2:Node=v(vsk_h("div")).resize(this.w(),this.h()).move(this.abs_x(),this.abs_y()).level(VSK_DRAG_Z).dock(document.body);break}}else{if(IN){switch(type){case 1:Node=v(this.b.cloneNode(1)).move(this.x(),this.y()).level(VSK_DRAG_Z).dock(this.b.parentNode);break;case 2:Node=v(vsk_h("div")).resize(this.w(),this.h()).move(this.x(),this.y()).level(VSK_DRAG_Z).dock(this.b.parentNode);break}}else{Node.move(mouse.x,mouse.y).level(VSK_DRAG_Z).dock(document.body)}}this.b.vskDragInitNode.vsk_event_fire("dragstart",Node);if(type){Node.b.vskDrag=true;Node.b.vskLastDragX=null;Node.b.vskDragMode=mode;Node.b.vskDragSource=this;Node.b.vskDragGroup=this.b.vskDragGroup;this.b.vskDragNode=Node;Node.s.cursor=this.s.cursor;if(this.b.vskBBox){Node.b.vskBBox=this.b.vskBBox}}if(type==1){Node.fade(VSK_DRAG_SHADOW_TRANSPARENCY)}else{if(type==2){Node.set_style(VSK_DRAG_FRAME_STYLE).fade(VSK_DRAG_FRAME_TRANSPARENCY)}}v(document).event_add("mousemove",function(e){if(!Node.b.vskDrag){return}vsk_get_mouse(e||event);if(Node.b.vskLastDragY===null){Node.b.vskLastDragY=vskY}if(Node.b.vskLastDragX===null){Node.b.vskLastDragX=vskX}Node.move(lockX?null:(Node.x()-(Node.b.vskLastDragX-vskX)),lockY?null:(Node.y()-(Node.b.vskLastDragY-vskY)));if(type){var nX=Node.abs_x();var nY=Node.abs_y();if(Math.abs(nX-vskX)>10||Math.abs(nY-vskY)<10){Node.move(lockX?null:vskX-(nX-Node.x()),lockY?null:vskY-(nY-Node.y()))}}Node.b.vskLastDragX=vskX;Node.b.vskLastDragY=vskY;if(Node.b.vskDragMode){var i,Targets=VSK_DROP_TARGETS,T,o2,O=0,D;if(Node.b.vskDragSource){var S=Node.b.vskDragSource}else{var S=Node}var OD=S.b.vskDropNode;if(OD){O=Math.max(Node.touching(OD.b),OD.touching(Node.b))}var K,k;for(i in Node.b.vskDragGroup){if(Targets[i]){K=Targets[i];for(k in K){T=K[k];o=Math.max(Node.touching(T.b),T.touching(Node.b));if(o&&o>T.b.vskDropSensitivity&&(o>=O||(D&&T.has_parent(D.b))||(OD&&T.has_parent(OD.b))||(OD&&OD==T))){if(D&&D.has_parent(T.b)){continue}D=T;if(OD&&D!=OD){OD.vsk_event_fire("dropdeselect",S);D.vsk_event_fire("dropselect",S)}else{if(!OD){D.vsk_event_fire("dropselect",S)}}O=o}}}}if(OD&&!D){OD.vsk_event_fire("dropdeselect",S)}S.b.vskDropNode=D}ve(e||event).stop();var EventNode=(Node.b.vskDragSource||Node).b.vskDragInitNode;EventNode.vsk_event_fire("drag")},"drag")}else{window.VSK_DRAG_NODE=null;this.b.vskLastDragY=null;this.b.vskLastDragX=null;var DN;if((DN=this.b.vskDragNode)){this.b.vskDragNode=null;if(this.b.vskDragMode!=1&&!this.b.vskDropNode){this.move(DN.x(),DN.y())}DN.undock()}if(!this.b.vskDragInitNode){this.b.vskDragInitNode=this}this.b.vskDragInitNode.vsk_event_fire("dragstop");v(document).event_unset("mousemove","drag")}return this};VSK_Node.prototype.touching=function(Node){var T=v(Node);var mX=this.abs_x(),mY=this.abs_y(),mW=this.w(),mH=this.h(),mR=mX+mW,mB=mY+mH,tX=T.abs_x(),tY=T.abs_y(),tW=T.w(),tH=T.h(),tR=tW+tX,tB=tH+tY;var touchesH,touchesV;if(mX<=tX&&mR>=tR){touchesH=tW}else{if(mX<=tX&&mR<=tR&&mR>=tX){touchesH=mR-tX}else{if(mX>=tX&&mR>=tR&&mX<=tR){touchesH=tR-mX}else{if(mX>=tX&&mR<=tR){touchesH=mW}}}}if(!touchesH){return 0}if(mY<=tY&&mB>=tB){touchesV=tH}else{if(mY<=tY&&mB<=tB&&mB>=tY){touchesV=mB-tY}else{if(mY>=tY&&mB>=tB&&mY<=tB){touchesV=tB-mY}else{if(mY>=tY&&mB<=tB){touchesV=mH}}}}if(!touchesV){return 0}return(touchesV*touchesH)/((tH*tW)/100)};var VSK_SMNU_FX_TIME=200;function vsk_smnu_init(){var i,a;for(i=0;i<arguments.length;i++){a=arguments[i];if(V(a)){V(a).s.cursor="pointer"}else{continue}if(vsk_cookie_get("smnu_"+a)){V(a).vsk_smnu_collapse(true)}V(a).b.onmousedown=function(){if(this.vskSmnuStatus){v(this).vsk_smnu_expand()}else{v(this).vsk_smnu_collapse()}}}}var VSK_SMNU_FX_TIME=200;VSK_Node.prototype.vsk_smnu_collapse=function(noFX){var n=V(this.b.id+"_c");if(!n){return}n.s.overflow="hidden";n.b.vskSmnuSize=n.h();if(!noFX){n.fx_morph(n.w(),1,null,null,VSK_SMNU_FX_TIME).onhalt=function(){n.hide(1)}}else{n.hide(1).fx_morph(n.w(),1,null,null,1).onhalt=function(){n.hide(1)}}this.b.vskSmnuStatus=1;vsk_cookie_set("smnu_"+this.b.id,"1",1000*60*60*24*356)};VSK_Node.prototype.vsk_smnu_expand=function(){var n=V(this.b.id+"_c");if(!n||!n.b.vskSmnuSize){return}n.hide(0).fx_morph(n.w(),n.b.vskSmnuSize,null,null,VSK_SMNU_FX_TIME).onhalt=function(){n.s.height=""};this.b.vskSmnuStatus=null;vsk_cookie_set("smnu_"+this.b.id,"",-1000)};var VUI_NODE=1;var VUI_TYPES=[];var VUI_MANAGER_MAX_ID=1000000;VUI_IS_OPERA=(VSK_I.name=="Opera");VUI_IS_IE=(VSK_I.name=="MSIE");VUI_IS_FF=(VSK_I.name=="Firefox");VUI_IS_CHROME=(VSK_I.name=="Chrome");VSK_VEGUI={clone_prepare:{},clone:{}};function vsk_vegui_clone_prepare(id,prepare){VSK_VEGUI.clone_prepare[id]=prepare}function vsk_vegui_clone(id,clone){VSK_VEGUI.clone[id]=clone}function vui_element_add(type,Constructor){if(typeof VUI_TYPES[type]!="undefined"){alert("Duplicate vegUIElement Type: "+type)}VUI_TYPES[type]=Constructor}function vsk_clone(Obj){var i;if(!Obj){return}for(i in Obj){if(Obj[i]&&Obj[i].push){this[i]=vsk_clone_array(Obj[i])}else{if(typeof Obj[i]=="object"&&Obj[i]!=null){this[i]=new vsk_clone(Obj[i])}else{this[i]=Obj[i]}}}}function vsk_clone_array(Arr){if(!Arr||!Arr.push){if(typeof Arr=="object"){return new vsk_clone(Arr)}else{return Arr}}var newArr=[];var i;for(i in Arr){newArr[i]=vsk_clone_array(Arr[i])}return newArr}vui_element_add(VUI_NODE,VegUIElement);VSK_Node.prototype.get_child_node=function(name,deep){var i,C;if(!this.b){return null}if(this.b.id==name){return this.b}var cn=this.b.childNodes;for(i in cn){if(cn[i].id==name){return cn[i]}}if(!deep){return null}for(i in cn){if((C=v(cn[i]).get_child_node(name))){return C}}return null};VSK_Node.prototype.gan=function(name,dflt){var r;if((r=this.ga(name,null))!==null){return r.match(/^0\d+$/)?r:parseInt(r)}else{return dflt}};VSK_Node.prototype.gaf=function(name,dflt){var r;if((r=this.ga(name,null))!==null){return parseFloat(r)}else{return dflt}};VSK_Node.prototype.ghost=function(style){var Model=v(vsk_h("div")).move(this.abs_x(),this.abs_y()).resize(this.w(),this.h()).set_style(style).dock(document.body);return Model};function VegUIElement(Manager,Parent,htmlType){this.C=[];this.Parent=this.P=Parent;this.Manager=this.M=Manager;if(htmlType){this.htmlType=htmlType}if(Parent){this.Root=Parent.Root}else{this.Root=this}this.build();this.set_up()}VegUIElement.prototype=VSK_Node.prototype;VegUIElement.prototype.htmlType="div";VegUIElement.prototype.set_up=function(){if(!this.b){return this}this.vsk_event_add("resize",function(E){var i,C;for(i in E.C){C=E.C[i];if(C.s.right&&C.s.left){C.vsk_event_fire("resize")}}},"_priv_child_align");return this};VegUIElement.prototype.build=function(){var Node=vsk_h(this.htmlType);this.control(Node);this.set_pos("absolute").place(true);return Node};VegUIElement.prototype.place=function(onlyAsChild,toNode){this.vsk_event_fire("before_place");if(this.isTheme){return this.vsk_event_fire("place")}if(this.P&&this.P.b){this.dock(this.P.b)}else{if(toNode){this.dock(toNode)}else{if(document.body&&!onlyAsChild){this.dock(document.body)}}}this.vsk_event_fire("place");return this};VegUIElement.prototype.place_event=function(){var i;this.vsk_event_fire("place");for(i in this.C){this.C[i].place_event()}return};VegUIElement.prototype.clone_prepare=function(oldNode){var n,i,R=this.Root;for(n in oldNode){if(n.match(/^vsk_on/)){this.b[n]=new VegUIDynFunc();var OF=oldNode[n].Funcs;var NF=this.b[n].Funcs;b=false;for(i in OF){if(i.match(/^_priv/)||(R.isThemeing&&!i.match(/^(_theme)/))){NF[i]=OF[i];if(!b&&(m=n.match(/(mouse|key)(down|up|over|out|move)$/))){this.handle(m[1]+m[2]);b=true}}}}}if(this.Manager.VSK_VEGUI){var modules=this.Manager.VSK_VEGUI.clone_prepare;for(i in modules){modules[i](this.b,oldNode)}}return this};VegUIElement.prototype.clone_node__element=function(Node){var n,R=this.Root,MF,CF;for(n in Node){if(n.match(/^vsk_on/)&&Node[n]){if(!this.b[n]){this.b[n]=new VegUIDynFunc()}MF=this.b[n];var CF=Node[n];for(i in CF.Funcs){MF.Funcs[i]=CF.Funcs[i]}}else{if(n.match(/^on(mouse|key|blur)/)&&Node[n]){this.handle(n.replace(/^on/,""))}else{if(n.match(/^on(select|drag)/)&&Node[n]){this.b[n]=Node[n]}}}}if(this.Manager.VSK_VEGUI){var modules=this.Manager.VSK_VEGUI.clone;for(n in modules){modules[n](this.b,Node)}}return this};VegUIElement.prototype.clone_node=VegUIElement.prototype.clone_node__element;VegUIElement.prototype.clone__element=function(Element,b){var a=false;if(!Element||!Element.clone__element){return this}if(!b){var oldId=this.b.id;var oldNode=this.b;this.undock().control(Element.b.cloneNode(1)).clone_prepare(oldNode);if(this.type!=Element.type){this.set_style_str(v(oldNode).style_str());this.clone_node(oldNode)}this.clone_node(Element.b);if(oldId){this.b.id=oldId}}var i;for(i in Element.C){if(!this.C[i]){this.child(Element.C[i].type,i,Element.C[i].b.nodeName).undock()}var oldNode=this.C[i].b;if(!this.C[i].noCloneSelf){this.C[i].control(this.get_child_node(i)).clone_prepare(oldNode).clone_node(Element.C[i].b).clone(Element.C[i],true)}else{this.C[i].control(this.get_child_node(i)).undock().control(oldNode).place(1)}if(this.C[i].noCloneChildren){var n;this.C[i].clear();for(n=0;n<oldNode.childNodes.length;n++){this.C[i].html_a(oldNode.childNodes[n])}}}for(i in this.C){if(Element.type==this.type&&!Element.C[i]){delete this.C[i]}else{if(Element.type!=this.type){this.C[i].place(1)}}}this.b.vskBBox=new vsk_clone(Element.b.vskBBox);this.noCloneSelf=Element.noCloneSelf;this.noCloneChildren=Element.noCloneChildren;if(!b&&!this.isTheme){this.place(1)}this.vsk_event_fire("clone");return this};VegUIElement.prototype.clone=VegUIElement.prototype.clone__element;VegUIElement.prototype.child=function(type,name,htmlType){var E=this.Manager.element(type,null,this,htmlType);E.childName=E.b.id=name;this.C[name]=E;return E};VegUIElement.prototype.child_adopt=function(Child,name){if(Child.Parent){delete Child.Parent.C[Child.childName]}if(name){Child.childName=Child.b.id=name}Child.Parent=Child.P=this;this.C[Child.childName]=Child;Child.place(1);return this};VegUIElement.prototype.focus=function(b){var M=this.Manager;var E=M.focusedElement;if(M.preventFocus){return this}if(E&&E.b==this.b){return this}if(b&&E&&E.has_parent(this.b)){return this}if(E){E.lose_focus()}if(M.focusedElement&&M.focusedElement.b==this.b){return this}M.focusedElement=this;this.shiftFocus=true;return this.vsk_event_fire("focus")};VegUIElement.prototype.lose_focus=function(){var E=this.Manager.focusedElement;if(E&&E.b==this.b){this.Manager.focusedElement=null;this.vsk_event_fire("losefocus");this.shift_focus()}return this};VegUIElement.prototype.html_fill=function(path,ondone){var E=this;this.M.Bridge.send(path,null,"GET",function(){E.b.innerHTML=this.request.responseText;E.vsk_event_fire("fill");if(ondone){ondone()}})};VegUIElement.prototype.shift_focus=function(){if(this.Parent){if(this.Parent.shiftFocus){this.Parent.focus()}else{this.Parent.shift_focus()}}return this};VegUIElement.prototype.set_skin=function(childName){this.C[childName].vsk_event_add("style",function(Skin){var i;if(!VUI_IS_CHROME){for(i in Skin.s){if(i.match(/^(font|color)/)&&Skin.s[i]){Skin.Parent.s[i]=Skin.s[i]}}}else{var n;for(i=0;i<Skin.s.length;i++){if(Skin.s[i].match(/^(font|color)/)){Skin.Parent.s[Skin.s[i]]=Skin.s.getPropertyValue(Skin.s[i])}}}},"_priv_fontstyle");return this};VegUIElement.prototype.theme=function(themeName,themeType){var T,themeType=themeType||this.type;if(!(T=this.M.Themes[themeName])||!(T=T[themeType])){return false}this.isThemeing=true;this.clone(T);this.isThemeing=false;this.vsk_event_fire("theme");return this};VegUIElement.prototype.mousehweel=function(){return false};function VegUIManager(){this.E=[];this.Themes={};this.claimedKeys=[];this.preventFocus=false;if(typeof window.VSK_VEGUI!="undefined"){this.VSK_VEGUI=VSK_VEGUI}else{this.VSK_VEGUI=null}this.base=v(vsk_h("div"));this.onCreate=new VegUIDynFunc();var M=this;if(v(document.body).h()<vsk_ih()){v(document.body).span(0,0,0,0)}v(document.body).event_add("mouseup",function(e){if(M.focusedElement){M.focusedElement.vsk_event_fire("glb_mouseup",e)}});switch(VSK_I.name){case"MSIE":var eventName="mousewheel";var eventNode=document;break;case"Opera":var eventName="mousewheel";var eventNode=window;break;default:var eventNode=window;var eventName="DOMMouseScroll";break}v(eventNode).event_add(eventName,function(e){if(!e){var e=event}if(M.focusedElement&&M.focusedElement.mousewheel()){ve(e).stop();M.focusedElement.vsk_event_fire("glb_mousewheel",e)}});if(VSK_I.name=="Opera"){eventName="keypress"}else{eventName="keydown"}v(document).event_add(eventName,function(e){if(!e){var e=event}if(M.focusedElement&&M.claimedKeys[ve(e).key_code()]){ve(e).stop();M.focusedElement.vsk_event_fire("glb_keydown",e)}});v(document).event_add("keyup",function(e){if(!e){var e=event}if(M.focusedElement&&M.claimedKeys[ve(e).key_code()]){ve(e).stop();M.focusedElement.vsk_event_fire("glb_keyup",e)}});this.stopselect(0)}VegUIManager.prototype.clone=function(Template,name,Parent){return this.element(Template.type,name,Parent).clone(Template)};VegUIManager.prototype.element=function(type,name,Parent,htmlType){if(!name){var name=this.id()}if(this.E[name]||!VUI_TYPES[type]){return null}var Constructor=VUI_TYPES[type];var E=new Constructor(this,Parent,htmlType);E.type=type;this.E[name]=E;E.uniqueId=name;this.onCreate.execute(E);return E.vsk_event_fire("create")};VegUIManager.prototype.kill=function(Element){if(!Element){return this}delete this.E[Element.uniqueId];Element.undock();if(Element.Parent){delete Element.Parent.C[Element.childName]}Element.vsk_event_fire("kill");Element.b=null;return this};VegUIManager.prototype.error_alert=function(msg){alert(msg)};VegUIManager.prototype.id=function(){var id=vsk_rand(0,VUI_MANAGER_MAX_ID),i=0;while(this.E[id]&&i<=10000){id=vsk_rand(0,VUI_MANAGER_MAX_ID);i++}return(i==10000?null:id)};VegUIManager.prototype.claim_keys=function(keys){var i;for(i in keys){this.claimedKeys[keys[i]]=true}return this};VegUIManager.prototype.free_keys=function(keys){var i;for(i in keys){delete this.claimedKeys[keys[i]]}return this};VegUIManager.prototype.stopselect=function(b){if(b){document.body.onselectstart=function(){return false};document.onselectstart=function(){return false};document.body.ondragstart=function(){return false};document.body.onmousedown=function(){return false}}else{document.body.onselectstart=function(){return true};document.onselectstart=function(){return true};document.body.ondragstart=function(){return true};document.body.onmousedown=function(){return true}}};VegUIManager.prototype.theme=function(themeName){var i,n,E,C,T=this.Themes[themeName];if(!T){return this}for(i in this.E){E=this.E[i];if(!E.Parent&&!E.isTheme){E.theme(themeName)}}};VegUIManager.prototype.eval=function(js){eval(js)};VegUIManager.prototype.include=function(fileName,para,method){var M=this;this.Bridge.send(fileName,para,method,function(){M.eval(this.request.responseText)})};vsk_vegui_clone_prepare("drag",function(NewNode,OldNode){if(OldNode.vskDragGroup){NewNode.vskDragGroup=new vsk_clone(OldNode.vskDragGroup);v(NewNode).dragprep();NewNode.vskDragMode=OldNode.vskDragMode;NewNode.vskDragType=OldNode.vskDragType;if(OldNode.vskDragNode){NewNode.vskDragNode=OldNode.vskDragNode}}if(OldNode.vskDropGroup){NewNode.vskDropGroup=new vsk_clone(OldNode.vskDropGroup);NewNode.vskDropSensitivity=OldNode.vskDropSensitivity}});vsk_vegui_clone("drag",function(NewNode,CloneNode){if(CloneNode.vskDragGroup){NewNode.vskDragGroup=new vsk_clone(CloneNode.vskDragGroup);v(NewNode).dragprep()}});vsk_vegui_clone_prepare("cooltip",function(NewNode,OldNode){if(OldNode.vskCooltipContent){v(NewNode).cooltip_set(OldNode.vskCooltipContent,OldNode.vskCooltipPD)}});vsk_vegui_clone("drag",function(NewNode,CloneNode){if(CloneNode.vskCooltipContent){v(NewNode).cooltip_set(CloneNode.vskCooltipContent,CloneNode.vskCooltipPD)}});function vui_xml_style_prep(styleStr){var style;if(!styleStr.match(/^@/)){eval("style = {"+styleStr+"};")}else{return styleStr.substr(1,styleStr.length)}return style}VSK_Node.prototype.vui_xml_apply_node_attributes=function(xml){var N=v(xml),z=N.gan("z"),x=N.gan("x"),y=N.gan("y"),r=N.gan("r"),b=N.gan("b");if((style=N.ga("style"))){this.set_style(vui_xml_style_prep(style))}this.resize(N.gan("w"),N.gan("h"));if((!isNaN(x)&&!isNaN(r))||(!isNaN(b)&&!isNaN(y))){this.span(x,y,r,b)}else{this.move(x,y,r,b)}if(!isNaN(z)){this.level(z)}if((h=N.ga("handle"))){var events=h.split(",");for(i in events){this.handle(events[i])}}if((h=N.ga("pos"))){this.set_pos(h)}if((h=N.ga("css"))){this.b.className=h}if((h=vskpi(N.gan("hide")))){this.hide(h)}if((h=N.ga("dock"))){this.dock(V(h).b)}if((h=N.gan("fade"))){this.fade(h)}if((h=N.ga("href"))){this.set("href",h)}if(N.ga("name")){eval("window."+N.ga("name")+"=this;")}if(N.ga("text")){this.clear(vsk_t(N.ga("text")))}if((z=N.ga("events"))){var events=z.split("; "),match;for(i in events){match=events[i].split(".");eval("var func = "+match[1]+";");this.vsk_event_add(match[0],func)}}return this};VSK_Node.prototype.xml_build_node=function(xml){var i,C,c,length=xml.childNodes.length;for(i=0;i<length;i++){c=xml.childNodes[i];C=null;switch(c.nodeName){case"N":case"Node":C=v(vsk_h("div")).vui_xml_apply_node_attributes(c).dock(this.b);break;case"NI":case"NodeInline":C=v(vsk_h("span")).set_pos("relative").vui_xml_apply_node_attributes(c).dock(this.b);break;case"Img":case"Image":C=v(vsk_h("img")).vui_xml_apply_node_attributes(c).dock(this.b);C.b.src=v(c).ga("src");break;case"I":case"Input":type=v(c).ga("type");switch(type){case"password":case"text":C=v(vsk_h("input"));C.b.setAttribute("type",type);break;case"textarea":C=v(vsk_h("textarea"));break}C.vui_xml_apply_node_attributes(c).dock(this.b);break;case"bbox":case"BBox":var x=v(c).gan("x");var y=v(c).gan("y");var w=v(c).gan("w");var h=v(c).gan("h");this.bbox(x,y,w,h);break}if(C){C.xml_build_node(c)}}return this};VegUIElement.prototype.xml_build__element=function(xml,Parent){var i,c,type,C,childName,theme,N=v(xml),style;var oD=this.s.display;this.s.display="none";if((theme=N.ga("theme"))){if(N.ga("themeType")){eval("type = "+N.ga("themeType")+";")}else{type=this.type}if((theme=this.Manager.Themes[theme][type])){this.clone(theme)}}this.vui_xml_apply_node_attributes(xml);if(Parent){Parent.child_adopt(this,N.ga("childname"))}if((i=N.gan("noCloneChildren"))){this.noCloneChildren=i}if((i=N.gan("noCloneSelf"))){this.noCloneSelf=i}var length=xml.childNodes.length;for(i=0;i<length;i++){c=xml.childNodes[i];switch(c.nodeName){case"E":case"Element":type=c.getAttribute("type");if((childName=v(c).ga("childname"))&&this.C[childName]){C=this.C[childName].xml_build(c)}else{if(type){eval("type = "+type+";");if(!childName){C=this.Manager.element(type).xml_build(c,this)}else{C=this.child(type,childName).xml_build(c,this)}}}break;case"Html":case"HTML":var src=v(c).ga("src");if(src){this.html_fill(src)}break;case"Event":var func,id=v(c).ga("id",null);if((func=v(c).ga("function"))){eval("func = "+func+";");this.vsk_event_add(v(c).ga("type"),func,id)}break}}var R=this.xml_build_node(xml);this.s.display=oD;return R};VegUIElement.prototype.xml_build=VegUIElement.prototype.xml_build__element;VegUIElement.prototype.theme_q=function(theme,ondone){if(!this.Manager.ThemeQueue[theme]){this.Manager.ThemeQueue[theme]=[]}if(ondone){this.vsk_event_add("theme",ondone)}this.Manager.ThemeQueue[theme].push(this)};VegUIManager.prototype.ThemeQueue={};VegUIManager.prototype.xml_process=function(xml,arg){var i,c,length=xml.childNodes.length;for(i=0;i<length;i++){c=xml.childNodes[i];switch(c.nodeName){case"Theme":var themeId=c.getAttribute("id");this.xml_build_theme(themeId,c);break;case"Interface":this.xml_build_interface(c,arg);break}}return this};VegUIManager.prototype.xml_build_theme=function(id,xml){if(!this.Themes[id]){this.Themes[id]={}}var i,c,T=this.Themes[id],E,length=xml.childNodes.length;for(i=0;i<length;i++){c=xml.childNodes[i];switch(c.nodeName){case"E":case"Element":var type=c.getAttribute("type");if(type){eval("type = "+type+";");E=this.element(type).undock();E.isTheme=true;T[type]=E.xml_build(c)}break}}return this};VegUIManager.prototype.xml_build_interface__manager=function(xml){var i,c,E,length=xml.childNodes.length;var t1=new Date().getTime();for(i=0;i<length;i++){c=xml.childNodes[i];switch(c.nodeName){case"E":case"Element":var type=c.getAttribute("type");if(type){eval("type = "+type+";");E=this.element(type).undock().xml_build(c);if(E&&!E.b.parentNode){E.place()}}break;case"ApplyTheme":var T;if((T=v(c).ga("id"))){this.theme(T)}break}}vsk_dbg_print("Interface Time: "+(new Date().getTime()-t1));return this};VegUIManager.prototype.xml_build_interface=VegUIManager.prototype.xml_build_interface__manager;VegUIManager.prototype.xml_load=function(filePath,ondone,a,m){var M=this;this.Bridge.send(filePath,a,m||"GET",function(R){if(R.responseXML){M.xml_process(R.responseXML.firstChild,a)}if(ondone){ondone(R)}M.theme_queue_process();M.base.vsk_event_fire("theme_"+filePath)});return this};VegUIManager.prototype.theme_queue_process=function(){var theme,i,a;for(a in this.ThemeQueue){theme=this.ThemeQueue[a];for(i in theme){if(theme[i].theme(a)){delete this.ThemeQueue[a]}}}};var VUI_TEXTINPUT=14;var VUI_TEXTAREA=15;vui_element_add(VUI_TEXTINPUT,VegUITextInput);vui_element_add(VUI_TEXTAREA,VegUITextArea);function VegUITextInput(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent,"input")}VegUITextInput.prototype=new vsk_clone(VegUIElement.prototype);function VegUITextArea(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent,"textarea")}VegUITextArea.prototype=new vsk_clone(VegUIElement.prototype);VegUITextInput.prototype.xml_build__textinput=function(xml,Parent){this.xml_build__element(xml,Parent);var N=v(xml),i;if((i=N.ga("inputType"))){this.set("type",i)}return this};VegUITextInput.prototype.xml_build=VegUITextInput.prototype.xml_build__textinput;function VegUIAjax(){this.maxTimeouts=10;this.conTimeouts=0;this.sendNum=0;this.timeoutNum=0;this.successNum=0;this.denyRequests=false;this.resend=true}VegUIAjax.prototype.request=function(){var req;if(window.XMLHttpRequest){req=new XMLHttpRequest()}else{if(window.ActiveXObject){req=new ActiveXObject("Msxml2.XMLHTTP")}else{req=new ActiveXObject("Microsoft.XMLHTTP")}}if(!req){return null}return req};VegUIAjax.prototype.onmaxtimeouts=function(){return true};VegUIAjax.prototype.ontimeout=function(){return true};VegUIAjax.prototype.send=function(url,parameters,method,onreceive,sync){if(this.denyRequests){return this}var A=this,p="",i,R=this.request();if(!R){alert("VegUIAjax: Error -> Could not create XMLHttpRequest Object");return this}var method=method||"get";method=method.toUpperCase();if(parameters){for(i in parameters){p+=escape(i)+"="+escape(parameters[i])+"&"}}if(p.length>0){if(method=="GET"){url+="?"+p}}var timeSent=new Date().getTime();R.onreadystatechange=function(){switch(R.readyState){case 4:switch(R.status){case 200:A.successNum++;A.conTimeouts=0;if(onreceive){onreceive(R,new Date().getTime()-timeSent)}break;case 500:case 505:case 408:A.conTimeouts++;A.ontimeout(url,parameters,method,onreceive,sync);if(A.conTimeouts==A.maxTimeouts){A.onmaxtimeouts()}if(A.resend){A.send(url,parameters,method,onreceive,sync)}break}break}};if(sync){R.open(method,url)}else{R.open(method,url,true)}if(method=="POST"){R.setRequestHeader("Content-Type","application/x-www-form-urlencoded");R.send(p)}else{R.send(null)}this.sendNum++};VegUIManager.prototype.Bridge=new VegUIAjax();VegUIManager.prototype.ajax=VegUIManager.prototype.Bridge.send;var VUI_BUTTON=2;vui_element_add(VUI_BUTTON,VegUIButton);function VegUIButton(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.Skin=this.child(VUI_NODE,"Skin").level(0);this.Label=this.child(VUI_NODE,"Label").level(2);this.currentState="normal";this.States={};this.centerLabel=true;this.Skin.span(0,0,0,0);this.Label.span(0,0,0,0).set_style({textAlign:"center",whiteSpace:"nowrap",overflow:"hidden"});this.set_style({cursor:"pointer"});this.vsk_event_add("resize",function(Btn){Btn.Label.set_style({lineHeight:Btn.centerLabel?Btn.h()+"px":"normal"})},"_priv");var Btn=this;this.handle("mousedown").handle("mouseover").handle("mouseout");this.vsk_event_add("mousedown",function(Btn,e){Btn.focus();Btn.M.stopselect(1);Btn.state("pressed")},"_priv");this.vsk_event_add("mouseover",function(Btn,e){var rt=v(vsk_rel_target(e?e:event));if(!rt.has_parent(Btn.b)&&rt.b!=Btn.b&&Btn.state){Btn.state("hover")}},"_priv");this.vsk_event_add("mouseout",function(Btn,e){var rt=v(vsk_rel_target(e?e:event));if(!rt.has_parent(Btn.b)&&rt.b!=Btn.b&&Btn.state){Btn.state("normal")}},"_priv");this.vsk_event_add("glb_mouseup",function(Btn){Btn.M.stopselect(0);Btn.lose_focus();Btn.state("normal",true)},"_priv");this.set_skin("Skin")}VegUIButton.prototype=new vsk_clone(VegUIElement.prototype);VegUIButton.prototype.script=function(Func){this.vsk_event_add("mousedown",Func)};VegUIButton.prototype.clone__button=function(Button,b){if(Button&&Button.type==this.type){this.States=new vsk_clone(Button.States);this.captionText=Button.captionText;this.currentState=Button.currentState;this.centerLabel=Button.centerLabel}return this.clone__element(Button,b)};VegUIButton.prototype.clone=VegUIButton.prototype.clone__button;VegUIButton.prototype.caption=function(caption){this.Label.clear(vsk_t(caption));this.captionText=caption;return this};VegUIButton.prototype.state=function(state,force){if(state=="normal"&&this.currentState=="pressed"&&!force){return this}if(!this.States.normal){this.States.normal={SkinNode:this.Skin.b.cloneNode(1),font:this.s.font,fontColor:this.s.color}}if(this.States[state]){var S=this.States[state];this.currentState=state;if(S.Skin){S.Skin(this.Skin)}else{if(S.SkinNode){this.Skin.undock().control(S.SkinNode.cloneNode(1)).place()}}if(S.font){this.set_style({font:S.font})}if(S.fontColor){this.set_style({color:S.fontColor})}}return this};VegUIButton.prototype.xml_build__button=function(xml,Parent){this.xml_build__element(xml,Parent);var N=v(xml),i;var caption=N.ga("caption");if(caption){this.caption(caption)}if((i=N.gan("centerLabel"))){this.centerLabel=i}for(i=0;i<xml.childNodes.length;i++){c=xml.childNodes[i];switch(c.nodeName){case"State":type=c.getAttribute("type");eval("var skinFunction = "+v(c).ga("skin")+";");this.States[type]={Skin:skinFunction};break}}return this};VegUIButton.prototype.xml_build=VegUIButton.prototype.xml_build__button;var VUI_CHECKBOX=9;vui_element_add(VUI_CHECKBOX,VegUICheckBox);function VegUICheckBox(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.CheckBox=this.child(VUI_NODE,"CheckBox");this.Label=this.child(VUI_NODE,"Label");this.Skin=this.child(VUI_NODE,"Skin");this.styleChecked={};this.styleUnchecked={};this.isChecked=false;this.set_style({cursor:"pointer"});this.Skin.span(0,0,0,0).level(0);this.CheckBox.move(0,0).resize(15,15).level(2);this.Label.span(15,0,0,0).level(1).set_style({overflow:"hidden",whiteSpace:"nowrap"});this.vsk_event_add("resize",function(CB){CB.Label.s.lineHeight=CB.h()+"px"},"_priv");this.handle("mousedown").vsk_event_add("mousedown",function(CB,e){CB.focus().check().Manager.stopselect(1)},"_priv");this.vsk_event_add("glb_mouseup",function(CB,e){CB.lose_focus().Manager.stopselect(0)},"_priv");this.vsk_event_add("before_place",function(CB){CB.check(CB.isChecked).vsk_event_fire("resize")},"_priv");this.set_skin("Skin");this.check(0);this.clone=this.clone__checkbox}VegUICheckBox.prototype=new vsk_clone(VegUIElement.prototype);VegUICheckBox.prototype.label=function(label){this.Label.clear(vsk_t(label));return this};VegUICheckBox.prototype.check=function(b){if(typeof b=="undefined"){var b=this.isChecked?0:1}this.isChecked=b;if(b){this.CheckBox.set_style(this.styleChecked)}else{this.CheckBox.set_style(this.styleUnchecked)}return this.vsk_event_fire("change",b)};VegUICheckBox.prototype.clone__checkbox=function(CheckBox,b){this.clone__element(CheckBox,b);if(this.type==CheckBox.type){this.styleChecked=new vsk_clone(CheckBox.styleChecked);this.styleUnchecked=new vsk_clone(CheckBox.styleUnchecked);this.check(CheckBox.isChecked)}return this};VegUICheckBox.prototype.xml_build__checkbox=function(xml,Parent){this.xml_build__element(xml,Parent);N=v(xml);var caption=N.ga("caption");var styleChecked=N.ga("styleChecked");var styleUnchecked=N.ga("styleUnchecked");if(caption){this.label(caption)}if(styleChecked){eval("this.styleChecked = {"+styleChecked+"}")}if(styleUnchecked){eval("this.styleUnchecked = {"+styleUnchecked+"}")}if(N.gan("check")==1){this.check(true)}return this};VegUICheckBox.prototype.xml_build=VegUICheckBox.prototype.xml_build__checkbox;var VUI_CBOX=3;var VUI_SCROLL_BAR=4;vui_element_add(VUI_CBOX,VegUIContentBox);vui_element_add(VUI_SCROLL_BAR,VegUIScrollBar);function VegUIContentBox(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.adjustContentWidth=false;this.ContentFrame=this.child(VUI_NODE,"ContentFrame");this.Content=this.ContentFrame.child(VUI_NODE,"Content");this.Skin=this.child(VUI_NODE,"Skin");this.ScrollY=this.child(VUI_SCROLL_BAR,"ScrollY");this.ScrollX=this.child(VUI_SCROLL_BAR,"ScrollX");this.Content.noCloneChildren=true;this.ContentFrame.span(0,0,15,15).level(1).set_style({overflow:"hidden"});this.Skin.span(0,0,15,15);this.Content.move(0,0).level(1);this.ScrollY.set_type("y");this.ScrollX.set_type("x");this.handle("mouseover").vsk_event_add("mouseover",function(CBox,e){var rt=v(vsk_rel_target(e));if(!rt.has_parent(CBox.b)&&rt.b!=CBox.b){CBox.focus(true)}},"_priv");this.handle("mouseout").vsk_event_add("mouseout",function(CBox,e){var rt=v(vsk_rel_target(e));if(!rt.has_parent(CBox.b)&&rt.b!=CBox.b){CBox.lose_focus()}},"_priv");this.vsk_event_add("focus",function(CBox,e){CBox.M.claim_keys([37,38,39,40])},"_priv");this.vsk_event_add("losefocus",function(CBox,e){CBox.M.free_keys([37,38,39,40])},"_priv");this.vsk_event_add("glb_keydown",function(CBox,e){switch(ve(e).key_code()){case 37:CBox.ScrollX.scroll(1,3);break;case 38:CBox.ScrollY.scroll(1,3);break;case 39:CBox.ScrollX.scroll(2,3);break;case 40:CBox.ScrollY.scroll(2,3);break}},"_priv");this.vsk_event_add("glb_mousewheel",function(CBox,e){var delta=ve(e).delta();if(CBox.ScrollY.overflow()){if(delta>0){CBox.ScrollY.scroll(1,3)}else{if(delta<0){CBox.ScrollY.scroll(2,3)}}}},"_priv");this.vsk_event_add("resize",function(CBox,e){if(CBox.b.parentNode){CBox.ScrollX.align().sync();CBox.ScrollY.align().sync()}},"_priv");this.vsk_event_add("place",function(CBox,e){CBox.ScrollX.link(CBox);CBox.ScrollY.link(CBox)},"_priv");this.clone=this.clone__cbox}VegUIContentBox.prototype=new vsk_clone(VegUIElement.prototype);VegUIContentBox.prototype.clone__cbox=function(CBox,b){this.clone__element(CBox,b);if(CBox.clone__cbox){this.ScrollY.link(this);this.ScrollX.link(this)}return this};VegUIContentBox.prototype.fill=function(Node){this.Content.clear(Node);this.ScrollY.align().sync();this.ScrollX.align().sync();return this};VegUIContentBox.prototype.fill_r=function(path,ondone){if(!this.M.Bridge){return this}var CB=this;this.M.Bridge.send(path,null,"GET",function(R){CB.Content.b.innerHTML=R.responseText;CB.ScrollX.align().sync();CB.ScrollY.align().sync();if(ondone){ondone()}});return this};VegUIContentBox.prototype.mousewheel=function(){return this.ScrollY.overflow()};function VegUIScrollBar(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.scrollType="y";this.scrollSpeed=20;this.scrollStep=8;this.Btn1=this.child(VUI_BUTTON,"Btn1").level(1);this.Btn2=this.child(VUI_BUTTON,"Btn2").level(1);this.Btn3=this.child(VUI_BUTTON,"Btn3").level(1);this.Skin=this.child(VUI_NODE,"Skin");this.Skin.span(0,0,0,0);this.set_style({overflow:"hidden"});var Scroll=this;this.Btn3.vsk_event_add("resize",function(Btn){if(!Btn.oh){Btn.oh=Btn.h();Btn.ow=Btn.w()}},"_priv_scroll");this.Btn1.vsk_event_add("resize",function(Btn){Btn.Parent.align()},"_priv_scroll");this.Btn3.vsk_event_add("drag",function(Btn){Btn.Parent.sync_r()},"_priv_scroll");this.Btn3.draginit(0,0,0);this.Btn1.vsk_event_add("mousedown",function(Btn){Btn.Parent.autoscroll(true,1)},"_priv_scroll");this.Btn2.vsk_event_add("mousedown",function(Btn){Btn.Parent.autoscroll(true,2)},"_priv_scroll");this.Btn1.vsk_event_add("glb_mouseup",function(Btn){Btn.Parent.autoscroll(false)},"_priv_scroll");this.Btn2.vsk_event_add("glb_mouseup",function(Btn){Btn.Parent.autoscroll(false)},"_priv_scroll");this.clone=this.clone__scroll}VegUIScrollBar.prototype=new vsk_clone(VegUIElement.prototype);VegUIScrollBar.prototype.clone__scroll=function(Scroll,b){this.clone__element(Scroll,b);if(Scroll&&Scroll.type==this.type){this.scrollStep=Scroll.scrollStep;this.scrollSpeed=Scroll.scrollSpeed;this.Btn3.oh=Scroll.Btn3.oh;this.Btn3.ow=Scroll.Btn3.ow;this.set_type(Scroll.scrollType)}return this};VegUIScrollBar.prototype.set_type=function(type){switch(type){case"x":this.Btn2.move(null,0,0);this.Btn3.draginit(0,0,0,0,1);break;case"y":this.Btn2.move(0,null,null,0);this.Btn3.draginit(0,0,0,1);break;default:return this}this.Btn1.move(0,0);this.scrollType=type;this.align().sync();return this};VegUIScrollBar.prototype.align=function(){var CBox=this.CBox;var Scroll=this;if(this.CBox){if(this.CBox==this.Parent){switch(this.scrollType){case"y":if(typeof _DEBUG!="undefined"&&_DEBUG){vsk_dbg_print(CBox.Skin.h())}this.move(null,0,0).resize(null,CBox.Skin.h());if(this.w()){this.Btn3.bbox(0,this.Btn1.h(),this.w(),this.asa())}break;case"x":this.move(0,null,null,0).resize(CBox.Skin.w(),null);if(this.h()){this.Btn3.bbox(this.Btn1.w(),0,this.asa(),this.h())}break}}if(this.scrollType=="y"){this.resize(this.Btn1.w())}else{this.resize(null,this.Btn1.h())}var C=CBox.Content;var F=CBox.ContentFrame;var yDiff=C.h()-F.h();var xDiff=C.w()-F.w();if(xDiff<1){xDiff=0}if(yDiff<1){yDiff=0}C.bbox((0-xDiff)-5,(0-yDiff)-5,F.w()+(xDiff*2)+5,F.h()+(yDiff*2)+5)}return this};VegUIScrollBar.prototype.link=function(CBox){this.CBox=CBox;var Scroll=this;switch(this.scrollType){case"y":CBox.Content.vsk_event_add("bumped_u",function(){Scroll.autoscroll(false)},this.uniqueId+"_bumped_u");CBox.Content.vsk_event_add("bumped_d",function(){Scroll.autoscroll(false)},this.uniqueId+"_bumped_d");break;case"x":CBox.Content.vsk_event_add("bumped_l",function(){Scroll.autoscroll(false)},this.uniqueId+"_bumped_l");CBox.Content.vsk_event_add("bumped_r",function(){Scroll.autoscroll(false)},this.uniqueId+"_bumped_r");break}this.align().sync();return this};VegUIScrollBar.prototype.asa=function(){return(this.scrollType=="y"?(this.h()-this.Btn1.h()-this.Btn2.h()):(this.w()-this.Btn1.w()-this.Btn2.w()))};VegUIScrollBar.prototype.overflow=function(){if(!this.CBox){return 0}var r=(this.scrollType=="y"?(this.CBox.Content.h()/this.CBox.ContentFrame.h()):(this.CBox.Content.w()/this.CBox.ContentFrame.w()));if(isNaN(r)){r=0}return(r<1?0:r)};VegUIScrollBar.prototype.scroll=function(dir,m){if(!this.CBox){return this}var CBox=this.CBox;var Content=CBox.Content;var CFrame=CBox.ContentFrame;if(!m){var m=1}switch(this.scrollType){case"y":switch(dir){case 1:if(Content.y()<0){Content.move(null,Content.y()+this.scrollStep*m)}break;case 2:Content.move(null,Content.y()-this.scrollStep*m);break}break;case"x":switch(dir){case 1:if(Content.x()<0){Content.move(Content.x()+this.scrollStep*m,null)}break;case 2:Content.move(Content.x()-this.scrollStep*m,null);break}break}this.sync()};VegUIScrollBar.prototype.autoscroll=function(b,dir){if(b){this.autoscroll(false);var Scroll=this;this.scrollTimer=setInterval(function(){Scroll.scroll(dir)},this.scrollSpeed)}else{clearInterval(this.scrollTimer);this.scrollTimer=null}return this};VegUIScrollBar.prototype.sync_r=function(){var CBox=this.CBox;var C=CBox.Content;var F=CBox.ContentFrame;if(this.scrollType=="y"){var posBar=(this.Btn3.y()-this.Btn1.h())/((this.asa()-this.Btn3.h())/100);var mod=-(((C.h()-F.h())/100)*posBar);C.move(null,mod)}else{var posBar=(this.Btn3.x()-this.Btn1.w())/((this.asa()-this.Btn3.w())/100);var mod=-(((C.w()-F.w())/100)*posBar);C.move(mod,null)}return this};VegUIScrollBar.prototype.sync=function(){if(!this.CBox){var overflow=0}else{var asa=this.asa();var overflow=this.overflow();var Content=this.CBox.Content;var CFrame=this.CBox.ContentFrame}switch(this.scrollType){case"y":if(!overflow){this.Btn3.bbox_tgl(0).move(0,this.Btn1.h()).resize(this.Btn3.ow,asa).bbox_tgl(1);if(this.CBox){this.CBox.Content.move(null,0)}}else{var f=(asa/overflow);if(f>=this.Btn3.oh){this.Btn3.resize(this.Btn3.ow,f)}else{this.Btn3.resize(this.Btn3.ow,this.Btn3.oh)}var covBar=this.Btn3.h()/(asa/100);var covCon=CFrame.h()/(Content.h()/100);if(covBar>covCon){var covDiff=1-(Math.abs(covBar-covCon)/100)}else{var covDiff=1+(Math.abs(covBar-covCon)/100)}var n=Math.abs(Content.y())/(Content.h()/100);var mod=((asa/100)*(n*covDiff))+this.Btn1.h();this.Btn3.move(0,mod)}break;case"x":if(!overflow){if(this.CBox){this.CBox.Content.move(0,null)}this.Btn3.bbox_tgl(0).move(this.Btn1.w(),0).resize(asa,this.Btn3.oh).bbox_tgl(1)}else{var f=(asa/overflow);if(f>=this.Btn3.ow){this.Btn3.resize(f,this.Btn3.oh)}else{this.Btn3.resize(this.Btn3.ow,this.Btn3.oh)}var covBar=this.Btn3.w()/(asa/100);var covCon=CFrame.w()/(Content.w()/100);if(covBar>covCon){var covDiff=1-(Math.abs(covBar-covCon)/100)}else{var covDiff=1+(Math.abs(covBar-covCon)/100)}var n=Math.abs(Content.x())/(Content.w()/100);var mod=((asa/100)*(n*covDiff))+this.Btn1.w();this.Btn3.move(mod,0)}break}if(VUI_IS_OPERA){this.undock().place()}return this};VegUIScrollBar.prototype.xml_build__scroll=function(xml,Parent){this.xml_build__element(xml,Parent);N=v(xml);var scrollType=N.ga("scrollType");var scrollSpeed=N.ga("speed");var scrollStep=N.ga("step");if(scrollType){this.set_type(scrollType).Btn1.vsk_event_fire("resize")}if(scrollSpeed){this.scrollSpeed=scrollSpeed}if(scrollStep){this.scrollStep=scrollStep}return this};VegUIScrollBar.prototype.xml_build=VegUIScrollBar.prototype.xml_build__scroll;var VUI_LISTTYPE_SINGLE=1;var VUI_LISTTYPE_MULTI=2;var VUI_LIST=5;var VUI_DROPDOWN_LIST=6;vui_element_add(VUI_LIST,VegUIList);vui_element_add(VUI_DROPDOWN_LIST,VegUIDropDownList);function VegUIList(Manager,Parent){this.constructor=VegUIContentBox;this.constructor(Manager,Parent);this.Items={};this.Selected={};this.listType=VUI_LISTTYPE_SINGLE;this.itemStyleHover={};this.itemStyleSelected={};this.itemStyleNormal={};this.itemStyleSelectedHover={};this.multiSelectStart=null;this.multiSelectStop=null;this.adjustContentWidth=true;this.ScrollX.vsk_event_add("place",function(ScrollX){ScrollX.hide(1)},"_priv_list");this.vsk_event_add("place",function(List){List.adjust()},"_priv");this.clone=this.clone__list}VegUIList.prototype=new vsk_clone(VegUIContentBox.prototype);VegUIList.prototype.clone__list=function(List,b){this.clone__cbox(List,b);if(List.clone__list){this.listType=List.listType;this.adjustContentWidth=List.adjustContentWidth;this.flush();this.Content.move(0,0);this.adjust();this.itemStyleNormal=List.itemStyleNormal;this.itemStyleHover=List.itemStyleHover;this.itemStyleSelected=List.itemStyleSelected;this.itemStyleSelectedHover=List.itemStyleSelectedHover}return this};VegUIList.prototype.item_add=function(Node,id,noAdjust,onBeforeClick){var List=this;this.item_delete(id);var Item=v(vsk_h("div")).resize(this.ContentFrame.w()).set_pos("relative");Item.b.vskListId=id;Item.set_style({right:"0px",cursor:"pointer"}).set_style(this.itemStyleNormal);Item.handle("mouseout").handle("mousedown").handle("mouseup").handle("mouseover");Item.vsk_event_add("mousedown",function(Item,e){ve(e).stop();if(typeof onBeforeClick=="function"){onBeforeClick((List.value()==Item.b.vskListId),List,Item)}if(ve(e).key_mod("shift")){if(List.multiSelectStart!==null){vsk_dbg_print(List.multiSelectStart);List.multiSelectEnd=Item.b.vskListId;List.select_range(List.multiSelectStart,List.multiSelectEnd);List.multiSelectStart=null;return}}if(List.listType==VUI_LISTTYPE_MULTI){List.multiSelectStart=Item.b.vskListId;List.hoverSelect=true}if(!List.Selected[Item.b.vskListId]){List.select_item(Item.b.vskListId,ve(e).key_mod("ctrl"))}else{if(List.listType!=VUI_LISTTYPE_MULTI||ve(e).key_mod("ctrl")){List.deselect_item(Item.b.vskListId)}else{List.select_item(Item.b.vskListId)}}});Item.vsk_event_add("mouseover",function(Item,e){if(ve(e||event).rt_valid()){if(!List.Selected[Item.b.vskListId]){if(List.hoverSelect){List.select_item(Item.b.vskListId,true)}else{Item.set_style(List.itemStyleHover)}}else{Item.set_style(List.itemStyleSelectedHover)}}});Item.vsk_event_add("mouseout",function(Item,e){if(ve(e||event).rt_valid()){if(!List.Selected[Item.b.vskListId]){Item.set_style(List.itemStyleNormal)}else{Item.set_style(List.itemStyleSelected)}}});Item.vsk_event_add("mouseup",function(Item,e){if(List.listType==VUI_LISTTYPE_MULTI){List.hoverSelect=false}});v(Node).dock(Item.b);Item.dock(this.Content.b);if(!noAdjust){this.adjust()}this.Items[id]=Item;return this};VegUIList.prototype.select_item=function(id,multi,noOnChange){if(this.Items[id]){if(this.listType!=VUI_LISTTYPE_MULTI||!multi){this.deselect()}var I=this.Items[id];I.set_style(this.itemStyleSelected);this.Selected[id]=true;if(!noOnChange){this.vsk_event_fire("change")}}return this};VegUIList.prototype.select_range=function(idStart,idEnd){var id2=Math.max(idStart,idEnd);var id1=Math.min(idStart,idEnd);var i,b=false;this.deselect();for(i in this.Items){if(i==id1){b=true}if(b){this.select_item(i,true)}if(i==id2){break}}return this};VegUIList.prototype.value=function(){var i;for(i in this.Selected){return i}};VegUIList.prototype.set_type=function(type){this.listType=type};VegUIList.prototype.deselect_item=function(id){if(this.Selected[id]&&this.Items[id]){var I=this.Items[id];I.set_style(this.itemStyleNormal)}delete this.Selected[id];return this};VegUIList.prototype.item_add_txt=function(text,id,noAdjust,onBeforeClick){return this.item_add(vsk_t(text),id,noAdjust,onBeforeClick)};VegUIList.prototype.adjust=function(){this.Content.span(0,null,0);this.ScrollY.link(this);return this};VegUIList.prototype.item_delete=function(id){if(this.Items[id]){v(this.Items[id].undock());delete this.Items[id]}if(this.Selected[id]){delete this.Selected[id]}this.ScrollY.align().sync();return this};VegUIList.prototype.deselect=function(){var i;for(i in this.Selected){this.deselect_item(i)}return this};VegUIList.prototype.flush=function(){this.Content.clear();this.Items={};this.Selected={};this.adjust();return this};VegUIList.prototype.to_string=function(){var i,a=[];for(i in this.Selected){a.push(i)}return a.join()};VegUIList.prototype.warp=function(id){if(this.Items[id]){var I=this.Items[id];var yD=I.y()+this.Content.y(),d;if((yD+I.h())>this.ContentFrame.h()){var toY=-(I.y2()-this.ContentFrame.h());this.Content.move(null,toY)}this.ScrollY.sync()}return this};function VegUIDropDownList(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.BtnOpen=this.child(VUI_BUTTON,"BtnOpen");this.Label=this.child(VUI_NODE,"Label");this.List=this.child(VUI_LIST,"List");this.BtnOpen.vsk_event_add("resize",function(Btn){var DL=Btn.Parent;DL.resize(null,Btn.h());DL.Label.resize(null,DL.Label.h()?null:Btn.h()).span(0,0,Btn.w());DL.List.span(0,Btn.h(),0)},"_priv_ddlist");this.vsk_event_add("place",function(DL){DL.List.set_style({width:""});DL.resize(null,DL.BtnOpen.h());DL.List.span(0,DL.BtnOpen.h(),0)},"_priv");this.vsk_event_add("before_place",function(DL){DL.List.set_type(VUI_LISTTYPE_SINGLE);DL.close()},"_priv");this.List.vsk_event_add("change",function(List){var DL=List.Parent;var I=List.Items[List.value()];DL.Label.b.innerHTML=I.b.innerHTML;DL.close()},"_priv_dd");this.BtnOpen.script(function(Btn){var DL=Btn.Parent;DL.isOpen?DL.close():DL.open()});this.BtnOpen.move(null,0,0)}VegUIDropDownList.prototype=new vsk_clone(VegUIElement.prototype);VegUIDropDownList.prototype.close=function(){this.List.hide(1);this.isOpen=false};VegUIDropDownList.prototype.open=function(){this.List.hide(0);this.isOpen=true};VegUIDropDownList.prototype.flush=function(){this.List.flush()};VegUIList.prototype.xml_build__list=function(xml,Parent){this.xml_build__element(xml,Parent);var N=v(xml);var listType=N.ga("listType");var styleHover=N.ga("styleHover");var styleNormal=N.ga("styleNormal");var styleSelected=N.ga("styleSelected");var styleSelectedHover=N.ga("styleSelectedHover");if(listType){this.set_type(listType)}if(styleHover){this.itemStyleHover=vui_xml_style_prep(styleHover)}if(styleNormal){this.itemStyleNormal=vui_xml_style_prep(styleNormal)}if(styleSelected){this.itemStyleSelected=vui_xml_style_prep(styleSelected)}if(styleSelectedHover){this.itemStyleSelectedHover=vui_xml_style_prep(styleSelectedHover)}for(i=0;i<xml.childNodes.length;i++){c=xml.childNodes[i];switch(c.nodeName){case"Item":var itemValue=v(c).ga("value");this.item_add_txt(v(c).ga("text")||null,v(c).ga("value"));this.Items[itemValue].xml_build_node(c);break}}return this};VegUIList.prototype.xml_build=VegUIList.prototype.xml_build__list;VegUIDropDownList.prototype.xml_build__ddlist=function(xml){this.xml_build__element(xml);return this};VegUIDropDownList.prototype.xml_build=VegUIDropDownList.prototype.xml_build__ddlist;var VUI_MENU=11;vui_element_add(VUI_MENU,VegUIMenu);function VegUIMenu(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.Skin=this.child(VUI_NODE,"Skin");this.Container=this.child(VUI_NODE,"Container");this.I=[];this.NextMenu=null;this.PrevMenu=null;this.RootMenu=this;this.ChildMenus=[];this.nestedIndicator=null;this.itemStyleNormal={};this.itemStyleHover={};this.itemStyleOpen={};this.nestedOffset=-5;this.closeTime=1000;this.CloseTimer=0;this.Friends={};this.fxType="morph";this.fxSpeed=200;this.iconWidth=25;this.iconHeight=25;this.Skin.span(0,0,0,0);this.Container.span(0,0,0).set_pos("relative");this.hide(1).set_style({overflow:"hidden"});this.set_skin("Skin");this.handle("mouseover").vsk_event_add("mouseover",function(Menu,e){var E=ve(e||event);if(E.rt_valid(Menu.b)){Menu.mouseIn=true}},"_priv");this.handle("mouseout").vsk_event_add("mouseout",function(Menu,e){var E=ve(e||event);if(E.rt_valid(Menu.b)){Menu.mouseIn=false;Menu.close_start()}},"_priv");this.clone=this.clone__menu}VegUIMenu.prototype=new vsk_clone(VegUIElement.prototype);VegUIMenu.prototype.clone__menu=function(Menu){this.clone__element(Menu);if(Menu.clone__menu){this.itemStyleHover=new vsk_clone(Menu.itemStyleHover);this.itemStyleNormal=new vsk_clone(Menu.itemStyleNormal);this.itemStyleOpen=new vsk_clone(Menu.itemStyleOpen);this.nestedIndicator=Menu.nestedIndicator;this.nestedOffset=Menu.nestedOffset;this.closeTime=Menu.closeTime;this.fxType=Menu.fxType;this.fxSpeed=Menu.fxSpeed;this.I=[];this.Container.clear()}return this};VegUIMenu.prototype.add_item=function(caption,script,icon,value){var I=v(vsk_h("div")).set_style(this.itemStyleNormal).set_pos("relative");if(icon){I.html_a(v(vsk_h("img")).set_style({verticalAlign:"middle"}).set("src",icon).resize(this.iconWidth,this.iconHeight).b);I.html_a(vsk_t(" "))}I.html_a(vsk_t(caption));var Menu=this;this.Container.html_a(I.b);this.I.push(I);I.b.vskMenuIndex=this.I.length-1;I.b.vskMenuValue=value;I.s.cursor="pointer";I.event_add("mouseover",function(e){var E=ve(e||event);if(E.rt_valid(I.b)){Menu.mouseIn=true;Menu.RootMenu.close();if(Menu.ChildMenus[I.b.vskMenuIndex]){Menu.open_child(I.b.vskMenuIndex)}I.set_style(Menu.itemStyleHover)}});I.event_add("mouseout",function(e){var E=ve(e||event);if(E.rt_valid(I.b)){if(Menu.NextMenu&&Menu.NextMenu.menuIndex==I.b.vskMenuIndex){I.set_style(Menu.itemStyleOpen)}else{I.set_style(Menu.itemStyleNormal)}}});I.event_add("mousedown",function(e){script(Menu,I,value)});return this};VegUIMenu.prototype.open_child=function(itemIndex){var SubMenu;if((SubMenu=this.ChildMenus[itemIndex])){SubMenu.dock(this.b.parentNode).move(this.x2()+this.nestedOffset,this.I[itemIndex].abs_y());SubMenu.level(this.z()+1);if(SubMenu.fx_morph&&SubMenu.fxType=="morph"){var w=SubMenu.w(),h=SubMenu.h();SubMenu.resize(1,1).hide(0).fx_morph(w,h,SubMenu.x(),SubMenu.y(),SubMenu.fxSpeed)}else{if(SubMenu.fx_fade_in&&SubMenu.fxType=="fade"){SubMenu.hide(0).fade(1).fx_fade_in(SubMenu.fxSpeed)}else{SubMenu.hide(0)}}this.close_stop();this.NextMenu=SubMenu}return this};VegUIMenu.prototype.close_start=function(){var Menu=this;if(this.RootMenu.CloseTimer){this.close_stop()}this.RootMenu.CloseTimer=setTimeout(function(){Menu.RootMenu.close()},this.closeTime);return this};VegUIMenu.prototype.close_stop=function(){if(this.RootMenu.CloseTimer){this.RootMenu.CloseTimer=clearTimeout(this.RootMenu.CloseTimer);this.RootMenu.CloseTiemr=null}return this};VegUIMenu.prototype.close=function(force){var M,i;if((M=this.tail())){while(M){if(!M.mouseIn||force){M.hide(1)}else{return this}M=M.PrevMenu;if(M){M.I[M.NextMenu.menuIndex].set_style(M.itemStyleNormal);M.NextMenu=null}}}return this};VegUIMenu.prototype.tail=function(){if(this.NextMenu){var i=this.NextMenu,M;while(i){M=i;i=i.NextMenu}return M}return this};VegUIMenu.prototype.submenu=function(itemIndex){if(!this.I[itemIndex]){return null}var SubMenu=this.Manager.clone(this).hide(1).link(this,itemIndex);return SubMenu};VegUIMenu.prototype.link=function(Menu,itemIndex){if(!Menu.I[itemIndex]){return null}this.PrevMenu=Menu;this.RootMenu=Menu.RootMenu;this.menuIndex=itemIndex;Menu.ChildMenus[itemIndex]=this;if(Menu.nestedIndicator){var I=Menu.I[itemIndex];var Gfx=v(vsk_h("img")).set_style({verticalAlign:"middle"}).move(null,null,0);Gfx.b.src=Menu.nestedIndicator;Gfx.dock(I.b)}this.dock(Menu.b.parentNode);return this};VegUIMenu.prototype.popup=function(E,xAlign,yAlign,xOffset,yOffset){this.dock(E.b.parentNode);var x=xOffset||0;var y=yOffset||0;switch(xAlign){default:this.move(E.x()+x);break;case"l":this.move(E.x()-this.w()+x);break;case"r":this.move(E.x2()+x);break}switch(yAlign){default:this.move(null,E.y()+y);break;case"t":this.move(null,E.y()-this.h()+y);break;case"b":this.move(null,E.y2()+y);break}this.close_friends();if(this.fx_morph&&this.fxType=="morph"){var w=this.w(),h=this.h();this.resize(1,1).hide(0).fx_morph(w,h,this.x(),this.y(),this.fxSpeed)}else{if(this.fx_fade_in&&this.fxType=="fade"){this.hide(0).fade(1).fx_fade_in(this.fxSpeed)}else{this.hide(0)}}return this};VegUIMenu.prototype.close_friends=function(){var i;for(i in this.Friends){if(i!=this.uniqueId){this.Friends[i].close(true)}}return this};VegUIMenu.prototype.friend=function(){var i,Menu;this.Friends[this.uniqueId]=this;for(i=0;i<arguments.length;i++){Menu=arguments[i];Menu.Friends=this.Friends;this.Friends[Menu.uniqueId]=Menu}return null};VegUIMenu.prototype.xml_build__menu=function(xml,Parent){this.xml_build__element(xml,Parent);var N=v(xml),i,s;if((i=N.ga("nestedImg"))){this.nestedIndicator=i}if((i=N.gan("nestedX"))){this.nestedOffset=i}if((i=N.gan("closeTime"))){this.closeTime=i}if((i=N.gan("iconWidth"))){this.iconWidth=i}if((i=N.gan("iconHeight"))){this.iconHeight=i}if((i=N.ga("friend"))){eval("this.friend("+i+");")}if((i=N.ga("link"))&&(s=N.gan("linkIndex"))){eval("this.link("+i+", "+s+");")}for(i=0;i<xml.childNodes.length;i++){c=xml.childNodes[i];switch(c.nodeName){case"ItemStyle":if((s=v(c).ga("normal"))){this.itemStyleNormal=vui_xml_style_prep(s)}if((s=v(c).ga("hover"))){this.itemStyleHover=vui_xml_style_prep(s)}if((s=v(c).ga("open"))){this.itemStyleOpen=vui_xml_style_prep(s)}break;case"Item":if((s=v(c).ga("function"))){eval("var func = "+s+";")}else{var func=null}this.add_item(v(c).ga("text"),func);break}}return this};VegUIMenu.prototype.xml_build=VegUIMenu.prototype.xml_build__menu;var VUI_GAUGE=12;vui_element_add(VUI_GAUGE,VegUIGaugeBar);function VegUIGaugeBar(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.Skin=this.child(VUI_NODE,"Skin").level(0);this.Bar=this.child(VUI_NODE,"Bar").level(1);this.Fill=this.Bar.child(VUI_NODE,"Fill").level(0);this.Label=this.Bar.child(VUI_NODE,"Label").level(1);this.value=0;this.Skin.span(0,0,0,0);this.Bar.span(0,0,0,0);this.Label.span(0,0,0,0);this.Label.set_style({textAlign:"center"});this.vsk_event_add("resize",function(Gauge){Gauge.Label.set_style({lineHeight:Gauge.Label.h()})},"_priv");this.set_skin("Skin")}VegUIGaugeBar.prototype=new vsk_clone(VegUIElement.prototype);VegUIGaugeBar.prototype.fill=function(n){this.value=n;var w=(this.Bar.w()/100)*n;this.Fill.resize(w,this.Bar.h());this.Label.set_style({lineHeight:this.Label.h()+"px"}).clear(vsk_t(n+" %"));return this};VegUIGaugeBar.prototype.xml_build__gauge=function(xml,Parent){this.xml_build__element(xml,Parent);var N=v(xml),i;if((i=N.gan("fill"))){this.fill(i)}return this};VegUIGaugeBar.prototype.xml_build=VegUIGaugeBar.prototype.xml_build__gauge;var VUI_PANEL=7;vui_element_add(VUI_PANEL,VegUIPanel);function VegUIPanel(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.resizeStyle={border:"1px black solid"};this.resizeTransparency=100;this.minWidth=1;this.minHeight=1;this.maxWidth=100000;this.maxHeight=100000;this.dragType=1;this.noResize=false;this.lockX=false;this.lockY=false;this.Pad=this.child(VUI_NODE,"Pad").level(1);this.Skin=this.child(VUI_NODE,"Skin").level(0);this.Plane=this.child(VUI_NODE,"Plane").level(2);this.Skin.span(0,0,0,0);this.set_pad_width(15).dragprep();if(VUI_IS_OPERA){this.Pad.s.cursor="move"}this.Plane.handle("mousedown").vsk_event_add("mousedown",function(Plane,e){if(!e){var e=event}if(ve(e).key_mod("shift")&&ve(e).button()==1){var P=Plane.Parent;Plane.M.stopselect(1);P.focus().dragmode(1,0,P.dragType,P.lockX,P.lockY).set_style({cursor:"move"})}},"_priv_panel");this.vsk_event_add("glb_mouseup",function(Panel,e){Panel.M.stopselect(0);Panel.lose_focus().set_style({cursor:"default"});if(Panel.bResize){Panel.resizemode(0)}},"_priv");this.Pad.handle("mousemove").vsk_event_add("mousemove",function(Pad,e){if(Pad.Parent.noResize){return}var c=ve(e||event).coords_node(),a="",b="",w=Pad.Parent.padWidth;if(c.x>(Pad.w()-w)){b="e"}else{if(c.x<w){b="w"}}if(c.y>(Pad.h()-w)){a="s"}else{if(c.y<w){a="n"}}if(a||b){if(!VUI_IS_OPERA){Pad.s.cursor=a+b+"-resize"}}Pad.Parent.resizeModX=b;Pad.Parent.resizeModY=a},"_priv_panel");this.Pad.handle("mousedown").vsk_event_add("mousedown",function(Pad,e){var Panel=Pad.Parent;if(!Panel.noResize){Panel.M.stopselect(1);Panel.focus().resizemode(1,Panel.resizeModX,Panel.resizeModY)}},"_priv_panel");this.clone=this.clone__panel}VegUIPanel.prototype=new vsk_clone(VegUIElement.prototype);VegUIPanel.prototype.clone__panel=function(Panel,b){this.clone__element(Panel,b);if(Panel.type==this.type){this.minWidth=Panel.minWidth;this.maxWidth=Panel.maxWidth;this.minHeight=Panel.minHeight;this.maxHeight=Panel.maxHeight;this.padWidth=Panel.padWidth;this.resizeStyle=new vsk_clone(Panel.resizeStyle);this.resizeTransparency=Panel.resizeTransparency;this.dragType=Panel.dragType;this.noResize=Panel.noResize}return this};VegUIPanel.prototype.set_pad_width=function(width){this.padWidth=width;var i=Math.round(width/2);this.Pad.span(-(i),-(i),-(i),-(i));this.Plane.span(i,i,i,i);return this};VegUIPanel.prototype.resizemode=function(b,dirX,dirY){var P=this;this.bResize=b;if(b){this.M.preventFocus=true;var S=v(vsk_h("div")).level(100000).dock(this.b.parentNode);S.resize(this.w(),this.h()).move(this.x(),this.y());S.set_style(this.resizeStyle).fade(this.resizeTransparency);S.b.vskLastResizeX=null;S.b.vskLastResizeY=null;if(this.b.vskBBox){S.b.vskBBox=this.b.vskBBox}this.resizeNode=S;v(document.body).event_add("mousemove",function(e){var E=ve(e||event),c=E.coords();if(S.b.lastResizeX===null){S.b.lastResizeX=c.x;S.b.lastResizeY=c.y}var w,h;if(dirX=="e"){w=S.w()-(S.b.lastResizeX-c.x);if(w>=P.minWidth&&w<=P.maxWidth){S.resize(w)}}else{if(dirX=="w"){w=S.w()+(S.b.lastResizeX-c.x);if(w>=P.minWidth&&w<=P.maxWidth){S.move(S.x()-(S.b.lastResizeX-c.x)).resize(w)}}}if(dirY=="s"){h=S.h()-(S.b.lastResizeY-c.y);if(h>=P.minHeight&&h<=P.maxHeight){S.resize(null,h)}}else{if(dirY=="n"){h=S.h()+(S.b.lastResizeY-c.y);if(h>=P.minHeight&&h<=P.maxHeight){S.move(null,S.y()-(S.b.lastResizeY-c.y)).resize(null,h)}}}S.b.lastResizeX=c.x;S.b.lastResizeY=c.y},this.uniqueId+"_resize")}else{var S=this.resizeNode;this.resize(S.w(),S.h()).move(S.x(),S.y());S.undock();this.resizeNode=null;this.M.preventFocus=false;v(document.body).event_unset("mousemove",this.uniqueId+"_resize")}return this};VegUIPanel.prototype.xml_build__panel=function(xml,Parent){this.xml_build__element(xml,Parent);var N=v(xml),i;if((i=N.gan("maxHeight"))){this.maxHeight=i}if((i=N.gan("maxWidth"))){this.maxWidth=i}if((i=N.gan("minHeight"))){this.minHeight=i}if((i=N.gan("minWidth"))){this.minWidth=i}if((i=N.gan("dragType"))){this.dragType=i}if((i=N.gan("noResize"))){this.noResize=i}if((i=N.gan("lockX"))){this.lockX=i}if((i=N.gan("lockY"))){this.lockY=i}for(i=0;i<xml.childNodes.length;i++){c=xml.childNodes[i];switch(c.nodeName){case"Resize":if((i=v(c).ga("style"))){eval("this.resizeStyle = {"+v(c).ga("style")+"};")}if((i=v(c).ga("alpha"))){this.resizeTransparency=v(c).ga("alpha")}break}}return this};VegUIPanel.prototype.xml_build=VegUIPanel.prototype.xml_build__panel;var VUI_TAB_DIALOGUE=10;var VUI_TAB=16;vui_element_add(VUI_TAB_DIALOGUE,VegUITabDialogue);vui_element_add(VUI_TAB,VegUITab);function VegUITabDialogue(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.Skin=this.child(VUI_NODE,"Skin").level(0);this.TabTpl=this.child(VUI_TAB,"TabTpl").hide(1).level(1);this.Tabs=[];this.tabSpace=0;this.TabTpl.span(0,0,0,0);this.clone=this.clone__tab_dialogue}VegUITabDialogue.prototype=new vsk_clone(VegUIElement.prototype);VegUITabDialogue.prototype.clone__tab_dialogue=function(Dlg,b){this.clone__element(Dlg,b);if(Dlg.type==this.type){var i,m;for(i in this.C){if((m=/^Tab_(\d+)$/.exec(i))){this.Tabs[m[1]]=this.C[i]}}this.tabSpace=Dlg.tabSpace}return this};VegUITabDialogue.prototype.select_tab=function(id){var i,T;for(i in this.Tabs){T=this.Tabs[i];if(T.uniqueId!=id){T.adjust(0).level(1).vsk_event_fire("toback")}else{T.adjust(1).level(2).vsk_event_fire("tofront");this.vsk_event_fire("change",i)}}return this};VegUITabDialogue.prototype.select_tab_by_name=function(tabName){var i;for(i in this.Tabs){if(this.Tabs[i].tabName==tabName){this.select_tab(this.Tabs[i].uniqueId);break}}return this};VegUITabDialogue.prototype.get_tab_by_name=function(tabName){var i;for(i in this.Tabs){if(this.Tabs[i].tabName==tabName){return this.Tabs[i]}}return null};VegUITabDialogue.prototype.add_tab=function(caption,tabW,tabName){var Tab=this.Manager.clone(this.TabTpl).hide(0);if(tabW){Tab.tabW=tabW}var i,x=0;for(i in this.Tabs){x+=this.Tabs[i].tabW}Tab.tabX=x+(this.tabSpace*this.Tabs.length);Tab.tabName=tabName;Tab.span(0,Tab.tabFrontHeight,0,0).caption(caption);this.child_adopt(Tab,"Tab_"+this.Tabs.length);this.Tabs.push(Tab);if(!x){this.select_tab(Tab.uniqueId)}else{Tab.adjust(0)}return Tab};function VegUITab(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.Panel=this.child(VUI_NODE,"Panel").level(1);this.Tab=this.child(VUI_BUTTON,"Tab").level(2);this.tabFrontHeight=20;this.tabBackHeight=15;this.tabFrontStyle={};this.tabBackStyle={};this.tabX=0;this.tabY=-1;this.tabW=75;this.tabPosition=false;this.adjust(false);this.Panel.span(0,0,0,0);this.Tab.handle("mousedown").vsk_event_add("mousedown",function(Btn){Btn.Parent.Parent.select_tab(Btn.Parent.uniqueId)},"_priv_tab");this.clone=this.clone__tab}VegUITab.prototype=new vsk_clone(VegUIElement.prototype);VegUITab.prototype.clone__tab=function(Tab,b){this.clone__element(Tab,b);if(Tab.type==this.type){this.tabFrontHeight=Tab.tabFrontHeight;this.tabBackHeight=Tab.tabBackHeight;this.tabFrontStyle=new vsk_clone(Tab.tabFrontStyle);this.tabBackStyle=new vsk_clone(Tab.tabBackStyle);this.tabX=Tab.tabX;this.tabY=Tab.tabY;this.tabName=Tab.tabName;this.tabW=Tab.tabW;this.tabSpace=Tab.tabSpace;this.tabPosition=Tab.tabPosition}return this};VegUITab.prototype.caption=function(caption){this.Tab.caption(caption);return this};VegUITab.prototype.adjust=function(position){if(typeof position=="undefined"){var position=this.tabPosition^1}switch(position){case 0:this.Tab.States.normal=this.tabBackStyle;this.Tab.resize(this.tabW,this.tabBackHeight).move(this.tabX,-this.tabBackHeight-this.tabY);this.Tab.Skin.set_style(this.tabBackStyle);this.vsk_event_fire("tab_to_back");break;case 1:this.Tab.States.normal=this.tabFrontStyle;this.Tab.resize(this.tabW,this.tabFrontHeight).move(this.tabX,-this.tabFrontHeight-this.tabY);this.Tab.Skin.set_style(this.tabFrontStyle);this.vsk_event_fire("tab_to_front");break}this.tabPosition=position;return this};VegUITabDialogue.prototype.xml_build__tab_dialogue=function(xml,Parent){this.xml_build__element(xml,Parent);var N=v(xml),i,h,Tab;if((h=N.gan("tab_space"))){this.tabSpace=h}for(i=0;i<xml.childNodes.length;i++){c=xml.childNodes[i];switch(c.nodeName){case"Tab":Tab=this.add_tab(v(c).ga("caption"),v(c).gan("w",50),v(c).ga("tabName"));if((h=v(c).ga("adopt"))){eval("Tab.Panel.child_adopt("+h+");")}break}}if(VUI_IS_OPERA){this.hide(0).place()}return this};VegUITabDialogue.prototype.xml_build=VegUITabDialogue.prototype.xml_build__tab_dialogue;VegUITab.prototype.xml_build__tab=function(xml,Parent){this.xml_build__element(xml,Parent);var N=v(xml),i;if((i=N.ga("backStyle"))){eval("this.tabBackStyle = {"+i+"};")}if((i=N.ga("frontStyle"))){eval("this.tabFrontStyle = {"+i+"};")}if((i=N.gan("backHeight"))){this.tabBackHeight=i}if((i=N.gan("frontHeight"))){this.tabFrontHeight=i}if((i=N.gan("tabX"))){this.tabX=i}if((i=N.gan("tabY"))){this.tabY=i}return this};VegUITab.prototype.xml_build=VegUITab.prototype.xml_build__tab;var VUI_WINDOW=8;var VUI_WINDOW_Z_START=100;vui_element_add(VUI_WINDOW,VegUIWindow);function VegUIWindow(Manager,Parent){this.constructor=VegUIPanel;this.constructor(Manager,Parent);this.Header=this.child(VUI_NODE,"Header").level(9);this.Caption=this.Header.child(VUI_NODE,"Caption");this.BtnClose=this.child(VUI_BUTTON,"BtnClose").level(10);this.BtnMax=this.child(VUI_BUTTON,"BtnMax").level(10);this.minWidth=100;this.minHeight=50;this.maximized=false;this.dragMode=2;this.killOnClose=false;this.Header.s.cursor="move";this.dragprep();this.Header.handle("mousedown").vsk_event_add("mousedown",function(Header,e){Header.Parent.focus();Header.M.stopselect(1);Header.Parent.dragmode(1,Header.Parent.dragMode,Header.Parent.dragType)},"_priv_window");this.BtnClose.vsk_event_add("mousedown",function(Btn,e){Btn.Parent.close()},"_priv_window");this.BtnMax.vsk_event_add("mousedown",function(Btn,e){Btn.Parent.maximize()},"_priv_window");this.vsk_event_add("kill",function(Window){delete Window.Manager.W[Window.uniqueId]},"_priv");this.vsk_event_add("place",function(Window){Window.open()},"_priv");this.handle("mousedown").vsk_event_add("mousedown",function(Window){Window.pop()},"_priv");this.vsk_event_add("create",function(Window){var M=Window.Manager;if(!M.W){M.W={}}M.W[Window.uniqueId]=Window},"_priv");this.clone=this.clone__window}VegUIWindow.prototype=new vsk_clone(VegUIPanel.prototype);VegUIWindow.prototype.clone__window=function(Window,b){this.clone__element(Window,b);if(Window.clone__window){this.captionStr=Window.captionStr;this.killOnClose=Window.killOnClose}return this};VegUIWindow.prototype.close=function(){if(this.killOnClose){this.Manager.kill(this)}else{this.hide(true)}return this.vsk_event_fire("win_close")};VegUIWindow.prototype.open=function(){this.hide(false).pop();return this.vsk_event_fire("win_open")};VegUIWindow.prototype.maximize=function(b){if(typeof b=="undefined"){var b=this.maximized^1}var B;if(b&&(B=this.b.vskBBox)){this.minimizedInfo={x:this.x(),y:this.y(),w:this.w(),h:this.h()};if(!this.fx_morph){this.move(B.x,B.y).resize(B.w,B.h)}else{this.fx_morph(B.w,B.h,B.x,B.y,100)}this.vsk_event_fire("win_maximize")}else{if(this.minimizedInfo){var I=this.minimizedInfo;if(!this.fx_morph){this.move(I.x,I.y).resize(I.w,I.h)}else{this.fx_morph(I.w,I.h,I.x,I.y,100)}this.vsk_event_fire("win_minimize")}}this.maximized=b;return this};VegUIWindow.prototype.pop=function(){var W=this.Manager.W;var w,i,z,a=[];for(i in W){if(W[i]!=this){a.push(W[i])}}a.sort(function(W1,W2){return W1.z()-W2.z()});z=VUI_WINDOW_Z_START;for(i in a){w=a[i];w.level(z++).vsk_event_fire("win_drop")}this.level(z);return this.vsk_event_fire("win_pop")};VegUIWindow.prototype.caption=function(caption){this.captionStr=caption;this.Caption.clear(vsk_t(caption));return this};VegUIWindow.prototype.xml_build__window=function(xml,Parent){this.xml_build__panel(xml,Parent);var N=v(xml),i;if((i=N.gan("maximized"))){this.maximize(i)}if((i=N.ga("caption"))){this.caption(i)}if((i=N.ga("killOnClose"))){this.killOnClose=true}return this};VegUIWindow.prototype.xml_build=VegUIWindow.prototype.xml_build__window;var WO_MODULE=1000;vui_element_add(WO_MODULE,WardenModule);window.WO_CLIENT_VERSION="b2.2.1";vsk_cookie_set("wo_screen_width",vsk_iw());function vsk_find(Obj,key,value){var i;for(i in Obj){if(Obj[i][key]==value){return i}}return false}function vsk_count(Obj){var i,n=0;for(i in Obj){n++}return n}function vsk_sorted_array(Obj,key,type){var i,A=[];for(i in Obj){A.push(Obj[i])}if(!type){if(typeof key!="function"){A.sort(function(A,B){return A[key]-B[key]})}else{A.sort(function(A,B){return key(A)-key(B)})}}else{if(typeof key!="function"){A.sort(function(A,B){var i,a=A[key],b=B[key],l=a.length;for(i=0;i<l;i++){if(a.charAt(i)<b.charAt(i)){return -1}else{if(a.charAt(i)>b.charAt(i)){return 1}}}return 0})}else{A.sort(function(A,B){var i,a=key(A),b=key(B),l=a.length;for(i=0;i<l;i++){if(a.charAt(i)<b.charAt(i)){return -1}else{if(a.charAt(i)>b.charAt(i)){return 1}}}return 0})}}return A}function vsk_object_append(Obj1,Obj2){if(typeof Obj2!="object"){return null}var i,t;for(i in Obj2){t=(typeof Obj2[i]=="object");if(!Obj1[i]&&t){Obj1[i]=new vsk_clone(Obj2[i])}else{if(t){vsk_object_append(Obj1[i],Obj2[i])}else{Obj1[i]=Obj2[i]}}}}function wo_sprite(path,flip){var img=v(vsk_h("img"));var base=v(vsk_h("div"));img.dock(WO_VOID.b).b.woFlipMe=flip;img.b.onload=function(){base.resize(v(this).w(),v(this).h()).html_a(this);var flip=this.woFlipMe;this.woFlipMe=false;base.vsk_event_fire("sprite");if(flip){base.wo_sprite_flip()}};img.set("src",path);return base}function tp(n,v){return n<0?v||0:n}function set_precision(n,c){c=Math.pow(10,c);return Math.round(n*c)/c}function in_array(arr,value){var i;for(i in arr){if(arr[i]==value){return true}}return false}function vote_browsermmo(id){var B=new VegUIAjax();if(typeof window.Manager!="undefined"){Manager.send("vote-at-browsermmo",{i:id})}return true}VSK_Node.prototype.wo_sprite_flip=function(force){if(this.b){var i,c,C,x,r;this.b.onload=function(){return false};if(!this.woSpriteStatus||force){this.woSpriteStatus=1}else{this.woSpriteStatus=0}for(i=0;i<this.b.childNodes.length;i++){C=v(this.b.childNodes[i]);if(C.b.nodeName.match(/^img$/i)){x=C.x();r=parseInt(C.s.right);if(C.b.src.match(/-f\.gif$/)){C.b.src=C.b.src.replace(/-f\.gif$/,".gif");C.move(r+(C.b.flipAdjust?-1:0))}else{C.b.src=C.b.src.replace(/\.gif$/,"-f.gif");C.move(null,null,x+(C.b.flipAdjust?1:0))}}}}return this};VSK_Node.prototype.wo_sprite_resize=function(wFactor,hFactor,m){if(this.b){var i,C,t,x,y,w,h,round=Math.round;if(!this.b.woSpriteTD){this.wo_sprite_truedata()}for(i=0;i<this.b.childNodes.length;i++){C=v(this.b.childNodes[i]);if(!C.b.woSpriteTD){C.wo_sprite_truedata()}t=C.b.woSpriteTD;if(C.b.nodeName.match(/^img$/i)){C.resize(w=(t.w*wFactor),h=(t.h*hFactor));if(!m){C.move(x=(t.x*wFactor),y=(t.y*hFactor))}}C.wo_sprite_truedata(w,h,x,y)}t=this.b.woSpriteTD;this.resize(w=(t.w*wFactor),h=(t.h*hFactor));if(!m){this.move(x=(t.x*wFactor),y=(t.y*hFactor))}this.wo_sprite_truedata(w,h,x,y)}return this};VSK_Node.prototype.wo_sprite_truedata=function(w,h,x,y){this.b.woSpriteTD={w:!isNaN(w)?w:this.w(),h:!isNaN(h)?h:this.h(),x:!isNaN(x)?x:this.x(),y:!isNaN(y)?y:this.y()}};VSK_Node.prototype.fx_blink=function(b,i,l,fadeTo,count,ondone){if(b){var sequence=new VSK_FX_Sequence(this);sequence.body=function(n){n.fx_fade_out(i,l).onhalt=function(n){n.fx_fade_in(i,(fadeTo||100)).sequence=sequence}};sequence.loop(count,ondone);this.blinkSequence=sequence}else{if(this.blinkSequence){this.blinkSequence.halt(["fade_in","fade_out"])}this.fade(fadeTo||100)}return this};function input_password(Fld){Fld.undock().control(Fld.b.cloneNode(1)).set("type","password").place()}function WardenModule(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.Skin=this.child(VUI_NODE,"Skin");this.Skin.span(0,0,0,0).level(0);this.set_skin("Skin");this.b.vsk_ignoreAbsX=true;if(VUI_IS_OPERA){this.vsk_event_add("place",function(M){setTimeout(function(){v(M.b.firstChild).html_ia(M.Skin.b)},100)},"_priv_operafix")}}WardenModule.prototype=new vsk_clone(VegUIElement.prototype);WardenModule.prototype.receive=function(xml){return this};function WardenCache(){this.Constants={};this.Objects={};this.data={item:{},item_instance:{},item_enchantment:{},character:{},inventory:{},base_stats:{},backpack:{},battlefield:{},act:{},npc:{},npc_group:{},pvp_challenge:{},pvp_map:{},character_statistics:{},achievement:{},account:{},worldmap:{},spell:{99993:{_id:99993,name:"Earth Blast",effect_id:"magical/natureblast",effect_gfx_id:"earthblast",spell_ct:2,description:"Deals a fair amount of magical damage (earth) to the current target.",cost:0,cooldown:0,type:3,trigger_type:0,school:1,range:4},99994:{_id:99994,name:"Wind Surge",effect_id:"magical/windblast",effect_gfx_id:"wind_gust",spell_ct:2,description:"Deals a fair amount of magical damage (wind) to the current target.",cost:0,cooldown:0,type:3,trigger_type:0,school:1,range:4},99995:{_id:99995,name:"Ice Shard",effect_id:"magical/iceblast",effect_gfx_id:"iceblast",spell_ct:2,description:"Deals a fair amount of magical damage (ice) to the current target.",cost:0,cooldown:0,type:3,trigger_type:0,school:1,range:4},99996:{_id:99996,name:"Shoot",effect_id:"range/shot",effect_gfx_id:"arrows-small",spell_ct:3,description:"Deals ranged damage to the current target.",cost:0,cooldown:0,type:3,trigger_type:0,school:8,range:5},99997:{_id:99997,name:"natural regeneration"},99998:{_id:99998,name:"Blast",effect_id:"magical/fireblast",effect_gfx_id:"fire_big",spell_ct:2,description:"Deals a fair amount of magical damage (fire) to the current target.",cost:0,cooldown:0,type:3,trigger_type:0,school:1,range:4},99999:{_id:99999,name:"melee",effect_gfx_id:"melee",spell_ct:1,effect_id:"physical/melee",description:"Deals physical damage to the current target.",cost:0,cooldown:0,type:1,trigger_type:0,school:7,range:1}},minion:{},listing:{},onchange:new VegUIDynFunc()};this.requests=0}WardenCache.prototype.request_push=function(type,id,token){var cache=this;if(this.data[type]&&this.data[type][id]){this.requests--;return}this.Manager.request_cache(type,id,token,function(){cache.requests--})};WardenCache.prototype.receive=function(xml){var i,N,n,r,R,a,A,g,G,p,X;for(i=0;i<xml.childNodes.length;i++){N=xml.childNodes[i];X=v(N);switch(N.nodeName){case"#text":break;case"cache_r":this.request_push(X.ga("type"),X.gan("id"),X.ga("t"));break;default:if(!this.data[N.nodeName]){this.data[N.nodeName]={}}if(v(N).ga("id").charAt(0)!="v"){var id=v(N).gan("id")}else{var id=v(N).ga("id")}var fixedKey;var data={};for(n=0;n<N.childNodes.length;n++){if((a=N.childNodes[n].nodeName)!="_data"&&a!="#text"){data[a]=v(N.childNodes[n]).ga("v",v(N.childNodes[n]).gan("n",v(N.childNodes[n]).gaf("f")))}else{if(a=="_data"){A=N.childNodes[n];var _data={};if(!v(A).ga("list")){for(r=0;r<A.childNodes.length;r++){R=A.childNodes[r];if(R.nodeName!="#text"){_data[R.nodeName]=v(R).ga("v",v(R).gan("n",v(R).gaf("f")))}}if(!v(A).ga("id").charAt(0)!="v"){data[v(A).gan("id")]=_data}else{data[v(A).ga("id")]=_data}}else{p=0;for(r=0;r<A.childNodes.length;r++){R=A.childNodes[r];var __data={};if(R.nodeName=="#text"){continue}for(g=0;g<R.childNodes.length;g++){G=R.childNodes[g];if(G.nodeName!="#text"){__data[G.nodeName]=v(G).ga("v",v(G).gan("n",v(G).gaf("f")))}}_data[p]=__data;p++}data[(fixedKey=v(A).ga("id").replace(/^[_]+/,""))]=_data;if(this.data[N.nodeName][id]&&v(A).ga("list")){delete this.data[N.nodeName][id][fixedKey]}}}}}var changed=false;if(v(N).gan("clear")){delete this.data[N.nodeName][id];changed=true}if(!this.data[N.nodeName][id]){this.data[N.nodeName][id]=data;this.data[N.nodeName][id].objects=[];this.data[N.nodeName][id]._id=id}else{vsk_object_append(this.data[N.nodeName][id],data);for(a in this.data[N.nodeName][id].objects){A=this.data[N.nodeName][id].objects[a];if(A.b){if(A.redraw){A.redraw(id,a)}}else{delete this.data[N.nodeName][id].objects[a]}}changed=true}if(changed){this.data.onchange.execute(N.nodeName,{data:this.data[N.nodeName][id],id:id})}break}}};WardenCache.prototype.clear=function(category){if(this.data[category]){var i,n,d;for(i in this.data[category]){d=this.data[category][i];if(!d.objects){continue}for(n in d.objects){if(!d.objects[n].b){delete d.objects[n]}}}}return this};WardenCache.prototype.cfg=function(config){if(!this.data.account[parseInt(this.Constants.account_id)]){return false}return((this.data.account[parseInt(this.Constants.account_id)].options&config)>0)};WardenCache.prototype.populate_spells=function(List,charId,npcId){var i,d,S,spells,C=this.Manager.Cache;if(charId){spells=C.data.character[charId].spells}else{if(npcId){spells=C.data.npc[npcId].spells}}var Node=v(vsk_h("div"));for(i in spells){d=spells[i];S=C.data.spell[d.spell_id];if(S){var Icon=v(vsk_h("img")).set_pos("relative").set("src",gp+"/spells/"+S.effect_id+".gif").resize(24,24);Icon.set_style({margin:"1px",cursor:"pointer"});Icon.handle("mousedown").vsk_event_add("mousedown",function(Icon){List.vsk_event_fire("spell_select",{spellId:Icon.b.spellId})});Icon.b.spellId=d.spell_id;Icon.cooltip_set(C.render_object_spellinfo(d.spell_id).b.cloneNode(1),"ac",false,List.P.P.b);Node.html_a(Icon.b)}}List.fill(Node.b)};WardenCache.prototype.populate_orders=function(List,classId){var i,d,S,spells,C=this.Manager.Cache;var Node=v(vsk_h("div"));for(i in WO_BO){var Icon=v(vsk_h("img")).set_pos("relative").set("src",gp+"/spells/battleorder/"+WO_BO[i]+".gif").resize(24,24);Icon.set_style({margin:"1px",cursor:"pointer"});Icon.handle("mousedown").vsk_event_add("mousedown",function(Icon){List.vsk_event_fire("order_select",{orderId:Icon.b.orderId})});Icon.b.orderId=WO_BO[i];Icon.cooltip_set(C.render_object_battleorder_info(WO_BO[i]).b.cloneNode(1),"ac",false,List.P.P.b);Node.html_a(Icon.b)}var R;if((R=WO_BO_CS[classId])){for(i in R){var Icon=v(vsk_h("img")).set_pos("relative").set("src",gp+"/spells/battleorder/"+R[i]+"_"+classId+".gif").resize(24,24);Icon.set_style({margin:"1px",cursor:"pointer"});Icon.handle("mousedown").vsk_event_add("mousedown",function(Icon){List.vsk_event_fire("order_select",{orderId:Icon.b.orderId})});Icon.b.orderId=R[i];Icon.cooltip_set(C.render_object_battleorder_info(R[i],classId).b.cloneNode(1),"ac",false,List.P.P.b);Node.html_a(Icon.b)}}List.fill(Node.b)};WardenCache.prototype.render_object_battlefield_info=function(battlefieldId){var d=this.data.battlefield,C,M;if((C=d[battlefieldId])){if(!(M=C.BFInfo)){M=this.Manager.element(WO_BATTLEFIELD_INFO);M.theme("game");M.undock().set_battlefield(C);C.BFInfo=M}}return M};WardenCache.prototype.render_object_battleorder_info=function(orderId,classId){var d=this.data.battlefield,C,M,objId="order_"+orderId+"_"+classId;if(!(M=this.Objects[objId])){M=this.Manager.element(WO_BATTLEORDER_INFO);M.theme("game");M.undock().set_battleorder(orderId,classId);this.Objects[objId]=M}return M};WardenCache.prototype.render_object_minioninfo=function(minionId){var d=this.data.minion,C,M;if((C=d[minionId])){if(!(M=C.MinionInfo)){M=this.Manager.element(WO_MINION_INFO);M.theme("game");M.set_minion(C);C.MinionInfo=M}return M}};WardenCache.prototype.render_object_spellinfo_compact=function(spellId,tiny){var d=this.data.spell,C,SpellInfo;if((C=d[spellId])){if(!(SpellInfo=C.SpellInfoC)){SpellInfo=this.Manager.element(WO_SPELL_INFO_COMPACT);SpellInfo.theme(!tiny?"game":"spellinfo-tiny").undock();SpellInfo.set_spell(C);C.SpellInfoC=SpellInfo}return SpellInfo}};WardenCache.prototype.render_object_spellinfo=function(spellId){var d=this.data.spell,C,SpellInfo;if((C=d[spellId])){if(!(SpellInfo=C.SpellInfo)||!SpellInfo.b){SpellInfo=this.Manager.element(WO_SPELL_INFO);SpellInfo.theme("game").undock();SpellInfo.set_spell(C);C.SpellInfo=SpellInfo}return SpellInfo}};WardenCache.prototype.render_object_npcinfo=function(npcId,help){var d=this.data.npc,C,NPCInfo;if((C=d[npcId])){if(!(NPCInfo=C.NPCInfo)){NPCInfo=this.Manager.element(WO_NPC_INFO);NPCInfo.theme("game").undock();NPCInfo.set_npc(C);C.NPCInfo=NPCInfo}NPCInfo.set_help(help);return NPCInfo}};WardenCache.prototype.render_object_iteminfo_vendor=function(itemId,buybackMode,buybackId,charId,priceMod){var d=this.data.item,item;if((item=d[itemId])){var ItemInfo;ItemInfo=this.Manager.element(WO_ITEMINFO_VENDOR);ItemInfo.theme("game");ItemInfo.undock().set_item_vendor(item,buybackMode,buybackId,charId,priceMod);ItemInfo.redraw=function(itemId,objectIdx){this.set_item_vendor(d[itemId],buybackMode,buybackId,charId,priceMod)};this.data.item[itemId].objects.push(ItemInfo);return ItemInfo}};WardenCache.prototype.render_object_iteminfo_sale=function(itemId,sellMode,charId,itemInstanceId){var d=this.data.item,item;if((item=d[itemId])){var ItemInfo;ItemInfo=this.Manager.element(WO_ITEMINFO_SALE);ItemInfo.theme("game");ItemInfo.undock().set_item_sale(item,sellMode,charId,itemInstanceId);ItemInfo.redraw=function(itemId,objectIdx){this.set_item_sale(d[itemId],sellMode,charId,itemInstanceId)};this.data.item[itemId].objects.push(ItemInfo);return ItemInfo}};WardenCache.prototype.render_object_iteminfo_compact=function(itemId,charId,itemInstanceId){var d=this.data.item,item;if((item=d[itemId])){var ItemInfo;ItemInfo=this.Manager.element(WO_ITEMINFO_SALE);ItemInfo.theme("game");ItemInfo.undock().iteminfo_set(item,charId,itemInstanceId);ItemInfo.redraw=function(itemId,objectIdx){this.iteminfo_set(item,charId,itemInstanceId)};this.data.item[itemId].objects.push(ItemInfo);return ItemInfo}};WardenCache.prototype.render_object_iteminfo=function(itemId,charId,enchantmentId){var d=this.data.item,item;if((item=d[itemId])){var ItemInfo=this.Manager.element(WO_ITEM_INFO);ItemInfo.theme("game");ItemInfo.undock().iteminfo_set(item,charId,enchantmentId);item.ItemInfo=ItemInfo;return ItemInfo}};WardenCache.prototype.render_object_achievement_info=function(achievementId,charId){var d=this.data.achievement,A;if((A=d[achievementId])){var Info=this.Manager.element(WO_ACHIEVEMENT_INFO);Info.theme("game");Info.undock().set_achievement(A,charId);return Info}};WardenCache.prototype.render_object_item_enchantment_info=function(enchantmentId){var d=this.data.item_enchantment,E;if((E=d[enchantmentId])){var Node=this.Manager.element(WO_ITEM_ENCHANTMENT_INFO);Node.theme("game");Node.undock().set_enchantment(E);return Node}};WardenCache.prototype.render_object_item_enchantment_info_compact=function(enchantmentId){var d=this.data.item_enchantment,E;if((E=d[enchantmentId])){var Node;Node=this.Manager.element(WO_ITEM_ENCHANTMENT_INFO_COMPACT);Node.theme("game");Node.undock().set_enchantment(E);Node.redraw=function(itemId,objectIdx){this.set(d[enchantmentId])};E.objects.push(Node);return Node}};WardenCache.prototype.render_object_npc=function(npcId,redraw,flip,dontCache,onSprite){var NPC,Cache=this;if((NPC=this.data.npc[npcId])){var Sprite=wo_sprite(gp+"/character/npc/"+NPC.gfx_id+".gif",flip);Sprite.redraw=function(npcId,objectIdx){var newSprite=Cache.render_object_npc(npcId,true,this.woSpriteStatus);this.html_ia(newSprite.b).undock();if(this.onredraw){newSprite.onredraw=this.onredraw;newSprite.onredraw(this)}Cache.data.npc[npcId].objects[objectIdx]=newSprite};if(!redraw&&!dontCache){this.data.npc[npcId].objects.push(Sprite)}return Sprite}return null};WardenCache.prototype.render_object_character_sprite=function(characterId,redraw,flip){var d,i,C;if((d=this.data.character[characterId])){C=v(vsk_h("img"));C.set("src","/script.php?s=game-sprite-character&char_id="+characterId+"&f="+(flip?1:0));C.redraw=function(characterId,objectIdx){C.set("src","/script.php?s=game-sprite-character&char_id="+characterId+"&f="+(flip?1:0))};if(!redraw){d.objects.push(C)}return C}return null};WardenCache.prototype.render_object_character=function(characterId,redraw,flip){if(typeof this.data.character!="undefined"){if(typeof this.data.character[characterId]!="undefined"){var skin,hair,facial,inv,i,item,I,z;var d=this.data.character[characterId];var flipAdjust=(d.class_id==WO_CLASS_WARRIOR);var C=v(vsk_h("div"));var cName=this.Game.character_class_xl(parseInt(d.class_id));var o=this.data.object_character[parseInt(d.class_id)];var gfxPath="/img/character/"+cName;var z;var skinP=gfxPath+"/skin-"+d.body_id+(flip?"-f":"")+".gif";if(d.hair_id<255){hair=gfxPath+"/hair-"+d.hair_id+"."+d.hair_color_id+".gif"}if(d.facial_id<255){facial=gfxPath+"/facial-"+d.facial_id+"."+d.hair_color_id+".gif"}C.hide(1);skin=v(vsk_h("img"));skin.b.onload=function(){C.resize(skin.w(),skin.h());skin.dock(C.b).hide(0);C.vsk_event_fire("sprite");C.hide(0)};skin.hide(1).dock(document.body).set("src",skinP);if(hair){hair=v(vsk_h("img")).set("src",hair).move(o.hair_x,o.hair_y).dock(C.b).level(2);hair.b.flipAdjust=flipAdjust}else{hair=v(vsk_h("img")).set("src",gp+"/ui/blank.gif").move(o.hair_x,o.hair_y).dock(C.b).level(2)}if(facial){facial=v(vsk_h("img")).set("src",facial).move(o.facial_x,o.facial_y).dock(C.b).level(1);facial.b.flipAdjust=flipAdjust}else{facial=v(vsk_h("img")).set("src",gp+"/ui/blank.gif").move(o.facial_x,o.facial_y).dock(C.b).level(1)}if((inv=this.data.inventory)){inv=inv[characterId];gfxPath+="/item";for(i in inv){if((item=inv[i])){if(!(item=this.data.item_instance[item])){continue}item=this.data.item[item.item_id];if(!item||!WO_INVSLOT_VISUAL[parseInt(item.slot)]){continue}I=v(vsk_h("img")).set("src",gfxPath+"/"+this.Game.item_type_xl(parseInt(item.item_type))+"/"+item.gfx_id+".gif");I.b.flipAdjust=flipAdjust;switch(d.class_id){case WO_CLASS_WIZARD:if(item.slot==14){z=0}else{z=item.slot}break;default:z=item.slot;break}I.move(item.x,item.y).level(z).dock(C.b)}}}C.update_skin=function(skinId){if(!this.b.childNodes[2]){return}this.b.childNodes[2].src=this.b.childNodes[2].src.replace(/-[\d]+\.gif$/,"-"+skinId+".gif")};C.update_hair=function(hairId,colorId){if(!this.b.childNodes[0]){return}if(hairId<255){this.b.childNodes[0].src=this.b.childNodes[0].src.replace(/-[\d]+\.[\d]+\.gif$/,"-"+hairId+"."+colorId+".gif")}v(this.b.childNodes[0]).hide(hairId==255)};C.update_facial=function(facialId,colorId){if(!this.b.childNodes[1]){return}if(facialId<255){this.b.childNodes[1].src=this.b.childNodes[1].src.replace(/-[\d]+\.[\d]+\.gif$/,"-"+facialId+"."+colorId+".gif")}v(this.b.childNodes[1]).hide(facialId==255)};var Cache=this;C.redraw=function(charId,objIndex){var oC=this,x,y,r,b;var C=Cache.render_object_character(charId,true,this.woSpriteStatus);if(VUI_IS_IE){oC.html_ia(C.b).undock();if(oC.onredraw){C.onredraw=oC.onredraw;C.onredraw(C,oC)}}else{C.fade(1);this.fx_fade_out(200).onhalt=function(){oC.html_ia(C.b).undock();if(oC.onredraw){C.onredraw=oC.onredraw;C.onredraw(C,oC)}C.fx_fade_in(200)}}C.hide(0);C.objIndex=oC.objIndex;Cache.data.character[charId].objects[objIndex]=C};if(!redraw){this.data.character[characterId].objects.push(C)}if(flip){C.wo_sprite_flip(1)}this.clear("character");return C}}};WardenCache.prototype.render_object_character_listentry=function(charId){var E,d=this.data.character,Sprite;if((d=d[charId])){if(!(E=d.listEntry)){E=this.Manager.element(WO_CHARACTER_LISTENTRY);E.theme("game");E.undock().set_character(charId);E.charId=charId;d.listEntry=E}return E}return null};WardenCache.prototype.minion_id_to_npc_id=function(minionId){var d=this.data.minion;if(!(d=d[minionId])){return null}return d.npc_id};WardenCache.prototype.minion_custom_name=function(minionId,charId){var m,cd=this.data.character[charId];if(cd&&(m=cd.minions)){var i;for(i in m){if(m[i].minion_id==minionId){return m[i].name}}}return null};WardenCache.prototype.achievement_data=function(charId,achievementId){var C=this.data.achievement;if(C){var i,a,A;for(i in C){if(C[i]._id==achievementId){return C[i]}}}return null};WardenCache.prototype.inventory_get_item=function(charId,slot,getId){var C,I,D;if((C=this.data.inventory[charId])){if((D=this.data.item_instance[C["slot_"+slot]])){return getId?D.item_id:this.data.item[D.item_id]}}return getId?0:null};function WardenPreloader(){this.images=[];this.imagesLoaded=0}WardenPreloader.prototype.receive=function(xml){var i,N,n,PL=this;for(i=0;i<xml.childNodes.length;i++){N=xml.childNodes[i];switch(N.nodeName){case"file":var img=v(vsk_h("img"));img.hide(1).dock(WO_VOID.b).set("src",v(N).ga("p"));break}}};function WardenClient(){this.constructor=VegUIManager;this.constructor();this.Game=new WardenGame();this.Cache=new WardenCache();this.Cache.Game=this.Game;this.Cache.Manager=this;this.Preloader=new WardenPreloader();this.WOSEC=new WOSEC()}WardenClient.prototype=new vsk_clone(VegUIManager.prototype);WardenClient.prototype.xml_build_interface__warden=function(xml,arg){var i,c,E,C=this;var G=xml.getElementsByTagName("preload");if(G.length){for(i=0;i<G.length;i++){this.Preloader.receive(G[i])}}var G=xml.getElementsByTagName("game");if(G.length){for(i=0;i<G.length;i++){this.cache_prepare(G[i])}}var t1=new Date().getTime();var loadingCache=setInterval(function(){if(C.Cache.requests<=0){vsk_dbg_print("Cache Time: "+(new Date().getTime()-t1));C.xml_build_client(xml,arg);clearInterval(loadingCache)}},100)};WardenClient.prototype.xml_build_interface=WardenClient.prototype.xml_build_interface__warden;WardenClient.prototype.xml_build_client=function(xml,arg){vsk_dbg_print("Building client ...");this.xml_build_interface__manager(xml);var xml=xml.getElementsByTagName("Warden")[0];if(xml){for(i=0;i<xml.childNodes.length;i++){c=xml.childNodes[i];switch(c.nodeName){case"combat":if(typeof window.combat!="undefined"){window.combat.receive(c)}break}}}if(arg.dockid){var dockId=arg.dockid;V("loading_"+dockId).undock();V(dockId).fade(100)}};WardenClient.prototype.tgl_loading=function(b){if(!this.ScrLoading){this.ScrLoading=this.element(VUI_NODE).set_style({backgroundColor:"#000"}).set_pos("fixed",50).span(0,0,0,0).fade(75).dock(document.body).hide(1)}if(b){this.ScrLoading.fade(1).hide(0).fx_fade_in(350,75)}else{var Scr=this.ScrLoading;this.ScrLoading.fx_fade_out(350).onhalt=function(){Scr.hide(1)}}};WardenClient.prototype.send=function(script,arg,onreceive,module,onerror,noLoading){var C=this;var i;if(module){arg.ui_id=module.uniqueId}if(!noLoading){this.tgl_loading(true)}this.Bridge.send("/script.php?s="+script,arg,"POST",function(req){if(!req.responseXML||!req.responseXML.firstChild){C.tgl_loading(false);C.alert("An error has occured, it has been logged and the devs will look at the problem. Sorry! :)");if(onerror){onerror(req)}return}C.cache_prepare(req.responseXML.firstChild);var loadingCache=setInterval(function(){if(C.Cache.requests<=0){C.receive(req.responseXML.firstChild);clearInterval(loadingCache);if(onreceive){onreceive(req)}C.tgl_loading(false)}},100)})};WardenClient.prototype.request_cache=function(type,id,token,onreceive){var C=this.Cache,P=this.Preloader;this.Bridge.send("/cache.php",{t:type,i:id,k:token,v:WO_CLIENT_VERSION},"GET",function(req){if(req.responseXML&&req.responseXML.firstChild){var X,i,xml=req.responseXML.firstChild;for(i=0;i<xml.childNodes.length;i++){X=v(xml.childNodes[i]);if(X.b.nodeName=="cache"){C.receive(X.b);break}else{if(X.b.nodeName=="preload"){P.receive(X.b)}}}}if(onreceive){onreceive(req)}})};WardenClient.prototype.cache_queue=function(F){var M=this;var queue=setInterval(function(){if(M.Cache.requests<=0){F();clearInterval(queue)}},100)};WardenClient.prototype.cache_prepare=function(XML){if(!XML){return}var M=this,i,N,X;var defines=XML.getElementsByTagName("define");if(defines[0]){for(i=0;i<defines.length;i++){X=v(defines[i]);this.Cache.Constants[X.ga("name")]=X.ga("value")}}var cacheInit=XML.getElementsByTagName("cache_init");if(cacheInit[0]){this.Cache.requests+=v(cacheInit[0]).gan("n")}for(i=0;i<XML.childNodes.length;i++){N=XML.childNodes[i];X=v(N);switch(N.nodeName){case"alert":this.alert(N.getAttribute("msg"),N.getAttribute("type"),N.getAttribute("redir"));break;case"redirect":window.document.location.href=N.getAttribute("url");break;case"flush":this.Cache.data[v(N).ga("name")]={};break;case"flush_sub":var name=v(N).ga("name");var id=v(N).gan("id");var sub=v(N).ga("sub");if(this.Cache.data[name]&&this.Cache.data[name][id]){delete this.Cache.data[name][id][sub]}break;case"cache":this.Cache.receive(N);break}}};WardenClient.prototype.receive=function(XML){var i,N,X;for(i=0;i<XML.childNodes.length;i++){N=XML.childNodes[i];X=v(N);switch(N.nodeName){case"input_error":V(N.getAttribute("id")).handle("keydown").vsk_event_add("keydown",function(Input){Input.s.borderColor=""}).s.borderColor="red";break;case"script":this.Cache.data.onchange.execute("script",{name:v(N).ga("name")});break;case"module":if(v(N).gan("id")){var Module=this.E[v(N).gan("id")]}else{var Module=window[v(N).ga("name")]}if(Module&&Module.type){Module.receive(N)}break}}};WardenClient.prototype.request_module=function(name,dockId,args,noBrowserMsg){document.write('<div style="position:relative" id="loading_'+dockId+'"></div>');document.write('<div style="position:relative" id="'+dockId+'"></div>');var M=this;if(args){args.name=name;args.dockid=dockId}else{var args={name:name,dockid:dockId}}var Loading=V("loading_"+dockId);Loading.set_style({textAlign:"center",padding:"5px",color:"#3c2f23",font:"bold italic 11px Verdana"});Loading.html_a(v(vsk_h("img")).set("src",gp+"/ui/loading.gif").b);Loading.html_a(vsk_h("br"));Loading.html_a(vsk_t("Loading ..."));if(!noBrowserMsg&&(VUI_IS_IE||VUI_IS_OPERA)){Loading.html_a(vsk_h("br"));Loading.html_a(vsk_h("br"));if(VUI_IS_IE){Loading.html_a(vsk_t("Internet Explorer has been found to perform badly. (8-10 times higher loading times)"))}else{if(VUI_IS_OPERA){Loading.html_a(vsk_t("Opera has been found to perform badly. (3-4 times higher loading times)"))}}Loading.html_a(vsk_h("br"));Loading.html_a(vsk_h("br"));Loading.html_a(vsk_t("Both Mozilla Firefox and Google Chrome are known to have excellent performance with our game, give them a try if the game performs slow in your browser."))}V(dockId).fade(1);this.base.vsk_event_add("theme_/lib-js/ui.v-"+window.WO_CLIENT_VERSION+".xml",function(B,filePath){M.xml_load("/request.php",function(R){M.receive(R.responseXML)},args)})};WardenClient.prototype.alert=function(msg,type,redir,input){var M=this;if(!this.Alert){this.Alert=this.element(VUI_NODE).theme("window").hide(1).resize(400).set_pos("fixed",1000);this.Alert.move(vsk_iw()/2-200);v(vsk_h("div")).set("id","wo_alert_msg_node").set_style({margin:"30px",marginBottom:"100px"}).set_pos("relative",1000).dock(this.Alert.b);this.Alert.set("id","alert");this.AlertBG=v(vsk_h("div")).set_style({backgroundColor:"#000"}).set_pos("fixed",50).span(0,0,0,0).hide(1).dock(document.body);var BtnOkay=this.Alert.child(VUI_BUTTON,"BtnOkay").theme("std").resize(100,43).caption("Okay").move(150,null,null,25);BtnOkay.vsk_event_add("mousedown",function(Btn){M.Alert.hide(1);M.AlertBG.fx_fade_out(200).onhalt=function(){M.AlertBG.hide(1)}});var BtnCancel=this.Alert.child(VUI_BUTTON,"BtnCancel").theme("std").resize(100,43).caption("Cancel").hide(1);BtnCancel.vsk_event_add("mousedown",function(Btn){M.Alert.hide(1);M.AlertBG.fx_fade_out(200).onhalt=function(){M.AlertBG.hide(1)}});var FldInput=this.Alert.child(VUI_NODE,"FldInput","INPUT").resize(300).move(50,null,null,75).hide(1);this.Alert.place()}var A=this.Alert,Msg=V("wo_alert_msg_node");if(!this.AlertBG.v()||A.clearOnNext){Msg.clear();A.C.BtnOkay.vsk_event_unset("glb_mouseup","redir");A.clearOnNext=false}Msg.html_a(v(vsk_h("div")).set("class",type).html_a(vsk_t(msg)));if(input){A.C.BtnOkay.move(100);A.C.BtnCancel.move(210,null,null,25).hide(0);A.C.FldInput.hide(0)}else{A.C.BtnOkay.move(150);A.C.BtnCancel.hide(1);A.C.FldInput.hide(1).b.value=""}if(redir){A.C.BtnOkay.vsk_event_add("glb_mouseup",function(Btn){if(input){redir[1].query_input=A.C.FldInput.b.value;Btn.Manager.send(redir[0],redir[1]);A.clearOnNext=true}else{window.document.location.href=redir}},"redir")}A.move(null,vsk_ih()/2-A.h()/2);this.AlertBG.fade(1).hide(0).fx_fade_in(200,70).onhalt=function(){A.hide(0);if(input){A.C.FldInput.b.focus()}}};WardenClient.prototype.owns=function(charId){return(charId==parseInt(this.Cache.Constants.char_id))};var WO_CLASS_WARRIOR=1;var WO_CLASS_WIZARD=2;var WO_CLASS_PRIESTESS=3;var WO_CLASS_BERZERKER=4;var WO_CLASS_SCOUT=5;var WO_CLASS_COLORS={};WO_CLASS_COLORS[WO_CLASS_WARRIOR]="#5263cc";WO_CLASS_COLORS[WO_CLASS_WIZARD]="#ff6600";WO_CLASS_COLORS[WO_CLASS_SCOUT]="#7ab357";var WO_DIFFICULTY_NAMES=["","Easy","Normal","Hard","Heroic","Epic","Legendary"];var WO_INVSLOT_VISUAL={2:1,13:1,14:1};var WO_MAGIC_FIRE=1;var WO_MAGIC_ICE=2;var WO_MAGIC_EARTH=3;var WO_MAGIC_WIND=4;var WO_MAGIC_DARK=5;var WO_MAGIC_LIGHT=6;var WO_SCHOOL_MELEE=7;var WO_SCHOOL_RANGE=8;var WO_ENCTYP_MAGIC=1;var WO_ENCTYP_POISON=2;var WO_ENCTYP_DISEASE=3;var WO_ENCTYP_BLEED=4;var WO_AT_DAMAGE_DONE_MELEE=4;var WO_AT_DAMAGE_DONE_MAGIC=8;var WO_AT_DAMAGE_TAKEN_MELEE=16;var WO_AT_DAMAGE_TAKEN_MAGIC=32;var WO_AT_DAMAGE_TAKEN_PERIODIC=64;var WO_AT_DAMAGE_TAKEN_RANGE=128;var WO_AT_ATTACK_SPELL=256;var WO_AT_ATTACK_MELEE=512;var WO_AT_ATTACK_RANGE=1024;var WO_AT_SPELL_FEAR=2048;var WO_AT_SPELL_STUN=4096;var WO_AT_SPELL_CONTROL=8192;var WO_AT_SPELL_SILENCE=16384;var WO_AT_SPELL_ROOT=32768;var WO_AT_DAMAGE_DONE_RANGE=65536;var WO_AT_DAMAGE_TAKEN_NATURAL=262144;var WO_AT_DAMAGE_DONE_NATURAL=524288;var WO_AT_ATTACK_NATURAL=1048576;var WO_AT_KILLING_BLOW=2097152;var WO_AT_OUT_OF_RANGE=4194304;var WO_AT_TIMEOUT=8388608;var WO_AT_TURN_BEGIN=16777216;var WO_AT_HOSTILE_TARGET=WO_AT_DAMAGE_TAKEN_RANGE|WO_AT_DAMAGE_TAKEN_MELEE|WO_AT_DAMAGE_TAKEN_MAGIC|WO_AT_DAMAGE_TAKEN_PERIODIC|WO_AT_DAMAGE_TAKEN_NATURAL;var WO_AT_HOSTILE_SOURCE=WO_AT_DAMAGE_DONE_MELEE|WO_AT_DAMAGE_DONE_MAGIC|WO_AT_DAMAGE_DONE_RANGE|WO_AT_DAMAGE_DONE_NATURAL;var WO_AT_ATTACK=WO_AT_ATTACK_SPELL|WO_AT_ATTACK_MELEE|WO_AT_ATTACK_RANGE|WO_AT_ATTACK_NATURAL;var WO_ENC_HEALTH=1;var WO_ENC_POWER=2;var WO_ENC_CONCENTRATION=3;var WO_ENC_LUCK=4;var WO_ENC_SPEED=5;var WO_ENC_MAIN0=6;var WO_ENC_MAIN1=7;var WO_ENC_MAIN2=8;var WO_ENC_ARMOR=9;var WO_ENC_RESIST_FIRE=10;var WO_ENC_RESIST_ICE=11;var WO_ENC_RESIST_WIND=12;var WO_ENC_RESIST_EARTH=13;var WO_ENC_RESIST_LIGHT=14;var WO_ENC_RESIST_DARK=15;var WO_ENC_DAMAGE_MELEE=16;var WO_ENC_DAMAGE_MAGIC=17;var WO_ENC_DAMAGE_RANGE=18;var WO_ENC_HOT=19;var WO_ENC_DOT=20;var WO_ENC_SPELL_EFFECTIVITY=21;var WO_ENC_STUN=22;var WO_ENC_ROOT=23;var WO_ENC_CONTROL=24;var WO_ENC_SILENCE=25;var WO_ENC_FEAR=26;var WO_ENC_SPELL=27;var WO_ENC_DAMAGE_REDIRECT=28;var WO_ENC_IMMUNITY_FEAR=29;var WO_ENC_IMMUNITY_STUN=30;var WO_ENC_IMMUNITY_CONTROL=31;var WO_ENC_IMMUNITY_SILENCE=32;var WO_ENC_IMMUNITY_ROOT=33;var WO_ENC_MOVE=34;var WO_ENC_SLEEP=35;var WO_ENC_IMMUNITY_SLEEP=36;var WO_ENC_IMMUNITY_FIRE=37;var WO_ENC_IMMUNITY_EARTH=38;var WO_ENC_IMMUNITY_ICE=39;var WO_ENC_IMMUNITY_WIND=40;var WO_ENC_IMMUNITY_MELEE=41;var WO_ENC_IMMUNITY_DARK=42;var WO_ENC_IMMUNITY_LIGHT=43;var WO_ENC_THREAT=44;var WO_ENC_GUILE=45;var WO_ENC_HEALTH_REGEN=46;var WO_ENC_ENERGY_REGEN=47;var WO_ENC_RELAY=48;var WO_ABILITY_GENERIC=1;var WO_ABILITY_COUNTER=2;var WO_ABILITY_QUEUED=3;var WO_SPELLCT_MELEE=1;var WO_SPELLCT_MAGIC=2;var WO_SPELLCT_ARCHERY=3;var WO_BO_WAIT_1=1;var WO_BO_WAIT_2=2;var WO_BO_WAIT_3=4;var WO_BO_WAIT_4=8;var WO_BO_WAIT_5=16;var WO_BO_SELECT_TARGET_HURT_IN_RANGE=32;var WO_BO_SELECT_TARGET_HURT=64;var WO_BO_CONTROL_AGGRO=128;var WO_BO_DEFEND_WHILE_MOVING=256;var WO_BO_ATTACK_WHILE_MOVING=512;var WO_BO_CROWD_CONTROL_FOCUS=1024;var WO_BO_FOCUS_MINIONS=2048;var WO_BO_DROP_TARGET=131072;var WO_BO_WARRIOR_PROTECT=4096;var WO_BO_WARRIOR_STANCE_DEFENSIVE=8192;var WO_BO_WARRIOR_STANCE_OFFENSIVE=16384;var WO_BO_WARRIOR_STANCE_EVASIVE=32768;var WO_BO_WIZARD_IM_ICE=4096;var WO_BO_WIZARD_IM_EARTH=8192;var WO_BO_WIZARD_IM_WIND=16384;var WO_BO_NUM=11;var WO_BO=[WO_BO_WAIT_1,WO_BO_WAIT_2,WO_BO_WAIT_3,WO_BO_WAIT_4,WO_BO_WAIT_5,WO_BO_SELECT_TARGET_HURT_IN_RANGE,WO_BO_SELECT_TARGET_HURT,WO_BO_CONTROL_AGGRO,WO_BO_DEFEND_WHILE_MOVING,WO_BO_ATTACK_WHILE_MOVING,WO_BO_CROWD_CONTROL_FOCUS,WO_BO_FOCUS_MINIONS,WO_BO_DROP_TARGET];var WO_BO_CS={};WO_BO_CS[WO_CLASS_WIZARD]=[WO_BO_WIZARD_IM_ICE,WO_BO_WIZARD_IM_EARTH,WO_BO_WIZARD_IM_WIND];WO_BO_CS[WO_CLASS_WARRIOR]=[WO_BO_WARRIOR_PROTECT,WO_BO_WARRIOR_STANCE_DEFENSIVE,WO_BO_WARRIOR_STANCE_EVASIVE,WO_BO_WARRIOR_STANCE_OFFENSIVE];WO_BO_CS[WO_CLASS_SCOUT]=[];var WO_CT_HUMANOID=1;var WO_CT_BEAST=2;var WO_CT_UNDEAD=3;var WO_CT_ARCANE_BEING=4;var WO_CT_ARCANE_CREATION=5;var WO_CT_INSECTOID=6;var WO_CT_BEAST_FLYING=7;var WO_CT_PLANT=8;var WO_CT_DEMON=9;var WO_CT_GIANT=10;var WO_CT_ITEM_STATS=["health","armor","power","main0","speed","move","damage","concentration","threat","guile","luck","resist_fire","resist_ice","resist_earth","resist_wind","resist_light","resist_dark","health_regen","energy_regen"];function battleorder_is_class_specific(order){return(order==4096||order==8192||order==16384||order==32768||order==65536)}function WardenGame(){}WardenGame.prototype.character_type_xl=function(id){switch(id){case WO_CT_HUMANOID:return"Humanoid";case WO_CT_BEAST:return"Beast";case WO_CT_UNDEAD:return"Undead";case WO_CT_ARCANE_BEING:return"Arcane Being";case WO_CT_ARCANE_CREATION:return"Arcane Creation";case WO_CT_INSECTOID:return"Insectoid";case WO_CT_BEAST_FLYING:return"Flying Beast";case WO_CT_PLANT:return"Plant";case WO_CT_DEMON:return"Demon";case WO_CT_GIANT:return"Giant";default:return"Unknown Type"}};WardenGame.prototype.order_xl=function(orderId,classId){switch(orderId){case WO_BO_WAIT_1:return"Wait 1 turn";break;case WO_BO_WAIT_2:return"Wait 2 turns";break;case WO_BO_WAIT_3:return"Wait 3 turns";break;case WO_BO_WAIT_4:return"Wait 4 turns";break;case WO_BO_WAIT_5:return"Wait 5 turns";break;case WO_BO_SELECT_TARGET_HURT_IN_RANGE:return"Select Target: Hurt & In Range";break;case WO_BO_SELECT_TARGET_HURT:return"Select Target: Hurt";break;case WO_BO_CONTROL_AGGRO:return"Control Aggro";break;case WO_BO_DEFEND_WHILE_MOVING:return"Defend While Moving";break;case WO_BO_ATTACK_WHILE_MOVING:return"Attack While Moving";break;case WO_BO_CROWD_CONTROL_FOCUS:return"Crowd Control Focus";break;case WO_BO_FOCUS_MINIONS:return"Focus on New Spawns";break;case WO_BO_DROP_TARGET:return"Drop Target Before It Dies";break;case 4096:switch(classId){case 1:return"Protect";case 2:return"Innate Magic: Ice"}break;case 8192:switch(classId){case 1:return"Stance: Defensive";case 2:return"Innate Magic: Earth"}break;case 16384:switch(classId){case 1:return"Stance: Offensive";case 2:return"Innate Magic: Wind"}break;case 32768:switch(classId){case 1:return"Stance: Evasive"}break;default:return"Unknown Battle Order";break}return"Unknown"};WardenGame.prototype.order_info=function(orderId,classId){switch(orderId){case WO_BO_WAIT_1:return"The character will wait 1 turn before going into combat.";break;case WO_BO_WAIT_2:return"The character will wait 2 turns before going into combat.";break;case WO_BO_WAIT_3:return"The character will wait 3 turns before going into combat.";break;case WO_BO_WAIT_4:return"The character will wait 4 turns before going into combat.";break;case WO_BO_WAIT_5:return"The character will wait 5 turns before going into combat.";break;case WO_BO_SELECT_TARGET_HURT_IN_RANGE:return"The character automatically switches to the most hurt enemy that is in melee range";break;case WO_BO_SELECT_TARGET_HURT:return"The character automatically switches to the most hurt enemy on the battlefield";break;case WO_BO_CONTROL_AGGRO:return"The character will skip his turn if his current target is attacking him in order to lessen his threat. Each time this battleorder is performed the character's threat towards his current target is reduced by a small amount";break;case WO_BO_DEFEND_WHILE_MOVING:return"If attacked while moving, the character will attack his pursuer while he moves towards his primary target";break;case WO_BO_ATTACK_WHILE_MOVING:return"The character will attack the next target while moving towards his primary target";break;case WO_BO_CROWD_CONTROL_FOCUS:return"The character will go out of his way to keep his current crowd control target under control";break;case WO_BO_FOCUS_MINIONS:return"The character will go out of his way to kill summoned creatures and creatures that enter the battle after it has started.";break;case WO_BO_DROP_TARGET:return"The character will attack the next target when his current target is almost dead (less than 21% health left)";break;case 4096:switch(classId){case 1:return'The warrior will stick close to the support target, attacking targets close by and shielding it from incoming damage.<br /><br /><span class="important_2">Only effective if the support target is not another warrior</span>';case 2:return"The wizard's base attack will be ice based. Also the wizard's resistance against other ice based spells is slightly increased"}break;case 8192:switch(classId){case 1:return'The warrior\'s armor, resistances to magic attacks and threat are increased while the damage output is decreased.<br /><br /><span class="important_2">Other selected stances will overrule this stance</span>';case 2:return"The wizard's base attack will be earth based. Also the wizard's resistance against other earth based spells is slightly increased"}break;case 16384:switch(classId){case 1:return'The warrior\'s armor rating is decreased while the damage output is increased.<br /><br /><span class="important_2">Other selected stances will overrule this stance</span>';case 2:return"The wizard's base attack will be wind based. Also the wizard's resistance against other wind based spells is slightly increased"}break;case 32768:switch(classId){case 1:return'The warrior will step out of melee range after attacking the current target. Damage output of the warrior is slightly decreased.<br /><br /><span class="important_2">Other selected stances will overrule this stance</span>'}break;default:return"Unknown Battle Order";break}};WardenGame.prototype.spell_real_id=function(spellId){switch(spellId){case"shoot":return 99996;case"earthblast":return 99993;case"windsurge":return 99994;case"iceshard":return 99995;case"blast":return 99998;case"melee":return 99999;default:return parseInt(spellId)}};WardenGame.prototype.enchantment_strength_xl=function(strength,stat){var isNegative=(strength<0),s;strength=Math.abs(strength);if(strength<10){s="slightly"}else{if(strength<30){s="noticably"}else{if(strength<50){s="moderately"}else{if(strength<70){s="significantly"}else{if(strength<90){s="greatly"}else{s="critically"}}}}}return s+" "+(isNegative?"decreased":"increased")};WardenGame.prototype.enchantment_stat_xl=function(classId,stat){switch(stat){case WO_ENC_HEALTH:return"Health";case WO_ENC_POWER:return"Power energy";case WO_ENC_CONCENTRATION:return"Concentration";case WO_ENC_LUCK:return"Luck";case WO_ENC_SPEED:return"Delay";case WO_ENC_MOVE:return"Movement Range";case WO_ENC_MAIN0:return this.item_stat_xl("stat_main0",classId);case WO_ENC_MAIN1:return this.item_stat_xl("stat_main1",classId);case WO_ENC_MAIN2:return this.item_stat_xl("stat_main2",classId);case WO_ENC_ARMOR:return"Armor";case WO_ENC_RESIST_FIRE:return"Magical Resistance: Fire";case WO_ENC_RESIST_ICE:return"Magical Resistance: Ice";case WO_ENC_RESIST_WIND:return"Magical Resistance: Wind";case WO_ENC_RESIST_EARTH:return"Magical Resistance: Earth";case WO_ENC_RESIST_DARK:return"Magical Resistance: Dark";case WO_ENC_RESIST_LIGHT:return"Magical Resistance: Light";case WO_ENC_DAMAGE_MELEE:return"Melee Damage";case WO_ENC_DAMAGE_RANGE:return"Ranged Damage";case WO_ENC_DAMAGE_MAGIC:return"Magical Damage";case WO_ENC_SPELL_EFFECTIVITY:return"Effectivity";case WO_ENC_THREAT:return"Threat";case WO_ENC_GUILE:return"Guile";case WO_ENC_HEALTH_REGEN:return"Health Regeneration";break;case WO_ENC_ENERGY_REGEN:return"Energy Regeneration";break;default:return"Unknown Stat"}};WardenGame.prototype.battlefield_type_xl=function(type){switch(type){case 1:return"Skirmish";case 2:return"Challenge";default:return"Unknown"}};WardenGame.prototype.enchantment_xl=function(enchantId,spellName){switch(enchantId){case WO_ENC_STUN:return"stunned";case WO_ENC_SLEEP:return"asleep";case WO_ENC_ROOT:return"rooted";case WO_ENC_SILENCE:return"silenced";case WO_ENC_FEAR:return"feared";case WO_ENC_CONTROL:return"mind-controlled";case WO_ENC_IMMUNITY_STUN:return"immune to stun effects";case WO_ENC_IMMUNITY_SLEEP:return"immune to sleep effects";case WO_ENC_IMMUNITY_ROOT:return"immune to immobilization effects";case WO_ENC_IMMUNITY_SILENCE:return"immune to silence effects";case WO_ENC_IMMUNITY_FEAR:return"immune to fear effects";case WO_ENC_IMMUNITY_CONTROL:return"immune to mind-control effects";case WO_ENC_IMMUNITY_FIRE:return"immune to fire";case WO_ENC_IMMUNITY_ICE:return"immune to ice";case WO_ENC_IMMUNITY_EARTH:return"immune to earth";case WO_ENC_IMMUNITY_WIND:return"immune to wind";case WO_ENC_IMMUNITY_LIGHT:return"immune to light";case WO_ENC_IMMUNITY_DARK:return"immune to darkness";case WO_ENC_IMMUNITY_MELEE:return"immune to melee damage";case WO_ENC_DOT:return"taking damage over time";case WO_ENC_HOT:return"being healed over time";case WO_ENC_RELAY:return"relaying incoming attacks";default:return"affected by "+spellName}};WardenGame.prototype.spell_info_text=function(Spell){var type=Spell.type;var triggerFlags=Spell.trigger_type;var part1="";var part2="";var part3="";var nonAE="";switch(type){case WO_ABILITY_GENERIC:part1="This is a <span class=\"tooltip_header\">generic ability</span>, it may be used when it's the character's turn.";break;case WO_ABILITY_COUNTER:part1='This is a <span class="tooltip_header">counter ability</span>. It may be used as an instantaneous response to an attack or event.';nonAE="(non AE)";break;case WO_ABILITY_QUEUED:part1="This is a <span class=\"tooltip_header\">queued ability</span>. It is activated by a certain event or attack and may be used when it's the character's turn.";break}if(Spell.school){part3='<span class="tooltip_header">School:</span> '+(Spell.school<7?"Magic: ":"")+this.spell_school_xl(Spell.school)}if(triggerFlags&WO_AT_DAMAGE_DONE_MELEE){part2+="Damage Dealt: Melee "+nonAE+"<br />"}if(triggerFlags&WO_AT_DAMAGE_DONE_MAGIC){part2+="Damage Dealt: Magic "+nonAE+"<br />"}if(triggerFlags&WO_AT_DAMAGE_DONE_RANGE){part2+="Damage Dealt: Ranged "+nonAE+"<br />"}if(triggerFlags&WO_AT_DAMAGE_TAKEN_MELEE){part2+="Damage Taken: Melee "+nonAE+"<br />"}if(triggerFlags&WO_AT_DAMAGE_TAKEN_MAGIC){part2+="Damage Taken: Magic "+nonAE+"<br />"}if(triggerFlags&WO_AT_DAMAGE_TAKEN_RANGE){part2+="Damage Taken: Ranged "+nonAE+"<br />"}if(triggerFlags&WO_AT_DAMAGE_TAKEN_PERIODIC){part2+="Damage Taken: Periodic<br />"}if(triggerFlags&WO_AT_ATTACK_SPELL){part2+="Incoming Attack: Spell "+nonAE+"<br />"}if(triggerFlags&WO_AT_ATTACK_MELEE){part2+="Incoming Attack: Melee "+nonAE+"<br />"}if(triggerFlags&WO_AT_ATTACK_RANGE){part2+="Incoming Attack: Ranged "+nonAE+"<br />"}if(triggerFlags&WO_AT_SPELL_FEAR){part2+="Affected By: Fear<br />"}if(triggerFlags&WO_AT_SPELL_STUN){part2+="Affected By: Stun<br />"}if(triggerFlags&WO_AT_SPELL_CONTROL){part2+="Affected By: Mind Control<br />"}if(triggerFlags&WO_AT_SPELL_ROOT){part2+="Affected By: Root<br />"}if(triggerFlags&WO_AT_SPELL_SILENCE){part2+="Affected By: Silence<br />"}if(triggerFlags&WO_AT_KILLING_BLOW){part2+="Killing Blow"}if(triggerFlags&WO_AT_OUT_OF_RANGE){part2+="Target out of range"}if(triggerFlags&WO_AT_TIMEOUT){part2+="Timeout"}if(triggerFlags&WO_AT_TURN_BEGIN){part2+="Beginning of character's turn"}if(part2){part2='<div class="tooltip_header">Triggered By:</div>'+part2}return part1+part2+(part3?"<br /><br />"+part3:"")};WardenGame.prototype.spell_school_xl=function(school){switch(school){case WO_MAGIC_FIRE:return"fire";case WO_MAGIC_EARTH:return"earth";case WO_MAGIC_WIND:return"wind";case WO_MAGIC_ICE:return"ice";case WO_MAGIC_DARK:return"dark";case WO_MAGIC_LIGHT:return"light";case WO_SCHOOL_MELEE:return"melee";case WO_SCHOOL_RANGE:return"range";default:return"unknown"}};WardenGame.prototype.item_type_xl=function(itemType,ucFirst,classId){switch(itemType){case 1:return(ucFirst?"Weapon":"weapon");case 2:if(!classId||classId==WO_CLASS_WARRIOR){return(ucFirst?"Shield":"shield")}else{if(classId==WO_CLASS_WIZARD){return(ucFirst?"Magical Stone":"magical stone")}else{if(classId==WO_CLASS_SCOUT){return(ucFirst?"Arrow":"arrow")}}}break;case 3:return(ucFirst?"Armor":"armor");default:return null}};WardenGame.prototype.character_class_xl=function(classId){switch(classId){case WO_CLASS_WARRIOR:return"warrior";case WO_CLASS_PRIESTESS:return"priestess";case WO_CLASS_BERZERKER:return"berzerker";case WO_CLASS_SCOUT:return"ranger";case WO_CLASS_WIZARD:return"wizard"}};WardenGame.prototype.item_color_xl=function(quality){switch(parseInt(quality)){default:case 0:return"#9f8b70";case 1:return"#69a0a2";case 2:return"#229d11";case 3:return"#5664bc";case 4:return"#8f56bc";case 5:return"#a93232";case 6:return"#e4a656"}};WardenGame.prototype.item_stat_xl=function(stat,classId){switch(stat){case"stat_main0":switch(parseInt(classId)){case WO_CLASS_WARRIOR:return"Strength";case WO_CLASS_WIZARD:return"Intellect";case WO_CLASS_SCOUT:return"Dexterity"}break;case"stat_main1":switch(parseInt(classId)){case WO_CLASS_WARRIOR:return"Taunt";case WO_CLASS_WIZARD:return"Clarity"}break;case"stat_main2":switch(parseInt(classId)){case WO_CLASS_WARRIOR:return"Vitality";case WO_CLASS_WIZARD:return"Wisdom"}break;case"stat_armor":return"Armor";case"stat_health":return"Health";case"stat_mana":return"Mana";case"stat_luck":return"Luck";case"stat_concentration":return"Effectivity";case"stat_speed":return"Delay";case"stat_resist_fire":return"Magic Resist - Fire";case"stat_resist_ice":return"Magic Resist - Ice";case"stat_resist_earth":return"Magic Resist - Earth";case"stat_resist_wind":return"Magic Resist - Wind";case"stat_resist_light":return"Magic Resist - Light";case"stat_resist_dark":return"Magic Resist - Darkness";case"stat_damage":return"Damage";case"stat_threat":return"Threat";case"stat_guile":return"Guile";case"stat_health_regen":return"Health Regeneration";case"stat_energy_regen":return"Power Regeneration";case"stat_move":return"Movement";default:return null}};WardenGame.prototype.slot_xl=function(slot){switch(slot){case 1:return"pants";case 2:return"chest";case 3:return"helmet";case 4:return"gloves";case 5:return"bracer";case 6:return"belt";case 7:return"shoulder";case 8:return"necklace";case 9:case 10:return"earring";case 11:case 12:return"ring";case 13:return"mainhand";case 14:return"offhand";case 15:return"boots";case 16:return"cloak"}};WardenGame.prototype.target_xl=function(type){switch(parseInt(type)){case 1:return"friendly";case 2:return"hero";case 3:return"minion";case 4:return"friendly_artefact";case 5:return"hostile";case 6:return"hostile_artefact"}};WardenGame.prototype.currency_split=function(copper){var silver,gold,mithril,rest;var b=copper/1000000;mithril=Math.floor(b);gold=(1000000*(b-mithril))/10000;rest=gold-Math.floor(gold);silver=(1000000*rest)/10000;rest=silver-Math.floor(silver);copper=Math.round(rest*100);gold=Math.floor(gold);silver=Math.floor(silver);if(copper==100){copper=0;silver+=1}return{copper:copper,silver:silver,gold:gold,mithril:mithril}};WardenGame.prototype.spell_ct_xl=function(ct){switch(ct){case WO_SPELLCT_MAGIC:return"book";case WO_SPELLCT_ARCHERY:return"bow";default:case WO_SPELLCT_MELEE:return"sword"}};WardenGame.prototype.character_type_traits=function(charType){switch(charType){case WO_CT_BEAST:case WO_CT_BEAST_FLYING:return["Increased Movement Range (+1)","Weak against physical ranged damage"];case WO_CT_UNDEAD:return["Immune to Fear Effects, Increased Strength","Increased Action Delay"];case WO_CT_ARCANE_BEING:case WO_CT_ARCANE_CREATION:return["Immune to Crowd Control Effects","Weak against magical damage"];case WO_CT_INSECTOID:return["Increased Speed","Weak against fire and decreased armor rating."];case WO_CT_PLANT:return["Increased Health Regeneration","Weak against fire."];case WO_CT_GIANT:return["Immune to Stun and Fear","None"];case WO_CT_DEMON:return["Increased Resistance to Magic (Dark)","Decreased Health Regeneration"]}return null};var WO_CHARACTER_CREATION=1001;vui_element_add(WO_CHARACTER_CREATION,WardenCharacterCreation);function WardenCharacterCreation(Manager,Parent){this.constructor=WardenModule;this.constructor(Manager,Parent);this.ClassSelect=this.child(VUI_NODE,"ClassSelect");this.ClassField=this.ClassSelect.child(VUI_NODE,"ClassField");this.BtnNext=this.child(VUI_BUTTON,"BtnNext");this.ClassDescription=this.ClassSelect.child(VUI_NODE,"Description");this.ClassDescription.child(VUI_NODE,"Text");this.ClassDescription.child(VUI_NODE,"Icon");this.ClassIcon=this.ClassSelect.child(VUI_NODE,"ClassIcon");this.ClassLabel=this.ClassSelect.child(VUI_NODE,"ClassLabel");this.Customize=this.child(VUI_NODE,"Customize");this.Customize.child(VUI_NODE,"Character");this.Customize.child(VUI_NODE,"ClassIcon");this.Customize.child(VUI_NODE,"ClassLabel");this.Customize.child(VUI_NODE,"LblName");this.Customize.child(VUI_TEXTINPUT,"FldName");this.Customize.child(VUI_NODE,"LblSkin");this.Customize.child(VUI_DROPDOWN_LIST,"LstSkin");this.Customize.child(VUI_NODE,"LblHair");this.Customize.child(VUI_DROPDOWN_LIST,"LstHair");this.Customize.child(VUI_NODE,"LblHairColor");this.Customize.child(VUI_DROPDOWN_LIST,"LstHairColor");this.Customize.child(VUI_NODE,"LblFacial");this.Customize.child(VUI_DROPDOWN_LIST,"LstFacial");this.Customize.child(VUI_CHECKBOX,"CbTutorial");this.Classes=[];this.processStatus=0;this.selectedClass=0;this.BtnNext.vsk_event_add("mousedown",function(Btn,e){var CC=Btn.Parent;if(!CC.processStatus){if(!CC.selectedClass){CC.Manager.alert("Please select a character class")}else{CC.customize_set();CC.ClassSelect.hide(1);CC.Customize.hide(0)}}else{var C=CC.Customize.C;CC.Manager.send("game-create-character",{name:C.FldName.b.value,skin_id:C.LstSkin.List.value(),hair_id:C.LstHair.List.value(),hair_color_id:C.LstHairColor.List.value(),facial_id:C.LstFacial.List.value(),tutorial:C.CbTutorial.isChecked,class_id:CC.selectedClass.wo_classId})}},"_priv_charcreate");this.Customize.C.LstSkin.List.vsk_event_add("change",function(List){var O=List.Parent.Parent.Parent.CharacterObject;if(O){O.update_skin(List.value())}},"_priv_charcreate");this.Customize.C.LstHair.List.vsk_event_add("change",function(List){var P=List.Parent.Parent;var O=P.Parent.CharacterObject;if(O){O.update_hair(List.value(),P.C.LstHairColor.List.value()||0)}},"_priv_charcreate");this.Customize.C.LstFacial.List.vsk_event_add("change",function(List){var P=List.Parent.Parent;var O=P.Parent.CharacterObject;if(O){O.update_facial(List.value(),P.C.LstHairColor.List.value()||0)}},"_priv_charcreate");this.Customize.C.LstHairColor.List.vsk_event_add("change",function(List){var P=List.Parent.Parent;var O=P.Parent.CharacterObject;if(O){O.update_facial(P.C.LstFacial.List.value(),List.value());O.update_hair(P.C.LstHair.List.value(),List.value())}},"_priv_charcreate");this.ClassSelect.span(5,5,5,30).level(1);this.ClassDescription.C.Text.clear(vsk_t("Please click on one of the statues to select the class it represents. Empty pedestals are reserved for future class additions"));this.Customize.span(5,5,5,30).hide(1).level(2)}WardenCharacterCreation.prototype=new vsk_clone(WardenModule.prototype);WardenCharacterCreation.prototype.customize_set=function(){var S,i;if((S=this.selectedClass)){var C=this.Customize.C;C.ClassIcon.clear(v(vsk_h("img")).set("src",S.wo_classIcon).b);var cName=v(vsk_h("div")).set_style({color:S.wo_color}).html_a(vsk_t(S.wo_cName));C.ClassLabel.clear(cName);var CO=this.Manager.Cache.render_object_character(S.wo_classId);CO.vsk_event_add("resize",function(CO){CO.move(C.Character.w()/2-CO.w()/2,C.Character.h()/2-CO.h()/2)});C.Character.clear(CO.b);this.CharacterObject=CO;var Cust=S.wo_custom;C.LstHair.flush();C.LstHairColor.flush();C.LstSkin.flush();C.LstFacial.flush();for(i in Cust.Hair){C.LstHair.List.item_add_txt(Cust.Hair[i],parseInt(i))}for(i in Cust.HairColor){C.LstHairColor.List.item_add_txt(Cust.HairColor[i],parseInt(i))}for(i in Cust.Skin){C.LstSkin.List.item_add_txt(Cust.Skin[i],parseInt(i))}for(i in Cust.Facial){C.LstFacial.List.item_add_txt(Cust.Facial[i],parseInt(i))}C.LstSkin.List.select_item(0);C.LstHair.List.select_item(0);C.LstHairColor.List.select_item(0);C.LstFacial.List.select_item(255);this.processStatus=1}};WardenCharacterCreation.prototype.class_select=function(ClassName){var i,C,CF=this.ClassField,CI=this.ClassIcon,CL=this.ClassLabel;var P=v(this.ClassDescription.b.childNodes[2]);CI.hide(1);CL.hide(1);P.hide(1);this.ClassDescription.C.Icon.clear();this.ClassDescription.C.Text.clear();if(this.selectedClass){if(this.selectedClass.wo_cName==ClassName){return this}else{C=this.selectedClass;C.fx_morph(C.wo_oldW,C.wo_oldH,C.wo_oldX,C.wo_oldY,250)}}for(i=0;i<this.Classes.length;i++){C=this.Classes[i];if(C.wo_cName==ClassName){this.selectedClass=C;var rc=(C.x()+C.w()/2)+C.wo_cOffset+CF.x();CI.move(rc-CI.w()/2).hide(0).fade(1).clear(v(vsk_h("img")).set("src",C.wo_classIcon).b).fx_fade_in(300);CL.move(rc-CL.w()/2).clear(vsk_t(C.wo_cName)).hide(0).fade(1).fx_fade_in(300);P.move(rc-P.w()/2-this.ClassDescription.x()).hide(0);this.ClassDescription.C.Icon.clear(v(vsk_h("img")).set("src",C.wo_classIcon).b);this.ClassDescription.C.Text.b.innerHTML='<span style="font:bold 14px Verdana, Arial, Helvetica; color:'+C.wo_color+'">The '+ClassName+"</span>"+C.wo_classDescription;C.fx_morph(C.wo_w,C.wo_h,C.x()-Math.floor((C.wo_w-C.w())/2),C.y()-Math.floor((C.wo_h-C.h())/2),250)}}};WardenCharacterCreation.prototype.xml_build__wocharcreat=function(xml,Parent){var c,C,M=this,r,R,i;this.xml_build__element(xml,Parent);for(i=0;i<xml.childNodes.length;i++){c=xml.childNodes[i];C=v(c);switch(c.nodeName){case"WOClass":var n=this.Classes.length;var w=C.gan("w");var h=C.gan("h");var wN=Math.round(w*0.75);var hN=Math.round(h*0.75);var sprite=C.ga("sprite");if(!C.ga("dud")){var name=C.ga("name");var S=v(vsk_h("img")).set("src",sprite).move(n*130,C.gan("y")).level(2).resize(wN,hN).dock(this.ClassField.b);S.handle("mousedown").vsk_event_add("mousedown",function(S){M.class_select(S.wo_cName)});S.wo_cName=name;S.wo_classIcon=C.ga("icon");S.wo_classDescription=C.ga("description");S.wo_cOffset=C.gan("c_offset");S.wo_color=C.ga("color");S.wo_classId=C.gan("class_id");S.wo_oldY=S.y();S.wo_oldX=S.x();S.wo_oldW=wN;S.wo_oldH=hN;S.wo_custom={};for(r=0;r<c.childNodes.length;r++){R=v(c.childNodes[r]);switch(R.b.nodeName){default:if(!S.wo_custom[R.b.nodeName]){S.wo_custom[R.b.nodeName]={}}S.wo_custom[R.b.nodeName][R.gan("id")]=R.ga("label");break}}}else{var S=v(vsk_h("img")).set("src",sprite).move(n*130,158).level(2).resize(wN,hN).dock(this.ClassField.b);S.wo_cName="dud"}S.set_style({cursor:"pointer"});S.wo_h=h;S.wo_w=w;this.Classes.push(S);break}}return this};WardenCharacterCreation.prototype.xml_build=WardenCharacterCreation.prototype.xml_build__wocharcreat;var WO_CHARACTER_SELECT=1002;var WO_SELECTED_CHARACTER=1003;vui_element_add(WO_CHARACTER_SELECT,WardenCharacterSelect);vui_element_add(WO_SELECTED_CHARACTER,WardenSelectedCharacter);function WardenSelectedCharacter(Manager,Parent){this.constructor=WardenModule;this.constructor(Manager,Parent);this.Details=this.child(VUI_NODE,"Details");this.Portrait=this.Details.child(VUI_NODE,"Portrait");this.LblPenalty=this.Details.child(VUI_NODE,"LblPenalty").level(10).hide(1);this.LblName=this.Details.child(VUI_NODE,"LblName");this.LblLevel=this.Details.child(VUI_NODE,"LblLevel");this.LblClass=this.Details.child(VUI_NODE,"LblClass");this.LblHAD=this.Details.child(VUI_NODE,"LblHAD");this.GauExp=this.Details.child(VUI_GAUGE,"GauExp");this.LblWealth=this.Details.child(WO_CURRENCY_LABEL,"LblWealth");this.LblEquiprank=this.Details.child(VUI_NODE,"LblEquiprank");this.BtnRestore=this.child(VUI_BUTTON,"BtnRestore");this.NotePvP=this.child(VUI_NODE,"NotePvP");this.NotePvP.child(VUI_NODE,"LblNew");this.NotePvP.child(VUI_NODE,"LblChanged");this.NotePvP.child(VUI_NODE,"LblFinished");this.LblName.set_style({overflow:"hidden"});this.Portrait.set_style({overflow:"hidden"});this.s.cursor="pointer";this.handle("mousedown").vsk_event_add("mousedown",function(CS){vsk_redirect("/game/character")},"_priv");var SC=this;this.Manager.Cache.data.onchange.add(function(type,d){if(type=="character"&&parseInt(d.data._id)==parseInt(SC.charId)){SC.set_character(d.data._id)}else{if(type=="base_stats"&&parseInt(d.data._id)==parseInt(SC.charId)){SC.LblHAD.clear(vsk_t(d.data.health+" / "+d.data.armor+" / "+d.data.damage))}}},"selected_character_"+this.uniqueId);this.C.BtnRestore.vsk_event_add("mousedown",function(Btn,e){Btn.Manager.send("game-restore-confidence",{full:1});ve(e).cancel_bubbling()},"_priv_highwarden").cooltip_set("Restore your confidence","ac");this.Details.cooltip_set(function(){if(SC.Character.penalty){return"Click to view your character details page.<br /><br />Your character has died and has suffed a confidence penalty of "+SC.Character.penalty+"%. Click Restore Confidence to restore your confidence to full"}else{return"Click to view your character details page"}},"ac");this.LblHAD.cooltip_set("Health / Armor / Damage","ac");this.GauExp.cooltip_set("Experience","ac");this.NotePvP.C.LblNew.cooltip_set("New PvP Challenges","ac");this.NotePvP.C.LblFinished.cooltip_set("Recently Finished PvP Challenges","ac");this.NotePvP.C.LblChanged.cooltip_set("PvP Challenges that await your action","ac");this.NotePvP.C.LblNew.handle("mousedown").vsk_event_add("mousedown",function(Btn,e){vsk_redirect("/game/pvp-challenges/open");ve(e).cancel_bubbling()},"_priv_sel_character");this.NotePvP.C.LblChanged.handle("mousedown").vsk_event_add("mousedown",function(Btn,e){vsk_redirect("/game/pvp-challenges/open");ve(e).cancel_bubbling()},"_priv_sel_character");this.NotePvP.C.LblFinished.handle("mousedown").vsk_event_add("mousedown",function(Btn,e){vsk_redirect("/game/pvp-challenges/finished");ve(e).cancel_bubbling()},"_priv_sel_character")}WardenSelectedCharacter.prototype=new vsk_clone(WardenModule.prototype);WardenSelectedCharacter.prototype.xml_build__woselchar=function(xml,Parent){this.xml_build__element(xml,Parent);var charId=v(xml).gan("character_id");this.set_character(charId);return this};WardenSelectedCharacter.prototype.xml_build=WardenSelectedCharacter.prototype.xml_build__woselchar;WardenSelectedCharacter.prototype.set_character=function(charId){var M=this.Manager;var Cache=M.Cache;var Game=M.Game;var S=Cache.render_object_character(charId);var D=Cache.data.character[charId];var O=Cache.data.object_character[D.class_id];var B=Cache.data.base_stats[charId];this.Character=D;this.charId=charId;this.Portrait.clear(S.move((this.Portrait.w()/2)-O.portrait_x,-O.portrait_y).b);if(D.penalty>0){this.LblPenalty.clear(vsk_t("-"+D.penalty+"%")).hide(0);var LblCost=M.element(WO_CURRENCY_LABEL);LblCost.set_pos("relative").set(Cache.Constants.highwarden_cost*D.penalty);this.BtnRestore.cooltip_set(LblCost.b,"ac")}else{this.LblPenalty.hide(1);this.BtnRestore.cooltip_set("You're 100% confident","ac")}this.LblEquiprank.clear(vsk_t("Equip. Rank: "+D.equip_level));this.LblName.clear(vsk_t(D.name));this.LblLevel.clear(vsk_t("Level "+D.level));this.LblClass.set_style({color:WO_CLASS_COLORS[parseInt(D.class_id)]}).clear(vsk_t(Game.character_class_xl(parseInt(D.class_id))));this.LblWealth.set(D.copper,true);this.LblHAD.clear(vsk_t(B.health+" / "+B.armor+" / "+B.damage));this.GauExp.fill(parseInt(Cache.Constants.exp_progress));return this};function WardenCharacterSelect(Manager,Parent){this.constructor=WardenModule;this.constructor(Manager,Parent);this.Select=this.child(VUI_NODE,"Select");this.Select.child(VUI_NODE,"Slot0");this.Select.child(VUI_NODE,"Slot1");this.Select.child(VUI_NODE,"Slot2");this.Select.child(VUI_NODE,"Slot3");this.Select.child(VUI_NODE,"Slot4");this.Description=this.child(VUI_NODE,"Description");this.Description.child(VUI_NODE,"Text");this.Characters={};var i,img,S,CS=this;for(i=0;i<5;i++){S=this.Select.C["Slot"+i];S.child(VUI_NODE,"IcoClass");S.child(VUI_NODE,"LblName");S.child(VUI_NODE,"LblLevel");S.child(VUI_BUTTON,"BtnDelete");S.set_style({cursor:"pointer"});S.handle("mousedown").vsk_event_add("mousedown",function(Slot){if(!Slot.charId){vsk_redirect("/game/new-character")}else{CS.Manager.send("account-select-character",{char_id:Slot.charId})}});S.C.BtnDelete.vsk_event_add("mousedown",function(Btn,e){if(Btn.P.charId){Btn.Manager.alert("Do you really wish to delete "+Btn.P.charName+"? If you are certain, please type the character's name into the field below and click 'Okay'","inf",["game-delete-character",{char_id:Btn.P.charId}],true)}else{Btn.Manager.alert("No character is occupying this slot")}ve(e).cancel_bubbling()},"_priv_char_select");img=v(vsk_h("img"));img.set("src",gpUi+"/char_select_pedestal.gif").move(0,null,null,0).dock(S.b);S.pedestal=img}}WardenCharacterSelect.prototype=new vsk_clone(WardenModule.prototype);WardenCharacterSelect.prototype.xml_build__wocharselect=function(xml,Parent){this.xml_build__element(xml,Parent);var c,C,M=this,i,charId,Cache=this.Manager.Cache,r=0,Game=this.Manager.Game;var oY=v(xml).gan("char_offset_y");for(i=0;i<xml.childNodes.length;i++){C=v(xml.childNodes[i]);switch(C.b.nodeName){case"WOCharacter":charId=C.gan("id");var data=Cache.data.character[charId];var Slot=this.Select.C["Slot"+r];var cName=Game.character_class_xl(parseInt(data.class_id));Slot.charId=charId;Slot.charName=data.name;var S=Cache.render_object_character(charId);S.level(30).hide(1).dock(Slot.b).move(Slot.w()/2-S.w()/2,null,null,oY);if(!S.w()){S.vsk_event_add("resize",function(S){var Slot=v(S.b.parentNode);S.move(Slot.w()/2-S.w()/2,null,null,oY).hide(0)});S.onredraw=function(S){var Slot=v(S.b.parentNode);S.move(Slot.w()/2-S.w()/2,null,null,oY).hide(0)}}else{S.hide(0)}Slot.C.IcoClass.clear(v(vsk_h("img")).set("src",gpUi+"/class_icon_"+cName+".png").b);Slot.C.LblName.set_style({color:WO_CLASS_COLORS[data.class_id]}).clear(vsk_t(data.name));Slot.C.LblLevel.clear(vsk_t("Level "+data.level));Slot.C.BtnDelete.cooltip_set("Delete "+data.name,"ac");r++;break}}return this};WardenCharacterSelect.prototype.xml_build=WardenCharacterSelect.prototype.xml_build__wocharselect;var WO_INVENTORY=1004;var WO_ITEM_INFO=1005;var WO_CHARACTER_DETAILS=1006;var WO_ITEM_INFO_COMPACT=1007;var WO_BACKPACK=1008;var WO_ACHIEVEMENT_LIST=1019;var WO_ACHIEVEMENT_NOTIFICATION=1020;var WO_BATTLELOG_MANAGER=1021;vui_element_add(WO_INVENTORY,WardenInventory);vui_element_add(WO_ITEM_INFO,WardenItemInfo);vui_element_add(WO_CHARACTER_DETAILS,WardenCharacterDetails);vui_element_add(WO_ITEM_INFO_COMPACT,WardenItemInfoCompact);vui_element_add(WO_BACKPACK,WardenBackPack);vui_element_add(WO_ACHIEVEMENT_LIST,WardenAchievementList);vui_element_add(WO_ACHIEVEMENT_NOTIFICATION,WardenAchievementNotification);vui_element_add(WO_BATTLELOG_MANAGER,WardenBattlelogManager);function WardenBattlelogManager(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.TblResults=this.child(VUI_NODE,"TblResults","Table");this.TblResults.child(VUI_NODE,"TBody","tbody");var TH=this.TblResults.C.TBody.child(VUI_NODE,"Header","tr");TH.child(VUI_NODE,"ColName","th");TH.child(VUI_NODE,"ColBattlefield","th");TH.child(VUI_NODE,"ColEnemy","th");TH.child(VUI_NODE,"ColResult","th");TH.child(VUI_NODE,"ColMode","th");TH.child(VUI_NODE,"ColDel","th");this.charId=0;this.owns=false;var BLM=this;this.Manager.Cache.data.onchange.add(function(type,d){if(type=="character"){if(parseInt(d.id)==BLM.charId){BLM.populate_list()}}},"battlelog_manager")}WardenBattlelogManager.prototype=new vsk_clone(VegUIElement.prototype);WardenBattlelogManager.prototype.set_character=function(charId){var C=this.M.Cache.data.character,L=this;var onLoad=function(){L.charId=charId;L.owns=(charId==parseInt(L.M.Cache.Constants.char_id));L.populate_list()};if(!C[charId]||!C[charId].battlelog){this.M.send("game-cd-battlelog",{char_id:charId},function(){L.M.cache_queue(onLoad)})}else{onLoad()}};WardenBattlelogManager.prototype.populate_list=function(){if(this.charId){var C=this.M.Cache.data.character[this.charId];if(C&&C.battlelog){vsk_dbg_print("sup");var L=C.battlelog,i;var BLM=this;var t,TB=this.TblResults.C.TBody.b.childNodes[0].nextSibling;if(TB){while(TB){t=TB.nextSibling;v(TB).undock();TB=t}}var col,row,d,g=0,cn,P,a,enemyName;for(i in L){d=L[i];cn="listing_l"+g;row=v(vsk_h("tr"));col=vsk_h("td");col.innerHTML='<a class="plain" href="/game/watch/'+d.id+'">'+d.name+"</a>";col.className=cn;row.html_a(col);col=vsk_h("td");col.innerHTML=d.bf_name;col.className=cn;row.html_a(col);col=vsk_h("td");col.innerHTML=d.ng_name||d.nc_name;col.className=cn;row.html_a(col);col=vsk_h("td");col.innerHTML=d.result?"Victory":"Defeat";col.className=cn;row.html_a(col);col=vsk_h("td");col.innerHTML='<span class="difficulty_'+d.difficulty+'">'+WO_DIFFICULTY_NAMES[d.difficulty]+"</span> ";col.className=cn;row.html_a(col);col=vsk_h("td");if(this.owns){v(col).html_a(v(vsk_h("img")).set("src",gp+"/ui/btn_delete_0.gif").handle("mouseup").vsk_event_add("mouseup",function(Btn){BLM.M.send("game-battlelog-drop",{log_id:Btn.b.parentNode.woLogId})}).set_style({verticalAlign:"middle",cursor:"pointer"}).cooltip_set("Delete this replay","ac").b)}col.woLogId=d.id;col.className=cn;row.html_a(col);row.b.logId=d.id;this.TblResults.C.TBody.html_a(row.b);g^=1}return this}}};function WardenItemInfoCompact(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.Icon=this.child(VUI_NODE,"Icon");this.LblName=this.child(VUI_NODE,"LblName");this.LblInfo=this.child(VUI_NODE,"LblInfo");this.LblPrice=this.child(VUI_NODE,"LblPrice");this.LblEquipped=this.child(VUI_NODE,"LblEquipped");this.LblClass=this.child(VUI_NODE,"LblClass");this.textInfo='<span class="%can_wear%">Level %level%</span>, %item_type% (%slot%)'}WardenItemInfoCompact.prototype=new vsk_clone(VegUIElement.prototype);WardenItemInfoCompact.prototype.iteminfo_set=function(itemCache,charId,itemInstanceId){var I=itemCache,t=this.textInfo,c,G=this.Manager.Game;var classId=parseInt(I.class_id);this.LblName.clear(vsk_t(I.name));this.LblInfo.clear(vsk_t(this.textInfo));this.LblName.set_style({color:G.item_color_xl(I.quality)});this.LblClass.set_style({color:WO_CLASS_COLORS[classId]});this.LblClass.clear(vsk_t(G.character_class_xl(classId)));var CD;if(charId){var invData=this.Manager.Cache.data.inventory[charId];var isEquipped=false;if(invData){if(I.slot==9||I.slot==10){isEquipped=(invData.slot_9==itemInstanceId||invData.slot_10==itemInstanceId)}else{if(I.slot==11||I.slot==12){isEquipped=(invData.slot_11==itemInstanceId||invData.slot_12==itemInstanceId)}else{isEquipped=(invData["slot_"+I.slot]==itemInstanceId)}}}if(isEquipped){this.LblEquipped.clear(vsk_t("<equipped>"))}else{this.LblEquipped.clear()}CD=this.Manager.Cache.data.character[charId]}var slotName=G.slot_xl(parseInt(I.slot));var typeName=G.item_type_xl(I.item_type);this.Icon.set_style({backgroundImage:"url("+gp+"/item/slot_"+I.quality+".gif)"}).clear(v(vsk_h("img")).move(0,0).set("src",gp+"/item/"+typeName+"/"+I.slot_gfx_id+".gif").b);this.LblInfo.b.innerHTML=t.replace(/%class%/g,(c=G.character_class_xl(classId))).replace(/%level%/g,I.level).replace(/%item_type%/g,G.item_type_xl(parseInt(I.item_type),true,classId)).replace(/%class_color%/g,WO_CLASS_COLORS[classId]).replace(/%can_wear%/g,(CD?(CD.level>=I.level?"yes":"no"):"maybe")).replace(/%slot%/g,G.slot_xl(I.slot));return this};function WardenItemInfo(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.Skin=this.child(VUI_NODE,"Skin");this.Icon=this.child(VUI_NODE,"Icon");this.LblName=this.child(VUI_NODE,"LblName");this.LblInfo=this.child(VUI_NODE,"LblInfo");this.LblLore=this.child(VUI_NODE,"LblLore");this.LblStats=this.child(VUI_NODE,"LblStats");this.LblEnchantment=this.child(VUI_NODE,"LblEnchantment");this.LblEnchantmentStats=this.child(VUI_NODE,"LblEnchantmentStats");this.LblStatCHeader=this.child(VUI_NODE,"LblStatCHeader");this.LblStatComparison=this.child(VUI_NODE,"LblStatComparison");this.LblStatName=this.child(VUI_NODE,"LblStatName").hide(1);this.LblStatValue=this.child(VUI_NODE,"LblStatValue").hide(1);this.colorEquip="#2f821e";this.colorNoEquip="#9f3219";this.textInfo='Level %level% <span style="color:%class_color%">%class%</span>, %item_type% (%slot%)';this.textCompare='Compared to <span style="color:%color_a%">%item_a%</span>%s%<span style="color:%color_b%">%item_b%</span>';this.Skin.span(0,0,0,0);this.LblStats.level(1);this.LblInfo.level(1);this.LblLore.level(1);this.LblName.level(1);this.set_skin("Skin")}WardenItemInfo.prototype=new vsk_clone(VegUIElement.prototype);WardenItemInfo.prototype.iteminfo_set=function(itemCache,charId,enchantmentId){var I=itemCache,t=this.textInfo,c,G=this.Manager.Game;this.LblName.clear(vsk_t(I.name));this.LblInfo.clear(vsk_t(this.textInfo));this.LblName.set_style({color:G.item_color_xl(I.quality)});var classId=parseInt(I.class_id);var slotName=G.slot_xl(parseInt(I.slot));var typeName=G.item_type_xl(I.item_type);this.Icon.set_style({backgroundImage:"url("+gp+"/item/slot_"+I.quality+".gif)"}).clear(v(vsk_h("img")).move(0,0).set("src",gp+"/item/"+typeName+"/"+I.slot_gfx_id+".gif").b);this.LblInfo.b.innerHTML=t.replace(/%class%/g,(c=G.character_class_xl(classId))).replace(/%level%/g,I.level).replace(/%item_type%/g,G.item_type_xl(parseInt(I.item_type),true,classId)).replace(/%class_color%/g,WO_CLASS_COLORS[classId]).replace(/%slot%/g,G.slot_xl(I.slot));var i,value,S,V,valueStr;this.LblStats.clear();if(charId){var Inv=this.M.Cache.data.inventory[charId];var slot=I.slot,slotB;if(slot==9||slot==11){slotB=slot+1}var comparisonA={},itemA;var comparisonB={},itemB;var hTxt=this.textCompare;if(Inv["slot_"+slot]){var itemA=this.M.Cache.data.item[this.M.Cache.data.item_instance[Inv["slot_"+slot]].item_id];hTxt=hTxt.replace(/%item_a%/,itemA.name).replace(/%color_a%/,G.item_color_xl(itemA.quality))}else{hTxt=hTxt.replace(/%item_a%/,"").replace(/%color_a%/,"transparent")}if(slotB&&Inv["slot_"+slotB]){var itemB=this.M.Cache.data.item[this.M.Cache.data.item_instance[Inv["slot_"+slotB]].item_id];hTxt=hTxt.replace(/%item_b%/,itemB.name).replace(/%color_b%/,G.item_color_xl(itemB.quality))}else{hTxt=hTxt.replace(/%item_b%/,"").replace(/%color_b%/,"transparent")}if(itemA&&itemB){hTxt=hTxt.replace(/%s%/," / ")}else{hTxt=hTxt.replace(/%s%/,"")}this.LblStatCHeader.b.innerHTML=hTxt}else{this.LblStatCHeader.hide(1).set_pos("absolute");this.LblStatComparison.hide(1).set_pos("absolute")}var Stats=WO_CT_ITEM_STATS,s,ri,e;if(enchantmentId){var E=this.M.Cache.data.item_enchantment[enchantmentId];this.LblEnchantment.clear(vsk_t("Enchanted with "+E.name))}else{this.LblEnchantment.hide(1).set_pos("absolute")}for(s in Stats){i=Stats[s];ri="stat_"+i;if(true){value=I[ri];if(E&&E[ri]){value+=E[ri];e=true}else{e=false}if(!value&&itemB&&itemB[ri]){comparisonB[ri]=-itemB[ri];switch(i){case"concentration":case"threat":case"guile":case"luck":case"health_regen":case"energy_regen":case"move":case"resist_fire":case"resist_ice":case"resist_earth":case"resist_wind":case"resist_dark":case"resist_light":comparisonB[ri]+="%";break}}if(!value&&itemA&&itemA[ri]){comparisonA[ri]=-itemA[ri];switch(i){case"concentration":case"threat":case"guile":case"luck":case"speed":case"health_regen":case"energy_regen":case"move":case"resist_fire":case"resist_ice":case"resist_earth":case"resist_wind":case"resist_dark":case"resist_light":comparisonA[ri]+="%";break}}else{if(value){S=v(this.LblStatName.b.cloneNode(1)).hide(0).set("id","");V=v(this.LblStatValue.b.cloneNode(1)).hide(0).set("id","");if(i=="speed"){value=0-value}if(itemA){if(i!="speed"){comparisonA[ri]=(!itemA[ri]?value:value-itemA[ri])}else{comparisonA[ri]=(!itemA[ri]?value:Math.abs(-value-itemA[ri]))}}if(itemB){if(i!="speed"){comparisonB[ri]=(!itemB[ri]?value:value-itemB[ri])}else{comparisonB[ri]=(!itemB[ri]?value:Math.abs(-value-itemB[ri]))}}switch(i){case"concentration":case"threat":case"guile":case"luck":case"speed":case"health_regen":case"energy_regen":case"move":case"resist_fire":case"resist_ice":case"resist_earth":case"resist_wind":case"resist_dark":case"resist_light":valueStr=value+"%";if(comparisonA&&comparisonA[ri]){comparisonA[ri]+="%"}if(comparisonB&&comparisonB[ri]){comparisonB[ri]+="%"}break;default:valueStr=value;break}S.b.className="stat_name";V.b.className=e?"stat_value_enchanted":"stat_value";S.clear(vsk_t(G.item_stat_xl(ri,classId)+":"));V.clear(vsk_t((value>0?"+":"")+valueStr));v(vsk_h("div")).set_style({marginBottom:"2px"}).set_pos("relative").dock(this.LblStats.b).html_a(S.b,V.b)}}}}var txt="";if(comparisonA||comparisonB){for(s in Stats){i=Stats[s],ri="stat_"+i;if(!comparisonA[ri]&&!comparisonB[ri]){continue}S=v(this.LblStatName.b.cloneNode(1)).hide(0).set("id","");V=v(this.LblStatValue.b.cloneNode(1)).hide(0).set("id","");S.b.className="stat_name";S.clear(vsk_t(G.item_stat_xl(ri,classId)+":"));if(comparisonA[ri]){txt=(parseFloat(comparisonA[ri])>0?"+":"")+comparisonA[ri]}else{if(comparisonB[ri]&&itemA){txt="0"}}if(comparisonB[ri]){if(txt){txt+=" / "}txt+=(parseFloat(comparisonB[ri])>0?"+":"")+comparisonB[ri]}else{if(comparisonA[ri]&&itemB){txt+=" / 0"}}V.clear(vsk_t(txt));v(vsk_h("div")).set_style({marginBottom:"2px"}).set_pos("relative").dock(this.LblStatComparison.b).html_a(S.b,V.b);txt=""}}return this};WardenItemInfo.prototype.xml_build__woiteminfo=function(xml,Parent){this.xml_build__element(xml,Parent);var N=v(xml),h;if((h=N.ga("c_equip"))){this.colorEquip=h}if((h=N.ga("c_noequip"))){this.colorNoEquip=h}if((h=N.ga("text_info"))){this.textInfo=h}return this};WardenItemInfo.prototype.xml_build=WardenItemInfo.prototype.xml_build__woiteminfo;function WardenCharacterDetails(Manager,Parent){this.constructor=WardenModule;this.constructor(Manager,Parent);this.PanCharacter=this.child(VUI_NODE,"PanCharacter");this.PanAchievements=this.child(VUI_NODE,"PanAchievements");this.PanCompanions=this.child(VUI_NODE,"PanCompanions");this.PanPVEBattles=this.child(WO_BATTLELOG_MANAGER,"PanPVEBattles");this.PanPVPBattles=this.child(WO_PVP_CHALLENGE_LIST,"PanPVPBattles");this.DlgBattles=this.child(VUI_TAB_DIALOGUE,"DlgBattles");this.DlgMain=this.child(VUI_TAB_DIALOGUE,"DlgMain");this.Inventory=this.PanCharacter.child(WO_INVENTORY,"Inventory");this.Details=this.PanCharacter.child(VUI_TAB_DIALOGUE,"Details");this.Stats=this.PanCharacter.child(VUI_NODE,"Stats");this.Stats.child(VUI_NODE,"Character");this.Stats.child(VUI_NODE,"Game");this.Stats.child(VUI_NODE,"LblStatName");this.Stats.child(VUI_NODE,"LblStatValue");this.Stats.child(VUI_NODE,"LblExp");this.Stats.child(VUI_GAUGE,"GauExp");this.BtnChallenge=this.Stats.child(VUI_BUTTON,"BtnChallenge");this.Bag=this.PanCharacter.child(WO_BACKPACK,"Bag");this.Abilities=this.child(VUI_NODE,"Abilities");this.Achievements=this.child(VUI_NODE,"Achievements");this.Statistics=this.PanCharacter.child(VUI_NODE,"Statistics");this.LstSpells=this.Abilities.child(VUI_LIST,"LstSpells");this.MinionList=this.PanCompanions.child(WO_MINION_LIST,"MinionList");this.PanAchievements.child(WO_ACHIEVEMENT_LIST,"Achievements");this.charId=0;this.Character=null;this.statText='<span class="stat_name">%n%:</span> <span class="stat_value">%v%</span>';var CD=this;this.DlgMain.vsk_event_add("change",function(Dlg,index){var T=Dlg.Tabs[index];if(T.tabName=="achievements"){var A=CD.PanAchievements.C.Achievements;if(!A.charId){A.set_character(CD.charId)}}else{if(T.tabName=="companions"){var A=CD.MinionList;if(!A.charId){A.lset_character(CD.charId)}}else{if(T.tabName=="abilities"&&!CD.spellsLoaded){CD.update_spells()}else{if(T.tabName=="battles"){CD.PanPVEBattles.set_character(CD.charId);CD.PanPVPBattles.request_result()}}}}},"_priv_char_details");this.Bag.set_inventory(this.Inventory);this.Manager.Cache.data.onchange.add(function(type,d){if(type=="base_stats"){if(parseInt(d.id)==CD.charId){CD.stats_update()}}else{if(type=="character"){if(parseInt(d.id)==CD.charId){CD.Inventory.set_title().set_backdrop();CD.statistics_update()}}else{if(type=="character_statistics"){if(parseInt(d.data.char_id)==CD.charId){CD.statistics_update()}}}}},"character-details");this.BtnChallenge.vsk_event_add("mousedown",function(Btn){vsk_redirect("/game/pvp/"+Btn.P.P.P.P.P.charId)},"_priv_character_details");this.BtnChallenge.cooltip_set("Challenge this character in a PvP battle","ac")}WardenCharacterDetails.prototype=new vsk_clone(WardenModule.prototype);WardenCharacterDetails.prototype.xml_build__chardetails=function(xml,Parent){var M=this.Manager,C=M.Cache,G=M.Game;this.xml_build__element(xml,Parent);var charId=v(xml).gan("char_id");this.set_character(charId);this.stats_update();this.set_mode(v(xml).gan("mode"));var i,N;for(i=0;i<xml.childNodes.length;i++){N=v(xml.childNodes[i]);switch(N.b.nodeName){case"Experience":this.Stats.C.GauExp.fill(N.gan("value"));break}}return this};WardenCharacterDetails.prototype.xml_build=WardenCharacterDetails.prototype.xml_build__chardetails;WardenCharacterDetails.prototype.set_mode=function(mode){this.mode=mode;if(mode){this.Stats.C.GauExp.hide(1);this.Stats.C.LblExp.hide(1);this.Bag.BtnDestroy.hide(1);var L=this.MinionList;L.Favorites.hide(1);L.BtnAddQuickselect.hide(1)}return this};WardenCharacterDetails.prototype.spelllist_set_entry=function(spellId){var C=this.M.Cache;this.LstSpells.Items[spellId].cooltip_set(function(){return C.render_object_spellinfo(spellId).b},"ac")};WardenCharacterDetails.prototype.set_character=function(charId){var C=this.Manager.Cache,i,S;this.Character=C.data.character[charId];if(this.Character){var spells=this.Character.spells,minions=this.Character.minions,d;var achieve=this.Character.achievements;this.charId=charId;this.statistics_update();var Achievements=this.PanAchievements.C.Achievements;V("win_header_char_details").clear(vsk_t("Character Details: "+this.Character.name));this.Inventory.set_character(charId)}else{this.charId=0}return this};WardenCharacterDetails.prototype.update_spells=function(){var M=this.M,L=this,charId=this.charId;M.send("game-cd-spells",{char_id:charId},function(){M.cache_queue(function(){var List=L.LstSpells;var C=M.Cache,i,S,d;spells=vsk_sorted_array(C.data.character[charId].spells,function(Obj){return C.data.spell[Obj.spell_id].name},1);List.flush();for(i in spells){d=spells[i];S=C.data.spell[d.spell_id];if(S){List.item_add(C.render_object_spellinfo_compact(d.spell_id).b.cloneNode(1),d.spell_id,true);L.spelllist_set_entry(d.spell_id)}}List.adjust();L.spellsLoaded=true})})};WardenCharacterDetails.prototype.statistic_add=function(S,i,I){if(!S){return}var N=v(vsk_h("div")).set_pos("relative");N.b.innerHTML=this.statText.replace(/%n%/g,I).replace(/%v%/g,S[i]);this.Statistics.html_a(N.b);return this};WardenCharacterDetails.prototype.statistics_update=function(){this.Stat=S=this.M.Cache.data.character_statistics[this.charId];S.pvp_success=set_precision(Math.max(S.pvp_won,1)/Math.max(S.pvp_lost,1),2);if(isNaN(S.pvp_success)){S.pvp_success=0}this.Statistics.clear();this.statistic_add(this.Character,"equip_level","Equipment Rank");this.statistic_add(S,"pvp_rank","PvP Rank");this.statistic_add(S,"pvp_won","PvP Battles Won");this.statistic_add(S,"pvp_lost","PvP Battles Lost");this.statistic_add(S,"pvp_success","PvP Success Rating")};WardenCharacterDetails.prototype.stats_update=function(){if(!this.charId){return null}var D=this.Manager.Cache.data.base_stats[this.charId];if(D){this.Stats.C.Character.clear();var i,I,N,W,SN,value;for(i in D){I=D[i];if(!(SN=this.Manager.Game.item_stat_xl("stat_"+i,this.Character.class_id))){continue}switch(i){case"concentration":case"luck":case"threat":case"guile":case"resist_fire":case"resist_ice":case"resist_dark":case"resist_light":case"resist_earth":case"resist_wind":value=D[i]+"%";break;default:value=D[i];break}N=v(vsk_h("div")).set_pos("relative");N.b.innerHTML=this.statText.replace(/%n%/g,SN).replace(/%v%/g,value);this.Stats.C.Character.html_a(N.b)}}};function WardenBackPack(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.LblCoin=this.child(VUI_NODE,"LblCoin");this.LblCoin.child(VUI_NODE,"LblMithril").cooltip_set("Mithril","ac");this.LblCoin.child(VUI_NODE,"LblGold").cooltip_set("Gold","ac");this.LblCoin.child(VUI_NODE,"LblSilver").cooltip_set("Silver","ac");this.LblCoin.child(VUI_NODE,"LblCopper").cooltip_set("Copper","ac");this.LblSpace=this.child(VUI_NODE,"LblSpace");this.Items=this.child(VUI_TAB_DIALOGUE,"Items");this.BtnDestroy=this.child(VUI_BUTTON,"BtnDestroy");this.CbShowEquipped=this.child(VUI_CHECKBOX,"CbShowEquipped");this.LstArmor=this.child(VUI_LIST,"LstArmor");this.LstWeapons=this.child(VUI_LIST,"LstWeapons");this.LstShields=this.child(VUI_LIST,"LstShields");this.LstQuest=this.child(VUI_LIST,"LstQuest");this.charId=0;this.Character=null;this.showEquipped=false;this.isInspect=false;var BP=this;this.Items.vsk_event_add("change",function(Dlg,idx){var idx=parseInt(idx);var BP=Dlg.Parent;switch(idx){case 0:BP.LstPrimary=BP.LstArmor;break;case 1:BP.LstPrimary=BP.LstWeapons;break;case 2:BP.LstPrimary=BP.LstShields;break;case 3:BP.LstPrimary=BP.LstQuest;break}},"_priv_backpack");this.Manager.Cache.data.onchange.add(function(type,d){if(type=="backpack"&&parseInt(d.data._id)==parseInt(BP.charId)){BP.set_character(d.data._id)}else{if(type=="character"&&parseInt(d.data._id)==parseInt(BP.charId)){BP.coin_update(d.data.copper);BP.set_space(d.data.__bagspace,d.data.backpack_size)}}},"backpack_"+BP.uniqueId);this.BtnDestroy.cooltip_set("Sell your items at the vendor to make room.","ac");this.BtnDestroy.vsk_event_add("mouseup",function(Btn){vsk_redirect("/game/vendor")},"_priv_backpack");this.CbShowEquipped.vsk_event_add("change",function(Cb){Cb.P.showEquipped=Cb.isChecked;Cb.P.set_character(Cb.P.charId)},"_priv_backpack")}WardenBackPack.prototype=new vsk_clone(VegUIElement.prototype);WardenBackPack.prototype.xml_build__backpack=function(xml,Parent){var M=this.Manager,C=M.Cache,G=M.Game;this.xml_build__element(xml,Parent);this.set_character(v(xml).gan("char_id"));var i,N;for(i=0;i<xml.childNodes.length;i++){N=v(xml.childNodes[i]);switch(N.b.nodeName){case"BagSpace":this.set_space(N.gan("space"),N.gan("total"));break}}return this};WardenBackPack.prototype.xml_build=WardenBackPack.prototype.xml_build__backpack;WardenBackPack.prototype.current_selection=function(){return this.LstPrimary?this.LstPrimary.to_string():0};WardenBackPack.prototype.set_space=function(n,total){this.LblSpace.clear(vsk_t(n+" of "+total+" slots free"))};WardenBackPack.prototype.set_sellmode=function(deduct,showEquipped){this.BtnDestroy.caption("Sell").cooltip_set("Sell the selected item","ac");this.BtnDestroy.vsk_event_add("mouseup",function(Btn){var M=Btn.Manager,id=Btn.Parent.current_selection();if(!id){return}M.send("vendor-sell",{item_id:id})},"_priv_backpack");this.showEquipped=showEquipped;this.sellMode=deduct;return this};WardenBackPack.prototype.receive=function(XML){var i,N,C=this.M.Cache.data.backpack[this.charId],r;for(i=0;i<XML.childNodes.length;i++){N=v(XML.childNodes[i]);switch(N.b.nodeName){case"drop_item":var itemType=N.gan("type");var itemId=N.gan("id");var List;switch(itemType){case 1:List=this.LstWeapons;break;case 2:List=this.LstShields;break;case 3:List=this.LstArmor;break;default:break}for(r in C){if(C[r].item_instance_id==itemId){delete C[r];break}}if(List){List.item_delete(itemId)}break}}};WardenBackPack.prototype.set_character=function(charId){var M=this.Manager,C=M.Cache,G=M.Game;var Character=C.data.character[charId];if(!Character){return null}this.Character=Character;this.charId=charId;this.item_list_fill(this.LstArmor,3);this.item_list_fill(this.LstShields,2);this.item_list_fill(this.LstWeapons,1);this.item_list_fill(this.LstQuest,0);this.coin_update(Character.copper);this.set_space(Character.__bagspace,Character.backpack_size)};WardenBackPack.prototype.set_inventory=function(Inventory){this.Inventory=Inventory;var i};WardenBackPack.prototype.coin_update=function(copper){var L=this.LblCoin.C;var silver,gold,mithril,rest;var b=copper/1000000;mithril=Math.floor(b);gold=(1000000*(b-mithril))/10000;rest=gold-Math.floor(gold);silver=(1000000*rest)/10000;rest=silver-Math.floor(silver);copper=Math.round(rest*100);gold=Math.floor(gold);silver=Math.floor(silver);L.LblMithril.clear(vsk_t(mithril));L.LblGold.clear(vsk_t(gold));L.LblSilver.clear(vsk_t(silver));L.LblCopper.clear(vsk_t(copper));return this};WardenBackPack.prototype.item_list_fill=function(List,itemType){if(!this.charId){return this}var C=this.Manager.Cache,D=C.data.backpack[this.charId],I;var i,itemId,BP=this,Inv,ID;List.flush();var n=0,dndid;var set_ct=function(List,id,itemId,enchantmentId,charId){List.Items[id].cooltip_set(function(){return C.render_object_iteminfo(itemId,charId,enchantmentId).b},"ac")};var isInspect=!(this.M.owns(this.charId));for(i in D){itemId=parseInt(D[i].item_instance_id);I=C.data.item_instance[itemId];if(I){ID=C.data.item[I.item_id]}if(!I||parseInt(ID.item_type)!=itemType){continue}if(this.has_equipped(itemId)&&!this.showEquipped){continue}if(!this.sellMode){List.item_add(C.render_object_iteminfo_compact(I.item_id,this.charId,itemId).b,itemId,true)}else{List.item_add(C.render_object_iteminfo_sale(I.item_id,this.sellMode,this.charId,itemId).b,itemId,true)}if((Inv=this.Inventory)&&!isInspect){if(ID.slot==9||ID.slot==10){dndid=["slot9","slot10"]}else{if(ID.slot==11||ID.slot==12){dndid=["slot11","slot12"]}else{dndid="slot"+ID.slot}}List.Items[itemId].draginit(dndid,1,1).vsk_event_add("dragstart",function(ListItem,DragNode){DragNode.resize(300);var s=ListItem.woItem.slot;if(s==9||s==10){Inv.Slot_9.set_style({border:"1px yellow solid"}).move_r(-1,-1);Inv.Slot_10.set_style({border:"1px yellow solid"}).move_r(-1,-1)}else{if(s==11||s==12){Inv.Slot_11.set_style({border:"1px yellow solid"}).move_r(-1,-1);Inv.Slot_12.set_style({border:"1px yellow solid"}).move_r(-1,-1)}else{Inv["Slot_"+s].set_style({border:"1px yellow solid"}).move_r(-1,-1)}}},"bag").vsk_event_add("dragstop",function(ListItem){var s=ListItem.woItem.slot;if(s==9||s==10){Inv.Slot_9.set_style({border:"none"}).move_r(1,1);Inv.Slot_10.set_style({border:"none"}).move_r(1,1)}else{if(s==11||s==12){Inv.Slot_11.set_style({border:"none"}).move_r(1,1);Inv.Slot_12.set_style({border:"none"}).move_r(1,1)}else{Inv["Slot_"+s].set_style({border:"none"}).move_r(1,1)}}BP.Items.cooltip_close()},"bag").woItem=ID;List.Items[itemId].woItemInstanceId=I.id}set_ct(List,itemId,I.item_id,I.enchantment_id,this.charId);List.Items[itemId].vsk_event_add("mousedown",function(Item){BP.Manager.stopselect(1)});List.Items[itemId].vsk_event_add("mouseup",function(Item){BP.Manager.stopselect()})}List.adjust();setTimeout(function(){List.adjust()},150);return this};WardenBackPack.prototype.has_equipped=function(itemInstanceId){if(this.charId){var s,I,i,C=this.M.Cache.data.inventory[this.charId];I=this.M.Cache.data.item[this.M.Cache.data.item_instance[itemInstanceId].item_id];if(I.slot==10||I.slot==9){return(C.slot_9==itemInstanceId||C.slot_10==itemInstanceId)}else{if(I.slot==11||I.slot==12){return(C.slot_11==itemInstanceId||C.slot_12==itemInstanceId)}else{return C["slot_"+I.slot]==itemInstanceId}}}return false};function WardenInventory(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);var i;for(i=1;i<17;i++){this["Slot_"+i]=this.child(VUI_NODE,"Slot_"+i).level(1);this["Slot_"+i].woSlotId=i}this.Portrait=this.child(VUI_NODE,"Portrait");this.Portrait.child(VUI_NODE,"Fader").level(0);this.Portrait.child(VUI_NODE,"Character").level(1);this.Skin=this.child(VUI_NODE,"Skin");this.LblName=this.child(VUI_NODE,"LblName");this.LblLevel=this.child(VUI_NODE,"LblLevel");this.LblTitle=this.child(VUI_NODE,"LblTitle");this.charId=0;this.Character=null;this.Skin.span(0,0,0,0).level(0);this.Portrait.level(1).set_style({overflow:"hidden"});this.set_skin("Skin");var Inv=this;for(i=1;i<17;i++){this.C["Slot_"+i].dropinit("slot"+i).vsk_event_add("dropselect",function(DropNode,DragNode){DropNode.set_style({borderColor:"white"})},"inv").vsk_event_add("dropdeselect",function(DropNode,DragNode){DropNode.set_style({borderColor:"yellow"})},"inv").vsk_event_add("drop",function(DropNode,DragNode){DropNode.Manager.send("game-inventory-equip",{char_id:Inv.charId,item_id:DragNode.woItemInstanceId,slot:DropNode.woSlotId})},"inv").b.vskDropSensitivity=5}this.Manager.Cache.data.onchange.add(function(type,d){if(type=="inventory"&&parseInt(d.data.char_id)==Inv.charId){var i;for(i in d.data){if(i.indexOf("slot")>-1){Inv.set_slot(d.data[i],i)}}}},"inventory");this.Portrait.C.Fader.span(0,0,0,0).fade(1).s.backgroundColor="#000";this.Portrait.C.Character.span(0,0,0,0);this.Portrait.handle("mouseover").vsk_event_add("mouseover",function(Portrait,e){if(!ve(e||event).rt_valid(Portrait.b)){return}Portrait.C.Fader.fx_fade_in(1000,50)},"inventory").handle("mouseout").vsk_event_add("mouseout",function(Portrait,e){if(!ve(e||event).rt_valid(Portrait.b)){return}Portrait.C.Fader.fx_fade_out(1000,1)},"inventory")}WardenInventory.prototype=new vsk_clone(VegUIElement.prototype);WardenInventory.prototype.xml_build__woinv=function(xml,Parent){this.xml_build__element(xml,Parent);var i,C,Character,Game=this.Manager.Game,Cache=this.Manager.Cache;var charId=v(xml).gan("char_id");var invStatus=v(xml).gan("inventory");this.set_character(charId);return this};WardenInventory.prototype.xml_build=WardenInventory.prototype.xml_build__woinv;WardenInventory.prototype.set_character=function(charId,mode){var i,C,Character,Game=this.Manager.Game,Cache=this.Manager.Cache;Character=Cache.data.character[charId];if(!Character){return null}this.charId=charId;this.Character=Character;var S=Cache.render_object_character(charId),P=this.Portrait;S.move(P.w()/2-S.w()/2,null,null,0);S.onredraw=function(){this.move(P.w()/2-S.w()/2,null,null,0)};if(VUI_IS_IE){setTimeout(function(){S.onredraw()},500)}S.vsk_event_add("resize",function(){S.move(P.w()/2-S.w()/2).level(1)});this.Portrait.C.Character.clear(S.level(1).b);this.set_backdrop();this.LblName.clear(vsk_t(Character.name));this.LblLevel.clear(vsk_t("Level "+Character.level+" "+Game.character_class_xl(parseInt(Character.class_id))));var inv=Cache.data.inventory[charId];var item,slotName,Slot;for(i in inv){if(i.indexOf("slot")==0){this.set_slot(inv[i],i,mode)}}return this.set_title()};WardenInventory.prototype.set_slot=function(itemId,slot,mode){var Slot=this[slot.replace(/^s/,"S")];if(mode=="select"){Slot.handle("mousedown");Slot.vsk_event_add("mousedown",function(Slot){Slot.P.vsk_event_fire("change",itemId)},"select_slot");Slot.set_style({cursor:"pointer"})}var G=this.Manager.Game,C=this.Manager.Cache,Inv=this;var item,slotName,itemId=parseInt(itemId);var item_data;if(!itemId){Slot.clear();return this}if(!(item=C.data.item_instance[itemId])){return this}item_data=C.data.item[item.item_id];slotName=G.slot_xl(parseInt(item.slot));var ItemIcon=v(vsk_h("div")).clear(v(vsk_h("img")).set("src",gp+"/item/"+G.item_type_xl(item_data.item_type)+"/"+item_data.slot_gfx_id+".gif").b).set_style({backgroundImage:"url("+gp+"/item/slot_"+item_data.quality+".gif)"}).move(3,3).resize(40,40);Slot.clear(ItemIcon.b);ItemIcon.cooltip_set(function(){return C.render_object_iteminfo(item.item_id,0,item.enchantment_id).b},"ac");return this};WardenInventory.prototype.set_title=function(){var C;if((C=this.Character)){var a=this.Manager.Cache.achievement_data(this.charId,C.title);if(!a||!a.title){a={title:"- no title -"}}this.LblTitle.clear(vsk_t(a.title))}return this};WardenInventory.prototype.set_backdrop=function(){var C;if((C=this.Character)){var a=this.Manager.Cache.achievement_data(this.charId,C.background_id);if(!a||!a.backdrop_id){a={backdrop_id:"default"}}this.Portrait.s.backgroundImage="url("+gp+"/world/backdrop-character/"+a.backdrop_id+".png)"}return this};function WardenAchievementList(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.LblStatusMoH=this.child(VUI_NODE,"LblStatusMoH");this.LblStatus=this.child(VUI_NODE,"LblStatus");this.LblHeader=this.child(VUI_NODE,"LblHeader");this.CbShowMissing=this.child(VUI_CHECKBOX,"CbShowMissing");this.LstAchievement=this.child(VUI_LIST,"LstAchievement");this.LblRewards=this.child(VUI_NODE,"LblRewards");this.LstRewards=this.child(VUI_LIST,"LstRewards");this.Browser=this.child(VUI_CBOX,"Browser");this.charId=0;this.LstAchievement.vsk_event_add("change",function(List){List.P.load_list(List.value())},"_priv_achievement");this.LstRewards.vsk_event_add("change",function(List){List.M.send("game-achievements-load",{char_id:List.P.charId,location:List.value()},function(req){List.P.browser_update(List.value())})},"_priv_achievement");this.CbShowMissing.vsk_event_add("change",function(Cb){Cb.P.browser_update(Cb.P.location)},"_priv_achievement")}WardenAchievementList.prototype=new vsk_clone(VegUIElement.prototype);WardenAchievementList.prototype.set_character=function(charId){var M=this.M,L=this;this.M.send("game-cd-achievements",{char_id:charId},function(){M.cache_queue(function(){L.charId=charId;L.load_list();L.status_update()})})};WardenAchievementList.prototype.load_list=function(l){var B=this.M.Bridge;var L=this;if(!this.XML){B.send("/lib-js/achievements.v-"+WO_CLIENT_VERSION+".xml",{},"GET",function(req){L.build_list(req.responseXML.firstChild,l,0);L.XML=req.responseXML.firstChild})}else{this.build_list(this.XML,l,0)}};WardenAchievementList.prototype.build_list=function(xml,loc,start){var N,X=xml.childNodes,S=v(xml),l=X.length,i;var n,P,List=this.LstAchievement,k=(loc||"").split("-");if(!start){var AL=this;List.flush();this.M.send("game-achievements-load",{char_id:this.charId,location:loc},function(req){AL.browser_update(loc)});this.LblHeader.b.innerHTML="";this.LstRewards.adjust()}if(S.b.nodeName=="Directory"&&S.ga("l")!="."){List.item_add_txt(S.ga("name"),S.ga("l"));var Item=List.Items[S.ga("l")];Item.b.className="mod_achievement_entry_"+start}if(S.ga("l")!="."&&S.ga("name")&&S.ga("r")==k[start-2]){this.LblHeader.b.innerHTML+=(start>=3?" &#187; ":"")+S.ga("name")}for(i=0;i<l;i++){N=v(X[i]);if(N.b.nodeName!="Directory"){continue}if(S.ga("l")=="."||S.ga("r")==k[start-2]){if(start<=k.length+1){this.build_list(N.b,loc,start+1)}}}};WardenAchievementList.prototype.status_update=function(){var Cache=this.M.Cache;var aNum=vsk_count(Cache.data.character[this.charId].achievements);var mNum=Cache.data.character[this.charId].mark_of_hero;this.LblStatus.clear(vsk_t("Achievements: "+aNum+"/"+Cache.Constants.achievement_num));this.LblStatusMoH.clear(vsk_t("Mark of the Hero: "+mNum+"/"+Cache.Constants.moh_num))};WardenAchievementList.prototype.browser_update=function(loc){var A,C=this.M.Cache.data.achievement,i,Cache=this.M.Cache;var Node=v(vsk_h("div"));if(!loc){return this.Browser.fill(Node.b)}this.status_update();var listTitles=(loc=="title");var listBackdrops=(loc=="backdrop");var listCompanions=(loc=="companion");var listItems=(loc=="item");var itemKey="item_"+this.Manager.Cache.data.character[this.charId].class_id+"_id";this.location=loc;var K=vsk_sorted_array(C,"name",1);var fM=this.CbShowMissing.isChecked;var d=Cache.data.character[this.charId];for(i in K){A=K[i];if(A.class_id&&A.class_id!=d.class_id){continue}if(fM&&d&&d.achievements){if(vsk_find(d.achievements,"achievement_id",A._id)!==false){continue}}if(!listTitles&&!listBackdrops&&!listItems&&!listCompanions&&A.location==loc){Node.html_a(Cache.render_object_achievement_info(A._id,this.charId).b)}else{if(listTitles&&A.title){Node.html_a(Cache.render_object_achievement_info(A._id,this.charId).b)}else{if(listBackdrops&&A.backdrop_id){Node.html_a(Cache.render_object_achievement_info(A._id,this.charId).b)}else{if(listCompanions&&A.minion_id){Node.html_a(Cache.render_object_achievement_info(A._id,this.charId).b)}else{if(listItems&&A[itemKey]){Node.html_a(Cache.render_object_achievement_info(A._id,this.charId).b)}}}}}}this.Browser.fill(Node.b).ScrollY.scroll(1);this.Browser.ScrollY.align().sync(0)};function WardenAchievementNotification(Manager,Parent){this.constructor=WardenModule;this.constructor(Manager,Parent);this.Display=this.child(VUI_NODE,"Display")}WardenAchievementNotification.prototype=new vsk_clone(WardenModule.prototype);WardenAchievementNotification.prototype.xml_build__woanotify=function(xml,Parent){this.xml_build__element(xml,Parent);var i,C,l=xml.childNodes.length,k=0;this.charId=v(xml).gan("char_id");for(i=0;i<l;i++){C=v(xml.childNodes[i]);if(C.b.nodeName=="achievement"){this.add_achievement(C.gan("id"),(k?(k=0):(k=1)))}}return this};WardenAchievementNotification.prototype.xml_build=WardenAchievementNotification.prototype.xml_build__woanotify;WardenAchievementNotification.prototype.add_achievement=function(id,row){var A=this.M.Cache.render_object_achievement_info(id,this.charId);A.b.className="listing_"+row;this.Display.html_a(A.b);return this};var WO_BATTLEFIELD=1009;var WO_BATTLE_MAP=1010;var WO_TARGET=1011;var WO_CHARACTER_LISTENTRY=1012;var WO_TARGET_ENTRY=1013;var WO_TARGET_SETUP=1014;var WO_COMBAT=2001;var WO_COMBAT_QUEUE=2003;var WO_COMBAT_ENCHANTMENT_FRAME=2004;var WO_COMBAT_LOG=2005;var WO_COMBAT_MAP=2006;var WO_COMBAT_ACTOR=2007;var WO_VICTORY_SCREEN=3001;var WO_DEFEAT_SCREEN=3002;var WO_PARTY_SELECT=3030;var WO_COMBAT_SETUP=3031;var WO_RANDOM_ENCOUNTER=3032;vui_element_add(WO_BATTLEFIELD,WardenBattlefield);vui_element_add(WO_BATTLE_MAP,WardenBattleMap);vui_element_add(WO_TARGET,WardenTarget);vui_element_add(WO_CHARACTER_LISTENTRY,WardenCharacterListEntry);vui_element_add(WO_COMBAT,WardenCombat);vui_element_add(WO_COMBAT_QUEUE,WardenCombatQueue);vui_element_add(WO_COMBAT_ENCHANTMENT_FRAME,WardenCombatEnchantmentFrame);vui_element_add(WO_COMBAT_LOG,WardenCombatLog);vui_element_add(WO_COMBAT_MAP,WardenCombatMap);vui_element_add(WO_COMBAT_ACTOR,WardenCombatActor);vui_element_add(WO_VICTORY_SCREEN,WardenVictoryScreen);vui_element_add(WO_COMBAT_SETUP,WardenCombatSetup);vui_element_add(WO_PARTY_SELECT,WardenPartySelect);vui_element_add(WO_RANDOM_ENCOUNTER,WardenRandomEncounter);var WO_ACTOR_CHARACTER=1;var WO_ACTOR_MINION=2;var WO_ACTOR_NPC=3;var WO_TARGET_FRIENDLY=1;var WO_TARGET_HERO=2;var WO_TARGET_MINION=3;var WO_TARGET_FRIENDLY_ARTEFACT=4;var WO_TARGET_HOSTILE=5;var WO_TARGET_HOSTILE_ARTEFACT=6;function WardenCombatSetup(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.Skin=this.child(VUI_NODE,"Skin").level(1).span(0,0,0,0);this.LblSource=this.child(VUI_NODE,"LblSource").level(1);this.LblSource.child(VUI_NODE,"Socket");this.LblSource.child(VUI_NODE,"LblName");this.LblSource.child(VUI_NODE,"LblInfo");this.PanLoadSetup=this.child(VUI_NODE,"PanLoadSetup").level(20);this.BtnLoadSetup=this.PanLoadSetup.child(VUI_BUTTON,"BtnLoadSetup");this.PanAbilities=this.child(VUI_NODE,"PanAbilities").level(1);this.IcoAbilityPointer=this.PanAbilities.child(VUI_NODE,"IcoAbilityPointer");this.LstAbilities=this.PanAbilities.child(VUI_CBOX,"LstAbilities");this.PanBattleOrders=this.child(VUI_NODE,"PanBattleOrders").level(1);this.IcoBattleOrderPointer=this.PanBattleOrders.child(VUI_NODE,"IcoAbilityPointer");this.LstBattleOrders=this.PanBattleOrders.child(VUI_CBOX,"LstAbilities");this.PanSpellsetSave=this.child(VUI_NODE,"PanSpellsetSave").level(20).hide(1);this.PanSpellsetSave.child(VUI_NODE,"LblHeader");this.PanSpellsetSave.child(VUI_NODE,"FldName","input");this.PanSpellsetSave.child(VUI_CHECKBOX,"CbDefault");this.PanSpellsetSave.child(VUI_BUTTON,"BtnClose").cooltip_set("Close","ac");this.PanSpellsetSave.child(VUI_BUTTON,"BtnSave").cooltip_set("Save the current selection of spells and battleorders","ac");this.PanSpellsetLoad=this.child(VUI_NODE,"PanSpellsetLoad").level(20).hide(1);this.PanSpellsetLoad.child(VUI_NODE,"LblHeader");this.PanSpellsetLoad.child(VUI_LIST,"LstSpellsets");this.PanSpellsetLoad.child(VUI_BUTTON,"BtnClose").cooltip_set("Close","ac");this.PanSpellsetLoad.child(VUI_BUTTON,"BtnLoad").cooltip_set("Load the selected template","ac");this.PanSpellsetLoad.child(VUI_BUTTON,"BtnDelete").cooltip_set("Delete the selected template","ac");this.BtnSpellsetSave=this.child(VUI_BUTTON,"BtnSpellsetSave").cooltip_set("Save Current Ability Setup","ac");this.BtnSpellsetLoad=this.child(VUI_BUTTON,"BtnSpellsetLoad").cooltip_set("Load Ability Setup","ac");var i,A;for(i=0;i<5;i++){A=this["AbilitySocket"+i]=this.PanAbilities.child(VUI_NODE,"AbilitySocket"+i).level(1);this.tgl_ability_slot(i,0);A.woSlotIdx=i;A.handle("mousedown").vsk_event_add("mousedown",function(A,e){var Setup=A.P.P.P.P.P;var ST=Setup.Source;if(!A.isEnabled){return}if(typeof ST.Abilities[A.woSlotIdx]!="undefined"){delete ST.Abilities[A.woSlotIdx];Setup.update_abilities()}Setup.select_ability_slot(A.woSlotIdx)},"_priv_combat_setup");A=this["BOSocket"+i]=this.PanBattleOrders.child(VUI_NODE,"BOSocket"+i).level(1);A.woSlotIdx=i;A.handle("mousedown").vsk_event_add("mousedown",function(A,e){var Setup=A.P.P.P.P.P;var ST=Setup.Source;if(typeof ST.Orders[A.woSlotIdx]!="undefined"){delete ST.Orders[A.woSlotIdx];Setup.update_battleorders()}Setup.select_battleorder_slot(A.woSlotIdx)},"_priv_combat_setup")}this.DlgAbilities=this.child(VUI_TAB_DIALOGUE,"DlgAbilities").level(1);this.Source=null;this.sourceInfoText='Level %level% <span style="color:%c%">%class%</span>';this.selectedAbilitySocket=0;this.selectedBOSocket=0;this.BtnLoadSetup.cooltip_set("Load the setup of your previous try at this encounter","ac");this.LblSource.C.Socket.set_style({overflow:"hidden"});this.LstAbilities.vsk_event_add("spell_select",function(List,a){var s,Setup=List.P.P.P.P.P,ST=Setup.Source;ST.set_ability((s=parseInt(Setup.selectedAbilitySocket)),parseInt(a.spellId));Setup.update_abilities();if(s>=4||!Setup["AbilitySocket"+(s+1)].isEnabled){s=0}else{s++}Setup.select_ability_slot(s)},"_priv_combat_setup");this.LstBattleOrders.vsk_event_add("order_select",function(List,a){var s,Setup=List.P.P.P.P.P,ST=Setup.Source;ST.set_battleorder((s=parseInt(Setup.selectedBOSocket)),a.orderId);Setup.update_battleorders();if(s>=4){s=0}else{s++}Setup.select_battleorder_slot(s)},"_priv_combat_setup");this.BtnLoadSetup.vsk_event_add("mousedown",function(Btn){var Setup=Btn.P.P,Map=Setup.P.Map;var i,targets=unescape(vsk_cookie_get("wo_setup")).split("#");for(i in targets){Map.set_target_from_string(targets[i])}for(i in targets){Map.set_allied_targets_from_string(targets[i])}Setup.PanLoadSetup.hide(1)},"_priv_combat_setup");this.PanSpellsetLoad.C.LstSpellsets.vsk_event_add("change",function(List){},"_priv_combat_setup");this.BtnSpellsetSave.vsk_event_add("mousedown",function(Btn){var Setup=Btn.P;Setup.tgl_spellset_save(true)},"_priv_combat_setup");this.BtnSpellsetLoad.vsk_event_add("mousedown",function(Btn){var Setup=Btn.P;Setup.tgl_spellset_load(true)},"_priv_combat_setup");this.PanSpellsetLoad.C.BtnClose.vsk_event_add("mouseup",function(Btn){Btn.P.P.tgl_spellset_load(false)},"_priv_combat_setup");this.PanSpellsetSave.C.BtnClose.vsk_event_add("mouseup",function(Btn){Btn.P.P.tgl_spellset_save(false)},"_priv_combat_setup");this.PanSpellsetSave.C.BtnSave.vsk_event_add("mouseup",function(Btn){Btn.P.P.spellset_save(Btn.P.C.FldName.b.value,Btn.P.C.CbDefault.isChecked)},"_priv_combat_setup");this.PanSpellsetLoad.C.BtnLoad.vsk_event_add("mouseup",function(Btn){Btn.P.P.spellset_load(Btn.P.C.LstSpellsets.value())},"_priv_combat_setup");this.PanSpellsetLoad.C.BtnDelete.vsk_event_add("mousedown",function(Btn){Btn.P.P.spellset_delete(Btn.P.C.LstSpellsets.value())},"_priv_combat_setup")}WardenCombatSetup.prototype=new vsk_clone(VegUIElement.prototype);WardenCombatSetup.prototype.set_source=function(Source){var G=this.M.Game;var C=this.M.Cache;var d,A,i;this.Source=Source;C.populate_spells(this.LstAbilities,this.Source.charId,this.Source.npcId);A=this.Manager.element(WO_COMBAT_ACTOR);A.setup(1,1);A.set(Source.charId?WO_ACTOR_CHARACTER:WO_ACTOR_MINION,Source.charId||Source.minionId,false,0,true,true);this.LblSource.C.Socket.clear(A.move(-2,-2).b);C.populate_orders(this.LstBattleOrders,A.characterData.class_id);var slotSelected=0;this.BtnSpellsetLoad.hide(!(Source.charId));this.BtnSpellsetSave.hide(!(Source.charId));if(Source.charId){d=C.data.character[Source.charId];for(i=0;i<5;i++){this.tgl_ability_slot(i,(i<d.__a_slots))}if(d.spellsets&&!Source.abilitiesSet){for(i in d.spellsets){if(d.spellsets[i].as_default){this.spellset_load(d.spellsets[i].name);Source.abilitiesSet=true;break}}}}else{d=C.data.npc[Source.npcId];for(i=0;i<5;i++){this.tgl_ability_slot(i,true)}var spells=C.data.npc[Source.npcId].spells;for(i in spells){if(i>4){break}if(!this.Source.abilitiesSet){this.Source.set_ability(i,spells[i].spell_id)}if(!this.Source.Abilities[i]&&!slotSelected){this.select_ability_slot(i);slotSelected=i}}this.Source.abilitiesSet=true}var Character=C.data.character[this.charId];this.update_abilities();this.update_battleorders();this.LblSource.C.LblName.clear(vsk_t(d.name));this.LblSource.C.LblInfo.b.innerHTML=this.sourceInfoText.replace(/%level%/,Source.charId?d.level:Math.max(1,Character.level-1)).replace(/%c%/,WO_CLASS_COLORS[d.class_id]).replace(/%class%/,G.character_class_xl(d.class_id));this.select_ability_slot(slotSelected);this.select_battleorder_slot(0);this.PanLoadSetup.hide(1);return this};WardenCombatSetup.prototype.update_abilities=function(){if(this.Source){var i,img,S=this.Source,A,Slot,C=this.Manager.Cache;var set_slot_ct=function(img,A,to){img.cooltip_set(function(){return C.render_object_spellinfo(A).b.cloneNode(1)},"ac",false,to.b)};for(i=0;i<5;i++){Slot=this["AbilitySocket"+i];if(typeof S.Abilities[i]!="undefined"){A=S.Abilities[i];Slot.clear(img=v(vsk_h("img")).move(0,0).resize(Slot.w(),Slot.h()).set("src",gp+"/spells/"+C.data.spell[A].effect_id+".gif").b);set_slot_ct(Slot,A,this.b);if(VUI_IS_IE){Slot.hide(1).hide(0)}Slot.s.cursor="pointer"}else{if(!Slot.isEnabled){if(S.charId){Slot.cooltip_set("This ability slot is not available to you yet. It will become available as your character becomes stronger","ac",false,this.b)}Slot.clear();Slot.s.cursor="default"}else{Slot.clear().cooltip_set("Click on this slot then select an ability from the list below to memorize it.","ac",false,this.b);Slot.s.cursor="pointer"}}}}return this};WardenCombatSetup.prototype.update_battleorders=function(){if(this.Source){var i,S=this.Source,A,Slot,C=this.Manager.Cache;for(i=0;i<5;i++){Slot=this["BOSocket"+i];if(typeof S.Orders[i]!="undefined"){A=S.Orders[i];Slot.clear(v(vsk_h("img")).move(0,0).resize(Slot.w(),Slot.h()).set("src",gp+"/spells/battleorder/"+A+(battleorder_is_class_specific(A)?"_"+S.data.class_id:"")+".gif").b).cooltip_set(C.render_object_battleorder_info(A,S.data.class_id).b.cloneNode(1),"ac",false,this.b);Slot.s.cursor="pointer"}else{Slot.clear().cooltip_set("Click on this slot then select a battle order from the list below to issue it.","ac",false,this.b);Slot.s.cursor="pointer"}}}return this};WardenCombatSetup.prototype.tgl_ability_slot=function(idx,b){var S=this["AbilitySocket"+idx];S.isEnabled=b;S.fade(b?100:25);return this};WardenCombatSetup.prototype.select_ability_slot=function(slotIdx){var Pointer=this.IcoAbilityPointer;var S=this["AbilitySocket"+slotIdx];if(!S){return this}Pointer.move((S.x()+(S.w()/2))-(Pointer.w()/2));this.selectedAbilitySocket=slotIdx;return this};WardenCombatSetup.prototype.select_battleorder_slot=function(slotIdx){var Pointer=this.IcoBattleOrderPointer;var S=this["BOSocket"+slotIdx];if(!S){return this}Pointer.move((S.x()+(S.w()/2))-(Pointer.w()/2));this.selectedBOSocket=slotIdx;return this};WardenCombatSetup.prototype.tgl_spellset_save=function(b){if(!this.Source.charId){var b=0}var P=this.PanSpellsetSave.hide(b^1).C;var r=this.loadedSpellSet;P.FldName.b.value=(r?r.name:"Template1");P.CbDefault.check(r?r.as_default:false)};WardenCombatSetup.prototype.tgl_spellset_load=function(b){if(!this.Source.charId){var b=0}this.PanSpellsetLoad.hide(b^1);var CS=this;if(b){var i,S,P=this.PanSpellsetLoad.C,d=this.M.Cache.data.character[this.Source.charId];var List=P.LstSpellsets;List.flush();for(i in d.spellsets){S=d.spellsets[i];List.item_add_txt(S.name,S.name,true,function(selected,List,Item){if(selected){CS.spellset_load(Item.b.vskListId)}})}List.adjust()}};WardenCombatSetup.prototype.spellset_load=function(name){if(!this.Source||!this.Source.charId){return this}var D=this.M.Cache.data.character[this.Source.charId];var d=D.spellsets;var i,r,n=0;for(i in d){if(d[i].name==name){r=d[i];break}}if(r){for(i=0;i<5;i++){if(!this["AbilitySocket"+i].isEnabled){break}this.Source.set_ability(i,r["slot_"+(i+1)])}for(i in WO_BO){if(n==5){break}if(WO_BO[i]&r.orders){this.Source.set_battleorder(n,WO_BO[i]);n++}}if(n<5&&WO_BO_CS[D.class_id]){for(i in WO_BO_CS[D.class_id]){if(n==5){break}if(WO_BO_CS[D.class_id][i]&r.orders){this.Source.set_battleorder(n,WO_BO_CS[D.class_id][i]);n++}}}this.loadedSpellSet=r}this.update_abilities();this.update_battleorders();this.tgl_spellset_load(false)};WardenCombatSetup.prototype.spellset_save=function(name,asDefault){if(!this.Source.charId){return this}var A=this.Source.Abilities;var i,orders=0;for(i in this.Source.Orders){vsk_dbg_print("Saving order "+this.Source.Orders[i]);orders|=this.Source.Orders[i]}for(i in A){vsk_dbg_print(i+" -> "+A[i])}vsk_dbg_print("Abilities: "+A[0]+","+A[1]+","+A[2]+","+A[3]+","+A[4]);this.M.send("game-spellset-save",{name:name,as_default:asDefault,slot_1:A[0]||0,slot_2:A[1]||0,slot_3:A[2]||0,slot_4:A[3]||0,slot_5:A[4]||0,orders:orders});this.tgl_spellset_save(false)};WardenCombatSetup.prototype.spellset_delete=function(name){this.M.send("game-spellset-drop",{name:name});this.PanSpellsetLoad.C.LstSpellsets.item_delete(name)};function WardenPartySelect(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.Skin=this.child(VUI_NODE,"Skin");this.LblHeader=this.child(VUI_NODE,"LblHeader").level(1);this.PanQuickselect=this.child(VUI_NODE,"PanQuickselect").span(0,0,0,0).level(1);this.BtnExpand=this.PanQuickselect.child(VUI_BUTTON,"BtnExpand");this.BtnInventory=this.PanQuickselect.child(VUI_BUTTON,"BtnInventory");this.SocketCharacter=this.PanQuickselect.child(VUI_NODE,"SocketCharacter");var i,S;for(i=0;i<9;i++){this["Socket"+i]=S=this.PanQuickselect.child(VUI_NODE,"Socket"+i);S.s.overflow="hidden"}this.PanExpanded=this.child(VUI_NODE,"PanExpanded").span(0,0,0,0).level(1).hide(1);this.LstMinions=this.PanExpanded.child(VUI_LIST,"LstMinions");this.BtnCollapse=this.PanExpanded.child(VUI_BUTTON,"BtnCollapse");this.charId=0;this.expandHeight=551;this.waitForInventory=false;var BF=this;this.BtnExpand.vsk_event_add("mousedown",function(Btn){var PS=Btn.P.P;PS.PanExpanded.hide(0);PS.PanQuickselect.hide(1);PS.collapseHeight=PS.h();PS.resize(null,PS.expandHeight)},"_priv_party_select");this.BtnCollapse.vsk_event_add("glb_mouseup",function(Btn){var PS=Btn.P.P;PS.PanExpanded.hide(1);PS.resize(null,PS.collapseHeight);PS.PanQuickselect.hide(0)},"_priv_party_select");this.BtnInventory.vsk_event_add("glb_mouseup",function(Btn){Btn.P.P.P.InventorySpace.hide(1);BF.waitForInventory=true;Btn.M.send("game-inventory-load")},"_priv_party_select").cooltip_set("Open your character's inventory","ac");this.Manager.Cache.data.onchange.add(function(type,d){if(type=="script"&&d.name=="game-inventory-load"){if(BF.waitForInventory){BF.P.Bag.set_character(BF.charId);BF.P.Inventory.set_character(BF.charId);BF.P.InventorySpace.hide(0)}}},"character-details");this.SocketCharacter.s.overflow="hidden";this.Skin.span(0,0,0,0);this.BtnExpand.cooltip_set("Show the complete companion list","ac")}WardenPartySelect.prototype=new vsk_clone(VegUIElement.prototype);WardenPartySelect.prototype.set_character=function(charId){this.charId=charId;var A,C=this.Manager.Cache,S,F,i,NPC;F=C.data.character[charId].minion_favorites;var Map=this.Map,fA=[];if(F){for(i=0;i<9;i++){fA[i]=F[i]}var sort=function(a,b){if(!a||!b){return 0}var cA=C.data.npc[C.data.minion[a.minion_id].npc_id].class_id;var cB=C.data.npc[C.data.minion[b.minion_id].npc_id].class_id;return(cA-cB)};F=fA;F.sort(sort);for(i in F){S=this["Socket"+i].clear();S.minionId=0;S.s.cursor="default";if(F&&F[i]){S.minionId=F[i].minion_id;NPC=C.data.npc[C.data.minion[F[i].minion_id].npc_id];S.cooltip_set('Drag <span class="stat_name">'+NPC.name+"</span> onto an empty socket on the map.","ac",false,this.b);A=this.Manager.element(WO_COMBAT_ACTOR);A.setup(1,1);A.set(WO_ACTOR_MINION,F[i].minion_id,false,0,true,true);S.clear(A.move(-2,-2).b);S.s.cursor="pointer";A.draginit(WO_TARGET_FRIENDLY,1,1,0,0,0,function(A){return A.b.cloneNode(1)}).vsk_event_add("dragstart",function(ListItem,DragNode){Map.blink_targets(WO_TARGET_FRIENDLY,true)},"battle").vsk_event_add("dragstop",function(ListItem){Map.blink_targets(WO_TARGET_FRIENDLY)},"battle").minionId=S.minionId;A.charType="m"}else{S.cooltip_set("This quickselect slot is empty","ac",false,this.b)}}}A=this.Manager.element(WO_COMBAT_ACTOR);A.setup(1,1);A.set(WO_ACTOR_CHARACTER,charId,false,0,true);this.SocketCharacter.clear(A.move(-2,-2).b).set_style({cursor:"pointer"}).cooltip_set("Drag your character onto an empty socket on the map","ac");var getTarget=function(){return A.b.cloneNode(1)};A.draginit(WO_TARGET_FRIENDLY,1,1,0,0,0,getTarget).vsk_event_add("dragstart",function(ListItem,DragNode){Map.blink_targets(WO_TARGET_FRIENDLY,true)},"battle").vsk_event_add("dragstop",function(ListItem){Map.blink_targets(WO_TARGET_FRIENDLY)},"battle").charId=charId;A.charType="c";var i,m,NPC,C=this.Manager.Cache.data,Manager=this.Manager,List=this.LstMinions;var M=C.character[charId].minions,I;for(i in M){m=C.minion[M[i].minion_id];NPC=C.npc[m.npc_id];this.LstMinions.item_add_txt(NPC.name,M[i].minion_id,true);I=this.LstMinions.Items[M[i].minion_id];I.minionId=M[i].minion_id;var getTarget=function(I){var T,minionId=I.minionId;if((T=Manager.E["BattleMapToken_M_"+minionId])){Manager.kill(T)}var Target=Manager.element(WO_COMBAT_ACTOR,"BattleMapToken_M_"+minionId);Target.setup(1,1);Target.set(WO_ACTOR_MINION,minionId,false,0,true,true);return Target.b};I.draginit(WO_TARGET_FRIENDLY,1,1,null,null,null,getTarget).vsk_event_add("dragstart",function(ListItem,DragNode){Map.blink_targets(WO_TARGET_FRIENDLY,true)},"battle").vsk_event_add("dragstop",function(ListItem){Map.blink_targets(WO_TARGET_FRIENDLY)},"battle");I.charType="m"}this.LstMinions.cooltip_set("Displaying all your companions that are in level range for this battlefield. Simply click the name of a companion and drag the appearing icon onto an empty socket on the map.","ac");return this};function WardenBattlefield(Manager,Parent){this.constructor=WardenModule;this.constructor(Manager,Parent);this.Map=this.child(WO_BATTLE_MAP,"Map");this.InventorySpace=this.child(VUI_NODE,"InventorySpace");this.Inventory=this.InventorySpace.child(WO_INVENTORY,"Inventory");this.InventorySpace.child(VUI_NODE,"BagSpace");this.InventorySpace.child(VUI_BUTTON,"BtnReturn");this.Bag=this.InventorySpace.C.BagSpace.child(WO_BACKPACK,"Bag");this.BtnFight=this.child(VUI_BUTTON,"BtnFight");this.BtnSkip=this.child(VUI_BUTTON,"BtnSkip");this.BtnFlee=this.child(VUI_BUTTON,"BtnFlee");this.BtnFleeFight=this.child(VUI_BUTTON,"BtnFleeFight");this.PartySelect=this.child(WO_PARTY_SELECT,"PartySelect");this.CombatSetup=this.child(WO_COMBAT_SETUP,"CombatSetup");this.LblPlayInfo=this.child(VUI_NODE,"LblPlayInfo");this.battlefieldId=0;this.battlefieldType="pve";this.npcId=0;this.Battlefield=null;this.zoneName=null;this.Heroes=[];this.SelectedTarget=null;this.PartySelect.Map=this.Map;this.skipFight=false;this.Bag.set_inventory(this.Inventory);this.BtnFight.cooltip_set("Attack!","ac");this.BtnFlee.cooltip_set("Fleeing from the battlefield will invoke a confidence penalty for your character. Confidence penalties can be removed at the High Warden.","ac");this.BtnFleeFight.cooltip_set("Flee from this fight and re-enter the same battlefield.<br /><br /> Fleeing from the battlefield will invoke a confidence penalty for your character. Confidence penalties can be removed at the High Warden.","ac");this.BtnFlee.vsk_event_add("mousedown",function(Btn,e){Btn.Manager.send("flee-pve")},"_priv_bfield");this.BtnFleeFight.vsk_event_add("mousedown",function(Btn,e){Btn.Manager.send("flee-pve",{ea:"1"})},"_priv_bfield");this.BtnFight.vsk_event_add("mousedown",function(Btn,e){var args={},arr,arrCC=[],arrO=[],arrTA=[],stri,dbgStr="",r,i,n=0,T,TA,Map=Btn.Parent.Map,Orders;for(i in Map.Targets){T=Map.Targets[i];if(!T.is_friendly()||(!T.charId&&!T.minionId)){continue}str=(T.charId?"c":(T.minionId?"m":"n"))+":"+(T.charId||T.minionId)+":"+T.mapCoords.x+","+T.mapCoords.y;arr=[];for(r=0;r<5;r++){if(T.Abilities[r]){arr.push(T.Abilities[r])}}str+=":"+arr.join();Orders=0;for(r in T.Orders){Orders|=parseInt(T.Orders[r])}str+=":"+Orders;arr=[];arrCC=[];for(r in T.Targets){if(!T.Targets[r]){continue}arr.push(T.Targets[r][0].spawnId);if(T.Targets[r][1]){arrCC.push(T.Targets[r][0].spawnId)}}arrTA=[];for(r in T.TargetsAlly){if(!T.TargetsAlly[r]){continue}TA=T.TargetsAlly[r][0];arrTA.push((TA.charId?"c":"m")+(TA.charId||TA.minionId))}str+=":"+arr.join()+":"+arrCC.join()+":"+arrTA.join();vsk_dbg_print(str);args["target"+n]=str;n++;dbgStr+=str+"#"}Btn.Manager.send("battle-pve",args,function(req){var XML;if((XML=req.responseXML.getElementsByTagName("combat")[0])){if(Btn.P.skipFight){vsk_redirect("/game/outcome");return}var Combat=Btn.Manager.element(WO_COMBAT);Combat.theme("game");Combat.xml_build(XML);Map.Parent.html_ia(Combat.b).undock()}},null,function(req){Btn.M.send("error-battle",{r:dbgStr,output:req.responseText.substr(0,1000),browser:VSK_I.name+": "+navigator.userAgent})});Btn.cooltip_close()},"_priv_bfield");this.BtnSkip.vsk_event_add("mouseup",function(Btn){Btn.P.skipFight=true;Btn.P.BtnFight.vsk_event_fire("mousedown")},"_priv");this.InventorySpace.C.BtnReturn.vsk_event_add("mouseup",function(Btn){Btn.P.hide(1)},"_priv_bfield");this.LblPlayInfo.b.innerHTML='New to Warden: Online? Check out the <a href="/site/how-to-play">How To Play</a> Guide!';this.BtnSkip.cooltip_set("Fight, but skip to the results right away.","ac")}WardenBattlefield.prototype=new vsk_clone(WardenModule.prototype);WardenBattlefield.prototype.xml_build__wobfield=function(xml,Parent){var i,c,C,Game=this.Manager.Game,Cache=this.Manager.Cache;this.xml_build__element(xml,Parent);this.isRandomEncounter=v(xml).ga("random_encounter");this.battleId=v(xml).gan("battle");for(i=0;i<xml.childNodes.length;i++){c=v(xml.childNodes[i]);switch(c.b.nodeName){case"Battlefield":this.Battlefield=Cache.data.battlefield[c.ga("id")];break;case"RandomEncounter":this.Map.set_map(c.ga("backdrop"));this.encounterName=c.ga("name");break;case"Character":if(c.gan("main")){this.set_character(c.gan("id"))}break;case"PlayerLoc":this.Map.add_target(c.gan("loc"),WO_TARGET_FRIENDLY);break;case"Npc":this.Map.add_target(c.gan("loc"),5);this.Map.add_hostile_npc(c.gan("spawn_id"),c.gan("npc_id"),c.gan("loc"));break}}this.Map.fx_shadow(25,"#000",5,5);this.set_random_encounter();this.Bag.LblSpace.hide(1);if(this.battleId&&this.battleId==parseInt(vsk_cookie_get("wo_battle"))&&vsk_cookie_get("wo_setup")){this.CombatSetup.PanLoadSetup.hide(0)}return this};WardenBattlefield.prototype.xml_build=WardenBattlefield.prototype.xml_build__wobfield;WardenBattlefield.prototype.set_random_encounter=function(){if(!this.isRandomEncounter){return this}this.zoneName=this.Battlefield.name+", battling against "+this.encounterName;V("win_battlefield").clear(vsk_t(this.zoneName));return this};WardenBattlefield.prototype.set_character=function(charId){this.charId=charId;var Character=this.Manager.Cache.data.character[charId];this.PartySelect.set_character(charId);this.CombatSetup.charId=charId;return this};WardenBattlefield.prototype.setup_select=function(Target){if(this.SelectedTarget){this.SelectedTarget.highlight(0);this.SelectedTarget=null;this.target_selection_update()}Target.cooltip_close();Target.set_tooltip();this.SelectedTarget=Target;this.SelectedTarget.highlight(1);this.CombatSetup.set_source(Target);this.target_selection_update();return this};WardenBattlefield.prototype.target_selection_update=function(){var ST=this.SelectedTarget,i,M=this.Map,T=M.Targets,Target;var color=(ST?WO_CLASS_COLORS[ST.data.class_id]:null);var tColor;for(i in T){if(!T[i].is_friendly()){tColor=WO_CLASS_COLORS[T[i].data.class_id];T[i].highlight(0);if(ST){T[i].set_tooltip([0,tColor,T[i].data.name,color,ST.data.name])}else{T[i].set_tooltip()}}else{if(ST&&T[i].occupied()&&T[i].mapFieldId!=ST.mapFieldId){tColor=WO_CLASS_COLORS[T[i].data.class_id];T[i].highlight(0).cooltip_set('<span class="tooltip_header">Ctrl+Click</span> to select <span style="color:'+tColor+'">'+T[i].data.name+'</span> as support target for <span style="color:'+color+'">'+ST.data.name+"</span>","ac")}else{if(!ST&&T[i]){T[i].set_tooltip()}}}}if(ST){for(i in ST.Targets){if(ST.Targets[i]&&(Target=ST.Targets[i][0])){Target.highlight(1,parseInt(i)+1,i);Target.TargetedBySource=ST;Target.CbCC.check(ST.Targets[i][1]);tColor=WO_CLASS_COLORS[Target.data.class_id];if(!Target.CbCC.isChecked&&i>0){Target.set_tooltip([1,tColor,Target.data.name,color,ST.data.name])}else{Target.set_tooltip()}}}for(i in ST.TargetsAlly){if(ST.TargetsAlly[i]&&(Target=ST.TargetsAlly[i][0])){Target.highlight(1,parseInt(i)+1,"A");Target.set_tooltip()}}}M.swapTargetFromIdx=-1;return this};WardenBattlefield.prototype.setup_targets=function(Target){if(!this.SelectedTarget&&!Target){return this}else{if(Target){this.setup_select(Target)}}return this};function WardenBattleMap(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.Grid=this.child(VUI_NODE,"Grid");this.Grid.child(VUI_NODE,"Skin");this.mapCols=10;this.mapRows=10;this.gridW=55;this.gridH=55;this.Targets={};this.targetMode=0;this.targetType="";this.swapTargetFromIdx=-1;this.Grid.span(0,0,0,0).level(10);this.Grid.C.Skin.span(0,0,0,0).fade(15).s.overflow="hidden"}WardenBattleMap.prototype=new vsk_clone(VegUIElement.prototype);WardenBattleMap.prototype.set_map=function(backdrop){this.s.backgroundImage="url("+gp+"/ui/strategy-map.png)";return this};WardenBattleMap.prototype.add_target=function(fieldId,targetType){var px=this.id_to_px(fieldId),M=this;var Target=this.Manager.element(WO_TARGET);Target.Map=this;Target.target_type(targetType).resize(this.gridW,this.gridH).move(px.x+1,px.y).dock(this.Grid.b);this.Targets[fieldId]=Target;Target.mapCoords=this.id_to_coords(fieldId);Target.mapFieldId=fieldId;Target.dropinit(targetType).vsk_event_add("dropselect",function(DropNode,DragNode){DropNode.blink(0)},"battle").vsk_event_add("dropdeselect",function(DropNode,DragNode){DropNode.blink(1)},"battle").vsk_event_add("drop",function(DropNode,DragNode){M.clear_target(WO_TARGET_FRIENDLY,DragNode.charId,DragNode.npcId,DragNode.minionId);if(DragNode.charId){DropNode.set_character(DragNode.charId)}else{if(DragNode.minionId){DropNode.set_minion(DragNode.minionId)}}M.Parent.setup_targets(DropNode)},"battle").b.vskDropSensitivity=10;Target.handle("mousedown").vsk_event_add("mousedown",function(Target,e){if(!Target.occupied()||(!Target.is_friendly()&&!M.Parent.SelectedTarget)){return}if(!Target.is_friendly()){if(!ve(e).key_mod("shift")){M.Parent.SelectedTarget.set_target(Target);M.Parent.target_selection_update()}else{var ST,idx;if((ST=Target.TargetedBySource)==M.Parent.SelectedTarget&&(idx=ST.index_of_target(Target))>-1){if(M.swapTargetFromIdx==-1||M.swapTargetFromType){if(M.swapTarget){M.swapTarget.IcoSwap.hide(1)}M.swapTargetFromIdx=idx;M.swapTargetFromType=0;M.swapTarget=Target;Target.IcoSwap.hide(0)}else{ST.set_target(Target,idx,M.swapTargetFromIdx);M.swapTargetFromIdx=-1;M.swapTarget=null;M.Parent.target_selection_update()}}}}else{var ST=M.P.SelectedTarget,noSelect,idx;if(Target.charId||Target.minionId){if(ve(e).key_mod("shift")){if(ST&&ST.mapFieldId==Target.mapFieldId){Target.clear_all_targets();M.Parent.target_selection_update();noSelect=true}else{if(ST&&ST.is_friendly()&&(idx=ST.index_of_target(Target))){if(M.swapTargetFromIdx==-1||!M.swapTargetFromType){if(M.swapTarget){M.swapTarget.IcoSwap.hide(1)}M.swapTargetFromIdx=idx;M.swapTargetFromType=1;M.swapTarget=Target;Target.IcoSwap.hide(0)}else{ST.set_target(Target,idx,M.swapTargetFromIdx);M.swapTargetFromIdx=-1;M.swapTarget=null;M.Parent.target_selection_update()}noSelect=true}}}else{if(ve(e).key_mod("alt")){M.clear_target(WO_TARGET_FRIENDLY,Target.charId,Target.npcId,Target.minionId);noSelect=true}else{if(ve(e).key_mod("ctrl")){ST.set_target(Target);M.Parent.target_selection_update();noSelect=true}}}if(!noSelect){M.Parent.setup_select(Target)}}}});return this};WardenBattleMap.prototype.tgl_target_mode=function(Target){this.targetMode=Target;return this};WardenBattleMap.prototype.add_hostile_npc=function(spawnId,npcId,fieldId){var Target;if((Target=this.Targets[fieldId])&&Target.targetType==WO_TARGET_HOSTILE){Target.set_npc(npcId,spawnId)}return this};WardenBattleMap.prototype.blink_targets=function(targetType,b){var targetType=parseInt(targetType),i,T;for(i in this.Targets){T=this.Targets[i];if(T.targetType==targetType){T.blink(b)}}return this};WardenBattleMap.prototype.coords_to_id=function(x,y){return this.mapCols*(y-1)+x};WardenBattleMap.prototype.coords_to_px=function(x,y){return{x:this.gridW*(x-1),y:this.gridH*(y-1)}};WardenBattleMap.prototype.id_to_coords=function(i){var fieldId=parseInt(i);var y=Math.ceil(fieldId/this.mapCols);var x=fieldId-(Math.floor(fieldId/this.mapCols)*this.mapCols);if(!x){x=this.mapCols}return{x:x,y:y}};WardenBattleMap.prototype.id_to_px=function(i){var i=parseInt(i);var coords=this.id_to_coords(i);return this.coords_to_px(coords.x,coords.y)};WardenBattleMap.prototype.clear_target=function(targetType,charId,npcId,minionId,artefactId){var i;for(i in this.Targets){if(this.Targets[i].targetType==targetType){if(charId&&this.Targets[i].charId==charId){this.Targets[i].reset();this.Parent.target_selection_update();break}else{if(minionId&&this.Targets[i].minionId==minionId){this.Targets[i].reset();this.Parent.target_selection_update();break}}}}};WardenBattleMap.prototype.get_target_by_spawn_id=function(spawnId){var i;for(i in this.Targets){if(this.Targets[i].spawnId===spawnId){return this.Targets[i]}}return null};WardenBattleMap.prototype.get_target_by_string_id=function(stringId){var i;var m=stringId.match(/^(c|m)(\d+)$/);if(!m){return null}for(i in this.Targets){if(m[1]=="c"&&this.Targets[i].charId==parseInt(m[2])){return this.Targets[i]}else{if(m[1]=="m"&&this.Targets[i].minionId==parseInt(m[2])){return this.Targets[i]}}}return null};WardenBattleMap.prototype.set_allied_targets_from_string=function(targetStr){var data=targetStr.split(":"),i,n=0;var targetAData=data[7].split(",");var characterType=data[0];var characterId=parseInt(data[1]);var Target=this.get_target_by_string_id(characterType+characterId);for(i in targetAData){Target.set_target(this.get_target_by_string_id(targetAData[i]))}};WardenBattleMap.prototype.set_target_from_string=function(targetStr){var data=targetStr.split(":"),i,n=0;var characterType=data[0];var characterId=parseInt(data[1]);var locData=data[2].split(",");var abilityData=data[3].split(",");var orderData=parseInt(data[4]);var targetData=data[5].split(",");var targetCCData=data[6].split(",");var field=this.coords_to_id(parseInt(locData[0]),parseInt(locData[1]));var Target=this.Targets[field];Target.reset();if(characterType=="c"){Target.set_character(characterId)}else{if(characterType=="m"){Target.set_minion(characterId)}else{return null}}Target.abilitiesSet=true;for(i in abilityData){Target.set_ability(i,parseInt(abilityData[i]))}for(i in WO_BO){if(orderData&WO_BO[i]){Target.set_battleorder(n++,WO_BO[i])}}for(i in WO_BO_CS[Target.data.class_id]){if(orderData&WO_BO_CS[Target.data.class_id][i]){Target.set_battleorder(n++,WO_BO_CS[Target.data.class_id][i])}}for(i in targetData){Target.set_target(this.get_target_by_spawn_id(parseInt(targetData[i])),undefined,undefined,in_array(targetCCData,targetData[i]))}};function WardenTarget(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.Skin=this.child(VUI_NODE,"Skin");this.TargetSkin=this.Skin.child(VUI_NODE,"TargetSkin");this.Portrait=this.child(VUI_NODE,"Portrait").level(2);this.Catcher=this.child(VUI_NODE,"Catcher").level(3);this.Highlight=this.child(VUI_NODE,"Highlight").level(4).hide(1);this.CbCC=this.child(VUI_CHECKBOX,"CbCC");this.LblCounter=this.child(VUI_NODE,"LblCounter").level(5).hide(1);this.IcoSwap=this.child(VUI_NODE,"IcoSwap","img").level(5).hide(1);this.charId=0;this.npcId=0;this.minionId=0;this.spawnId=null;this.targetType=0;this.data=null;this.Targets=[];this.TargetsAlly=[];this.Abilities={};this.Orders={};this.TargetedBy={};this.TargetedByAlly={};this.TargetedBySource=null;this.TargetsById={};this.TargetsAllyById={};this.Skin.span(2,3,3,2).set_style({backgroundImage:"url("+gp+"/ui/strategy-slot.gif)"});this.TargetSkin.span(1,1,1,1);this.Portrait.span(7,7,8,8).s.overflow="hidden";this.Highlight.move(2,3);this.CbCC.theme("cb_cc");this.CbCC.hide(1).move(null,null,0,0);this.LblCounter.resize(14,14).set_style({backgroundImage:"url("+gp+"/ui/target_hostile_counter.gif)",color:"#fff",font:"bold 10px Verdana, Arial, Helvetica",textAlign:"center"}).move(0,null,null,0);this.CbCC.handle("mousedown").vsk_event_add("mousedown",function(Cb,e){ve(e).cancel_bubbling()},"_priv_target");this.CbCC.vsk_event_add("change",function(Cb){var S,T=Cb.Parent,idx;if((S=T.TargetedBySource)&&(idx=S.index_of_target(T))>-1){S.Targets[idx][1]=Cb.isChecked}},"_priv_target_entry");this.IcoSwap.set("src",gp+"/ui/target_swap.png").move(17,17);this.set_style({cursor:"pointer"})}WardenTarget.prototype=new vsk_clone(VegUIElement.prototype);WardenTarget.prototype.target_type=function(type){this.targetType=parseInt(type);this.targetTypeS=this.Manager.Game.target_xl(type);this.Highlight.clear(v(vsk_h("img")).set("src",gp+"/ui/target_"+(this.is_friendly()?"friendly":"hostile")+"_highlight.gif").b);if(!this.is_friendly()){this.Skin.set_style({backgroundImage:"url("+gp+"/ui/strategy-slot-hostile.gif)"})}else{this.LblCounter.set_style({backgroundImage:"url("+gp+"/ui/target_ally_counter.gif)"})}return this};WardenTarget.prototype.highlight=function(b,counter,n){this.LblCounter.clear(vsk_t(counter||"-"));if(!this.is_friendly()){this.LblCounter.hide((b^1));this.CbCC.hide(n==0?1:(b^1))}else{this.CbCC.hide(1);if(n=="A"){this.Highlight.b.firstChild.src=gp+"/ui/target_ally_highlight.gif";this.LblCounter.hide((b^1))}else{this.Highlight.b.firstChild.src=gp+"/ui/target_friendly_highlight.gif";this.LblCounter.hide(1)}}this.Highlight.hide(b^1);this.IcoSwap.hide(1);return this};WardenTarget.prototype.set_npc=function(npcId,spawnId){var NPC,P=this.Portrait;if((NPC=this.Manager.Cache.render_object_npc(npcId,0,1))){var d=this.Manager.Cache.data.npc[npcId];this.Portrait.clear(NPC.b);NPC.vsk_event_add("sprite",function(Sprite){Sprite.move(null,P.h()/2-d.portrait_y,-d.portrait_x+P.w()/2)});NPC.move(null,P.h()/2-d.portrait_y,-d.portrait_x+P.w()/2);NPC.onredraw=function(oldSprite){this.move(null,P.h()/2-d.portrait_y,-d.portrait_x+P.w()/2)};this.npcId=npcId;this.spawnId=spawnId;this.set_tooltip();this.data=d;this.TargetSkin.set_style({backgroundImage:"url("+gp+"/ui/strategy-target-hostile.gif)"});if(d.boss_w){this.set_boss()}}return this};WardenTarget.prototype.set_boss=function(){this.resize(3*this.Map.gridW,2*this.Map.gridH);this.Skin.set_style({backgroundImage:"none"});var S=this.TargetSkin.set_style({backgroundImage:"url("+gp+"/ui/target_hostile_boss.gif)"});this.Highlight.clear(v(vsk_h("img")).set("src",gp+"/ui/target_hostile_highlight_boss.gif").b).move(4,5);this.Portrait.span(8,10,10,10)};WardenTarget.prototype.occupied=function(){return(this.charId||this.minionId||this.npcId)};WardenTarget.prototype.set_character=function(charId){var C;this.reset();if((C=this.Manager.Cache.render_object_character(charId))){var d=this.Manager.Cache.data.character[charId];var o=this.Manager.Cache.data.object_character[parseInt(d.class_id)];var P=this.Portrait;C.vsk_event_add("sprite",function(C){C.move((P.w()/2)-o.portrait_x,-o.portrait_y)});this.Portrait.clear(C.b);C.move((P.w()/2)-o.portrait_x,-o.portrait_y);C.onredraw=function(C,oC){C.move((P.w()/2)-o.portrait_x,-o.portrait_y)};this.charId=charId;this.minionId=0;this.npcId=0;this.Sprite=C;this.data=d;this.set_tooltip();this.TargetSkin.set_style({backgroundImage:"url("+gp+"/ui/strategy-target-"+(this.is_friendly()?"friendly":"hostile")+".gif)"})}return this};WardenTarget.prototype.set_minion=function(minionId){this.reset();var npcId=this.Manager.Cache.minion_id_to_npc_id(minionId),NPC;if((NPC=this.Manager.Cache.render_object_npc(npcId))){var d=this.Manager.Cache.data.npc[npcId];var P=this.Portrait;NPC.vsk_event_add("sprite",function(Sprite){Sprite.move(-d.portrait_x+P.w()/2,P.h()/2-d.portrait_y)});NPC.move(-d.portrait_x+P.w()/2,P.h()/2-d.portrait_y);NPC.onredraw=function(oldSprite){this.move(-d.portrait_x+P.w()/2,P.h()/2-d.portrait_y)};this.Portrait.clear(NPC.b);this.minionId=minionId;this.Sprite=NPC;this.npcId=npcId;this.set_tooltip();this.TargetSkin.set_style({backgroundImage:"url("+gp+"/ui/strategy-target-"+(this.is_friendly()?"friendly":"hostile")+".gif)"});this.data=d}return this};WardenTarget.prototype.set_tooltip=function(help){if(!this.Map){return}if(this.npcId){this.cooltip_set(this.Manager.Cache.render_object_npcinfo(this.npcId,help).b,"ac")}else{if(this.minionId){this.cooltip_set(this.Manager.Cache.render_object_minioninfo(this.minionId).b.cloneNode(1),"ac")}else{if(this.charId){this.cooltip_set(this.Manager.Cache.render_object_character_listentry(this.charId).resize(150).set_pos("relative").b.cloneNode(1),"ac")}}}};WardenTarget.prototype.blink=function(b){this.Skin.fx_blink(b,1000,50,(b?100:100))};WardenTarget.prototype.reset=function(){this.clear_targeted_by();this.charId=0;this.npcId=0;this.minionId=0;this.Targets=[];this.TargetsAlly=[];this.Abilities={};this.Orders={};this.TargetedBy={};this.TargetedByAlly={};this.TargetsById={};this.TargetsAllyById={};this.AlliedTarget=null;this.abilitiesSet=false;this.highlight(0);this.vsk_event_unset("mouseover","cooltip");if(this.Sprite){this.Sprite.undock()}this.Sprite=null;this.TargetSkin.set_style({backgroundImage:"none"})};WardenTarget.prototype.is_friendly=function(){switch(this.targetType){case WO_TARGET_FRIENDLY:case WO_TARGET_FRIENDLY_ARTEFACT:return true;break;default:return false;break}};WardenTarget.prototype.set_ability=function(slotIdx,spellId){var i;if(!spellId){return}for(i in this.Abilities){if(this.Abilities[i]==spellId){delete this.Abilities[i]}}this.Abilities[slotIdx]=spellId};WardenTarget.prototype.set_battleorder=function(slotIdx,orderId){var i;for(i in this.Orders){if(this.Orders[i]==orderId){delete this.Orders[i]}}this.Orders[slotIdx]=orderId};WardenTarget.prototype.set_allied_target=function(Target){if(this.AlliedTarget&&Target&&this.AlliedTarget.mapFieldId==Target.mapFieldId){this.AlliedTarget=null}else{this.AlliedTarget=Target}return this};WardenTarget.prototype.set_target=function(Target,toIdx,fromIdx,asCC){if(!Target||Target.mapFieldId==this.mapFieldId){return this}var type=Target.is_friendly();if(!type&&!Target.charId&&!Target.npcId&&!Target.minionId){return this}else{if(type&&!Target.charId&&!Target.minionId){return this}}if(Target.is_friendly()&&!type){return this}else{if(!Target.is_friendly()&&type){return this}}var T=(!type?this.Targets:this.TargetsAlly);var A=this.Abilities;var I=(!type?this.TargetsById:this.TargetsAllyById);if(!asCC){asCC=false}if(toIdx<0||fromIdx<0){return this}var i,A1,A2,idx=-1,free=-1;for(i in T){if(T[i]&&T[i][0]==Target){idx=i}else{if(!T[i]&&free==-1){free=(parseInt(i))}}}if(i){if(T[0]&&free==-1){free=parseInt(i)+1}}if(free==-1){free=0}if(typeof toIdx!="undefined"||typeof fromIdx!="undefined"){if(T[toIdx]&&T[fromIdx]){var T1=T[fromIdx];var T2=T[toIdx];T1[0].clear_targeted_by(this);T2[0].clear_targeted_by(this);T[toIdx]=T1;T[fromIdx]=T2;I[T1[0].uniqueId]=toIdx;I[T2[0].uniqueId]=fromIdx;T2[0].set_targeted_by(this,fromIdx);T1[0].set_targeted_by(this,toIdx);T2[0].TargetedBySource=this;T1[0].TargetedBySource=this}else{if(T[fromIdx]){Target.set_targeted_by(this,toIdx);T[toIdx]=T[fromIdx];if(idx>-1){this.clear_target(idx,type)}I[Target.uniqueId]=toIdx;Target.TargetedBySource=this;Target.clear_targeted_by(this)}}}else{if(idx==-1&&free>-1){T[free]=[Target,asCC];I[Target.uniqueId]=free;Target.TargetedBySource=!type?this:null;Target.set_targeted_by(this,free)}else{if(idx>-1){Target.clear_targeted_by(this);Target.TargetedBySource=null}}}return this};WardenTarget.prototype.index_of_target=function(Target){var T=(Target.is_friendly()?this.TargetsAlly:this.Targets);var i,idx=-1;for(i in T){if(T[i]&&T[i][0]==Target){idx=i}}return idx};WardenTarget.prototype.clear_target=function(targetIdx,type){var T,Targets=(type?this.TargetsAlly:this.Targets);var TargetsById=(type?this.TargetsAllyById:this.TargetsById);if(!Targets[targetIdx]||!(T=Targets[targetIdx][0])){return}Targets[targetIdx]=null;delete TargetsById[T.uniqueId]};WardenTarget.prototype.clear_all_targets=function(){var i;for(i in this.Targets){this.clear_target(i)}for(i in this.TargetsAlly){this.clear_target(i,1)}};WardenTarget.prototype.set_targeted_by=function(Target,targetIdx){if(!this.is_friendly()){this.TargetedBy[Target.uniqueId]={Target:Target,idx:targetIdx}}else{this.TargetedByAlly[Target.uniqueId]={Target:Target,idx:targetIdx}}};WardenTarget.prototype.clear_targeted_by=function(Target){if(Target){if(this.is_friendly()&&Target.is_friendly()){Target.clear_target(this.TargetedByAlly[Target.uniqueId].idx,1)}else{Target.clear_target(this.TargetedBy[Target.uniqueId].idx)}return}var i,T;for(i in this.TargetedBy){this.TargetedBy[i].Target.clear_target(this.TargetedBy[i].idx)}for(i in this.TargetedByAlly){this.TargetedByAlly[i].Target.clear_target(this.TargetedByAlly[i].idx,1)}};function WardenCharacterListEntry(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.Portrait=this.child(VUI_NODE,"Portrait");this.LblName=this.child(VUI_NODE,"LblName");this.LblInfo=this.child(VUI_NODE,"LblInfo");this.charId=0;this.infoText='Level %level% <span style="color:%color%">%class%</span>';this.Portrait.s.overflow="hidden"}WardenCharacterListEntry.prototype=new vsk_clone(VegUIElement.prototype);WardenCharacterListEntry.prototype.set_character=function(charId){var D,C,Cache=this.Manager.Cache,Game=this.Manager.Game;if((D=Cache.data.character[charId])){var classId=parseInt(D.class_id);this.charId=charId;C=Cache.render_object_character(charId);this.Portrait.clear(C.b);this.LblName.clear(vsk_t(D.name));this.LblInfo.b.innerHTML=this.infoText.replace(/%class%/g,(c=Game.character_class_xl(classId))).replace(/%level%/g,D.level).replace(/%color%/g,WO_CLASS_COLORS[classId])}return this};function WardenCombat(Manager,Parent){this.constructor=WardenModule;this.constructor(Manager,Parent);this.LblLocation=this.child(VUI_NODE,"LblLocation");this.BtnSpeedDown=this.LblLocation.child(VUI_BUTTON,"BtnSpeedDown");this.BtnSpeedUp=this.LblLocation.child(VUI_BUTTON,"BtnSpeedUp");this.LblSpeed=this.LblLocation.child(VUI_NODE,"LblSpeed");this.Map=this.child(WO_COMBAT_MAP,"Map");this.Queue=this.child(WO_COMBAT_QUEUE,"Queue");this.Enchantments=this.child(WO_COMBAT_ENCHANTMENT_FRAME,"Enchantments");this.Log=this.child(WO_COMBAT_LOG,"Log");this.BtnLeave=this.child(VUI_BUTTON,"BtnLeave");this.LblMsg=this.child(VUI_NODE,"LblMsg");this.LblMsg.child(VUI_NODE,"Skin").span(0,0,0,0);this.LblMsg.child(VUI_NODE,"Label").level(1);this.LblOutcome=this.child(VUI_NODE,"LblOutcome");this.LblOutcome.child(VUI_NODE,"Skin").span(0,0,0,0);this.LblOutcome.child(VUI_NODE,"LblHeader").level(1);this.LblOutcome.child(VUI_NODE,"LblInfo").level(1);this.LblOutcome.child(VUI_BUTTON,"BtnLeave").level(1);this.LblOutcome.child(VUI_BUTTON,"BtnRefight").level(1).hide(1);this.Queue.Map=this.Map;this.Queue.Combat=this;this.Map.Combat=this;this.speed=1;this.InventoryDumps={};this.Team=null;this.Actors=this.Map.Actors;this.LD={};this.BtnLeave.hide(1);this.BtnLeave.vsk_event_add("mouseup",function(Btn){if(!Btn.P.isPvP){vsk_redirect("/game/outcome")}else{vsk_redirect("/game/pvp-challenges")}},"_priv_combat");this.LblOutcome.C.BtnLeave.vsk_event_add("mouseup",function(Btn){if(!Btn.P.P.isPvP){if(Btn.P.P.pveWatchMode){history.go(-1)}else{vsk_redirect("/game/outcome")}}else{if(Btn.P.P.owns){vsk_redirect("/game/pvp-challenges")}else{history.go(-1)}}},"_priv_combat");this.BtnSpeedUp.vsk_event_add("mousedown",function(Btn,e){var speed=Btn.P.P.speed;Btn.P.P.set_speed(speed+1)},"_priv_combat");this.BtnSpeedDown.vsk_event_add("mousedown",function(Btn,e){var speed=Btn.P.P.speed;Btn.P.P.set_speed(speed-1)},"_priv_combat");this.set_speed(parseInt(vsk_cookie_get("combat_speed")||1))}WardenCombat.prototype=new vsk_clone(WardenModule.prototype);WardenCombat.prototype.xml_build__wocombat=function(xml,Parent){this.xml_build__element(xml,Parent);var i,c,C,l=xml?xml.childNodes.length:0;for(i=0;i<l;i++){C=v(xml.childNodes[i]);switch(C.b.nodeName){case"Watcher":this.Team=C.ga("team");this.pvpWatcherId=C.gan("char_id");this.pvpOpponent=C.gan("opponent_id");this.owns=this.M.owns(C.gan("d_id"))||this.M.owns(C.gan("c_id"));vsk_dbg_print("owns: "+this.owns);break}}this.pveWatchMode=v(xml).gan("watch");if(!this.pveWatchMode&&xml){this.receive(xml)}else{if(this.pveWatchMode){var Combat=this;this.M.send("game-pve-watch",{log_id:this.pveWatchMode},function(r){Combat.receive(r.responseXML.getElementsByTagName("combat")[0],null,null,true);Combat.hide(0)})}}this.Map.fx_shadow(25,"#000",5,5);return this};WardenCombat.prototype.xml_build=WardenCombat.prototype.xml_build__wocombat;WardenCombat.prototype.receive=function(xml){var i,C,c;this.isPvP=v(xml).gan("pvp");if(this.isPvP){this.BtnLeave.caption("Close")}for(i=0;i<xml.childNodes.length;i++){C=v(xml.childNodes[i]);switch(C.b.nodeName){case"invdump":this.InventoryDumps[C.gan("id")]={1:C.gan("slot_1"),2:C.gan("slot_2"),3:C.gan("slot_13"),4:C.gan("slot_14")};break;case"battlefield":this.Map.set_map(C.ga("zone"));break;case"status":this.Team=C.ga("team");if(!this.isPvP){this.charId=C.gan("char_id");this.owns=this.M.owns(this.charId)}break;case"actor":var actorId=C.ga("id");if(actorId.charAt(0)!="v"){actorId=parseInt(actorId)}this.Map.actor_add(C.gan("type"),actorId,C.gan("x"),C.gan("y"),C.ga("team"),C.gan("actor"));break;case"queue":var actorId=C.gan("t");var Actor=this.Actors[actorId];this.Queue.insert(Actor,C.gan("index"));break;case"log":var Combat=this;this.XMLLog=C.b;this.Log.fill(vsk_h("div")).place();this.Log.Content.span(0,null,0);if(this.M.Cache.cfg(WO_ACFG_ZOOM)){this.Map.zoom_out();this.Map.permaZoom=true}setTimeout(function(){Combat.combat_prepare().combat(true)},1000);break}}return this};WardenCombat.prototype.set_speed=function(speed){if(speed>4){var speed=4}if(speed<1){var speed=1}switch(parseInt(speed)){case 1:this.LblSpeed.clear(vsk_t("Normal Speed"));speed=1.5;break;case 2:this.LblSpeed.clear(vsk_t("Double Speed"));break;case 3:this.LblSpeed.clear(vsk_t("Triple Speed"));break;case 4:this.LblSpeed.clear(vsk_t("Ludicrous Speed"));break}vsk_cookie_set("combat_speed",speed,1000*60*60*24*30);this.speed=speed;this.Map.set_speed(speed);return this};WardenCombat.prototype.combat_prepare=function(){var a,A;for(a in this.Actors){A=this.Actors[a];if(A.GauHealth){A.GauHealth.hide(0).fill(100);A.GauPower.hide(0).fill(100)}}this.ready=true;this.Queue.update();return this};WardenCombat.prototype.ld_ae_effect=function(Actor){var LD=this.LD;if(LD.isAE&&LD.lastEffect&&!LD.aeTrack[Actor.actorId]){Actor.effect(LD.lastEffect,1);LD.aeTrack[Actor.actorId]=true}};WardenCombat.prototype.combat=function(reset,waitForCenter){var Log=this.XMLLog;if(reset){this.logI=0;this.logR=0;this.LD={aeTrack:{}}}var Combat=this;if(waitForCenter&&!this.Map.hasCentered){setTimeout(function(){Combat.combat(false,true)},250);return this}else{if(waitForCenter&&this.Map.hasCentered){var waitForCenter=false}}var zoomIn,i,L,l,r,R,G,pause=0,fPause=0,aePause=0,LD=this.LD;var Game=this.Manager.Game;var Cache=this.Manager.Cache;L=v(Log.childNodes[this.logI]);if(this.Map.zoom){this.Map.Map.move(0,0)}if(L.b){switch(L.b.nodeName){case"requeue":var ActorT=this.Actors[L.gan("t")];var index=L.gan("index");this.Queue.insert(ActorT,index);pause=500;break;case"spawn":this.Map.actor_add(L.gan("type"),L.gan("id"),L.gan("x"),L.gan("y"),L.ga("team"),L.gan("actor"),true);break;case"move":var Actor=this.Actors[L.gan("t")];Actor.render_effects("enchant");var x,y;if(!this.logR){this.Enchantments.update(Actor);this.Log.log_text(Actor," moves.");this.Map.center(Actor.actorId);var waitForCenter=true}R=v(L.b.childNodes[this.logR]);if(R.b){switch(R.b.nodeName){case"path":x=R.gan("x");y=R.gan("y");var px=this.Map.Map.coords_to_px(x,y);Actor.fx_morph(Actor.w(),Actor.h(),px.x+(this.Map.zoom?1:2),px.y+(this.Map.zoom?1:2),200);if(x>Actor.mapX&&Actor.flipped()){Actor.Sprite.wo_sprite_flip();Actor.flip_effects()}else{if(x<Actor.mapX&&!Actor.flipped()){Actor.Sprite.wo_sprite_flip();Actor.flip_effects()}}if(!Actor.hasHighlight&&(Actor.mapX!=x||Actor.mapY!=y)){this.highlight([Actor],Actor)}Actor.mapX=x;Actor.mapY=y;Actor.level(y);this.Map.center(Actor.actorId,true);var waitForCenter=true;pause=300;break}}else{this.Map.show_actors();pause=500}break;case"center":var Actor=this.Actors[L.gan("t")];this.Map.center(Actor.actorId);var waitForCenter=true;break;case"ability":var ActorS=this.Actors[L.gan("s")];ActorS.render_effects("enchant");var ActorT=this.Actors[L.gan("t")];ActorT.render_effects("enchant");var spellId=L.ga("spell");switch(spellId){case"melee":spellId=99999;break;case"earthblast":spellId=99993;break;case"windsurge":spellId=99994;break;case"iceshard":spellId=99995;break;case"blast":spellId=99998;break;case"shoot":spellId=99996;break}spellId=parseInt(spellId);var Spell=Cache.data.spell[spellId];this.Enchantments.update(ActorS);ActorS.effect(spellId);LD.spellId=spellId;if(Spell.is_ae){LD.isAE=true;LD.aeTrack[ActorT.actorId]=true;fPause=this.Map.permaZoom?0:1250;this.Map.zoom_out(function(){if(ActorT.mapX>ActorS.mapX&&ActorS.flipped()){ActorS.Sprite.wo_sprite_flip();ActorS.flip_effects()}else{if(ActorT.mapX<ActorS.mapX&&!ActorS.flipped()){ActorS.Sprite.wo_sprite_flip();ActorS.flip_effects()}}Combat.highlight([ActorS],ActorS,Spell)})}else{if(ActorT.mapX>ActorS.mapX&&ActorS.flipped()){ActorS.Sprite.wo_sprite_flip();ActorS.flip_effects()}else{if(ActorT.mapX<ActorS.mapX&&!ActorS.flipped()){ActorS.Sprite.wo_sprite_flip();ActorS.flip_effects()}}this.highlight([ActorS],ActorS,Spell)}waitForCenter=true;this.Log.log_ability(ActorS,ActorT,Spell);pause=(this.Map.permaZoom?0:1250);break;case"ability_effect":var ActorS=this.Actors[L.gan("s")];var ActorT=this.Actors[L.gan("t")];var spellId=Game.spell_real_id(L.ga("spell"));ActorT.effect(spellId,1);LD.lastEffect=spellId;pause=(this.Map.permaZoom?0:1250);break;case"damage_melee":var ActorS=this.Actors[L.gan("s")];var ActorT=this.Actors[L.gan("t")];var damage=L.gan("dmg");this.highlight([ActorT],null,null,ActorT);ActorT.render_effects("offensive");waitForCenter=true;var blocked=L.gan("b_dmg");var spellId,spellName;if((spellId=Game.spell_real_id(L.ga("spell")))){spellName=this.Manager.Cache.data.spell[spellId].name}else{spellName=L.ga("cause_name")}ActorT.scrolltext("-"+damage+(blocked?" (~"+blocked+")":""),"bad",WO_SCHOOL_MELEE,spellName.replace(/ #[\d]+$/,""));this.Log.log_damage(ActorS,ActorT,damage,WO_SCHOOL_MELEE,L.gan("b_dmg"));this.ld_ae_effect(ActorT);pause=2000;break;case"damage_range":var ActorS=this.Actors[L.gan("s")];var ActorT=this.Actors[L.gan("t")];var damage=L.gan("dmg");this.highlight([ActorT],null,null,ActorT);ActorT.render_effects("offensive");waitForCenter=true;var blocked=L.gan("b_dmg");var spellId,spellName;if((spellId=Game.spell_real_id(L.ga("spell")))){spellName=this.Manager.Cache.data.spell[spellId].name}else{spellName=L.ga("cause_name")}ActorT.scrolltext("-"+damage+(blocked?" (~"+blocked+")":""),"bad",WO_SCHOOL_RANGE,spellName.replace(/ #[\d]+$/,"")+(L.gan("vul")?" -- damage bonus!":""));this.Log.log_damage(ActorS,ActorT,damage,WO_SCHOOL_RANGE,L.gan("b_dmg"));if(L.gan("vul")){this.Log.log_text(ActorT," took increased damage (weakness against ranged attacks).")}this.ld_ae_effect(ActorT);pause=2000;break;case"reflect":var ActorT=this.Actors[L.gan("t")];var spellId,spellName;if((spellId=Game.spell_real_id(L.ga("spell")))){spellName=this.Manager.Cache.data.spell[spellId].name}else{spellName=L.ga("cause_name")}ActorT.scrolltext("[reflect attack]","good",null,spellName);pause=1500;break;case"damage_natural":case"damage_magic":var ActorS=this.Actors[L.gan("s")];var ActorT=this.Actors[L.gan("t")];var damage=L.gan("dmg");this.highlight([ActorT],null,null,ActorT);waitForCenter=true;ActorT.render_effects("offensive");var spellId,spellName;if((spellId=Game.spell_real_id(L.ga("spell")))){spellName=this.Manager.Cache.data.spell[spellId].name}else{spellName=L.ga("cause_name")}var resisted=L.gan("resisted");ActorT.scrolltext("-"+damage+(resisted?" (~"+resisted+")":""),"bad",L.gan("school"),spellName.replace(/ #[\d]+$/,"")+(L.gan("vul")?" -- damage bonus!":""));this.Log.log_damage(ActorS,ActorT,damage,L.gan("school"),resisted);if(L.gan("vul")){this.Log.log_text(ActorT," took increased damage (weakness against magic attacks).")}this.ld_ae_effect(ActorT);pause=2000;break;case"damage_power":var ActorS=this.Actors[L.gan("s")];var ActorT=this.Actors[L.gan("t")];var damage=L.gan("dmg");this.highlight([ActorT],null,null,ActorT);waitForCenter=true;ActorT.render_effects("offensive");var spellId,spellName;if((spellId=Game.spell_real_id(L.ga("spell")))){spellName=this.Manager.Cache.data.spell[spellId].name}else{spellName=L.ga("cause_name")}ActorT.scrolltext("-"+damage+" power","bad",L.gan("school"),spellName.replace(/ #[\d]+$/,""));this.Log.log_text(ActorT,"'s power is drained by "+damage);this.ld_ae_effect(ActorT);pause=1500;break;case"heal":var Actor=this.Actors[L.gan("s")];this.highlight([Actor],null,null,Actor);waitForCenter=true;var spellId,spellName;if((spellId=L.gan("spell"))){spellName=this.Manager.Cache.data.spell[spellId].name}Actor.scrolltext("+"+L.gan("heal"),"good",WO_MAGIC_LIGHT,spellName);Actor.render_effects("support");this.Log.log_text(Actor," is healed for "+L.gan("heal")+" points.");this.ld_ae_effect(Actor);pause=2000;break;case"damage_redirect":var ActorS=this.Actors[L.gan("s")];var ActorT=this.Actors[L.gan("t")];var damage=L.gan("amount");ActorT.render_effects("offensive");this.Log.log_damage_redirect(ActorS,ActorT,damage);ActorT.scrolltext("-"+damage+(resisted?" (~"+resisted+")":""),"bad",L.gan("school"),spellName.replace(/ #[\d]+$/,"")+(L.gan("vul")?" -- damage bonus!":""));break;case"health":var Actor=this.Actors[L.gan("t")];Actor.health=L.gan("v")<=0?1:L.gan("v");Actor.GauHealth.fill(Actor.health);break;case"power":var Actor=this.Actors[L.gan("t")];Actor.power=L.gan("v")<=0?1:L.gan("v");Actor.GauPower.fill(Actor.power);break;case"respawn":var ActorT=this.Actors[L.gan("t")];this.highlight([ActorT],null,null,ActorT);waitForCenter=true;this.Queue.drop(ActorT,true);this.Log.log_text(ActorT," respawns.");var M=this.Map;ActorT.scrolltext("<Respawn>","bad");ActorT.Sprite.fx_fade_out(200).onhalt=function(){ActorT.undock();M.actor_add(WO_ACTOR_NPC,L.gan("npc"),ActorT.mapX,ActorT.mapY,ActorT.team,ActorT.actorId,true)};pause=1000;break;case"death":var ActorT=this.Actors[L.gan("t")];this.highlight([ActorT],null,null,ActorT);waitForCenter=true;this.Queue.drop(ActorT,true);ActorT.scrolltext("<Death>","bad");ActorT.fx_fade_out(200).onhalt=function(){ActorT.undock()};if(!ActorT.characterData.is_object){this.Log.log_text(ActorT," dies.")}else{this.Log.log_text(ActorT," crumbles.")}pause=1000;break;case"msg":this.Log.log_text(null,L.ga("text"),L.ga("color"));this.battle_alert(L.ga("text"));if(!L.gan("instant")){pause=L.ga("text").length*10+2000}break;case"npc_talk":var ActorT=this.Actors[L.gan("t")];this.Log.log_text(ActorT," says, '"+L.ga("text")+"'","#d3b96a");pause=L.ga("text").length*15+3000;this.npc_talk(L.ga("text"),L.gan("t"),((pause*0.9)/this.speed));break;case"wizard_chain_break":var ActorT=this.Actors[L.gan("t")];this.Log.log_text(ActorT,"'s Elemental Chain is broken.");ActorT.scrolltext("<Elemental Chain Broken>","bad");break;case"enchant":var ActorS=this.Actors[L.gan("s")];var ActorT=this.Actors[L.gan("t")];G=v(L.b.childNodes[this.logR]);this.highlight([ActorT]);var spellId,iconId;if((spellId=L.gan("spell"))){iconId=this.Manager.Cache.data.spell[spellId].effect_id}var Enc=ActorT.enchant(ActorS,L.ga("enchant"),L.ga("turns"),iconId||"magical/blast",L.gan("type"),L.ga("visual_id"));for(r=0;r<L.b.childNodes.length;r++){G=v(L.b.childNodes[r]);switch(G.b.nodeName){case"stat":Enc.stats[G.gan("name")]=G.ga("value");break;case"effect":Enc.effects[G.gan("type")]=true;break}}ActorT.render_effects("enchant");ActorT.scrolltext("<"+Enc.name+">",L.gan("type")==1?"bad":"good");this.Log.log_enchantment(ActorT,Enc);this.ld_ae_effect(ActorT);pause=1500;break;case"disenchant":var ActorS=this.Actors[L.gan("s")];var ActorT=this.Actors[L.gan("t")];var encName=L.ga("enchant");var Enc=ActorT.Enchantments[L.gan("type")][ActorS.actorId+"-"+encName];if(Enc.visualImg){Enc.visualImg.undock()}ActorT.scrolltext("<"+ActorT.characterName+" is no longer affected by "+Enc.name+">",L.gan("type")==1?"bad":"good");this.Log.log_disenchantment(ActorT,Enc);delete ActorT.Enchantments[L.gan("type")][ActorS.actorId+"-"+encName];ActorT.render_effects("enchant");pause=1500;break;case"immunity":var ActorT=this.Actors[L.gan("t")];var spellId,spellName;if((spellId=Game.spell_real_id(L.ga("spell")))){spellName=this.Manager.Cache.data.spell[spellId].name}else{spellName=L.ga("cause_name")}ActorT.scrolltext("<Spell has no effect>","good",null,spellName);this.Log.log_text(ActorT," is not affected by "+spellName);pause=1000;break;case"immunity_effect":var ActorT=this.Actors[L.gan("t")];var effectName=this.M.Game.enchantment_xl(L.gan("e"));ActorT.scrolltext("<Immune to Effect>","good",null,effectName);this.Log.log_text(ActorT," is not affected by enchantment effect: "+effectName);pause=1000;break;case"ae_end":fPause=1000;break;case"ability_end":if(LD.isAE){LD.isAE=false;LD.aeTrack={};pause=!this.Map.permaZoom?3000:0;fPause=!this.Map.permaZoom?500:0;zoomIn=!this.Map.permaZoom?2000:0}break;case"pull":case"knockback":var ActorS=this.Actors[L.gan("s")];var ActorT=this.Actors[L.gan("t")];var x=L.gan("x");var y=L.gan("y");var px=this.Map.Map.coords_to_px(x,y);var diff=Math.max(Math.abs(ActorT.mapX-x),Math.abs(ActorT.mapY-y));ActorT.fx_morph(ActorT.w(),ActorT.h(),px.x+2,px.y+2,diff*100);ActorT.mapX=x;ActorT.mapY=y;ActorT.level(y);if(L.b.nodeName=="knockback"){this.Log.log_text(ActorT," is knocked back violently")}else{this.Log.log_text(ActorT," is pulled towards "+ActorS.characterName)}pause=diff*100;this.Map.show_actors();break;case"teleport":var ActorT=this.Actors[L.gan("t")];var x=L.gan("x");var y=L.gan("y");var px=this.Map.Map.coords_to_px(x,y);var M=this.Map;this.Log.log_text(ActorT," teleports to a new location");ActorT.fx_fade_out(100).onhalt=function(){ActorT.move(px.x+2,px.y+2).fx_fade_in(100);ActorT.mapX=x;ActorT.mapY=y;ActorT.level(y);M.center(ActorT.actorId)};var waitForCenter=true;pause=1500;this.Map.show_actors();break;case"stunned":var ActorT=this.Actors[L.gan("t")];this.highlight([ActorT],null,null,ActorT);waitForCenter=true;ActorT.scrolltext("<"+ActorT.characterName+" is stunned>","bad");this.Log.log_text(ActorT," is stunned and skips this round.");pause=500;break;case"feared":var ActorT=this.Actors[L.gan("t")];this.highlight([ActorT],null,null,ActorT);waitForCenter=true;ActorT.scrolltext("<"+ActorT.characterName+" is feared>","bad");this.Log.log_text(ActorT," is feared and attempts to flee in terror.");pause=500;break;case"controlled":var ActorT=this.Actors[L.gan("t")];this.highlight([ActorT],null,null,ActorT);waitForCenter=true;ActorT.scrolltext("<"+ActorT.characterName+" is mind controlled>","bad");this.Log.log_text(ActorT," attacks their allies in a fit of madness.");pause=500;break;case"asleep":var ActorT=this.Actors[L.gan("t")];this.highlight([ActorT],null,null,ActorT);waitForCenter=true;ActorT.scrolltext("<"+ActorT.characterName+" is asleep>","bad");this.Log.log_text(ActorT," eyes droop as they fall asleep.");pause=500;break;case"victory":var victory=(L.ga("team")==this.Team);this.outcome_alert(victory);this.Log.log_text(null,(victory?"You have defeated your enemy!":"You have been defeated."));this.BtnLeave.hide(0);break;case"fx_quake":this.Map.Map.fx_quake(L.gan("m"),(4000/this.speed));aePause=4000;break}}if(R&&R.b){this.logR++}else{this.logI++;this.logR=0}if(LD.isAE){pause=0;if(aePause){pause+=aePause}}if(pause){pause=Math.round(pause/this.speed)}pause+=fPause;var Combat=this;if(zoomIn){setTimeout(function(){Combat.Map.zoom_in()},Math.round(zoomIn/this.speed))}if(L.b){setTimeout(function(){Combat.combat(false,waitForCenter)},pause)}return this};WardenCombat.prototype.battle_alert=function(msg){this.LblMsg.C.Label.clear(vsk_t(msg));this.LblMsg.fx_fade_in(250);var speed=this.speed;var LM=this.LblMsg;var interval=msg.length*10+2000;interval=Math.round(interval/speed);setTimeout(function(){LM.fx_fade_out(Math.round(250/speed))},interval);return this};WardenCombat.prototype.outcome_alert=function(outcome){var L=this.LblOutcome;if(this.isPvP){var opponent=this.pvpOpponent}if(outcome){L.C.LblHeader.clear(vsk_t("Victory!")).set_style({color:"green"});L.C.LblInfo.clear(vsk_t("The remains of your enemies lie scattered across the battle grounds"));if(!this.isPvP){if(!this.pveWatchMode){L.C.BtnLeave.caption("Claim Your Loot")}else{L.C.BtnLeave.caption("Close").vsk_event_add("mousedown",function(Btn){history.go(-1)})}}else{L.C.BtnLeave.caption("Close");if(this.owns){L.C.BtnRefight.caption("Re-Challenge").hide(0).vsk_event_add("mousedown",function(Btn){vsk_redirect("/game/pvp/"+opponent)})}}}else{L.C.LblHeader.clear(vsk_t("Defeat!")).set_style({color:"red"});L.C.LblInfo.clear(vsk_t("All vital characters of you have died. Any remaining minions have fled the battlefield"));if(!this.isPvP){if(!this.pveWatchMode){L.C.BtnLeave.caption("Leave the Battlefield")}else{L.C.BtnLeave.caption("Close").vsk_event_add("mousedown",function(Btn){history.go(-1)})}}else{L.C.BtnLeave.caption("Close");if(this.owns){L.C.BtnRefight.caption("Revenge").hide(0).vsk_event_add("mousedown",function(Btn){vsk_redirect("/game/pvp/"+opponent)})}}}this.Map.Shade.hide(0);L.hide(0);return this};WardenCombat.prototype.highlight=function(Actors,ActorH,Spell,ActorC){var i,r,A;for(i in this.Actors){A=this.Actors[i];A.Skin.b.className="target_"+(A.isHostile?"hostile":"friendly");A.highlight(0);for(r in Actors){if(Actors[r].actorId==A.actorId){A.Skin.b.className="target_"+(A.isHostile?"hostile":"friendly")+"_selected"}}if(ActorH&&A.actorId==ActorH.actorId){this.Map.center(A.actorId);A.highlight(1,Spell)}else{if(!ActorH&&ActorC&&ActorC.actorId==A.actorId){this.Map.center(A.actorId)}}}};WardenCombat.prototype.log_write=function(text){this.Log.Content.html_a(v(vsk_h("div")).clear(vsk_t(text)).b);this.Log.ScrollY.sync().align();return this};WardenCombat.prototype.npc_talk=function(text,actorId,time){var A=this.Map.Actors[actorId];var p=gp+"/ui/";if(A){var S=v(vsk_h("div"));S.b.className="talk_bubble";var s=[5,5,15,9];v(vsk_h("img")).move(0,0).set("src",p+"chat_bubble_ul.gif").resize(s[0],s[1]).level(2).dock(S.b);v(vsk_h("img")).move(null,0,0).set("src",p+"chat_bubble_ur.gif").resize(s[0],s[1]).level(2).dock(S.b);v(vsk_h("img")).move(null,null,0,0).set("src",p+"chat_bubble_lr.gif").resize(s[0],s[1]).level(2).dock(S.b);v(vsk_h("img")).move(0,null,null,0).set("src",p+"chat_bubble_ll.gif").resize(s[0],s[1]).level(2).dock(S.b);var pointer=v(vsk_h("img")).set("src",p+"chat_bubble_p.gif").resize(s[2],s[3]).level(5).dock(S.b);v(vsk_h("div")).span(s[0],0,s[0]).resize(0,s[1]).level(0).set_style({backgroundImage:"url("+p+"chat_bubble_t.gif)",backgroundRepeat:"repeat-x"}).dock(S.b);v(vsk_h("div")).span(s[0],null,s[0],0).resize(0,s[1]).level(0).set_style({backgroundImage:"url("+p+"chat_bubble_b.gif)",backgroundRepeat:"repeat-x"}).dock(S.b);v(vsk_h("div")).span(0,s[1],null,s[1]).resize(s[1]).set_style({backgroundImage:"url("+p+"chat_bubble_l.gif)",backgroundRepeat:"repeat-y"}).dock(S.b);v(vsk_h("div")).span(null,s[1],0,s[1]).resize(s[1]).set_style({backgroundImage:"url("+p+"chat_bubble_r.gif)",backgroundRepeat:"repeat-y"}).dock(S.b);var C=v(vsk_h("div")).set_pos("relative",10);C.b.innerHTML='<div class="talk_bubble_header">'+A.characterData.name+"</div>'"+text.replace(/#/g,"<br />")+"'";C.b.className="talk_bubble_content";C.dock(S.b);S.dock(this.b).resize(200);pointer.move(S.w()/2-15/2,null,null,-8);S.move((A.abs_x(this.b)+(A.w()/2))-S.w()/2,((A.abs_y(this.b)+A.Sprite.y())-15)-S.h()).level(100);setTimeout(function(){S.undock()},time)}};function WardenCombatQueue(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.Skin=this.child(VUI_NODE,"Skin").level(0);this.Queue=[];this.Skin.span(0,0,0,0)}WardenCombatQueue.prototype=new vsk_clone(VegUIElement.prototype);WardenCombatQueue.prototype.drop=function(Actor,update){var i,r;for(i in this.Queue){if(this.Queue[i].actorId==Actor.actorId){var OldActor=this.Queue.splice(i,1);this.refresh();if(update){this.update(null,OldActor[0])}return OldActor[0]}}return null};WardenCombatQueue.prototype.refresh=function(){var i;for(i in this.Queue){this.Queue[i].queueIndex=i}};WardenCombatQueue.prototype.insert=function(Actor,index){var i,dropIdx,addIdx;var OldQueueActor;var QueueActor=this.Manager.element(WO_COMBAT_ACTOR);QueueActor.setup(true);QueueActor.set(Actor.characterType,Actor.characterId,Actor.isHostile,Actor.actorId);OldQueueActor=this.drop(Actor);if(index>=this.Queue.length){this.Queue.push(QueueActor)}else{if(index<1){this.Queue.unshift(QueueActor)}else{this.Queue.splice(index,0,QueueActor)}}this.refresh();return this.update(QueueActor,OldQueueActor)};WardenCombatQueue.prototype.update=function(Actor,OldActor){this.clear();var i,A;if(OldActor){this.Manager.kill(OldActor)}for(i in this.Queue){A=this.Map.Actors[this.Queue[i].actorId];this.Queue[i].move(52*this.Queue[i].queueIndex,3).dock(this.b);this.Queue[i].GauHealth.hide(!this.Combat.ready).fill(A.health);this.Queue[i].GauPower.hide(!this.Combat.ready).fill(A.power)}return this};function WardenCombatLog(Manager,Parent){this.constructor=VegUIContentBox;this.constructor(Manager,Parent);this.vsk_event_add("glb_mouseup",function(L){L.cooltip_close()})}WardenCombatLog.prototype=new vsk_clone(VegUIContentBox.prototype);WardenCombatLog.prototype.fresh=function(Actor){var N=v(vsk_h("div"));N.b.className="log_entry_"+(Actor&&Actor.isHostile?"hostile":"friendly");return N};WardenCombatLog.prototype.fresh_actor=function(Actor){if(!Actor){return null}var N=v(vsk_h("span")).clear(vsk_t(Actor.characterData.name));N.s.color=WO_CLASS_COLORS[Actor.characterData.class_id];return N};WardenCombatLog.prototype.fresh_spell=function(Spell){var L=this;var N=v(vsk_h("span"));N.html_a(v(vsk_h("img")).set("src",gp+"/spells/"+Spell.effect_id+".gif").resize(15,15).set_style({verticalAlign:"middle"}).b);N.html_a(vsk_t(Spell.name));N.b.className="log_spell";N.s.cursor="pointer";N.handle("mousedown").vsk_event_add("mousedown",function(N){L.cooltip_show(L.Manager.Cache.render_object_spellinfo(Spell._id).b.cloneNode(1),"ac")});return N};WardenCombatLog.prototype.fresh_enchantment=function(Actor,E){var L=this;var eN=this.Manager.element(WO_ENCHANTMENT_INFO);eN.theme("game");eN.set(Actor.characterData,E).undock();var e=v(vsk_h("span")).clear(vsk_t(E.name));e.b.className="log_enchantment";e.s.cursor="pointer";e.handle("mousedown").vsk_event_add("mousedown",function(E){L.cooltip_show(eN.b,"ac")});return e};WardenCombatLog.prototype.log_text=function(Actor,text,color){var N=this.fresh(Actor);if(Actor){N.html_a(this.fresh_actor(Actor).b)}N.html_a(vsk_t(text));if(color){N.s.color=color}return this.log(N)};WardenCombatLog.prototype.log_ability=function(ActorS,ActorT,Spell){var aS=this.fresh_actor(ActorS);var aT=this.fresh_actor(ActorT);var S=this.fresh_spell(Spell);var N=this.fresh(ActorS);N.html_a(aS.b);N.html_a(vsk_t(" uses "));N.html_a(S.b);N.html_a(vsk_t(" on "));N.html_a(aT.b);return this.log(N)};WardenCombatLog.prototype.log_damage=function(ActorS,ActorT,damage,school,damageAvoided){var aS=this.fresh_actor(ActorS);var aT=this.fresh_actor(ActorT);var N=this.fresh(ActorS);N.html_a(aS.b);N.html_a(vsk_t(" deals "));N.html_a(vsk_t(damage));N.html_a(vsk_t(" points of "));N.html_a(vsk_t(this.Manager.Game.spell_school_xl(school)+" damage to "));N.html_a(aT.b);if(damageAvoided){N.html_a(vsk_t(" (~"+damageAvoided+")"))}return this.log(N)};WardenCombatLog.prototype.log_enchantment=function(Actor,E){var N=this.fresh(Actor);var aS=this.fresh_actor(Actor);var e=this.fresh_enchantment(Actor,E);N.html_a(aS.b);N.html_a(vsk_t(" is affected by "));N.html_a(e.b);return this.log(N)};WardenCombatLog.prototype.log_disenchantment=function(Actor,E){var N=this.fresh(Actor);var aS=this.fresh_actor(Actor);var e=this.fresh_enchantment(Actor,E);N.html_a(aS.b);N.html_a(vsk_t(" is NO LONGER affected by "));N.html_a(e.b);return this.log(N)};WardenCombatLog.prototype.log=function(EntryNode){if(!this.Content.b.firstChild){this.Content.html_a(EntryNode.b)}else{v(this.Content.b.firstChild).html_ib(EntryNode.b)}this.ScrollY.sync().align();return this};function WardenCombatEnchantmentFrame(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.Skin=this.child(VUI_NODE,"Skin").level(0);this.LblHeader=this.child(VUI_NODE,"LblHeader").level(1);this.Frame=this.child(VUI_NODE,"Frame").level(2);this.Skin.span(0,0,0,0)}WardenCombatEnchantmentFrame.prototype=new vsk_clone(VegUIElement.prototype);WardenCombatEnchantmentFrame.prototype.update=function(Actor){this.LblHeader.clear(vsk_t(Actor.characterData.name+"'s Enchantments"));this.Frame.clear();var G=this.Manager.Game;var r,str,i,EP=Actor.Enchantments[2],E,EN=Actor.Enchantments[1];var name=Actor.characterData.name;var classId=Actor.characterData.class_id;for(i in EP){E=EP[i];var text=this.Manager.element(WO_ENCHANTMENT_INFO);text.theme("game");text.set(Actor.characterData,E);var icon=v(vsk_h("img")).set("src",gp+"/spells/"+E.visual+".gif");icon.resize(25,25);icon.cooltip_set(text.b,"ac");this.Frame.html_a(icon.b)}for(i in EN){E=EN[i];var text=this.Manager.element(WO_ENCHANTMENT_INFO);text.theme("game");text.set(Actor.characterData,E);var icon=v(vsk_h("img")).set("src",gp+"/spells/"+E.visual+".gif");icon.resize(25,25);icon.cooltip_set(text,"ac");this.Frame.html_a(icon.b)}return this};function WardenCombatMap(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.Map=this.child(WO_BATTLE_MAP,"BattleMap");this.Map.child(VUI_NODE,"Scene");this.Shade=this.child(VUI_NODE,"Shade");this.Actors={};this.zoom=false;this.permaZoom=false;this.Shade.fade(50).set_style({backgroundColor:"#000"}).level(1000).span(0,0,0,0).hide(1);this.set_style({overflow:"hidden"});this.Map.gridW=144;this.Map.gridH=71;this.Map.resize(this.Map.mapCols*this.Map.gridW,146+this.Map.mapRows*this.Map.gridH);this.Map.Grid.span(0,146,0,0);this.Map.Grid.C.Skin.set_style({backgroundImage:"url("+gp+"/ui/grid.gif)"}).fade(15);this.Map.C.Scene.span(0,null,0).resize(null,146)}WardenCombatMap.prototype=new vsk_clone(VegUIElement.prototype);WardenCombatMap.prototype.set_speed=function(speed){this.speed=speed;var i;for(i in this.Actors){this.Actors[i].speed=speed}};WardenCombatMap.prototype.set_map=function(gfxId){this.Map.set_style({backgroundImage:"url("+gp+"/world/backdrop-battle/floor/"+gfxId+".gif)"});this.Map.C.Scene.set_style({backgroundImage:"url("+gp+"/world/backdrop-battle/scene/"+gfxId+".gif)"});return this};WardenCombatMap.prototype.actor_add=function(type,id,x,y,team,index,fade){var Actor=this.Manager.element(WO_COMBAT_ACTOR);Actor.Map=this;Actor.setup(false);if(fade&&!VUI_IS_IE){Actor.fade(1)}Actor.set(type,id,(team!=this.Parent.Team),index).dock(this.Map.Grid.b);var px=this.Map.coords_to_px(x,y);Actor.move(px.x+2,px.y+2);Actor.GauHealth.fill(100);Actor.GauPower.fill(100);Actor.mapX=x;Actor.mapY=y;Actor.speed=this.speed;Actor.level(y);this.Actors[index]=Actor;if(type==WO_ACTOR_NPC){var d=Actor.characterData;if(d.boss_w){Actor.resize(this.Map.gridW*d.boss_w,this.Map.gridH*d.boss_h);Actor.Portrait.resize(this.Map.gridW*d.boss_w,this.Map.gridH*d.boss_h)}}if(this.zoom||this.permaZoom){setTimeout(function(){Actor.zoom_out()},500)}if(fade&&!VUI_IS_IE){Actor.fx_fade_in(500/this.speed)}if(this.Combat.ready){Actor.GauHealth.hide(0);Actor.GauPower.hide(0)}return this};WardenCombatMap.prototype.center=function(actorId,force){var A;if(this.zoom){this.hasCentered=true;return this}if((A=this.Actors[actorId])){if(!force&&(A.x()-50)>-this.Map.x()&&(A.x2()+50)<(-this.Map.x()+this.w())){if((A.y()-50)+this.Map.Grid.y()>-this.Map.y()&&(A.y2()+50)+this.Map.Grid.y()<(-this.Map.y()+this.h())){this.hasCentered=true;return this}}this.hasCentered=false;var M=this;var x,y,px=this.Map.coords_to_px(A.mapX,A.mapY);px.x+=A.w()/2;px.y+=A.h()/2;x=-px.x+Math.round(this.w()/2);y=-px.y+Math.round(this.h()/2);if(x>0){x=0}else{if(x+this.Map.w()<this.w()){x=this.w()-this.Map.w()}}if(y>0){y=0}else{if(y+this.Map.h()<this.h()){y=this.h()-this.Map.h()}}var d=Math.abs(x-this.Map.x())+Math.abs(y-this.Map.y());var interval=Math.round((d*1.25)/this.speed);this.Map.fx_morph(this.Map.w(),this.Map.h(),x,y,interval,10).onhalt=function(){M.hasCentered=true}}return this};WardenCombatMap.prototype.zoom_out=function(ondone){if(!this.zoom&&!this.permaZoom){var M=this.Map;var S=M.C.Scene;var B=this;var F=v(vsk_h("div")).set_style({backgroundColor:"#000"}).fade(1);F.span(0,0,0,0).level(1000).dock(this.b);this.zoomOutPos={x:this.Map.x(),y:this.Map.y()};F.fx_fade_in(150).onhalt=function(){M.move(0,0);M.s.backgroundImage=M.s.backgroundImage.replace(/floor/,"floor/zoom");S.s.backgroundImage=S.s.backgroundImage.replace(/scene/,"scene/zoom");M.Grid.C.Skin.s.backgroundImage="url("+gp+"/ui/grid_small-2.gif)";M.Grid.span(0,73,0,0);M.gridW=72;M.gridH=36;S.resize(null,73);var i,px,A;for(i in B.Actors){A=B.Actors[i];A.zoom_out();px=M.coords_to_px(A.mapX,A.mapY);A.move(px.x,px.y)}B.zoom=true;F.fx_fade_out(150).onhalt=function(){F.undock();if(typeof ondone=="function"){ondone()}}}}else{if(typeof ondone=="function"){ondone()}}};WardenCombatMap.prototype.zoom_in=function(){if(this.zoom&&!this.permaZoom){var F=v(vsk_h("div")).set_style({backgroundColor:"#000"}).fade(1);F.span(0,0,0,0).level(1000).dock(this.b);var M=this.Map;var S=M.C.Scene;var B=this,P=this.zoomOutPos;F.fx_fade_in(150).onhalt=function(){M.move(P.x,P.y);M.s.backgroundImage=M.s.backgroundImage.replace(/\/zoom/,"");S.s.backgroundImage=S.s.backgroundImage.replace(/\/zoom/,"");M.Grid.C.Skin.s.backgroundImage="url("+gp+"/ui/grid.gif)";M.Grid.span(0,146,0,0);M.gridW=144;M.gridH=71;S.resize(null,146);var i,px,A;for(i in B.Actors){A=B.Actors[i];A.zoom_in();px=M.coords_to_px(A.mapX,A.mapY);A.move(px.x,px.y)}B.zoom=false;F.fx_fade_out(150).onhalt=function(){F.undock()}}}};WardenCombatMap.prototype.show_actors=function(){var i,A,n,B,f;for(i in this.Actors){A=this.Actors[i];f=false;for(n in this.Actors){B=this.Actors[n];if(A.actorId==B.actorId||A.mapY>=B.mapY){continue}if(B.Sprite.touching(A.Sprite.b)>50){f=true;A.level(10000-(A.mapY*100)).Sprite.fade(50)}}if(!f){A.level(A.mapY).Sprite.fade(100)}}};function WardenCombatActor(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.Skin=this.child(VUI_NODE,"Skin").level(0);this.Portrait=this.child(VUI_NODE,"Portrait").level(1);this.GauHealth=this.child(VUI_GAUGE,"GauHealth").level(2);this.GauPower=this.child(VUI_GAUGE,"GauPower").level(2);this.LblEnchantments=this.child(VUI_NODE,"LblEnchantments").level(2);this.LblName=this.child(VUI_NODE,"LblName");this.LblAction=this.child(VUI_NODE,"LblAction");this.LblAction.child(VUI_NODE,"Icon");this.LblAction.child(VUI_NODE,"Text");this.LblAction.child(VUI_NODE,"Skin");this.Highlight=this.child(VUI_NODE,"Highlight").level(1).fade(1).hide(1);this.health=100;this.power=100;this.SpriteEffect={};this.effectStatus={};this.Enchantments={0:{},1:{},2:{}};this.LblName.hide(1);this.LblAction.hide(1)}WardenCombatActor.prototype=new vsk_clone(VegUIElement.prototype);WardenCombatActor.prototype.setup=function(asToken,hideGauge,destroyOnUndock){this.asToken=asToken;if(asToken){this.theme("game")}else{this.theme("nontoken")}if(hideGauge){this.GauHealth.hide(1);this.GauPower.hide(1)}var A=this;if(destroyOnUndock){this.vsk_event_add("undock",function(){A.Manager.kill(A)})}return this};WardenCombatActor.prototype.scrolltext=function(text,type,effect,textSmall){var T=v(vsk_h("div"));if(effect){T.clear(v(vsk_h("img")).set_style({verticalAlign:"middle"}).set("src",gp+"/spells/effects/"+effect+".gif").resize(25,25).b)}T.html_a(vsk_t(text));T.b.className="scrolltext_"+type;T.s.textAlign="center";T.resize(200).move(this.w()/2-T.w()/2,this.Sprite.y()).level(1000);T.dock(this.b);if(textSmall){var TS=v(vsk_h("div")).clear(vsk_t("["+textSmall+"]"));TS.s.textAlign="center";TS.b.className="scrolltext_small";TS.dock(T.b)}var interval=Math.round(1500/this.speed);T.fx_morph(T.w(),T.h(),T.x(),this.Sprite.y()-50,interval).onhalt=function(){T.undock()};return this};WardenCombatActor.prototype.load_effect=function(mode,flip,onload){var S;var modeName=mode+(flip?"F":"");if(!(S=this.SpriteEffect[modeName])){S=v(vsk_h("img"));this.SpriteEffect[modeName]=S;var zoom=this.zoom;if(mode=="rooted"){S.b.onload=function(){if(zoom){v(this).wo_sprite_resize(0.5,0.5)}};S.set("src",gp+"/spells/effects/root.png").move(10,null,null,25);S.dock(this.Portrait.b).level(101);return S}var A=this;S.b.onload=function(){v(this).dock(A.Portrait.b).level(100).fade(1);var ic=(A.characterType==WO_ACTOR_CHARACTER);var ad=(A.Sprite.y()%2==0?1:1);if(!A.zoom){if(!flip||!ic){v(this).move(A.Sprite.x()+A.effectOffset.x,A.Sprite.y()+A.effectOffset.y)}else{v(this).move(A.Sprite.x()+(A.Sprite.w()-A.effectOffset.x2),A.Sprite.y()+A.effectOffset.y)}v(this).wo_sprite_truedata()}else{var f=0.5;if(!flip||A.characterType!=WO_ACTOR_CHARACTER){v(this).move(A.Sprite.x()+(A.effectOffset.x*f),A.Sprite.y()+(A.effectOffset.y*f))}else{v(this).move(A.Sprite.x()+(A.Sprite.w()-(A.effectOffset.x2*f)),A.Sprite.y()+(A.effectOffset.y*f))}v(this).wo_sprite_resize(0.5,0.5,true)}if(onload){onload(v(this))}};switch(this.characterType){case WO_ACTOR_CHARACTER:var C=this.M.Cache;var O=this.characterObject;var cd=this.characterData;var torso=C.inventory_get_item(this.characterId,2,1);var mainhand=C.inventory_get_item(this.characterId,13,1);var offhand=C.inventory_get_item(this.characterId,14,1);S.set("src","/script.php?s=game-sprite-character-v&dna="+cd.class_id+"-"+cd.body_id+"-"+cd.hair_id+"-"+cd.facial_id+"-"+cd.hair_color_id+"-"+torso+"-"+mainhand+"-"+offhand+"&m="+mode+"&f="+(flip?1:0));break;default:S.set("src","/script.php?s=game-sprite-npc&n="+this.characterData.gfx_id+"&m="+mode+"&f="+(flip?1:0));break}}else{if(onload){onload(S)}}return S};WardenCombatActor.prototype.render_effects=function(type,turnOff,forceFlipped){var e,f=typeof forceFlipped!="undefined"?forceFlipped:this.flipped();var P=this.Portrait;var speed=this.speed;switch(type){case"highlight":case"offensive":case"support":var S=this.load_effect(type,f,function(e){e.fx_blink(1,Math.round(500/speed),10,60,2,function(n){n.fx_fade_out(Math.round(200/speed))})});break;case"stunned":case"feared":case"asleep":case"mind-controlled":case"rooted":this.load_effect(type,f,function(e){e.fade(!turnOff?100:1)});break;case"enchant":var z=this.zoom,i,e,E,b,visual,Enc,S;this.effectStatus={};var effects=["rooted","stunned","asleep","feared","mind-controlled"];for(i in effects){S=effects[i];if(this.SpriteEffect[S]){this.SpriteEffect[S].fade(1)}if(this.SpriteEffect[S+"F"]){this.SpriteEffect[S+"F"].fade(1)}}for(b=1;b<3;b++){for(i in this.Enchantments[b]){Enc=this.Enchantments[b][i];E=Enc.effects;for(e in E){this.render_effects(this.Manager.Game.enchantment_xl(parseInt(e)))}visual=this.Enchantments[b][i].visualC;if(visual!="0"&&visual){Enc.visualImg=v(vsk_h("img")).fade(1).hide(1);Enc.visualImg.b.onload=function(){v(this).move(P.w()/2-v(this).w()/2,null,null,10).hide(0).fx_fade_in(Math.round(250/speed));if(z){v(this).wo_sprite_resize(0.5,0.5)}};Enc.visualImg.dock(P.b).set("src",gp+"/spells/"+visual+".png");Enc.visualC=null}}}break;default:return}this.effectStatus[type]=turnOff?0:1};WardenCombatActor.prototype.flip_effects=function(){var effects=["stunned","asleep","feared","mind-controlled"];var i,e;var f=this.flipped()?0:1;for(i in effects){e=effects[i];if(this.effectStatus[e]){this.render_effects(e,true,f);this.render_effects(e)}}return this};WardenCombatActor.prototype.flipped=function(){return this.Sprite.woSpriteStatus};WardenCombatActor.prototype.highlight=function(b,Spell){var e;this.render_effects(b?"highlight":null);this.tgl_name(b);this.tgl_action(Spell);this.hasHighlight=b;return this};WardenCombatActor.prototype.effect=function(spellId,trueEffect,time){if(!trueEffect){return this}var C=this.Manager.Cache.data.spell[spellId];var SpellEffect=v(vsk_h("img")).set("src",gp+"/spells/"+(!trueEffect?C.effect_id:"effects/"+C.effect_gfx_id)+"."+(trueEffect?"png":"gif"));SpellEffect.fade(1).dock(this.b).level(3);if(this.zoom){SpellEffect.wo_sprite_resize(0.5,0.5,true)}if(!trueEffect){SpellEffect.move(this.w()/2-SpellEffect.w()/2-2,this.h()/2-SpellEffect.h()/2-2)}else{SpellEffect.move(this.w()/2-SpellEffect.w()/2-2,null,null,this.h()/2)}var speed=this.speed;SpellEffect.fx_fade_in(Math.round(400/speed)).onhalt=function(){setTimeout(function(){SpellEffect.fx_fade_out(Math.round(400/speed)).onhalt=function(){SpellEffect.undock()}},Math.round(1000/speed))}};WardenCombatActor.prototype.enchant=function(ActorS,enchantName,turns,visual,type,visualC){var E=this.Enchantments[type][ActorS.actorId+"-"+enchantName]={name:enchantName.replace(/ #[\d]+$/,""),turns:turns,visual:visual,visualC:visualC,stats:{},effects:{}};return E};WardenCombatActor.prototype.set=function(type,id,isHostile,actorId,asToken,classColor){var R,i,n,O,o,x,y,C=this.Manager.Cache,P=this.Portrait,G=this.M.Game;var asToken=this.asToken;var effectOffset={x:0,y:0,x2:0};switch(type){case WO_ACTOR_CHARACTER:O=C.render_object_character(id);this.characterObject=o=C.data.object_character[parseInt(C.data.character[id].class_id)];O.dock(WO_VOID.b);if(asToken&&!isHostile){O.move((P.w()/2)-o.portrait_x,-o.portrait_y);O.onredraw=function(C,oC){C.move((P.w()/2)-o.portrait_x,-o.portrait_y)}}for(i=0,n=O.b.childNodes.length;i<n;i++){R=v(O.b.childNodes[i]);if(R.x()<effectOffset.x&&R.x()<0){effectOffset.x=R.x()}if(R.y()<effectOffset.y&&R.y()<0){effectOffset.y=R.y()}if(R.x2()>effectOffset.x2&&R.x2()>0){effectOffset.x2=R.x2()}}O.undock();o=C.data.character[id];break;case WO_ACTOR_MINION:var i;o=C.data.npc[C.data.minion[id].npc_id];O=C.render_object_npc(C.data.minion[id].npc_id,false,isHostile);if(asToken){if(isHostile){O.move(null,this.Portrait.h()/2-o.portrait_y,-o.portrait_x+this.Portrait.w()/2)}else{O.move(-o.portrait_x+this.Portrait.w()/2,this.Portrait.h()/2-o.portrait_y)}}break;case WO_ACTOR_NPC:O=C.render_object_npc(id,false,isHostile);o=C.data.npc[id];if(asToken){if(isHostile){O.move(null,this.Portrait.h()/2-o.portrait_y,-o.portrait_x+this.Portrait.w()/2)}else{O.move(-o.portrait_x+this.Portrait.w()/2,this.Portrait.h()/2-o.portrait_y)}}break}this.characterType=type;this.characterId=id;this.characterData=o;this.isHostile=isHostile;this.actorId=actorId;this.Sprite=O;this.effectOffset=effectOffset;this.characterName=o.name;this.Portrait.clear(O.b);if(!asToken){O.move(P.w()/2-O.w()/2,null,null,Math.round(P.h()/2));O.vsk_event_add("sprite",function(O){O.move(P.w()/2-O.w()/2,null,null,Math.round(P.h()/2))});O.onredraw=function(O){O.move(P.w()/2-O.w()/2,null,null,Math.round(P.h()/2))};this.Skin.b.className="target_"+(isHostile?"hostile":"friendly");this.LblName.b.className="name_"+(isHostile?"hostile":"friendly");this.LblName.clear(vsk_t(o.name))}else{if(isHostile){if(!classColor){this.Skin.s.backgroundImage="url("+gp+"/ui/target_hostile.gif)"}else{this.Skin.s.backgroundImage="url("+gp+"/ui/target_cs_"+G.character_class_xl(o.class_id)+".gif)"}this.Highlight.s.backgroundImage="url("+gp+"/ui/target_highlight_hostile.gif)"}else{if(!classColor){this.Skin.s.backgroundImage="url("+gp+"/ui/target_friendly.gif)"}else{this.Skin.s.backgroundImage="url("+gp+"/ui/target_cs_"+G.character_class_xl(o.class_id)+".gif)"}this.Highlight.s.backgroundImage="url("+gp+"/ui/target_highlight_friendly.gif)"}}return this};WardenCombatActor.prototype.zoom_out=function(){if(!this.asToken&&!this.zoom){var i,S;var f=(this.flipped()&&this.characterType==WO_ACTOR_CHARACTER);if(f){this.Sprite.wo_sprite_flip()}this.Sprite.wo_sprite_resize(0.5,0.5);this.resize(this.w()*0.5,this.h()*0.5);this.GauHealth.fill(this.GauHealth.value);this.GauPower.fill(this.GauPower.value);this.zoom=true;this.Portrait.resize(this.Portrait.w()*0.5,this.Portrait.h()*0.5);for(i in this.SpriteEffect){S=this.SpriteEffect[i];S.wo_sprite_resize(0.5,0.5)}var b,Enc;for(b=1;b<3;b++){for(i in this.Enchantments[b]){Enc=this.Enchantments[b][i];if(Enc.visualImg){Enc.visualImg.wo_sprite_resize(0.5,0.5)}}}if(f){this.Sprite.wo_sprite_flip()}this.LblAction.move(this.w()/2-this.LblAction.w()/2,this.Sprite.y()-40);this.LblName.move(this.w()/2-this.LblName.w()/2,this.Sprite.y()-20)}};WardenCombatActor.prototype.zoom_in=function(){if(!this.asToken&&this.zoom){var i,S;var f=(this.flipped()&&this.characterType==WO_ACTOR_CHARACTER);if(f){this.Sprite.wo_sprite_flip()}this.Sprite.wo_sprite_resize(2,2);this.resize(this.w()*2,this.h()*2);this.GauHealth.fill(this.GauHealth.value);this.GauPower.fill(this.GauPower.value);this.zoom=false;this.Portrait.resize(this.Portrait.w()*2,this.Portrait.h()*2);for(i in this.SpriteEffect){S=this.SpriteEffect[i];S.wo_sprite_resize(2,2)}var b,Enc;for(b=1;b<3;b++){for(i in this.Enchantments[b]){Enc=this.Enchantments[b][i];if(Enc.visualImg){Enc.visualImg.wo_sprite_resize(2,2)}}}if(f){this.Sprite.wo_sprite_flip()}this.LblAction.move(this.w()/2-this.LblAction.w()/2,this.Sprite.y()-40);this.LblName.move(this.w()/2-this.LblName.w()/2,this.Sprite.y()-20)}};WardenCombatActor.prototype.tgl_name=function(b){if(b){this.LblName.move(this.w()/2-this.LblName.w()/2,this.Sprite.y()-20)}this.LblName.hide(b^1);return this};WardenCombatActor.prototype.tgl_action=function(Spell){this.LblAction.hide(Spell?0:1);if(!Spell){return this}this.LblAction.move(this.w()/2-this.LblAction.w()/2,this.Sprite.y()-40);var I=this.LblAction.C.Icon;var T=this.LblAction.C.Text;var G=this.Manager.Game;I.clear(v(vsk_h("img")).set("src",gp+"/spells/"+Spell.effect_id+".gif").resize(30,30).b);T.clear(vsk_t(Spell.name));return this};function WardenVictoryScreen(Manager,Parent){this.constructor=WardenModule;this.constructor(Manager,Parent);this.LblVictory=this.child(VUI_NODE,"LblVictory");this.LblEnemy=this.child(VUI_NODE,"LblEnemy");this.EnemyActors=this.child(VUI_NODE,"EnemyActors");this.LblCurrencyReward=this.child(VUI_NODE,"LblCurrencyReward");this.LblExp=this.child(VUI_NODE,"LblExp");this.LblExp.child(VUI_NODE,"LblHeader");this.GauExp=this.LblExp.child(VUI_GAUGE,"GauExp");this.LblLevelUp=this.child(VUI_NODE,"LblLevelUp");this.LblSpells=this.child(VUI_NODE,"LblSpells");this.LblSpells.child(VUI_NODE,"LblHeader");this.LblSpells.child(VUI_NODE,"LblSubHeader");this.LblSpells.child(VUI_NODE,"Display");this.LblMinionUnlock=this.child(VUI_NODE,"LblMinionUnlock");this.LblMinionUnlock.child(VUI_NODE,"LblHeader");this.LblMinionUnlock.child(VUI_NODE,"LblSubHeader");this.LblMinionUnlock.child(VUI_NODE,"Display");this.LblAchievementUnlock=this.child(VUI_NODE,"LblAchievementUnlock");this.LblAchievementUnlock.child(VUI_NODE,"LblHeader");this.LblAchievementUnlock.child(VUI_NODE,"Display");this.LblLootHeader=this.child(VUI_NODE,"LblLootHeader");this.FrameLoot=this.child(VUI_NODE,"FrameLoot");this.LstLoot=this.FrameLoot.child(VUI_LIST,"LstLoot");this.PanReplay=this.child(VUI_NODE,"PanReplay");this.PanReplay.child(VUI_NODE,"FldName","input");this.PanReplay.child(VUI_BUTTON,"BtnSave");this.PanReplay.child(WO_BATTLELOG_MANAGER,"LogManager");this.BtnLeave=this.child(VUI_BUTTON,"BtnLeave").level(10000);this.BtnFleeAndFight=this.child(VUI_BUTTON,"BtnFleeAndFight").level(10000);this.BtnReview=this.child(VUI_BUTTON,"BtnReview");this.LblInfo=this.child(VUI_NODE,"LblInfo");this.BtnFight=this.child(VUI_BUTTON,"BtnFight").level(10000);this.txtRetries="You may try again, or flee the battlefield.";this.txtChallengeNext='You have defeated <span class="defeat_counter">%n</span> of <span class="retry_counter">%m</span> encounters in this challenge.<br /><span class="tiny_info">Click \'Next Battle\' to fight the next opponent in the challenge</span>';this.BtnLeave.vsk_event_add("mouseup",function(Btn){if(!Btn.P.defeat||!Btn.P.retries){Btn.Manager.send("leave-pve")}else{Btn.Manager.send("flee-pve")}},"_priv_victory");this.BtnFight.vsk_event_add("mouseup",function(Btn){if((!Btn.P.defeat||!Btn.P.retries)){Btn.M.send("leave-pve",{fa:"1"})}else{if((Btn.P.defeat&&Btn.P.retries)){Btn.M.send("leave-pve",{ta:"1"})}}},"_priv_victory");this.BtnFleeAndFight.vsk_event_add("mouseup",function(Btn){Btn.M.send("flee-pve",{ea:"1"})},"_priv_victory");this.PanReplay.C.BtnSave.vsk_event_add("mouseup",function(Btn){Btn.M.send("game-battlelog-save",{name:Btn.P.C.FldName.b.value})},"_priv_victory");this.BtnLeave.cooltip_set("Leave this battlefield and return to the battlefield selection list","ac");this.BtnFleeAndFight.cooltip_set("Flee from this fight and re-enter the same battlefield.<br /><br /> Fleeing from the battlefield will invoke a confidence penalty for your character. Confidence penalties can be removed at the High Warden.","ac");this.BtnFight.cooltip_set("Click to try once more to defeat this enemy.","ac")}WardenVictoryScreen.prototype=new vsk_clone(WardenModule.prototype);WardenVictoryScreen.prototype.xml_build__wovictory=function(xml,Parent){this.xml_build__element(xml,Parent);var i,C,M=this.Manager;var Cache=M.Cache;var VS=this;this.LstLoot.flush();var charId=this.charId=v(xml).gan("char_id");var defeat=this.defeat=v(xml).gan("defeat");var retries=this.retries=v(xml).gan("retries");var battleType=this.battleType=v(xml).ga("battle_type");var battlefieldType=v(xml).gan("battlefield_type");var List=this.LstLoot;var set_ct=function(Item,itemId){Item.cooltip_set(function(){return Cache.render_object_iteminfo(itemId,charId).b},"ac",false,List.b)};for(i=0;i<xml.childNodes.length;i++){C=v(xml.childNodes[i]);switch(C.b.nodeName){case"Loot":case"loot":this.LstLoot.item_add(Cache.render_object_iteminfo_compact(C.gan("item"),this.charId).b.cloneNode(1),C.gan("id"));var Item=this.LstLoot.Items[C.gan("id")];Item.b.woItemId=C.gan("item");Item.b.woLootId=C.gan("id");Item.vsk_event_add("mousedown",function(Item){M.send("loot",{loot_id:Item.b.woLootId},null,VS);Item.cooltip_close()});set_ct(Item,C.gan("item"));var Text=v(vsk_h("div"));Text.clear(vsk_t("<click to loot>"));Text.set_style({textAlign:"center",font:"10px Verdana, Arial, Helvetica"});Text.span(0,null,0).move(null,16).level(100).dock(Item.b);break;case"currency":case"Currency":this.set_currency(C.gan("amount"));break;case"npcgroup":case"Npcgroup":this.set_enemy_npc(C.gan("id"));break;case"minion":case"Minion":this.set_minion(C.gan("id"));break;case"spell":case"Spell":this.set_spell(C.gan("id"));break;case"experience":case"Experience":this.GauExp.fill(C.gan("value"));break;case"challenge":case"Challenge":this.challengeMax=C.gan("max");this.challengePos=C.gan("pos");break;case"achievement":this.add_achievement(C.gan("id"));break}}if(defeat){if(retries){this.LblInfo.b.innerHTML=this.txtRetries.replace(/%n/g,(this.retries<0?"unlimited":this.retries));this.BtnLeave.cooltip_set("Flee from this battle. Fleeing the battlefield will cause you to suffer a confidence penalty of 2. Confidency Penalties can be restored at the High Warden.","ac")}else{this.LblInfo.b.innerHTML="Click 'New Battle' for a new battle in the same zone."}this.BtnFleeAndFight.hide(0)}else{this.BtnFleeAndFight.hide(1);if(this.battleType=="pve"){this.BtnFight.cooltip_set("Fight another battle in the same zone","ac")}else{if(this.challengeMax>this.challengePos){this.LblInfo.b.innerHTML=this.txtChallengeNext.replace(/%n/g,this.challengePos).replace(/%m/g,this.challengeMax);this.BtnFight.cooltip_set("Face the next opponent in the challenge.","ac")}else{this.LblInfo.clear(vsk_t("Congratulations, you have defeated all encounters in this challenge"));this.BtnFight.cooltip_set("Begin a new challenge.","ac")}}}if(this.M.Cache.Constants.difficulty){vsk_cookie_set("difficulty",this.M.Cache.Constants.difficulty)}return this};WardenVictoryScreen.prototype.xml_build=WardenVictoryScreen.prototype.xml_build__wovictory;WardenVictoryScreen.prototype.receive=function(xml){var C,i;for(i=0;i<xml.childNodes.length;i++){C=v(xml.childNodes[i]);switch(C.b.nodeName){case"take_loot":this.LstLoot.item_delete(C.gan("id"));var item=this.Manager.Cache.data.item[C.gan("item")];this.LstLoot.cooltip_show("You put "+item.name+" into your backpack.","ac");break;case"load_battlelog":vsk_dbg_print("sup");this.PanReplay.C.LogManager.hide(0).set_pos("relative").set_character(this.charId);break}}};WardenVictoryScreen.prototype.set_currency=function(copper){if(!copper){this.LblCurrencyReward.clear(vsk_t("Your enemies had no coin on them."));return this}var N=v(vsk_h("div"));N.html_a(vsk_t("You have looted "));var silver,gold,mithril,rest;var b=copper/1000000;mithril=Math.floor(b);gold=(1000000*(b-mithril))/10000;rest=gold-Math.floor(gold);silver=(1000000*rest)/10000;rest=silver-Math.floor(silver);copper=Math.round(rest*100);gold=Math.floor(gold);silver=Math.floor(silver);if(mithril>0){N.html_a(v(vsk_h("img")).set("src",gp+"/ui/coin_mithril.gif").b);N.html_a(vsk_t(" "+mithril+" "))}if(gold>0){N.html_a(v(vsk_h("img")).set("src",gp+"/ui/coin_gold.gif").b);N.html_a(vsk_t(" "+gold+" "))}if(silver>0){N.html_a(v(vsk_h("img")).set("src",gp+"/ui/coin_silver.gif").b);N.html_a(vsk_t(" "+silver+" "))}if(copper>0){N.html_a(v(vsk_h("img")).set("src",gp+"/ui/coin_bronze.gif").b);N.html_a(vsk_t(" "+copper+" "))}N.html_a(vsk_t(" from the bodies of your fallen enemies."));this.LblCurrencyReward.clear(N.b);return this};WardenVictoryScreen.prototype.set_minion=function(minionId){var C=this.Manager.Cache;var I=C.render_object_minioninfo(minionId);this.LblMinionUnlock.C.Display.html_a(I.set_pos("relative").b);return this};WardenVictoryScreen.prototype.add_achievement=function(id){var C=this.Manager.Cache;var I=C.render_object_achievement_info(id);this.LblAchievementUnlock.C.Display.html_a(I.set_pos("relative").b);return this};WardenVictoryScreen.prototype.set_spell=function(spellId){var C=this.Manager.Cache;var Spell=C.data.spell[spellId];var D=this.LblSpells.C.Display;var Icon=v(vsk_h("img")).set("src",gp+"/spells/"+Spell.effect_id+".gif");Icon.cooltip_set(C.render_object_spellinfo(spellId).b.cloneNode(1),"ac");D.html_a(Icon.b);return this};WardenVictoryScreen.prototype.set_enemy_npc=function(npcGroupId){var C=this.Manager.Cache;var NpcGroup=C.data.npc_group[npcGroupId];this.EnemyActors.clear();if(NpcGroup){var i;for(i in NpcGroup.members_spawned){var npcId=NpcGroup.members_spawned[i].npc_id;var Actor=this.Manager.element(WO_COMBAT_ACTOR);Actor.setup(true);Actor.set(WO_ACTOR_NPC,npcId,true).move(55*i);Actor.GauHealth.hide(1);Actor.GauPower.hide(1);Actor.cooltip_set(C.render_object_npcinfo(npcId).b.cloneNode(1),"ac");this.EnemyActors.html_a(Actor.set_style({display:"inline"}).b)}}return this};function WardenRandomEncounter(Manager,Parent){this.constructor=WardenModule;this.constructor(Manager,Parent);this.LblHeader=this.child(VUI_NODE,"LblHeader");this.LblInfo=this.child(VUI_NODE,"LblInfo");this.LblMode=this.child(VUI_NODE,"LblMode");this.LblDifficulty=this.child(VUI_NODE,"LblDifficulty");var D,i;for(i=1;i<=2;i++){D=this.LblMode.child(VUI_NODE,"Mode_"+i);D.handle("mousedown").vsk_event_add("mousedown",function(Btn){Btn.P.P.select_mode(Btn.woBattleMode)},"_priv_random_encounter");D.handle("mouseover").vsk_event_add("mouseover",function(Btn){Btn.b.className="mod_re_difficulty_option_hover"},"_priv_random_encounter");D.handle("mouseout").vsk_event_add("mouseout",function(Btn){if(Btn.woBattleMode!=Btn.P.P.mode){Btn.b.className="mod_re_difficulty_option"}else{Btn.b.className="mod_re_difficulty_option_selected"}},"_priv_random_encounter");D.woBattleMode=i;D.set_style({cursor:"pointer"})}for(i=1;i<=6;i++){D=this.LblDifficulty.child(VUI_NODE,"Difficulty_"+i);D.handle("mousedown").vsk_event_add("mousedown",function(Btn){Btn.P.P.select_difficulty(Btn.difficulty)},"_priv_random_encounter");D.handle("mouseover").vsk_event_add("mouseover",function(Btn){Btn.b.className="mod_re_difficulty_option_hover"},"_priv_random_encounter");D.handle("mouseout").vsk_event_add("mouseout",function(Btn){if(Btn.difficulty!=Btn.P.P.difficulty){Btn.b.className="mod_re_difficulty_option"}else{Btn.b.className="mod_re_difficulty_option_selected"}},"_priv_random_encounter");D.difficulty=i;D.set_style({cursor:"pointer"})}this.Worldmap=this.child(VUI_NODE,"Worldmap");this.BtnRandom=this.child(VUI_BUTTON,"BtnRandom");this.difficulty=1;this.mode=1;this.BtnRandom.vsk_event_add("mousedown",function(Btn){vsk_redirect("/game/battlefield/"+Btn.P.mode+"/"+Btn.P.difficulty+"/0")},"_priv_random_encounter").cooltip_set("Random Battlefield Location","ac");this.LblDifficulty.cooltip_set("Select a difficulty level. The greater the difficulty the greater the chance of loot drops, loot quality and experience gain will be.","ac")}WardenRandomEncounter.prototype=new vsk_clone(WardenModule.prototype);WardenRandomEncounter.prototype.xml_build__randomencounter=function(xml,Parent){var i,C,c;for(i=0;i<xml.childNodes.length;i++){C=v(xml.childNodes[i]);switch(C.b.nodeName){case"Mode":var M=this.add_mode(C.gan("mode"),C.ga("img"),C.ga("name"));break}}this.xml_build__element(xml,Parent);this.select_worldmap(v(xml).gan("worldmap"));this.select_mode((vsk_cookie_get("wo_battle_mode")||1));this.select_difficulty((vsk_cookie_get("difficulty")||1));return this};WardenRandomEncounter.prototype.xml_build=WardenRandomEncounter.prototype.xml_build__randomencounter;WardenRandomEncounter.prototype.add_mode=function(mode,img,name){var RE=this;var M=this["Mode"+mode]=this.child(VUI_NODE,"Mode"+mode,"Img");M.set("src",gp+"/ui/"+img+".gif");M.cooltip_set(function(){return"Click to enter the "+name+' battlefield<br />Difficulty Level: <span class="mod_re_difficulty_'+RE.difficulty+'">'+RE.difficultyName+"</span>"},"ac");M.set_style({cursor:"pointer"});M.handle("mouseover").vsk_event_add("mouseover",function(Btn){Btn.fx_fade_in(200)},"_priv_random_encounter");M.handle("mouseout").vsk_event_add("mouseout",function(Btn){Btn.fx_fade_out(200,80)},"_priv_random_encounter");M.handle("mousedown").vsk_event_add("mousedown",function(Btn){vsk_redirect("/game/battlefield/"+mode+"/"+Btn.P.difficulty)},"_priv_random_encounter");return M};WardenRandomEncounter.prototype.select_mode=function(mode){var mode=parseInt(mode);if(!this.LblMode.C["Mode_"+mode]){return this}this.mode=mode;var i;for(i=1;i<=2;i++){this.LblMode.C["Mode_"+i].fx_blink(0).b.className="mod_re_difficulty_option"}this.LblMode.C["Mode_"+mode].fx_blink(1,750,50).b.className="mod_re_difficulty_option_selected";switch(mode){case 1:this.modeName="Skirmish";break;case 2:this.modeName="Challenge";break}vsk_cookie_set("wo_battle_mode",mode);return this};WardenRandomEncounter.prototype.select_difficulty=function(difficulty){var difficulty=parseInt(difficulty);if(!this.LblDifficulty.C["Difficulty_"+difficulty]){return this}this.difficulty=difficulty;var i;for(i=1;i<=6;i++){this.LblDifficulty.C["Difficulty_"+i].fx_blink(0).b.className="mod_re_difficulty_option"}this.LblDifficulty.C["Difficulty_"+difficulty].fx_blink(1,750,50).b.className="mod_re_difficulty_option_selected";switch(difficulty){case 1:this.difficultyName="Easy";break;case 2:this.difficultyName="Normal";break;case 3:this.difficultyName="Hard";break;case 4:this.difficultyName="Heroic";break;case 5:this.difficultyName="Epic";break;case 6:this.difficultyName="Legendary";break}vsk_cookie_set("difficulty",difficulty);return this};WardenRandomEncounter.prototype.select_worldmap=function(id){var d=this.M.Cache.data.worldmap[id];if(d){var R=this;var Map=this.Worldmap;Map.set_style({backgroundImage:"url("+gp+"/world/worldmap/"+d.map_gfx_id+".gif)"});Map.clear();var Zones=d.zones,i,Z,L,LInfo;for(i in d.zones){Z=d.zones[i];L=v(vsk_h("img")).set("src",gp+"/ui/blank.gif");L.resize(Z.w,Z.h).move(Z.x,Z.y).level(1000).dock(Map.b);L.set_style({cursor:"pointer"});L.handle("mousedown").vsk_event_add("mousedown",function(L){vsk_redirect("/game/battlefield/"+R.mode+"/"+R.difficulty+"/"+L.battlefieldId)});L.battlefieldId=Z.battlefield_id;LInfo=this.M.Cache.render_object_battlefield_info(Z.battlefield_id).b;L.cooltip_set(LInfo,"ac")}}return this};var WO_SPELL_INFO=1016;var WO_MINION_INFO=1017;var WO_ENCHANTMENT_INFO=1250;var WO_BATTLEFIELD_INFO=1251;var WO_ITEMINFO_VENDOR=1252;var WO_CURRENCY_LABEL=1253;var WO_ITEMINFO_SALE=1254;var WO_NPC_INFO=1015;var WO_SPELL_INFO_COMPACT=1255;var WO_BATTLEORDER_INFO=1256;var WO_ITEM_ENCHANTMENT_INFO=1257;var WO_ITEM_ENCHANTMENT_INFO_COMPACT=1258;var WO_ACHIEVEMENT_INFO=1259;vui_element_add(WO_SPELL_INFO,WardenSpellInfo);vui_element_add(WO_MINION_INFO,WardenMinionInfo);vui_element_add(WO_ENCHANTMENT_INFO,WardenEnchantmentInfo);vui_element_add(WO_BATTLEFIELD_INFO,WardenBattlefieldInfo);vui_element_add(WO_CURRENCY_LABEL,WardenCurrencyLabel);vui_element_add(WO_ITEMINFO_VENDOR,WardenItemInfoVendor);vui_element_add(WO_ITEMINFO_SALE,WardenItemInfoSale);vui_element_add(WO_NPC_INFO,WardenNPCInfo);vui_element_add(WO_SPELL_INFO_COMPACT,WardenSpellInfoCompact);vui_element_add(WO_BATTLEORDER_INFO,WardenBattleOrderInfo);vui_element_add(WO_ITEM_ENCHANTMENT_INFO_COMPACT,WardenItemEnchantmentInfoCompact);vui_element_add(WO_ITEM_ENCHANTMENT_INFO,WardenItemEnchantmentInfo);vui_element_add(WO_ACHIEVEMENT_INFO,WardenAchievementInfo);function WardenAchievementInfo(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.LblName=this.child(VUI_NODE,"LblName");this.LblDescription=this.child(VUI_NODE,"LblDescription");this.LblRewards=this.child(VUI_NODE,"LblRewards");this.txtReward='<span class="tooltip_header">%name%:</span> '}WardenAchievementInfo.prototype=new vsk_clone(VegUIElement.prototype);WardenAchievementInfo.prototype.set_achievement=function(Achievement,charId){if(!Achievement){return this}this.LblName.clear(vsk_t(Achievement.name));this.LblDescription.clear(vsk_t(Achievement.reason));var i,N,L,d,Item,M=this.Manager,C=M.Cache,G=M.Game;if(!charId){var charId=parseInt(C.Constants.char_id)}var cd=C.data.character[charId];var status=0;if(charId){var Character=this.M.Cache.data.character[charId];if(Character&&Character.achievements){if(vsk_find(Character.achievements,"achievement_id",Achievement._id)!==false){this.LblName.s.color="#6caf75";status=(charId==parseInt(this.M.Cache.Constants.char_id))}}}if(Achievement.title){N=v(vsk_h("div")).dock(this.LblRewards.b);N.b.className="stat_name";N.b.innerHTML=this.txtReward.replace(/%name%/,"Title");N.html_a((L=v(vsk_h("span")).clear(vsk_t(Achievement.title))).b);if(status){L.b.className="tooltip_link";L.handle("mousedown").vsk_event_add("mousedown",function(){M.send("game-set-title",{id:Achievement._id})})}if(status){N.html_a(vsk_t(" - click to set"))}}if(Achievement.backdrop_id){N=v(vsk_h("div")).dock(this.LblRewards.b);N.b.className="stat_name";N.b.innerHTML=this.txtReward.replace(/%name%/,"Character Backdrop");L=v(vsk_h("span")).clear(vsk_t(Achievement.backdrop_name));L.cooltip_set(v(vsk_h("img")).set("src",gp+"/world/backdrop-character/"+Achievement.backdrop_id+".png").b,"ac");if(status){L.b.className="tooltip_link";L.handle("mousedown").vsk_event_add("mousedown",function(L){M.send("game-set-backdrop",{id:Achievement._id})})}L.dock(N.b);if(status){N.html_a(vsk_t(" - click to set"))}}if(Achievement.minion_id){d=C.data.npc[C.data.minion[Achievement.minion_id].npc_id];N=v(vsk_h("div")).dock(this.LblRewards.b);N.b.className="stat_name";N.b.innerHTML=this.txtReward.replace(/%name%/,"Companion");L=v(vsk_h("span")).clear(vsk_t(d.name));L.s.color=WO_CLASS_COLORS[d.class_id];L.set_style({cursor:"pointer"});L.cooltip_set(C.render_object_minioninfo(Achievement.minion_id).b.cloneNode(1),"ac");L.dock(N.b)}if(Achievement.item_1_id&&cd&&cd.class_id==WO_CLASS_WARRIOR){d=C.data.item[Achievement.item_1_id];N=v(vsk_h("div")).dock(this.LblRewards.b);N.b.className="stat_name";N.b.innerHTML=this.txtReward.replace(/%name%/,"Item");L=v(vsk_h("span")).clear(vsk_t(d.name));L.s.color=G.item_color_xl(d.quality);L.set_style({cursor:"pointer"});L.cooltip_set(C.render_object_iteminfo(Achievement.item_1_id,charId).b,"ac");L.dock(N.b)}else{if(Achievement.item_2_id&&cd&&cd.class_id==WO_CLASS_WIZARD){d=C.data.item[Achievement.item_2_id];N=v(vsk_h("div")).dock(this.LblRewards.b);N.b.className="stat_name";N.b.innerHTML=this.txtReward.replace(/%name%/,"Item");L=v(vsk_h("span")).clear(vsk_t(d.name));L.s.color=G.item_color_xl(d.quality);L.cooltip_set(C.render_object_iteminfo(Achievement.item_2_id,charId).b,"ac");L.set_style({cursor:"pointer"});L.dock(N.b)}else{if(Achievement.item_5_id&&cd&&cd.class_id==WO_CLASS_SCOUT){d=C.data.item[Achievement.item_5_id];N=v(vsk_h("div")).dock(this.LblRewards.b);N.b.className="stat_name";N.b.innerHTML=this.txtReward.replace(/%name%/,"Item");L=v(vsk_h("span")).clear(vsk_t(d.name));L.s.color=G.item_color_xl(d.quality);L.set_style({cursor:"pointer"});L.cooltip_set(C.render_object_iteminfo(Achievement.item_5_id,charId).b,"ac");L.dock(N.b)}}}if(Achievement.value){N=v(vsk_h("div")).dock(this.LblRewards.b);N.b.className="stat_name";N.b.innerHTML=this.txtReward.replace(/%name%/,"Marks of the Hero");N.html_a(v(vsk_h("span")).clear(vsk_t("+"+Achievement.value)).b)}};function WardenItemEnchantmentInfoCompact(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.LblName=this.child(VUI_NODE,"LblName");this.Icon=this.child(VUI_NODE,"Icon");this.LblPrice=this.child(WO_CURRENCY_LABEL,"LblPrice")}WardenItemEnchantmentInfoCompact.prototype=new vsk_clone(VegUIElement.prototype);WardenItemEnchantmentInfoCompact.prototype.set_enchantment=function(Enchantment){this.LblName.clear(vsk_t(Enchantment.name));this.LblPrice.set(Enchantment.price);this.Icon.clear(v(vsk_h("img")).set("src",gp+"/item/enchantment/"+Enchantment.quality+".gif").b)};function WardenItemEnchantmentInfo(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.LblName=this.child(VUI_NODE,"LblName");this.Icon=this.child(VUI_NODE,"Icon");this.LblStats=this.child(VUI_NODE,"LblStats");this.LblPrice=this.child(WO_CURRENCY_LABEL,"LblPrice");this.statText='<span class="stat_name">%n%:</span> <span class="stat_value">%v%</span>'}WardenItemEnchantmentInfo.prototype=new vsk_clone(VegUIElement.prototype);WardenItemEnchantmentInfo.prototype.set_enchantment=function(Enchantment){this.LblName.clear(vsk_t(Enchantment.name));this.LblPrice.set(Enchantment.price);this.Icon.clear(v(vsk_h("img")).set("src",gp+"/item/enchantment/"+Enchantment.quality+".gif").b);var Stats=WO_CT_ITEM_STATS,s,i,ri,G=this.M.Game;this.LblStats.clear();for(s in Stats){i=Stats[s];ri="stat_"+i;value=Enchantment[ri];if(value){if(i=="speed"){value=-value}var N=v(vsk_h("div")).set_pos("relative");N.b.className="stat_entry";N.b.innerHTML=this.statText.replace(/%n%/g,G.item_stat_xl(ri)).replace(/%v%/g,(value>0?"+":"")+value+"%");this.LblStats.html_a(N.b)}}};function WardenBattleOrderInfo(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.Icon=this.child(VUI_NODE,"Icon").level(1);this.LblHeader=this.child(VUI_NODE,"LblHeader");this.LblInfo=this.child(VUI_NODE,"LblInfo")}WardenBattleOrderInfo.prototype=new vsk_clone(VegUIElement.prototype);WardenBattleOrderInfo.prototype.set_battleorder=function(orderId,classId){var G=this.M.Game;this.LblHeader.clear(vsk_t(G.order_xl(orderId,classId)));this.LblInfo.b.innerHTML=G.order_info(orderId,classId);this.Icon.set_style({backgroundImage:"url("+gp+"/spells/battleorder/"+orderId+(classId?"_"+classId:"")+".gif)"});return this};function WardenSpellInfoCompact(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.Icon=this.child(VUI_NODE,"Icon","img");this.LblName=this.child(VUI_NODE,"LblName","span");this.Spell=null}WardenSpellInfoCompact.prototype=new vsk_clone(VegUIElement.prototype);WardenSpellInfoCompact.prototype.set_spell=function(Spell){this.Spell=Spell;this.LblName.clear(vsk_t(Spell.name));this.Icon.set("src",gp+"/spells/"+Spell.effect_id+".gif");return this};function WardenCurrencyLabel(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent)}WardenCurrencyLabel.prototype=new vsk_clone(VegUIElement.prototype);WardenCurrencyLabel.prototype.set=function(copper,lowPrecision){var c=this.Manager.Game.currency_split(copper);this.clear();var N=this;if(c.mithril>0){N.html_a(v(vsk_h("img")).set("src",gp+"/ui/coin_mithril.gif").set_style({verticalAlign:"middle"}).b);N.html_a(vsk_t(" "+c.mithril+" "))}if(c.gold>0){N.html_a(v(vsk_h("img")).set("src",gp+"/ui/coin_gold.gif").set_style({verticalAlign:"middle",marginLeft:(c.mithril?"20px":"0px")}).b);N.html_a(vsk_t(" "+c.gold+" "))}if(c.silver>0){N.html_a(v(vsk_h("img")).set("src",gp+"/ui/coin_silver.gif").set_style({verticalAlign:"middle",marginLeft:(c.gold?"5px":"0px")}).b);N.html_a(vsk_t(" "+c.silver+" "))}if(c.copper>0&&(!c.mithril||!lowPrecision)){N.html_a(v(vsk_h("img")).set("src",gp+"/ui/coin_bronze.gif").set_style({verticalAlign:"middle",marginLeft:(c.silver?"5px":"0px")}).b);N.html_a(vsk_t(" "+c.copper+" "))}return this};function WardenItemInfoSale(Manager,Parent){this.constructor=WardenItemInfoCompact;this.constructor(Manager,Parent);this.LblPrice=this.child(WO_CURRENCY_LABEL,"LblPrice")}WardenItemInfoSale.prototype=new vsk_clone(WardenItemInfoCompact.prototype);WardenItemInfoSale.prototype.set_item_sale=function(Item,buybackMode,charId,itemInstanceId){this.iteminfo_set(Item,charId,itemInstanceId);this.LblPrice.set(Math.floor(Item.price*(buybackMode||1)));return this};function WardenItemInfoVendor(Manager,Parent){this.constructor=WardenItemInfoCompact;this.constructor(Manager,Parent);this.LblPrice=this.child(WO_CURRENCY_LABEL,"LblPrice");this.BtnBuy=this.child(VUI_BUTTON,"BtnBuy")}WardenItemInfoVendor.prototype=new vsk_clone(WardenItemInfoCompact.prototype);WardenItemInfoVendor.prototype.set_item_vendor=function(Item,buybackMode,buybackId,charId,priceMod){this.iteminfo_set(Item,charId);if(!buybackMode){this.BtnBuy.vsk_event_add("mousedown",function(Btn,e){Btn.Manager.send("vendor-buy",{item_id:Btn.Item._id});ve(e||window.event).cancel_bubbling()},"buy").Item=Item}else{this.BtnBuy.vsk_event_add("mousedown",function(Btn,e){Btn.Manager.send("vendor-buy-back",{item_id:buybackId});ve(e||window.event).cancel_bubbling()},"buy").Item=Item}this.LblPrice.set(buybackMode?Math.ceil(Item.price*buybackMode):(Item.price*(priceMod||1)));return this};function WardenBattlefieldInfo(Manager,Parent){this.constructor=WardenModule;this.constructor(Manager,Parent);this.IcoBackdrop=this.child(VUI_NODE,"IcoBackdrop").level(1);this.LblName=this.child(VUI_NODE,"LblName").level(1);this.LblLore=this.child(VUI_NODE,"LblLore").level(1);this.LblInfo=this.child(VUI_NODE,"LblInfo").level(1);this.infoText="Level Required: %level%";this.Battlefield=null;this.vsk_event_add("place",function(BfInfo){BfInfo.IcoBackdrop.fx_shadow(15,"#000",7,7)},"_priv")}WardenBattlefieldInfo.prototype=new vsk_clone(WardenModule.prototype);WardenBattlefieldInfo.prototype.set_battlefield=function(Battlefield){this.Battlefield=Battlefield;var zoneType=this.Manager.Game.battlefield_type_xl(Battlefield.type)+" Zone";this.LblName.clear(vsk_t(Battlefield.name));this.LblLore.clear(vsk_t(Battlefield.lore));this.LblInfo.b.innerHTML=this.infoText.replace(/%zone_type%/g,zoneType).replace(/%level%/g,Battlefield.level);var progress=parseInt(this.M.Cache.Constants.story_mode_progress),l=false;this.IcoBackdrop.set_style({backgroundImage:"url("+(gp+"/world/backdrop-battle/scene/zoom/"+Battlefield.default_backdrop_id+".gif")+")"});return this};function WardenEnchantmentInfo(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.IcoEffect=this.child(VUI_NODE,"IcoEffect");this.LblName=this.child(VUI_NODE,"LblName");this.Effects=this.child(VUI_NODE,"Effects");this.effectText="%name% is %effect%.";this.statText="%name%'s %stat% is %effect%"}WardenEnchantmentInfo.prototype=new vsk_clone(VegUIElement.prototype);WardenEnchantmentInfo.prototype.set=function(C,E){var G=this.Manager.Game;this.Effects.clear();this.LblName.clear(vsk_t(E.name));this.IcoEffect.clear(v(vsk_h("img")).set("src",gp+"/spells/"+E.visual+".gif").b);var i,N;for(i in E.effects){N=v(vsk_h("div"));N.b.innerHTML=this.effectText.replace(/%name%/g,C.name).replace(/%effect%/g,G.enchantment_xl(parseInt(i),E.name));this.Effects.html_a(N.b)}for(i in E.stats){N=v(vsk_h("div"));N.b.innerHTML=this.statText.replace(/%name%/g,C.name).replace(/%effect%/g,G.enchantment_strength_xl(E.stats[i],parseInt(i))).replace(/%stat%/g,G.enchantment_stat_xl(C.class_id,parseInt(i)));this.Effects.html_a(N.b)}return this};function WardenSpellInfo(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.LblName=this.child(VUI_NODE,"LblName").level(1);this.LblDescription=this.child(VUI_NODE,"LblDescription").level(1);this.LblInfo=this.child(VUI_NODE,"LblInfo").level(1);this.LblRequirement=this.child(VUI_NODE,"LblRequirement").level(1);this.Icon=this.child(VUI_NODE,"Icon").level(1);this.LblCost=this.child(VUI_NODE,"LblCost").level(1);this.LblCooldown=this.child(VUI_NODE,"LblCooldown").level(1);this.LblRange=this.child(VUI_NODE,"LblRange").level(1);this.Skin=this.child(VUI_NODE,"Skin");this.costText='<span class="tooltip_header">Cost:</span> %cost%';this.cooldownText='<span class="tooltip_header">Cooldown:</span> %cooldown%';this.requirementText='<div class="tooltip_header">Usage Requirements:</div><div>%requirements%</div>';this.rangeText='<span class="tooltip_header">Range:</span> %min_range%%range%';this.Skin.span(0,0,0,0).level(0);this.set_skin("Skin")}WardenSpellInfo.prototype=new vsk_clone(VegUIElement.prototype);WardenSpellInfo.prototype.set_spell=function(S){var C=this.Manager.Cache,S;if(S){this.LblName.clear(vsk_t(S.name));this.LblDescription.clear(vsk_t(S.description));this.LblInfo.b.innerHTML=this.Manager.Game.spell_info_text(S);this.LblCost.b.innerHTML=this.costText.replace(/%cost%/g,S.cost);this.LblRange.b.innerHTML=this.rangeText.replace(/%min_range%/g,(S.min_range>0?S.min_range+" - ":"")).replace(/%range%/g,(S.range<99?S.range:"anywhere on the map"));this.LblCooldown.b.innerHTML=this.cooldownText.replace(/%cooldown%/g,S.cooldown);if(S.description_requirement){this.LblRequirement.b.innerHTML=this.requirementText.replace(/%requirements%/g,S.description_requirement);this.LblRequirement.hide(0)}else{this.LblRequirement.hide(1)}this.Icon.set_style({backgroundImage:"url("+gp+"/spells/"+S.effect_id+".gif)"})}};function WardenMinionInfo(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.Portrait=this.child(VUI_NODE,"Portrait");this.LblName=this.child(VUI_NODE,"LblName");this.LblDescription=this.child(VUI_NODE,"LblDescription");this.LblInfo=this.child(VUI_NODE,"LblInfo");this.LblAbilities=this.child(VUI_NODE," LblAbilities");this.Minion=null;this.infoText='<span style="color:#%color%">%class%</span>';this.Portrait.s.overflow="hidden"}WardenMinionInfo.prototype=new vsk_clone(VegUIElement.prototype);WardenMinionInfo.prototype.set_minion=function(Minion){var npcId=parseInt(Minion.npc_id);var NPC=this.Manager.Cache.data.npc[npcId];var classId=parseInt(NPC.class_id);this.Minion=Minion;var I=this.Manager.Cache.render_object_npc(npcId);I.move(-NPC.portrait_x+this.Portrait.w()/2,this.Portrait.h()/2-NPC.portrait_y);this.Portrait.clear(I.b);this.LblName.clear(vsk_t(NPC.name));this.LblInfo.b.innerHTML=this.infoText.replace(/%level%/g,NPC.level).replace(/%color%/g,WO_CLASS_COLORS[classId]).replace(/%class%/g,this.Manager.Game.character_class_xl(classId));this.LblDescription.clear(vsk_t(NPC.description));this.LblAbilities.clear();var i,S,C=this.Manager.Cache,SI,T,icon;for(i in NPC.spells){S=C.data.spell[NPC.spells[i].spell_id];icon=v(vsk_h("img")).set("src",gp+"/spells/"+S.effect_id+".gif").resize(25,25);icon.set_pos("relative").cooltip_set(C.render_object_spellinfo(NPC.spells[i].spell_id).b,"ac");this.LblAbilities.html_a(icon.b)}this.LblAbilities.set_pos("relative");return this};function WardenNPCInfo(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.LblName=this.child(VUI_NODE,"LblName");this.LblInfo=this.child(VUI_NODE,"LblInfo");this.LblDescription=this.child(VUI_NODE,"LblDescription");this.LblTrait=this.child(VUI_NODE,"LblTrait");this.LblHelp=this.child(VUI_NODE,"LblHelp");this.LblAbilities=this.child(VUI_NODE,"LblAbilities");this.infoText='Level %level% %type% <span style="color:%color%;">%class%</span>';this.traitText='<span class="tooltip_header">Strength:</span> %s%<br /><span class="tooltip_header">Weakness:</span> %w%';this.help=['<span class="tooltip_header">Click</span> to select <span style="color:%t_color%">%t_name%</span> as target for <span style="color:%c_color%">%c_name%</span>','Check the <span class="tooltip_header">zzz</span> checkbox in the lower right corner to select <span style="color:%t_color%">%t_name%</span> as a <span class="tooltip_header">crowd control target</span> for <span style="color:%c_color%">%c_name%</span>'];this.abilityText="<b>%name%</b> - <i>%description%</i>";this.styleAbility={};this.NPC=null}WardenNPCInfo.prototype=new vsk_clone(VegUIElement.prototype);WardenNPCInfo.prototype.xml_build__npcinfo=function(xml,Parent){this.xml_build__element(xml,Parent);var h,N=v(xml);if((h=N.ga("styleAbility"))){this.styleAbility=h}return this};WardenNPCInfo.prototype.xml_build=WardenNPCInfo.prototype.xml_build__npcinfo;WardenNPCInfo.prototype.set_help=function(help){if(!help){this.LblHelp.hide(1);return}else{this.LblHelp.hide(0)}this.LblHelp.b.innerHTML=this.help[help[0]].replace(/%t_color%/g,help[1]).replace(/%t_name%/g,help[2]).replace(/%c_color%/g,help[3]).replace(/%c_name%/g,help[4])};WardenNPCInfo.prototype.set_npc=function(NPC){var G=this.Manager.Game;if(NPC.name){this.NPC=NPC;this.LblName.clear(vsk_t(NPC.name));if(!NPC.is_object){this.LblInfo.b.innerHTML=this.infoText.replace(/%level%/g,NPC.level).replace(/%class%/g,G.character_class_xl(parseInt(NPC.class_id))).replace(/%color%/g,WO_CLASS_COLORS[parseInt(NPC.class_id)]).replace(/%type%/g,G.character_type_xl(parseInt(NPC.type)))}else{this.LblInfo.b.innerHTML="Object"}var t=G.character_type_traits(NPC.type);if(!NPC.is_object){this.LblTrait.b.innerHTML=this.traitText.replace(/%s%/g,(t?t[0]:"none")).replace(/%w%/g,(t?t[1]:"none"))}else{this.LblTrait.undock()}this.LblDescription.b.innerHTML=NPC.description.replace(/#/g,"<br />");this.LblAbilities.clear()}return this};var WO_ADVENTURE_LIST=4567;vui_element_add(WO_ADVENTURE_LIST,WardenAdventureList);function WardenAdventureList(Manager,Parent){this.constructor=WardenModule;this.constructor(Manager,Parent);this.LblAct=this.child(VUI_NODE,"LblAct").level(1);this.LblActInfo=this.child(VUI_NODE,"LblActInfo").level(1);this.LstActs=this.child(VUI_DROPDOWN_LIST,"LstActs").level(1);this.FraBattlefields=this.child(VUI_NODE,"FraBattlefields").level(1);this.Row=this.child(VUI_NODE,"Row").hide(1).level(1);this.actId=0;this.Act=0;this.LstActs.List.vsk_event_add("change",function(List){vsk_redirect("/game/adventure/"+List.value())},"_priv_adventure")}WardenAdventureList.prototype=new vsk_clone(WardenModule.prototype);WardenAdventureList.prototype.xml_build__woadventure=function(xml,Parent){this.xml_build__element(xml,Parent);var X=v(xml);this.set_act(X.gan("act"));var i,N,C=this.M.Cache.data;for(i=0;i<xml.childNodes.length;i++){N=v(xml.childNodes[i]);switch(N.b.nodeName){case"battlefield":case"Battlefield":this.add_battlefield(N.gan("id"));break;case"act":case"Act":this.LstActs.List.item_add_txt(C.act[N.gan("id")].name,N.gan("id"));break}}return this};WardenAdventureList.prototype.xml_build=WardenAdventureList.prototype.xml_build__woadventure;WardenAdventureList.prototype.set_act=function(actId){this.actId=actId;if(!this.M.Cache.data.act[actId]){return this}this.Act=this.Manager.Cache.data.act[actId];this.LblAct.clear(vsk_t(this.Act.name));this.LblActInfo.clear(vsk_t(this.Act.lore));vsk_cookie_set("wo_act",actId);return this};WardenAdventureList.prototype.add_battlefield=function(battlefieldId){var F=this.FraBattlefields;var BFNode=this.Manager.Cache.render_object_battlefield_info(battlefieldId);var Row=v(this.Row.b.cloneNode(1)).set_pos("relative");Row.clear(BFNode.set_pos("relative").b.cloneNode(1));Row.cooltip_set("Click to enter this battlefield","ac");Row.s.cursor="pointer";Row.handle("mousedown").vsk_event_add("mousedown",function(Row){vsk_redirect("/game/battlefield/"+BFNode.Battlefield._id)});this.FraBattlefields.html_a(Row.hide(0).b,v(vsk_h("div")).set_style({padding:"5px"}).b);return this};var WO_VENDOR=5678;var WO_VENDOR_SECTION=5679;vui_element_add(WO_VENDOR,WardenVendor);vui_element_add(WO_VENDOR_SECTION,WardenVendorSection);function WardenVendor(Manager,Parent){this.constructor=WardenModule;this.constructor(Manager,Parent);this.LblHeader=this.child(VUI_NODE,"LblHeader");this.LblLore=this.child(VUI_NODE,"LblLore");this.DlgVendor=this.child(VUI_TAB_DIALOGUE,"DlgVendor");this.FraBuy=this.child(VUI_NODE,"FraBuy");this.LblCurrency=this.FraBuy.child(WO_CURRENCY_LABEL,"LblCurrency");this.SecExotic=this.FraBuy.child(WO_VENDOR_SECTION,"SecExotic");this.SecArmor=this.FraBuy.child(WO_VENDOR_SECTION,"SecArmor");this.SecWeapon=this.FraBuy.child(WO_VENDOR_SECTION,"SecWeapon");this.SecShield=this.FraBuy.child(WO_VENDOR_SECTION,"SecShield");this.SecPotion=this.FraBuy.child(WO_VENDOR_SECTION,"SecPotion");this.FraSell=this.child(VUI_NODE,"FraSell");this.SecBuyback=this.FraSell.child(WO_VENDOR_SECTION,"SecBuyback");this.CbHideEquipped=this.FraSell.child(VUI_CHECKBOX,"CbHideEquipped");this.Bag=this.FraSell.child(WO_BACKPACK,"Bag");this.charId=0;this.Character=null;this.showEquipped=false;var Vendor=this;this.Manager.Cache.data.onchange.add(function(type,d){if(type=="character"&&parseInt(d.data._id)==parseInt(Vendor.charId)){Vendor.Character=d.data;Vendor.update_buyback();Vendor.update_currency()}},"vendor_"+Vendor.uniqueId);this.CbHideEquipped.vsk_event_add("change",function(Cb){if(Vendor.charId){Vendor.showEquipped=Cb.isChecked;Vendor.Bag.set_sellmode(Vendor.sellModeDeduct,Vendor.showEquipped);Vendor.Bag.set_character(Vendor.charId)}},"_priv_vendor")}WardenVendor.prototype=new vsk_clone(WardenModule.prototype);WardenVendor.prototype.xml_build__wovendor=function(xml,Parent){this.xml_build__element(xml,Parent);var i,N;this.sellModeDeduct=v(xml).gaf("deduct");this.sellModeExoticCost=v(xml).gan("exotic_cost");this.set_character(v(xml).gan("char_id"));for(i=0;i<xml.childNodes.length;i++){N=v(xml.childNodes[i]);switch(N.b.nodeName){case"item":case"Item":this.add_item(N.gan("id"));break;case"exotic_item":case"Exotic_item":this.add_item(N.gan("id"),this.sellModeExoticCost);break}}this.SecExotic.LstItems.adjust();this.SecArmor.LstItems.adjust();this.SecShield.LstItems.adjust();this.SecWeapon.LstItems.adjust();this.SecPotion.LstItems.adjust();this.SecBuyback.LstItems.adjust();return this};WardenVendor.prototype.xml_build=WardenVendor.prototype.xml_build__wovendor;WardenVendor.prototype.set_character=function(charId){this.charId=charId;var Character=this.Character=this.Manager.Cache.data.character[charId];this.SecExotic.set("Rare Offers",Character);this.SecArmor.set("Armor",Character);this.SecShield.set("Offhand",Character);this.SecWeapon.set("Weapon",Character);this.SecPotion.set("Potion",Character,true);this.SecBuyback.set("Buy-back",Character,true);this.Bag.set_sellmode(this.sellModeDeduct,this.showEquipped);this.Bag.set_character(charId);this.update_buyback();this.update_currency();return this};WardenVendor.prototype.update_buyback=function(){if(!this.Character){return this}var Character=this.Character;this.SecBuyback.LstItems.flush();var BB=Character.buyback,i,Item,C=this.Manager.Cache;for(i in BB){if(!(Item=C.data.item[BB[i].item_id])){continue}this.SecBuyback.add_item(Item._id,this.sellModeDeduct,BB[i].id,0,BB[i].enchantment_id)}return this};WardenVendor.prototype.update_currency=function(){if(!this.Character){return this}this.LblCurrency.set(this.Character.copper)};WardenVendor.prototype.add_item=function(itemId,exotic){var Item=this.Manager.Cache.data.item[itemId];if(Item){if(!exotic){var typeStr=this.Manager.Game.item_type_xl(Item.item_type,true)}else{var typeStr="Exotic"}this["Sec"+typeStr].add_item(itemId,null,null,exotic)}return this};function WardenVendorSection(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.LblHeader=this.child(VUI_NODE,"LblHeader");this.LstItems=this.child(VUI_LIST,"LstItems");this.headerText="%name% &#187; %class% - Level %level_min% - %level_max%";this.Character=null}WardenVendorSection.prototype=new vsk_clone(VegUIElement.prototype);WardenVendorSection.prototype.set=function(name,Character,noLevelRange){this.LblHeader.b.innerHTML=this.headerText.replace(/%name%/g,name).replace(/%level_min%/g,(noLevelRange?"1":tp(Character.level-5,1))).replace(/%level_max%/g,Character.level+1).replace(/%class%/g,this.Manager.Game.character_class_xl(Character.class_id));this.LstItems.flush();this.Character=Character;return this};WardenVendorSection.prototype.add_item=function(itemId,buybackMode,buybackId,priceMod,enchantmentId){var C=this.Manager.Cache;var ItemInfo=C.render_object_iteminfo_vendor(itemId,buybackMode,buybackId,this.Character._id,priceMod);this.LstItems.item_add(ItemInfo.set_pos("relative").b,buybackId||itemId,true);ItemInfo.BtnBuy.cooltip_set("Purchase this item.","ac");var charId=this.Character._id;ItemInfo.cooltip_set(function(){return C.render_object_iteminfo(itemId,charId,enchantmentId).b},"ac",false,this.b);return this};var WO_NPC_DETAILS=4500;var WO_MINION_LIST=4501;var WO_MINION_FAVORITES=4502;vui_element_add(WO_NPC_DETAILS,WardenNPCDetails);vui_element_add(WO_MINION_LIST,WardenMinionList);vui_element_add(WO_MINION_FAVORITES,WardenMinionFavorites);function WardenMinionFavorites(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);var i,S;for(i=0;i<9;i++){S=this.child(VUI_NODE,"Socket"+i);S.s.overflow="hidden";S.handle("mousedown").vsk_event_add("mousedown",function(Btn){if(Btn.minionId){Btn.M.send("game-minion-favorite-drop",{minion_id:Btn.minionId})}},"_priv_minion_favorites")}this.charId=0}WardenMinionFavorites.prototype=new vsk_clone(VegUIElement.prototype);WardenMinionFavorites.prototype.set_character=function(charId){this.charId=charId;var A,C=this.Manager.Cache,S,F,i,NPC;F=C.data.character[charId].minion_favorites;for(i=0;i<9;i++){S=this.C["Socket"+i].clear();S.minionId=0;S.s.cursor="default";if(F&&F[i]){S.minionId=F[i].minion_id;if(!C.data.minion[S.minionId]){continue}NPC=C.data.npc[C.data.minion[F[i].minion_id].npc_id];S.cooltip_set('Click to remove <span class="stat_name">'+NPC.name+"</span> from your party","ac");A=this.Manager.element(WO_COMBAT_ACTOR);A.setup(1,1);A.set(WO_ACTOR_MINION,F[i].minion_id,false,0,true);S.clear(A.move(-2,-2).b);S.s.cursor="pointer"}else{S.cooltip_set("Select a companion and click the 'Add to Party' button","ac")}}return this};function WardenMinionList(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.LstMinions=this.child(VUI_LIST,"LstMinions");this.Details=this.child(WO_NPC_DETAILS,"Details");this.Favorites=this.child(WO_MINION_FAVORITES,"Favorites");this.BtnAddQuickselect=this.child(VUI_BUTTON,"BtnAddQuickselect");this.charId=0;this.Character=0;this.LstMinions.vsk_event_add("change",function(List){var D=List.Parent;var npcId=D.Manager.Cache.data.minion[List.value()].npc_id;var scaleM=Math.max((D.Character.equip_level/D.Character.level/16),1);D.Details.set_npc(D.Manager.Cache.data.npc[npcId],List.value(),Math.max(D.Character.level-1,1),scaleM,D.charId)},"_priv_minion_list");this.BtnAddQuickselect.vsk_event_add("mousedown",function(Btn){var ML=Btn.P;if(ML.LstMinions.value()){ML.M.send("game-minion-favorite-add",{minion_id:ML.LstMinions.value()})}},"_priv_minion_list");var ML=this;this.Manager.Cache.data.onchange.add(function(type,d){if(type=="character"){if(parseInt(d.id)==ML.charId){ML.set_character(ML.charId);ML.Favorites.set_character(ML.charId);ML.LstMinions.vsk_event_fire("change")}}},"minion-list")}WardenMinionList.prototype=new vsk_clone(VegUIElement.prototype);WardenMinionList.prototype.lset_character=function(charId,battleMode){var M=this.M,L=this;M.send("game-cd-minions",{char_id:charId},function(){M.cache_queue(function(){L.set_character(charId,battleMode)})})};WardenMinionList.prototype.set_character=function(charId,battleMode){var Character=this.Manager.Cache.data.character[charId];if(!Character){return this}this.charId=charId;this.Character=Character;this.LstMinions.flush();var i,m,NPC,C=this.Manager.Cache.data;var M=vsk_sorted_array(Character.minions,function(Obj){return C.npc[C.minion[Obj.minion_id].npc_id].name},1);var Manager=this.Manager;var List=this.LstMinions;var firstMinionId=0;for(i in M){m=C.minion[M[i].minion_id];if(!firstMinionId){firstMinionId=M[i].minion_id}NPC=C.npc[m.npc_id];this.LstMinions.item_add_txt(NPC.name,M[i].minion_id,true);this.LstMinions.Items[M[i].minion_id].woMinionId=M[i].minion_id;if(battleMode){this.set_drag(NPC._id,M[i].minion_id,battleMode)}}if(firstMinionId){this.LstMinions.select_item(firstMinionId)}this.Favorites.set_character(charId);return this};WardenMinionList.prototype.set_drag=function(npcId,minionId,Map){var List=this.LstMinions;var I=List.Items[minionId];var C=this.Manager.Cache;var d=C.data.npc[npcId];var Manager=this.Manager;var getTarget=function(){var T;if((T=Manager.E["BattleMapToken_M_"+minionId])){Manager.kill(T)}var Target=Manager.element(WO_COMBAT_ACTOR,"BattleMapToken_M_"+minionId);Target.setup(1,1);Target.set(WO_ACTOR_MINION,minionId,false,0,true);return Target.b};I.draginit(WO_TARGET_FRIENDLY,1,1,null,null,null,getTarget).vsk_event_add("dragstart",function(ListItem,DragNode){Map.blink_targets(WO_TARGET_FRIENDLY,true)},"battle").vsk_event_add("dragstop",function(ListItem){Map.blink_targets(WO_TARGET_FRIENDLY)},"battle").minionId=minionId;I.charType="m";I.npcId=npcId;return this};function WardenNPCDetails(Manager,Parent){this.constructor=VegUIElement;this.constructor(Manager,Parent);this.LblName=this.child(VUI_NODE,"LblName");this.LblInfo=this.child(VUI_NODE,"LblInfo");this.LblLore=this.child(VUI_NODE,"LblLore");this.LblStats=this.child(VUI_NODE,"LblStats");this.LblAbilities=this.child(VUI_NODE,"LblAbilities");this.DlgInfo=this.child(VUI_TAB_DIALOGUE,"DlgInfo");this.Portrait=this.child(VUI_NODE,"Portrait");this.charId=0;this.npcId=0;this.minionId=0;this.NPC=null;this.statText='<span class="stat_name">%n%:</span> <span class="stat_value">%v%</span>';this.infoText='%t% <span style="color:%co%">%c%</span>, <b>level</b> %l%, <b>bonus</b> %e%';this.Portrait.s.overflow="hidden"}WardenNPCDetails.prototype=new vsk_clone(VegUIElement.prototype);WardenNPCDetails.prototype.set_npc=function(NPC,minionId,scale,scaleM,charId){if(!NPC||!NPC._id){return this}this.npcId=NPC._id;this.minionId=minionId;this.NPC=NPC;var i,customName;this.update_stats(scale,scaleM);this.update_abilities();this.LblName.clear(vsk_t(NPC.name));this.LblInfo.b.innerHTML=this.infoText.replace(/%l%/g,scale||NPC.level).replace(/%co%/g,WO_CLASS_COLORS[NPC.class_id]).replace(/%c%/g,this.Manager.Game.character_class_xl(NPC.class_id)).replace(/%e%/g,set_precision(scaleM||0,2)).replace(/%t%/g,this.M.Game.character_type_xl(NPC.type));var LblLore=this.DlgInfo.get_tab_by_name("lore").Panel.C.LblLore;LblLore.clear(vsk_t(NPC.description));this.Portrait.s.backgroundImage="url("+gp+"/world/backdrop-npc/"+NPC.background_id+".gif)";var NPCSprite=this.Manager.Cache.render_object_npc(NPC._id);NPCSprite.level(1);var P=this.Portrait.clear();NPCSprite.onredraw=function(oldSprite){this.move(P.w()/2-this.w()/2,null,null,5)};NPCSprite.vsk_event_add("sprite",function(NPCSprite){NPCSprite.move(P.w()/2-NPCSprite.w()/2,null,null,5)},"_priv");NPCSprite.vsk_event_add("dock",function(NPCSprite){NPCSprite.move(P.w()/2-NPCSprite.w()/2,null,null,5)},"_priv");NPCSprite.dock(P.b);return this};WardenNPCDetails.prototype.update_stats=function(scale,scaleM){var NPC;if(!(NPC=this.NPC)){return this}var value,N,i,G=this.Manager.Game,name;var LblStats=this.DlgInfo.get_tab_by_name("stats").Panel.C.LblStats;LblStats.clear();if(!scaleM){var scaleM=1}for(i in NPC){if(!(name=G.item_stat_xl(i,NPC.class_id))){continue}switch(i){case"stat_resist_fire":case"stat_resist_earth":case"stat_resist_ice":case"stat_resist_wind":case"stat_resist_light":case"stat_resist_dark":case"stat_speed":case"stat_move":case"stat_threat":case"stat_guile":case"stat_concentration":case"stat_energy_regen":value=NPC[i];break;default:if(scale){value=Math.round((NPC[i]/NPC.level)*scale);value=Math.round(value*scaleM)}else{value=NPC[i]}break}switch(i){case"stat_concentration":case"stat_threat":value=value+"%";break;case"stat_guile":value=value+"%";break;default:value=value;break}N=v(vsk_h("div")).set_pos("relative");N.b.innerHTML=this.statText.replace(/%n%/g,name).replace(/%v%/g,value);LblStats.html_a(N.b)}return this};WardenNPCDetails.prototype.update_abilities=function(){var NPC;if(!(NPC=this.NPC)){return this}this.LblAbilities.clear();var i,S,C=this.Manager.Cache,SI,T,icon;for(i in NPC.spells){S=C.data.spell[NPC.spells[i].spell_id];icon=v(vsk_h("img")).set("src",gp+"/spells/"+S.effect_id+".gif").resize(35,35);icon.set_pos("relative").cooltip_set(C.render_object_spellinfo(NPC.spells[i].spell_id).b,"ac");this.LblAbilities.html_a(icon.b)}return this};var WO_HIGH_WARDEN=12000;vui_element_add(WO_HIGH_WARDEN,WardenHighWarden);function WardenHighWarden(Manager,Parent){this.constructor=WardenModule;this.constructor(Manager,Parent);this.LblHeader=this.child(VUI_NODE,"LblHeader");this.LblInfo=this.child(VUI_NODE,"LblInfo");this.LblLore=this.child(VUI_NODE,"LblLore");this.LblConfidence=this.child(VUI_NODE,"LblConfidence");this.FraRestore=this.child(VUI_NODE,"FraRestore");this.FraRestore.child(VUI_NODE,"LblHeader");this.FraRestore.child(VUI_NODE,"LblSubHeader");this.FraRestore.child(WO_CURRENCY_LABEL,"LblCost");this.FraRestore.child(VUI_BUTTON,"BtnRestore");this.FraRestoreFull=this.child(VUI_NODE,"FraRestoreFull");this.FraRestoreFull.child(VUI_NODE,"LblHeader");this.FraRestoreFull.child(VUI_NODE,"LblSubHeader");this.FraRestoreFull.child(WO_CURRENCY_LABEL,"LblCost");this.FraRestoreFull.child(VUI_BUTTON,"BtnRestore");this.FraRestore.C.BtnRestore.vsk_event_add("mousedown",function(Btn){Btn.Manager.send("game-restore-confidence")},"_priv_highwarden");this.FraRestoreFull.C.BtnRestore.vsk_event_add("mousedown",function(Btn){Btn.Manager.send("game-restore-confidence",{full:1})},"_priv_highwarden");var HW=this;this.Manager.Cache.data.onchange.add(function(type,d){if(type=="character"&&parseInt(d.data._id)==parseInt(HW.charId)){HW.set_character(HW.charId)}},"highwarden_"+HW.uniqueId)}WardenHighWarden.prototype=new vsk_clone(WardenModule.prototype);WardenHighWarden.prototype.xml_build__wohiwarden=function(xml,Parent){this.xml_build__element(xml,Parent);this.cost=v(xml).gan("cost");this.set_character(v(xml).gan("char_id"));return this};WardenHighWarden.prototype.xml_build=WardenHighWarden.prototype.xml_build__wohiwarden;WardenHighWarden.prototype.set_character=function(charId){var C=this.Manager.Cache.data.character[charId];if(!C){return this}this.Character=C;this.charId=charId;this.set_confidence(C.penalty);this.set_cost(C.penalty);return this};WardenHighWarden.prototype.set_confidence=function(n){this.LblConfidence.clear(vsk_t("Your current confidence penalty: "+n));return this};WardenHighWarden.prototype.set_cost=function(n){var once=this.cost;var full=once*n;this.FraRestore.C.LblCost.set(once);this.FraRestoreFull.C.LblCost.set(full);return this};var WO_LISTINGS=5750;var WO_PVP_LISTINGS=5751;vui_element_add(WO_LISTINGS,WardenListings);vui_element_add(WO_PVP_LISTINGS,WardenPVPListings);function WardenListings(Manager,Parent){this.constructor=WardenModule;this.constructor(Manager,Parent);this.LblHeader=this.child(VUI_NODE,"LblHeader");this.LblInfo=this.child(VUI_NODE,"LblInfo");this.PanelFilter=this.child(VUI_NODE,"PanelFilter");this.PanelFilter.child(VUI_NODE,"FldFilterActName","input");this.PanelFilter.child(VUI_NODE,"FldFilterCharName","input");this.PanelFilter.child(VUI_DROPDOWN_LIST,"LstFilterClassId");this.PanelFilter.child(VUI_NODE,"FldFilterLevel","input");this.PanelFilter.child(VUI_BUTTON,"BtnSearch");this.CbFilterOnline=this.child(VUI_CHECKBOX,"CbFilterOnline");this.TblResults=this.child(VUI_NODE,"TblResults","Table");this.TblResults.child(VUI_NODE,"TBody","tbody");var TH=this.TblResults.C.TBody.child(VUI_NODE,"Header","tr");TH.child(VUI_NODE,"ColName","th").cooltip_set("Click to sort list by this field","ac");TH.child(VUI_NODE,"ColClass","th").cooltip_set("Click to sort list by this field","ac");TH.child(VUI_NODE,"ColLevel","th").cooltip_set("Click to sort list by this field","ac");TH.child(VUI_NODE,"ColEquip","th").cooltip_set("Click to sort list by this field","ac");TH.child(VUI_NODE,"ColWealth","th").cooltip_set("Click to sort list by this field","ac");this.PanelBrowse=this.child(VUI_NODE,"PanelBrowse");this.BtnNext=this.PanelBrowse.child(VUI_BUTTON,"BtnNext");this.BtnPrev=this.PanelBrowse.child(VUI_BUTTON,"BtnPrev");this.charName="";this.classId=0;this.level="";this.actName="";this.browse=0;this.sort="equip";this.browseNum=50;this.filterOnline=0;this.searchScript="listing-search";this.defaultSort="equip";var F=this.PanelFilter;F.C.FldFilterActName.b.value="<Player Name>";F.C.FldFilterCharName.b.value="<Character Name>";F.C.FldFilterLevel.b.value="<Minimum Level>";var funcFldFocus=function(Fld){if(Fld.b.value.charAt(0)=="<"){Fld.b.value=""}};var funcFldSubmit=function(Fld,e){var E=ve(e);if(E.key_code()==13){Fld.P.C.BtnSearch.vsk_event_fire("mousedown")}};F.C.FldFilterActName.handle("mouseup").vsk_event_add("mouseup",funcFldFocus,"_priv_listings");F.C.FldFilterCharName.handle("mouseup").vsk_event_add("mouseup",funcFldFocus,"_priv_listings");F.C.FldFilterLevel.handle("mouseup").vsk_event_add("mouseup",funcFldFocus,"_priv_listings");F.C.FldFilterLevel.handle("keydown").vsk_event_add("keydown",funcFldSubmit,"_priv_listings");F.C.FldFilterCharName.handle("keydown").vsk_event_add("keydown",funcFldSubmit,"_priv_listings");F.C.FldFilterActName.handle("keydown").vsk_event_add("keydown",funcFldSubmit,"_priv_listings");F.C.FldFilterLevel.cooltip_set("Specified a minimum level (x) or a level range (x-y)","ac");this.PanelFilter.C.BtnSearch.vsk_event_add("mousedown",function(Btn){var F=Btn.P,L=F.P;L.request_result("equip",true)},"_priv_listings");TH.C.ColName.handle("mousedown").vsk_event_add("mousedown",function(Col){Col.P.P.P.P.request_result("name")},"_priv_listings");TH.C.ColClass.handle("mousedown").vsk_event_add("mousedown",function(Col){Col.P.P.P.P.request_result("class")},"_priv_listings");TH.C.ColLevel.handle("mousedown").vsk_event_add("mousedown",function(Col){Col.P.P.P.P.request_result("level")},"_priv_listings");TH.C.ColEquip.handle("mousedown").vsk_event_add("mousedown",function(Col){Col.P.P.P.P.request_result("equip")},"_priv_listings");TH.C.ColWealth.handle("mousedown").vsk_event_add("mousedown",function(Col){Col.P.P.P.P.request_result("wealth")},"_priv_listings");this.BtnNext.vsk_event_add("mousedown",function(Btn){Btn.P.P.request_result(null,null,"n")},"_priv_listings");this.BtnPrev.vsk_event_add("mousedown",function(Btn){Btn.P.P.request_result(null,null,"p")},"_priv_listings");this.CbFilterOnline.vsk_event_add("change",function(Cb){Cb.P.request_result()},"_priv_listings")}WardenListings.prototype=new vsk_clone(WardenModule.prototype);WardenListings.prototype.xml_build__wolistings=function(xml,Parent){this.xml_build__element(xml,Parent);var L=this.PanelFilter.C.LstFilterClassId.List;L.flush();L.item_add_txt("<Character Class>",0);L.item_add_txt("Ranger",WO_CLASS_SCOUT);L.item_add_txt("Warrior",WO_CLASS_WARRIOR);L.item_add_txt("Wizard",WO_CLASS_WIZARD);L.select_item(0);this.update();return this};WardenListings.prototype.xml_build=WardenListings.prototype.xml_build__wolistings;WardenListings.prototype.receive=function(XML){var N,XML=v(XML.childNodes),i;for(i=0;i<XML.length;i++){N=v(XML.childNodes[i]);switch(N.b.nodeName){case"update":this.update();break}}return this};WardenListings.prototype.update=function(){var L=this.Manager.Cache.data.listing,i;var Listing=this;var t,TB=this.TblResults.C.TBody.b.childNodes[0].nextSibling;if(TB){while(TB){t=TB.nextSibling;v(TB).undock();TB=t}}var col,row,d,g=0,cn,P,a;for(i in L){d=L[i];cn="listing"+g;row=v(vsk_h("tr"));col=vsk_h("td");col.innerHTML='<a class="plain" href="/game/inspect/'+d.account_name+"/"+d.character_name+'"><span class="listing_act_name">'+d.account_name+".</span>"+d.character_name+(d.action_time<600&&d.action_dt&&d.s_char_id==d.id?' <span class="listing_status">(online)</span>':"")+(d.title?'<div class="listing_title">'+d.title+"</div></a>":"");col.className=cn;row.html_a(col);col=vsk_h("td");col.innerHTML='<img src="'+gp+"/ui/class_icon_"+this.Manager.Game.character_class_xl(d.class_id,1)+'.png" />';col.className=cn;v(col).cooltip_set(this.Manager.Game.character_class_xl(d.class_id),"ac");row.html_a(col);col=vsk_h("td");col.innerHTML=d.level;col.className=cn;row.html_a(col);col=vsk_h("td");col.innerHTML=d.equip_level;col.className=cn;row.html_a(col);col=vsk_h("td");P=this.Manager.element(WO_CURRENCY_LABEL).move(0,0).set_pos("relative");P.theme("game");P.set(d.copper);v(col).html_a(P.b);col.className=cn;row.html_a(col);row.b.actName=d.account_name;row.b.charName=d.character_name;this.TblResults.C.TBody.html_a(row.b);g^=1}return this};WardenListings.prototype.request_result=function(sort,newSet,browseDir){var F=this.PanelFilter.C;var L=this;var actName=F.FldFilterActName.b.value.replace("<Player Name>","");var charName=F.FldFilterCharName.b.value.replace("<Character Name>","");var classId=F.LstFilterClassId.List.value();var level=F.FldFilterLevel.b.value.replace("<Minimum Level>","");var filterOnline=this.CbFilterOnline.isChecked;if(newSet){this.actName=actName;this.charName=charName;this.classId=classId;this.level=level;this.sort=sort;this.browse=0}else{actName=this.actName;charName=this.charName;level=this.level;classId=this.classId;if(sort){this.sort=sort}else{sort=this.sort}}if(browseDir){var browse=(browseDir=="n"?this.browse+this.browseNum:this.browse-this.browseNum)}else{var browse=this.browse}if(browse<0){browse=0}this.M.send(this.searchScript,{act_name:actName,char_name:charName,class_id:classId,min_level:level,sort:sort||this.defaultSort,browse:browse,filter_online:filterOnline},function(){L.update();if(browse!=L.browse){L.browse=browse}});return this};function WardenPVPListings(Manager,Parent){this.constructor=WardenModule;this.constructor(Manager,Parent);this.LblHeader=this.child(VUI_NODE,"LblHeader");this.LblInfo=this.child(VUI_NODE,"LblInfo");this.PanelFilter=this.child(VUI_NODE,"PanelFilter");this.PanelFilter.child(VUI_NODE,"FldFilterActName","input");this.PanelFilter.child(VUI_NODE,"FldFilterCharName","input");this.PanelFilter.child(VUI_DROPDOWN_LIST,"LstFilterClassId");this.PanelFilter.child(VUI_NODE,"FldFilterLevel","input");this.PanelFilter.child(VUI_BUTTON,"BtnSearch");this.CbFilterOnline=this.child(VUI_CHECKBOX,"CbFilterOnline");this.TblResults=this.child(VUI_NODE,"TblResults","Table");this.TblResults.child(VUI_NODE,"TBody","tbody");var TH=this.TblResults.C.TBody.child(VUI_NODE,"Header","tr");TH.child(VUI_NODE,"ColName","th").cooltip_set("Click to sort list by this field","ac");TH.child(VUI_NODE,"ColClass","th").cooltip_set("Click to sort list by this field","ac");TH.child(VUI_NODE,"ColLevel","th").cooltip_set("Click to sort list by this field","ac");TH.child(VUI_NODE,"ColEquip","th").cooltip_set("Click to sort list by this field","ac");TH.child(VUI_NODE,"ColRank","th").cooltip_set("Click to sort list by this field","ac");this.PanelBrowse=this.child(VUI_NODE,"PanelBrowse");this.BtnNext=this.PanelBrowse.child(VUI_BUTTON,"BtnNext");this.BtnPrev=this.PanelBrowse.child(VUI_BUTTON,"BtnPrev");this.charName="";this.classId=0;this.level="";this.actName="";this.browse=0;this.sort="rank";this.filterOnline=0;this.searchScript="pvp-listing-search";this.defaultSort="rank";this.browseNum=50;var F=this.PanelFilter;F.C.FldFilterActName.b.value="<Player Name>";F.C.FldFilterCharName.b.value="<Character Name>";F.C.FldFilterLevel.b.value="<Minimum Level>";var funcFldFocus=function(Fld){if(Fld.b.value.charAt(0)=="<"){Fld.b.value=""}};var funcFldSubmit=function(Fld,e){var E=ve(e);if(E.key_code()==13){Fld.P.C.BtnSearch.vsk_event_fire("mousedown")}};F.C.FldFilterActName.handle("mouseup").vsk_event_add("mouseup",funcFldFocus,"_priv_listings");F.C.FldFilterCharName.handle("mouseup").vsk_event_add("mouseup",funcFldFocus,"_priv_listings");F.C.FldFilterLevel.handle("mouseup").vsk_event_add("mouseup",funcFldFocus,"_priv_listings");F.C.FldFilterLevel.handle("keydown").vsk_event_add("keydown",funcFldSubmit,"_priv_listings");F.C.FldFilterCharName.handle("keydown").vsk_event_add("keydown",funcFldSubmit,"_priv_listings");F.C.FldFilterActName.handle("keydown").vsk_event_add("keydown",funcFldSubmit,"_priv_listings");F.C.FldFilterLevel.cooltip_set("Specified a minimum level (x) or a level range (x-y)","ac");this.PanelFilter.C.BtnSearch.vsk_event_add("mousedown",function(Btn){var F=Btn.P,L=F.P;L.request_result("rank",true)},"_priv_listings");TH.C.ColName.handle("mousedown").vsk_event_add("mousedown",function(Col){Col.P.P.P.P.request_result("name")},"_priv_listings");TH.C.ColClass.handle("mousedown").vsk_event_add("mousedown",function(Col){Col.P.P.P.P.request_result("class")},"_priv_listings");TH.C.ColLevel.handle("mousedown").vsk_event_add("mousedown",function(Col){Col.P.P.P.P.request_result("level")},"_priv_listings");TH.C.ColEquip.handle("mousedown").vsk_event_add("mousedown",function(Col){Col.P.P.P.P.request_result("equip")},"_priv_listings");TH.C.ColRank.handle("mousedown").vsk_event_add("mousedown",function(Col){Col.P.P.P.P.request_result("rank")},"_priv_listings");this.BtnNext.vsk_event_add("mousedown",function(Btn){Btn.P.P.request_result(null,null,"n")},"_priv_pvp_listings");this.BtnPrev.vsk_event_add("mousedown",function(Btn){Btn.P.P.request_result(null,null,"p")},"_priv_pvp_listings");this.CbFilterOnline.vsk_event_add("change",function(Cb){Cb.P.request_result()},"_priv_listings")}WardenPVPListings.prototype=new vsk_clone(WardenModule.prototype);WardenPVPListings.prototype.xml_build__wolistings=WardenListings.prototype.xml_build__wolistings;WardenPVPListings.prototype.xml_build=WardenPVPListings.prototype.xml_build__wolistings;WardenPVPListings.prototype.receive=WardenListings.prototype.receive;WardenPVPListings.prototype.update=function(){var L=this.Manager.Cache.data.pvp_listing,i;var Listing=this;var t,TB=this.TblResults.C.TBody.b.childNodes[0].nextSibling;if(TB){while(TB){t=TB.nextSibling;v(TB).undock();TB=t}}var col,row,d,g=0,cn,P,a;for(i in L){d=L[i];cn="listing"+g;row=v(vsk_h("tr"));col=vsk_h("td");col.innerHTML='<a class="plain" href="/game/pvp/'+d.id+'"><span class="listing_act_name">'+d.account_name+".</span>"+d.character_name+(d.action_time<600&&d.action_dt&&d.s_char_id==d.id?' <span class="listing_status">(online)</span>':"")+(d.title?'<div class="listing_title">'+d.title+"</div></a>":"");col.className=cn;row.html_a(col);col=vsk_h("td");col.innerHTML='<img src="'+gp+"/ui/class_icon_"+this.Manager.Game.character_class_xl(d.class_id,1)+'.png" />';col.className=cn;v(col).cooltip_set(this.Manager.Game.character_class_xl(d.class_id),"ac");row.html_a(col);col=vsk_h("td");col.innerHTML=d.level;col.className=cn;row.html_a(col);col=vsk_h("td");col.innerHTML=d.equip_level;col.className=cn;row.html_a(col);col=vsk_h("td");col.innerHTML=(d.level==50?d.pvp_rank||1500:"-");col.className=cn;row.html_a(col);row.b.actName=d.account_name;row.b.charName=d.character_name;this.TblResults.C.TBody.html_a(row.b);g^=1}return this};WardenPVPListings.prototype.request_result=WardenListings.prototype.request_result;var WO_PVP_NEW_CHALLENGE=14001;var WO_PVP_BATTLEFIELD=14002;var WO_PVP_CHALLENGE_LIST=14003;vui_element_add(WO_PVP_NEW_CHALLENGE,WardenPVPNewChallenge);vui_element_add(WO_PVP_BATTLEFIELD,WardenPVPBattlefield);vui_element_add(WO_PVP_CHALLENGE_LIST,WardenPVPChallengeList);function WardenPVPNewChallenge(Manager,Parent){this.constructor=WardenModule;this.constructor(Manager,Parent);this.LblHeader=this.child(VUI_NODE,"LblHeader");this.LblConfirmation=this.child(VUI_NODE,"LblConfirmation");this.PortraitChallenger=this.child(VUI_NODE,"PortraitChallenger");this.PortraitDefender=this.child(VUI_NODE,"PortraitDefender");this.LblNameChallenger=this.child(VUI_NODE,"LblNameChallenger");this.LblNameDefender=this.child(VUI_NODE,"LblNameDefender");this.LblInfoChallenger=this.child(VUI_NODE,"LblInfoChallenger");this.LblInfoDefender=this.child(VUI_NODE,"LblInfoDefender");this.LblStake=this.child(VUI_NODE,"LblStake");this.BtnStakeDown=this.child(VUI_BUTTON,"BtnStakeDown");this.BtnStakeUp=this.child(VUI_BUTTON,"BtnStakeUp");this.LblLinkChallenger=this.child(VUI_NODE,"LblLinkChallenger","A");this.LblLinkDefender=this.child(VUI_NODE,"LblLinkDefender","A");this.BtnChallenge=this.child(VUI_BUTTON,"BtnChallenge");this.BtnDecline=this.child(VUI_BUTTON,"BtnDecline");this.LstType=this.child(VUI_DROPDOWN_LIST,"LstType");this.LblType=this.child(VUI_NODE,"LblType");this.txtInfo='Level %n% <span style="color:%c%">%cn%</span>';this.stakeM=1;this.BtnChallenge.vsk_event_add("mousedown",function(Btn,e){var P=Btn.P;if(P.charId==P.challengerId){vsk_redirect("/game/pvp/"+P.defenderId+"/"+P.LstType.List.value()+"/issue/"+P.stakeM)}else{P.M.send("game-pvp-accept",{id:P.challengeId})}},"_priv_pvp");this.BtnDecline.vsk_event_add("mousedown",function(Btn,e){var P=Btn.P;P.M.send("game-pvp-decline",{id:P.challengeId})},"_priv_pvp");var NC=this;this.Manager.Cache.data.onchange.add(function(type,d){if(type=="pvp_challenge"&&d.id==NC.challengeId){if(d.data.phase!=NC.phase){if(d.data.phase!=4){vsk_redirect(window.document.location.href)}else{vsk_redirect("/game/pvp-watch/"+d.data.id)}}}},"pvp-challenge");this.BtnStakeUp.vsk_event_add("mousedown",function(Btn){Btn.P.change_stake(1)},"_priv_pvp");this.BtnStakeDown.vsk_event_add("mousedown",function(Btn){Btn.P.change_stake(-1)},"_priv_pvp")}WardenPVPNewChallenge.prototype=new vsk_clone(WardenModule.prototype);WardenPVPNewChallenge.prototype.xml_build__pvpnew=function(xml,Parent){this.xml_build__element(xml,Parent);var N=v(xml);this.set(N.gan("challenge_id"),N.ga("char_id"),N.ga("opponent_name"));this.LstType.List.item_add_txt("Quick Battle (no companions)",1);this.LstType.List.item_add_txt("Group Battle (with companions)",2);this.LstType.List.select_item(1);return this};WardenPVPNewChallenge.prototype.xml_build=WardenPVPNewChallenge.prototype.xml_build__pvpnew;WardenPVPNewChallenge.prototype.set=function(challengeId,charId,opponentName){var R=this.Challenge=this.M.Cache.data.pvp_challenge[challengeId];this.challengerId=R.challenger_id;this.defenderId=R.defender_id;this.stake=R.stake;this.phase=R.phase;this.challengeId=challengeId;if(this.phase==3){this.defenderId="v_"+this.defenderId;this.challengerId="v_"+this.challengerId}else{var charId=parseInt(charId)}this.charId=charId;vsk_dbg_print("Char: "+this.charId);this.Challenger=this.Manager.Cache.data.character[this.challengerId];this.Defender=this.Manager.Cache.data.character[this.defenderId];if(charId==this.challengerId){if(!this.phase){this.LblHeader.clear(vsk_t("Challenge Player"));this.LblConfirmation.clear(vsk_t("Do you wish to challenge "+this.Defender.name+"?"))}else{if(this.phase==1){this.LblHeader.clear(vsk_t("Waiting for Player"));this.LblConfirmation.clear(vsk_t("Waiting for "+this.Defender.name+" to accept your challenge. You may leave this screen and come back to it later via the Open Pvp Challenges list."));this.BtnChallenge.hide(1);this.BtnDecline.caption("Back out")}else{if(this.phase==2){this.LblHeader.clear(vsk_t("Waiting for Player"));this.LblConfirmation.clear(vsk_t("Waiting for "+this.Defender.name+" to position his character and companions on the battlefield. You may leave this screen and come back to it later via the Open PvP Challenges list."));this.BtnChallenge.hide(1);this.BtnDecline.hide(1)}else{if(this.phase==3){this.LblHeader.clear(vsk_t("Waiting for Player"));if(R.type==2){this.LblConfirmation.clear(vsk_t("Waiting for "+this.Defender.name+" to finish his battle preperations. You may leave this screen, you will be notified when the battle has been fought and you may review it."))}else{if(R.type==1){this.LblConfirmation.clear(vsk_t("Waiting for "+this.Defender.name+" to accept the challenge and finish his battle preperations. You may leave this screen, you will be notified when the battle has been fought and you may review it."))}}this.BtnChallenge.hide(1);this.BtnDecline.hide(1)}}}}this.LblLinkChallenger.set("href","/game/character").set("target","_blank");this.LblLinkDefender.set("href","/game/inspect/"+opponentName+"/"+this.Defender.name).set("target","_blank")}else{this.LstType.hide(1);if(this.phase==1||!R.has_accepted){this.LblHeader.clear(vsk_t("Accept Challenge?"));this.LblConfirmation.clear(vsk_t("Do you wish to accept the challenge from "+this.Challenger.name+"?"));this.BtnChallenge.caption("Accept Challenge");this.BtnDecline.caption("Decline Challenge")}else{if(this.phase==2){this.LblHeader.clear(vsk_t("Waiting for Player"));this.LblConfirmation.clear(vsk_t("Waiting for "+this.Challenger.name+" to position his character and companions on the battlefield. You may leave this screen and come back to it later via the Open Pvp Challenges list."));this.BtnChallenge.hide(1);this.BtnDecline.hide(1)}else{if(this.phase==3){this.LblHeader.clear(vsk_t("Waiting for Player"));this.LblConfirmation.clear(vsk_t("Waiting for "+this.Challenger.name+" to finish his battle preperations. You may leave this screen, you will be notified when the battle has been fought and you may review it."));this.BtnChallenge.hide(1);this.BtnDecline.hide(1)}}}this.LblLinkDefender.set("href","/game/character").set("target","_blank");this.LblLinkChallenger.set("href","/game/inspect/"+opponentName+"/"+this.Challenger.name).set("target","_blank")}if(this.phase>0){this.LstType.hide(1);this.BtnStakeUp.hide(1);this.BtnStakeDown.hide(1)}if(this.phase>1||!R.has_accepted){if(R.type==1){this.LblType.clear(vsk_t("Solo Battle (no companions)"))}else{if(R.type==2){this.LblType.clear(vsk_t("Group Battle (with companions)"))}}this.LblType.hide(0)}else{this.LblType.hide(1)}this.set_portrait("Challenger");this.set_portrait("Defender");var Stake=this.Manager.element(WO_CURRENCY_LABEL);Stake.set(this.stake*this.stakeM);this.LblStake.clear(Stake.b);Stake.move(this.LblStake.w()/2-Stake.w()/2);this.LblStakeAmount=Stake;var NC=this;setInterval(function(){NC.M.send("game-pvp-check",{challenge_id:NC.challengeId})},10000)};WardenPVPNewChallenge.prototype.set_portrait=function(side){var a=this.Manager.Cache.achievement_data(this[side.toLowerCase()+"Id"],this[side].background_id);if(!a){a={backdrop_id:"default"}}this["Portrait"+side].s.backgroundImage="url("+gp+"/world/backdrop-character/"+a.backdrop_id+".png)";var charId=this[side.toLowerCase()+"Id"];var S=this.Manager.Cache.render_object_character(charId,false,(side=="Defender")),P=this["Portrait"+side];S.move(P.w()/2-S.w()/2,null,null,0);S.onredraw=function(){this.move(P.w()/2-S.w()/2,null,null,0)};S.vsk_event_add("resize",function(){S.move(P.w()/2-S.w()/2).level(1)});P.clear(S.level(1).b);this["LblName"+side].clear(vsk_t(this[side].name));this["LblInfo"+side].b.innerHTML=this.txtInfo.replace(/%n%/g,this[side].level).replace(/%c%/g,WO_CLASS_COLORS[this[side].class_id]).replace(/%cn%/g,this.Manager.Game.character_class_xl(this[side].class_id))};WardenPVPNewChallenge.prototype.change_stake=function(n){if(n>0){this.stakeM*=2}else{this.stakeM/=2}if(this.stakeM<1){this.stakeM=1}if(this.stakeM>1000){this.stakeM=1000}this.stakeM=Math.round(this.stakeM);this.LblStakeAmount.set(this.stake*this.stakeM).move(this.LblStake.w()/2-this.LblStakeAmount.w()/2);return this};function WardenPVPBattlefield(Manager,Parent){this.constructor=WardenModule;this.constructor(Manager,Parent);this.LblLocation=this.child(VUI_NODE,"LblLocation");this.Map=this.child(WO_BATTLE_MAP,"Map");this.InventorySpace=this.child(VUI_NODE,"InventorySpace");this.Inventory=this.InventorySpace.child(WO_INVENTORY,"Inventory");this.InventorySpace.child(VUI_NODE,"BagSpace");this.InventorySpace.child(VUI_BUTTON,"BtnReturn");this.Bag=this.InventorySpace.C.BagSpace.child(WO_BACKPACK,"Bag");this.BtnFight=this.child(VUI_BUTTON,"BtnFight");this.PartySelect=this.child(WO_PARTY_SELECT,"PartySelect");this.CombatSetup=this.child(WO_COMBAT_SETUP,"CombatSetup");this.LblPhaseHeader=this.child(VUI_NODE,"LblPhaseHeader");this.LblPhaseInfo=this.child(VUI_NODE,"LblPhaseInfo");this.LblChangedHeader=this.child(VUI_NODE,"LblChangedHeader");this.LblChangedInfo=this.child(VUI_NODE,"LblChangedInfo");this.battlefieldType="pvp";this.Battlefield=null;this.SelectedTarget=null;this.PartySelect.Map=this.Map;this.Bag.set_inventory(this.Inventory);this.BtnFight.cooltip_set("Continue to the next phase of this pvp battle.","ac");this.BtnFight.vsk_event_add("mousedown",function(Btn,e){var args={},arr,arrCC=[],arrTA=[],str,G,r,i,n=0,T,Map=Btn.Parent.Map,Orders;var C=Btn.P.Challenge;for(i in Map.Targets){T=Map.Targets[i];if(!T.is_friendly()||(!T.charId&&!T.minionId)){continue}if(C.phase==2){str=(T.charId?"c":"m")+":"+(T.charId||T.minionId)+":"+T.mapCoords.x+","+T.mapCoords.y}else{str=(T.charId?"c":"m")+":"+(T.charId||T.minionId);arr=[];for(r in T.Abilities){arr.push(T.Abilities[r])}str+=":"+arr.join();Orders=0;for(r in T.Orders){Orders|=parseInt(T.Orders[r])}str+=":"+Orders;arr=[];arrCC=[];for(r in T.Targets){G=T.Targets[r][0];arr.push(G.pvpTargetId);if(T.Targets[r][1]){arrCC.push(G.pvpTargetId)}}arrTA=[];for(r in T.TargetsAlly){if(!T.TargetsAlly[r]){continue}TA=T.TargetsAlly[r][0];arrTA.push(TA.pvpTargetId)}str+=":"+arr.join()+":"+arrCC.join()+":"+arrTA.join()}args["target"+n]=str;n++}args.challenge_id=Btn.P.challengeId;Btn.Manager.send("game-pvp-phase"+C.phase,args);Btn.cooltip_close()},"_priv_bfield");this.InventorySpace.C.BtnReturn.vsk_event_add("mouseup",function(Btn){Btn.P.hide(1)},"_priv_bfield")}WardenPVPBattlefield.prototype=new vsk_clone(WardenModule.prototype);WardenPVPBattlefield.prototype.xml_build__wobfield=function(xml,Parent){var i,c,C,Game=this.Manager.Game,Cache=this.Manager.Cache;C=v(xml);this.xml_build__element(xml,Parent);this.Map.fx_shadow(25,"#000",5,5);this.set_battlefield(C.gan("challenge_id"),C.gan("char_id"));this.set_character(C.gan("char_id"));this.Bag.LblSpace.hide(1);this.Map.set_map(C.ga("backdrop"));return this};WardenPVPBattlefield.prototype.xml_build=WardenPVPBattlefield.prototype.xml_build__wobfield;WardenPVPBattlefield.prototype.set_battlefield=function(challengeId,charId){var i,Game=this.Manager.Game,Cache=this.Manager.Cache;if(!(this.Challenge=Cache.data.pvp_challenge[challengeId])){return null}this.challengeId=challengeId;this.PVPMap=Cache.data.pvp_map[this.Challenge.map_id];if(this.Challenge.phase==3){this.Challenger=Cache.data.character["v_"+this.Challenge.challenger_id];this.Defender=Cache.data.character["v_"+this.Challenge.defender_id]}else{this.Challenger=Cache.data.character[this.Challenge.challenger_id];this.Defender=Cache.data.character[this.Challenge.defender_id]}this.Opponent=(charId!=this.Challenge.challenger_id?this.Challenger:this.Defender);this.player=(charId!=this.Challenge.challenger_id?2:1);this.set_character(charId);this.LblLocation.clear(vsk_t("PvP Battle against "+this.Opponent.name));switch(this.Challenge.phase){case 2:var tarLoc=this.PVPMap.locs,L;var px,sType;for(i in tarLoc){L=tarLoc[i];this.Map.add_target(parseInt(L.loc),this.player==L.player?WO_TARGET_FRIENDLY:WO_TARGET_HOSTILE)}break;case 3:var i,st,S,M=this.Map;for(i in this.Challenge.setup){S=this.Challenge.setup[i];this.Map.add_target(S.position,this.player==S.player?WO_TARGET_FRIENDLY:WO_TARGET_HOSTILE);if(S.char_type=="c"){M.Targets[S.position].set_character("v_"+S.char_id);if(S.player==this.player){this.setup_select(M.Targets[S.position])}}else{if(S.char_type=="m"){M.Targets[S.position].set_minion(S.char_id)}}M.Targets[S.position].pvpTargetId=S.target_id}break}return this};WardenPVPBattlefield.prototype.set_character=function(charId){this.charId=charId;var Character=this.Manager.Cache.data.character[charId];if(this.Challenge.phase==2){this.PartySelect.set_character(charId)}this.CombatSetup.charId=charId;return this};WardenPVPBattlefield.prototype.setup_select=function(Target){if(this.SelectedTarget){this.SelectedTarget.highlight(0);this.SelectedTarget=null;this.target_selection_update()}Target.cooltip_close();Target.set_tooltip();this.SelectedTarget=Target;this.SelectedTarget.highlight(1);this.CombatSetup.set_source(Target);this.target_selection_update();return this};WardenPVPBattlefield.prototype.target_selection_update=function(){var ST=this.SelectedTarget,i,M=this.Map,T=M.Targets,Target;var color=(ST?WO_CLASS_COLORS[ST.data.class_id]:null);var tColor;for(i in T){if(!T[i].is_friendly()&&T[i].data){tColor=WO_CLASS_COLORS[T[i].data.class_id];T[i].highlight(0);if(ST){T[i].cooltip_set('<span class="tooltip_header">Click</span> to select <span style="color:'+tColor+'">'+T[i].data.name+'</span> as target for <span style="color:'+color+'">'+ST.data.name+"</span>","ac")}else{T[i].set_tooltip()}}else{if(ST&&T[i].occupied()&&T[i].mapFieldId!=ST.mapFieldId){tColor=WO_CLASS_COLORS[T[i].data.class_id];T[i].highlight(0).cooltip_set('<span class="tooltip_header">Ctrl+Click</span> to select <span style="color:'+tColor+'">'+T[i].data.name+'</span> as support target for <span style="color:'+color+'">'+ST.data.name+"</span>","ac")}else{if(!ST&&T[i]){T[i].set_tooltip()}}}}if(ST){for(i in ST.Targets){if(ST.Targets[i]&&(Target=ST.Targets[i][0])){Target.highlight(1,parseInt(i)+1,i);Target.TargetedBySource=ST;Target.CbCC.check(ST.Targets[i][1]);tColor=WO_CLASS_COLORS[Target.data.class_id];if(!Target.CbCC.isChecked&&i>0){Target.cooltip_set('Check the <span class="tooltip_header">zzz</span> checkbox in the lower right corner to select <span style="color:'+tColor+'">'+Target.data.name+'</span> as a <span class="tooltip_header">crowd control target</span> for <span style="color:'+color+'">'+ST.data.name+"</span>","ac")}else{Target.set_tooltip()}}}for(i in ST.TargetsAlly){if(ST.TargetsAlly[i]&&(Target=ST.TargetsAlly[i][0])){Target.highlight(1,parseInt(i)+1,"A");Target.set_tooltip()}}}M.swapTargetFromIdx=-1;return this};WardenPVPBattlefield.prototype.target_selection_update_old=function(){var ST=this.SelectedTarget,i,M=this.Map,T=M.Targets,Target;for(i in T){if(!T[i].is_friendly()){T[i].highlight(0)}}if(ST){for(i in ST.Targets){if((Target=ST.Targets[i][0])){Target.highlight(1,parseInt(i)+1);Target.TargetedBySource=ST;Target.CbCC.check(ST.Targets[i][1])}}}M.swapTargetFromIdx=-1;return this};WardenPVPBattlefield.prototype.setup_targets=function(Target){if(!this.SelectedTarget&&!Target){return this}else{if(Target){this.setup_select(Target)}}return this};function WardenPVPChallengeList(Manager,Parent){this.constructor=WardenModule;this.constructor(Manager,Parent);this.LblHeader=this.child(VUI_NODE,"LblHeader");this.LblInfo=this.child(VUI_NODE,"LblInfo");this.TblResults=this.child(VUI_NODE,"TblResults","Table");this.TblResults.child(VUI_NODE,"TBody","tbody");var TH=this.TblResults.C.TBody.child(VUI_NODE,"Header","tr");TH.child(VUI_NODE,"ColName","th");TH.child(VUI_NODE,"ColType","th");TH.child(VUI_NODE,"ColStatus","th");TH.child(VUI_NODE,"ColRank","th");TH.child(VUI_NODE,"ColStake","th");TH.child(VUI_NODE,"ColBattle","th");TH.child(VUI_NODE,"ColDate","th");this.PanelBrowse=this.child(VUI_NODE,"PanelBrowse");this.BtnNext=this.PanelBrowse.child(VUI_BUTTON,"BtnNext");this.BtnPrev=this.PanelBrowse.child(VUI_BUTTON,"BtnPrev");this.browse=0;this.browseNum=50;this.BtnNext.vsk_event_add("mousedown",function(Btn){Btn.P.P.request_result(null,null,"n")},"_priv_pvp_c_listings");this.BtnPrev.vsk_event_add("mousedown",function(Btn){Btn.P.P.request_result(null,null,"p")},"_priv_pvp_c_listings")}WardenPVPChallengeList.prototype=new vsk_clone(WardenModule.prototype);WardenPVPChallengeList.prototype.xml_build__wolistings=function(xml,Parent){this.xml_build__element(xml,Parent);this.charId=v(xml).gan("char_id");this.challengeType=v(xml).ga("challenge_type");this.update();return this};WardenPVPChallengeList.prototype.xml_build=WardenPVPChallengeList.prototype.xml_build__wolistings;WardenPVPChallengeList.prototype.receive=function(XML){var N,XML=v(XML.childNodes),i;for(i=0;i<XML.length;i++){N=v(XML.childNodes[i]);switch(N.b.nodeName){case"update":this.update();break}}return this};WardenPVPChallengeList.prototype.update=function(){var L=this.Manager.Cache.data.pvp_challenge_listing,i;var Listing=this;var t,TB=this.TblResults.C.TBody.b.childNodes[0].nextSibling;if(TB){while(TB){t=TB.nextSibling;v(TB).undock();TB=t}}var ad,ic,iw,col,row,d,g=0,cn,P,a;for(i in L){d=L[i];cn="listing"+g;row=v(vsk_h("tr"));col=vsk_h("td");if(this.charId==d.challenger_id){ic=true;ad=[d.d_name,d.da_name,d.defender_id]}else{ic=false;ad=[d.c_name,d.ca_name,d.challenger_id]}col.innerHTML='<a class="plain" href="/game/pvp/'+ad[2]+"/"+d.type+'"><span class="listing_act_name">'+ad[1]+".</span>"+ad[0];col.className=cn;row.html_a(col);col=vsk_h("td");col.innerHTML=d.type==1?"Quick":"Group";col.className=cn;row.html_a(col);col=vsk_h("td");iw=false;if(!d.has_accepted){if(!d.status){if(ic){ad="Waiting"}else{ad="New"}}else{ad=ic?"Declined":"Declined"}}else{if(d.status==1){ad=ic?'<span class="victory">Victory</span>':'<span class="defeat">Defeat</span>';iw=ic?1:0}else{if(d.status==2){ad=!ic?'<span class="victory">Victory</span>':'<span class="defeat">Defeat</span>';iw=!ic?1:0}else{if(!d.status){if((ic&&d.player_status&1)||(!ic&&d.player_status&2)){ad="Waiting"}else{ad="Phase "+d.phase}}}}}col.innerHTML=ad;col.className=cn;row.html_a(col);col=vsk_h("td");col.innerHTML=ic?d.pvp_rank_challenger:d.pvp_rank_defender;col.className=cn;row.html_a(col);col=vsk_h("td");P=this.Manager.element(WO_CURRENCY_LABEL).move(0,0).set_pos("relative");P.theme("game");P.set(d.stake);v(col).html_a(P.b);col.className=cn;row.html_a(col);col=vsk_h("td");if(d.status){if(d.days<=3){col.innerHTML='<a href="/game/pvp-watch/'+d.id+'">View</a>'}else{col.innerHTML="too old"}}else{col.innerHTML=(d.tooOld?"too old":"-")}col.className=cn;row.html_a(col);col=vsk_h("td");col.innerHTML=d.date;col.className=cn;row.html_a(col);this.TblResults.C.TBody.html_a(row.b);g^=1}return this};WardenPVPChallengeList.prototype.request_result=function(sort,newSet,browseDir){var L=this;if(newSet){this.browse=0}if(browseDir){var browse=(browseDir=="n"?this.browse+this.browseNum:this.browse-this.browseNum)}else{var browse=this.browse}if(browse<0){browse=0}this.M.send("pvp-challenges-list",{char_id:this.charId,type:this.challengeType,browse:browse},function(){L.update();if(browse!=L.browse){L.browse=browse}});return this};var WO_LOYALITY=12031;vui_element_add(WO_LOYALITY,WardenLoyality);function WardenLoyality(Manager,Parent){this.constructor=WardenModule;this.constructor(Manager,Parent);this.LblBadges=this.child(VUI_NODE,"LblBadges");var Fld;var Btn;this.LblToWealth=this.child(VUI_NODE,"LblToWealth");this.LblToWealth.child(VUI_NODE,"LblHeader");this.LblToWealth.child(VUI_NODE,"LblData");Fld=this.LblToWealth.child(VUI_NODE,"FldInput","INPUT");Btn=this.LblToWealth.child(VUI_BUTTON,"BtnConvert");this.LblToWealth.child(WO_CURRENCY_LABEL,"LblWealth");Fld.handle("keydown").vsk_event_add("keydown",function(Fld,e){var k=ve(e).key_char();var c=ve(e).key_code();if(isNaN(k)&&c!=8&&c!=116){ve(e).stop()}},"_priv_loyality");Fld.handle("keyup").vsk_event_add("keyup",function(Fld,e){Fld.P.P.update_to_wealth()},"_priv_loyality");Btn.vsk_event_add("glb_mouseup",function(Btn){Btn.M.send("loyality-convert",{to:"wealth",n:Btn.P.C.FldInput.b.value})},"_priv_loyality");this.LblToExp=this.child(VUI_NODE,"LblToExp");this.LblToExp.child(VUI_NODE,"LblHeader");this.LblToExp.child(VUI_NODE,"LblData");Fld=this.LblToExp.child(VUI_NODE,"FldInput","INPUT");Btn=this.LblToExp.child(VUI_BUTTON,"BtnConvert");this.LblToExp.child(VUI_NODE,"LblResult");this.LblToExp.child(VUI_NODE,"LblCurrentBonus");this.LblToExp.child(VUI_NODE,"LblMaxBonus");Fld.handle("keydown").vsk_event_add("keydown",function(Fld,e){var k=ve(e).key_char();var c=ve(e).key_code();if(isNaN(k)&&c!=8&&c!=116){ve(e).stop()}},"_priv_loyality");Fld.handle("keyup").vsk_event_add("keyup",function(Fld,e){Fld.P.P.update_to_exp()},"_priv_loyality");Btn.vsk_event_add("glb_mouseup",function(Btn){Btn.M.send("loyality-convert",{to:"exp",n:Btn.P.C.FldInput.b.value})},"_priv_loyality");this.LblToLootChance=this.child(VUI_NODE,"LblToLootChance");this.LblToLootChance.child(VUI_NODE,"LblHeader");this.LblToLootChance.child(VUI_NODE,"LblData");Fld=this.LblToLootChance.child(VUI_NODE,"FldInput","INPUT");Btn=this.LblToLootChance.child(VUI_BUTTON,"BtnConvert");this.LblToLootChance.child(VUI_NODE,"LblResult");this.LblToLootChance.child(VUI_NODE,"LblCurrentBonus");this.LblToLootChance.child(VUI_NODE,"LblMaxBonus");Fld.handle("keydown").vsk_event_add("keydown",function(Fld,e){var k=ve(e).key_char();var c=ve(e).key_code();if(isNaN(k)&&c!=8&&c!=116){ve(e).stop()}},"_priv_loyality");Fld.handle("keyup").vsk_event_add("keyup",function(Fld,e){Fld.P.P.update_to_loot_chance()},"_priv_loyality");Btn.vsk_event_add("glb_mouseup",function(Btn){Btn.M.send("loyality-convert",{to:"loot",n:Btn.P.C.FldInput.b.value})},"_priv_loyality");this.LblToPartyChance=this.child(VUI_NODE,"LblToPartyChance");this.LblToPartyChance.child(VUI_NODE,"LblHeader");this.LblToPartyChance.child(VUI_NODE,"LblData");Fld=this.LblToPartyChance.child(VUI_NODE,"FldInput","INPUT");Btn=this.LblToPartyChance.child(VUI_BUTTON,"BtnConvert");this.LblToPartyChance.child(VUI_NODE,"LblResult");this.LblToPartyChance.child(VUI_NODE,"LblCurrentBonus");this.LblToPartyChance.child(VUI_NODE,"LblMaxBonus");Fld.handle("keydown").vsk_event_add("keydown",function(Fld,e){var k=ve(e).key_char();var c=ve(e).key_code();if(isNaN(k)&&c!=8&&c!=116){ve(e).stop()}},"_priv_loyality");Fld.handle("keyup").vsk_event_add("keyup",function(Fld,e){Fld.P.P.update_to_party_chance()},"_priv_loyality");Btn.vsk_event_add("glb_mouseup",function(Btn){Btn.M.send("loyality-convert",{to:"party",n:Btn.P.C.FldInput.b.value})},"_priv_loyality");this.LblHeader=this.child(VUI_NODE,"LblHeader");this.LblInfo=this.child(VUI_NODE,"LblInfo");this.LblHeaderVote=this.child(VUI_NODE,"LblHeaderVote");this.LblInfoVote=this.child(VUI_NODE,"LblInfoVote");this.LblVoteBrowserMMO=this.child(VUI_NODE,"LblVoteBrowserMMO","a").set("target","_blank");this.LblVoteTWG=this.child(VUI_NODE,"LblVoteTWG","a");this.LblVoteApex=this.child(VUI_NODE,"LblVoteApex","a");this.LblHeaderRAFLink=this.child(VUI_NODE,"LblHeaderRAFLink");this.LblInfoRAFLink=this.child(VUI_NODE,"LblInfoRAFLink");this.LblRAFLink=this.child(VUI_NODE,"LblRAFLink");var L=this;this.Manager.Cache.data.onchange.add(function(type,d){if(type=="account"&&parseInt(d.data._id)==parseInt(L.accountId)){L.set_account(d.data._id)}},"loyality_"+this.uniqueId);this.LblVoteBrowserMMO.handle("mouseup").vsk_event_add("mouseup",function(Lbl){vote_browsermmo(Lbl.M.Cache.Constants.account_id)},"_priv_loyality")}WardenLoyality.prototype=new vsk_clone(WardenModule.prototype);WardenLoyality.prototype.xml_build__loyality=function(xml,Parent){this.xml_build__element(xml,Parent);var N=v(xml);this.set_account(N.gan("account_id"));this.LblToWealth.C.FldInput.b.value="1";this.LblToExp.C.FldInput.b.value="1";this.LblToLootChance.C.FldInput.b.value="1";this.LblToPartyChance.C.FldInput.b.value="1";this.update_to_wealth();this.update_to_exp();this.update_to_loot_chance();this.update_to_party_chance();return this};WardenLoyality.prototype.xml_build=WardenLoyality.prototype.xml_build__loyality;WardenLoyality.prototype.update_to_exp=function(){var badges=parseInt(this.LblToExp.C.FldInput.b.value);if(badges>this.Account.badges_of_loyality&&this.Account.badges_of_loyality){this.LblToExp.C.FldInput.s.color="red"}else{this.LblToExp.C.FldInput.s.color="inherit"}if(!isNaN(badges)){this.LblToExp.C.LblResult.clear(vsk_t("+"+set_precision(badges*parseFloat(this.M.Cache.Constants.bol_to_exp),2)+"% bonus"))}else{this.LblToExp.C.LblResult.clear(vsk_t("-"))}};WardenLoyality.prototype.update_to_loot_chance=function(){var badges=parseInt(this.LblToLootChance.C.FldInput.b.value);if(badges>this.Account.badges_of_loyality&&this.Account.badges_of_loyality){this.LblToLootChance.C.FldInput.s.color="red"}else{this.LblToLootChance.C.FldInput.s.color="inherit"}if(!isNaN(badges)){this.LblToLootChance.C.LblResult.clear(vsk_t("+"+set_precision(badges*parseFloat(this.M.Cache.Constants.bol_to_loot),2)+"% bonus"))}else{this.LblToLootChance.C.LblResult.clear(vsk_t("-"))}};WardenLoyality.prototype.update_to_party_chance=function(){var badges=parseInt(this.LblToPartyChance.C.FldInput.b.value);if(badges>this.Account.badges_of_loyality&&this.Account.badges_of_loyality){this.LblToPartyChance.C.FldInput.s.color="red"}else{this.LblToPartyChance.C.FldInput.s.color="inherit"}if(!isNaN(badges)){this.LblToPartyChance.C.LblResult.clear(vsk_t("+"+set_precision(badges*parseFloat(this.M.Cache.Constants.bol_to_party),2)+"% bonus"))}else{this.LblToPartyChance.C.LblResult.clear(vsk_t("-"))}};WardenLoyality.prototype.update_to_wealth=function(){var badges=parseInt(this.LblToWealth.C.FldInput.b.value);if(badges>this.Account.badges_of_loyality&&this.Account.badges_of_loyality){badges=this.Account.badges_of_loyality;this.LblToWealth.C.FldInput.b.value=badges}if(!isNaN(badges)){this.LblToWealth.C.LblWealth.set(parseInt(this.M.Cache.Constants.bol_to_wealth)*badges)}else{this.LblToWealth.C.LblWealth.set(0)}};WardenLoyality.prototype.set_account=function(accountId){this.accountId=accountId;var A=this.Account=this.M.Cache.data.account[accountId];this.LblBadges.clear(vsk_t(A.badges_of_loyality+" Badges of Loyality"));this.LblToExp.C.LblCurrentBonus.clear(vsk_t("Your current bonus: +"+A.exp_mod+"% "));this.LblToLootChance.C.LblCurrentBonus.clear(vsk_t("Your current bonus: +"+A.loot_mod+"% "));this.LblToPartyChance.C.LblCurrentBonus.clear(vsk_t("Your current bonus: +"+A.party_mod+"% "));return this};var WO_ENCHANTER=5690;vui_element_add(WO_ENCHANTER,WardenEnchanter);function WardenEnchanter(Manager,Parent){this.constructor=WardenModule;this.constructor(Manager,Parent);this.LblHeader=this.child(VUI_NODE,"LblHeader");this.LblLore=this.child(VUI_NODE,"LblLore");this.Frame=this.child(VUI_NODE,"Frame");this.SelectedItem=this.Frame.child(VUI_NODE,"SelectedItem");this.Inventory=this.Frame.child(WO_INVENTORY,"Inventory");this.LstEnchantment=this.Frame.child(VUI_LIST,"LstEnchantment");this.PanSelectItem=this.Frame.child(VUI_NODE,"PanSelectItem");this.LblCurrency=this.Frame.child(WO_CURRENCY_LABEL,"LblCurrency");var Enchanter=this;this.Inventory.vsk_event_add("change",function(Inventory,itemId){var E=Inventory.P.P;E.select_item(itemId)},"_priv_enchanter");this.LstEnchantment.vsk_event_add("change",function(List){List.M.send("enchanter-buy",{item_id:List.P.P.itemId,enchantment_id:List.value()})},"_priv_enchanter");this.Manager.Cache.data.onchange.add(function(type,d){if(type=="character"&&parseInt(d.data._id)==parseInt(Enchanter.charId)){Enchanter.update_currency()}},"enchanter_"+Enchanter.uniqueId)}WardenEnchanter.prototype=new vsk_clone(WardenModule.prototype);WardenEnchanter.prototype.xml_build__woenc=function(xml,Parent){this.xml_build__element(xml,Parent);var i,C;this.set_character(v(xml).gan("char_id"));return this};WardenEnchanter.prototype.xml_build=WardenEnchanter.prototype.xml_build__woenc;WardenEnchanter.prototype.set_character=function(charId){this.Inventory.set_character(charId,"select");this.charId=charId;this.update_currency();return this};WardenEnchanter.prototype.update_currency=function(){this.LblCurrency.set(this.M.Cache.data.character[this.charId].copper);return this};WardenEnchanter.prototype.select_item=function(itemId){var C=this.M.Cache,II=C.data.item_instance[itemId],I=C.data.item[II.item_id];this.SelectedItem.clear(this.M.Cache.render_object_iteminfo_compact(II.item_id,this.charId,itemId).move(5,5).b);this.PanSelectItem.hide(1);this.fill_enchantments(I.slot,I.level);this.itemId=itemId;return this};WardenEnchanter.prototype.fill_enchantments=function(slot,level){var C=this.M.Cache,e=C.data.item_enchantment,i,E;var List=this.LstEnchantment.flush();var set_ct=function(id){List.Items[id].cooltip_set(function(){return C.render_object_item_enchantment_info(id).b},"ac")};for(i in e){E=e[i];if(slot<=12&&slot>=9&&E.type!=2){continue}if((slot>12||slot<9)&&slot!=14&&slot!=13){if(E.type!=1){continue}}if(slot==13&&E.type!=3){continue}if(slot==14&&E.type!=4){continue}this.LstEnchantment.item_add(C.render_object_item_enchantment_info_compact(E.id).b,E.id);set_ct(E.id)}return this};var WO_SETTINGS=423;var WO_RESTORE_PASSWORD=424;vui_element_add(WO_SETTINGS,WardenSettings);vui_element_add(WO_RESTORE_PASSWORD,WardenRestorePassword);var WO_ACFG_NEWSLETTER=1;var WO_ACFG_ZOOM=2;var WO_ACFG_AUTO_PENALTY=4;var WO_ACFG_HIDE_HEADER=8;var WO_ACFG_NOTIFY_PVP=16;function WardenRestorePassword(Manager,Parent){this.constructor=WardenModule;this.constructor(Manager,Parent);this.child(VUI_NODE,"LblHeader");this.PanPhase1=this.child(VUI_NODE,"PanPhase1");this.PanPhase2=this.child(VUI_NODE,"PanPhase2");this.PanPhase1.child(VUI_NODE,"LblHeaderEmail");this.PanPhase1.child(VUI_NODE,"LblInfoEmail");this.PanPhase1.child(VUI_NODE,"FldEmail","input");this.PanPhase1.child(VUI_BUTTON,"BtnEmail");this.PanPhase2.child(VUI_NODE,"LblHeaderKey");this.PanPhase2.child(VUI_NODE,"LblInfoKey");this.PanPhase2.child(VUI_NODE,"FldKey","input");this.PanPhase2.child(VUI_NODE,"LblHeaderPassword");this.PanPhase2.child(VUI_NODE,"FldPasswordNew","input");input_password(this.PanPhase2.C.FldPasswordNew);this.PanPhase2.child(VUI_NODE,"FldPasswordVerify","input");input_password(this.PanPhase2.C.FldPasswordVerify);this.PanPhase2.child(VUI_NODE,"LblPasswordNew");this.PanPhase2.child(VUI_NODE,"LblPasswordVerify");this.PanPhase2.child(VUI_BUTTON,"BtnSave");this.PanPhase1.C.BtnEmail.vsk_event_add("mousedown",function(Btn){Btn.M.send("account-rp-init",{email:Btn.P.C.FldEmail.b.value})},"_priv_rp");this.PanPhase2.C.BtnSave.vsk_event_add("mousedown",function(Btn){var P=Btn.P.C;Btn.M.send("account-rp-save",{email:Btn.M.Cache.Constants.rp_email,key:P.FldKey.b.value,passwd_n:P.FldPasswordNew.b.value,passwd_v:P.FldPasswordVerify.b.value})},"_priv_rp")}WardenRestorePassword.prototype=new vsk_clone(WardenModule.prototype);function WardenSettings(Manager,Parent){this.constructor=WardenModule;this.constructor(Manager,Parent);this.LblHeader=this.child(VUI_NODE,"LblHeader");this.DlgSettings=this.child(VUI_TAB_DIALOGUE,"DlgSettings");this.PanAccount=this.child(VUI_NODE,"PanAccount");this.PanAccount.child(VUI_NODE,"LblHeaderPasswordCurrent");this.PanAccount.child(VUI_NODE,"FldPasswordCurrent","input");input_password(this.PanAccount.C.FldPasswordCurrent);this.PanAccount.child(VUI_NODE,"LblInfoPasswordCurrent");this.PanAccount.child(VUI_NODE,"LblHeaderEmail");this.PanAccount.child(VUI_NODE,"FldEmail","input");this.PanAccount.child(VUI_NODE,"LblHeaderPassword");this.PanAccount.child(VUI_NODE,"FldPasswordNew","input");input_password(this.PanAccount.C.FldPasswordNew);this.PanAccount.child(VUI_NODE,"FldPasswordVerify","input");input_password(this.PanAccount.C.FldPasswordVerify);this.PanAccount.child(VUI_NODE,"LblInfoPasswordNew");this.PanAccount.child(VUI_NODE,"LblInfoPasswordVerify");this.PanAccount.child(VUI_NODE,"LblHeaderNewsletter");this.PanAccount.child(VUI_CHECKBOX,"CbNewsletter");this.PanGame=this.child(VUI_NODE,"PanGame");this.PanGame.child(VUI_CHECKBOX,"CbZoom");this.PanGame.child(VUI_CHECKBOX,"CbAutoPenalty");this.PanGame.child(VUI_CHECKBOX,"CbHideHeader");this.PanGame.child(VUI_CHECKBOX,"CbNotifyPvP");this.BtnSave=this.child(VUI_BUTTON,"BtnSave");this.BtnSave.vsk_event_add("mousedown",function(Btn){var CFG=Btn.P;var A=CFG.PanAccount.C;var G=CFG.PanGame.C;Btn.M.send("account-config",{email:A.FldEmail.b.value,passwd_c:A.FldPasswordCurrent.b.value,passwd_n:A.FldPasswordNew.b.value,passwd_v:A.FldPasswordVerify.b.value,options:CFG.make_options()})},"_priv_settings");var CFG=this;this.Manager.Cache.data.onchange.add(function(type,d){if(type=="account"&&parseInt(d.id)==CFG.accountId){CFG.set_account(d.id)}},"character-details")}WardenSettings.prototype=new vsk_clone(WardenModule.prototype);WardenSettings.prototype.xml_build__wosettings=function(xml,Parent){this.xml_build__element(xml,Parent);this.set_account(v(xml).gan("account_id"));return this};WardenSettings.prototype.xml_build=WardenSettings.prototype.xml_build__wosettings;WardenSettings.prototype.make_options=function(){var o=0,G=this.PanGame.C,A=this.PanAccount.C;if(A.CbNewsletter.isChecked){o|=WO_ACFG_NEWSLETTER}if(G.CbZoom.isChecked){o|=WO_ACFG_ZOOM}if(G.CbAutoPenalty.isChecked){o|=WO_ACFG_AUTO_PENALTY}if(G.CbHideHeader.isChecked){o|=WO_ACFG_HIDE_HEADER}if(G.CbNotifyPvP.isChecked){o|=WO_ACFG_NOTIFY_PVP}return o};WardenSettings.prototype.set_account=function(accountId){var C=this.M.Cache,A=C.data.account[accountId];var PA=this.PanAccount.C;var PG=this.PanGame.C;if(A){this.accountId=accountId;var O=A.options;PA.FldEmail.b.value=A.email;PA.FldPasswordCurrent.b.value="";PA.FldPasswordNew.b.value="";PA.FldPasswordVerify.b.value="";PA.CbNewsletter.check(O&WO_ACFG_NEWSLETTER);PG.CbZoom.check(O&WO_ACFG_ZOOM);PG.CbAutoPenalty.check(O&WO_ACFG_AUTO_PENALTY);PG.CbHideHeader.check(O&WO_ACFG_HIDE_HEADER);PG.CbNotifyPvP.check(O&WO_ACFG_NOTIFY_PVP)}};function woses_set(b){vsk_cookie_set("wosec_status",b);Manager.WOSEC.unlocked=b}function WOSEC(host,port){this.bridge=null;this.host=(host||"127.0.0.1");this.port=(port||17117);this.unlocked=parseInt(vsk_cookie_get("wosec_status"))}WOSEC.prototype.init=function(){this.bridge=v(vsk_h("iframe")).move(-1000,-1000).hide(1).dock(document.body)};WOSEC.prototype.play=function(path){if(!this.unlocked){return}this.bridge.b.src="http://"+this.host+":"+this.port+"/$play/"+path};