/*
This file is assembled by %IMPRINT_LINK%
It contains files from different sources with the following copyrights:

Router, Base and Config classes (renamed to GameCore_*) Copyright (c) 2006 - 2008 Sebastian Lagemann (http://code.degola.de)
These classes which were used are under the terms of an proprietary software license (see http://code.degola.de/License/Proprietary/Javascript/mediatainmentGmbH/).

The GameCore-classes contains scripts from http://phpjs.org/ see http://phpjs.org/pages/license for license.

The Yahoo! User Interface Library (YUI), Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt



*/
var Element={'applyMethods':function(element){if(element){if(!element.__cloneNode){element.__cloneNode=element.cloneNode;}
element.getId=function(){return element.id;};element.getStyle=function(name){return YAHOO.util.Dom.getStyle(element.getId(),name);};element.setStyle=function(values){for(var property in values){try{if(property=='opacity'){element.setOpacity(values[property]);}else if(property=='float'){element.setFloat(values[property]);}else{YAHOO.util.Dom.setStyle([element.getId()],property,values[property]);}}catch(e){}}};element.update=function(value){element.innerHTML=value;};element.cloneNode=function(param){var newElement=element.__cloneNode(param);if(!newElement.__cloneNode){return Element.applyMethods(newElement);}
return newElement;};element.hide=function(){element.style.display='none';return element;};element.show=function(specialValue){element.style.display=(specialValue?specialValue:'');return element;};element.visible=function(){if(!element.style.display){var style=(element.className?GameCore.Dom.getStylesheetByStyleClass(element.className):null);if(style){return style.display!='none';}
return true;}else{return element.style.display!='none';}};element.toggle=function(){if(element.visible()==false){element.show();}else{element.hide();}};element.toggle=function(){if(element.visible()===true){element.hide();}else{element.show();}
return element;};element.remove=function(){element.parentNode.removeChild(element);return element;};element.setFloat=function(value){if(YAHOO.env.ua.ie>=6){YAHOO.util.Dom.setStlye([element.getId()],'styleFloat',value);}else{YAHOO.util.Dom.setStlye([element.getId()],'cssFloat',value);}};element.getFloat=function(){if(YAHOO.env.ua.ie>=6){return element.style.styleFloat;}else{return element.style.cssFloat;}};element.getOpacity=function(){if(YAHOO.env.ua.ie>=6){var filter=element.style.filter;var result=null;if(result=filter.match(/opacity=([0-9]{1,})/)){return parseInt(result[1])/100;}
return null;}
return element.style.opacity;};element.setOpacity=function(value){value=(value==1||value==='')?'':(value<0.00001)?0:value;if(YAHOO.env.ua.ie>=6){YAHOO.util.Dom.setStyle([element.getId()],'filter','alpha(opacity='+(value*100)+')');}else{YAHOO.util.Dom.setStyle([element.getId()],'opacity',value);}};if(YAHOO.env.ua.ie==0){element.clear=function(){element.value='';};}
element.writeAttribute=function(name,value){YAHOO.util.Dom.setAttribute(element,name,value);};}
return element;}};function $(elementId){return Element.applyMethods(YAHOO.util.Dom.get(elementId));};function __Event(){this.pointer=function(event){var docElement=document.documentElement,body=document.body||{scrollLeft:0,scrollTop:0};return{x:event.pageX||(event.clientX+
(docElement.scrollLeft||body.scrollLeft)-
(docElement.clientLeft||0)),y:event.pageY||(event.clientY+
(docElement.scrollTop||body.scrollTop)-
(docElement.clientTop||0))};};this.pointerX=function(event){return Event.pointer(event).x};this.pointerY=function(event){return Event.pointer(event).y};};var Event=new __Event();var Ajax={'Request':function(url,options){var request=null;var params='';var callbacks={};if(options.method=='post'){if(options.parameters){for(var key in options.parameters){params+=key+'='+options.parameters[key]+'&';}
params=params.substr(0,params.length-1);}}
if(options.onSuccess){callbacks.success=function(o){for(var key in o.getResponseHeader){o.getResponseHeader[key.toUpperCase()]=o.getResponseHeader[key];}
var transport={'responseText':o.responseText,'status':o.status,'headers':o.getResponseHeader,'getHeader':function(id){return this.headers[id];}};if(o.getResponseHeader['X-JSON']){transport.responseJSON=YAHOO.lang.JSON.parse(o.responseText);}
options.onSuccess(transport);};}
if(options.method=='post'){request=YAHOO.util.Connect.asyncRequest('POST',url,callbacks,params);}else{request=YAHOO.util.Connect.asyncRequest('GET',url,callbacks,params);}
return request;}};function PeriodicalExecuter(callback,interval){this.callback=callback;this.interval=interval;this.Timer=null;this.currentlyExecuting=false;this.Init=function(){if(this.Timer==null){var self=this;this.Timer=window.setInterval(function(){self.execute(self); },this.interval*1000);this.currentlyExecuting=false;}};this.execute=function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.callback(this);}finally{this.currentlyExecuting=false;}}};this.stop=function(){if(!this.Timer)return;clearInterval(this.Timer);this.Timer=null;};this.Init();};
if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}
YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;i=i+1){d=(""+a[i]).split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;j=j+1){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}
return o;};YAHOO.log=function(msg,cat,src){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(msg,cat,src);}else{return false;}};YAHOO.register=function(name,mainClass,data){var mods=YAHOO.env.modules,m,v,b,ls,i;if(!mods[name]){mods[name]={versions:[],builds:[]};}
m=mods[name];v=data.version;b=data.build;ls=YAHOO.env.listeners;m.name=name;m.version=v;m.build=b;m.versions.push(v);m.builds.push(b);m.mainClass=mainClass;for(i=0;i<ls.length;i=i+1){ls[i](m);}
if(mainClass){mainClass.VERSION=v;mainClass.BUILD=b;}else{YAHOO.log("mainClass is undefined for module "+name,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(name){return YAHOO.env.modules[name]||null;};YAHOO.env.ua=function(){var o={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0,caja:0},ua=navigator.userAgent,m;if((/KHTML/).test(ua)){o.webkit=1;}
m=ua.match(/AppleWebKit\/([^\s]*)/);if(m&&m[1]){o.webkit=parseFloat(m[1]);if(/ Mobile\//.test(ua)){o.mobile="Apple";}else{m=ua.match(/NokiaN[^\/]*/);if(m){o.mobile=m[0];}}
m=ua.match(/AdobeAIR\/([^\s]*)/);if(m){o.air=m[0];}}
if(!o.webkit){m=ua.match(/Opera[\s\/]([^\s]*)/);if(m&&m[1]){o.opera=parseFloat(m[1]);m=ua.match(/Opera Mini[^;]*/);if(m){o.mobile=m[0];}}else{m=ua.match(/MSIE\s([^;]*)/);if(m&&m[1]){o.ie=parseFloat(m[1]);}else{m=ua.match(/Gecko\/([^\s]*)/);if(m){o.gecko=1;m=ua.match(/rv:([^\s\)]*)/);if(m&&m[1]){o.gecko=parseFloat(m[1]);}}}}}
m=ua.match(/Caja\/([^\s]*)/);if(m&&m[1]){o.caja=parseFloat(m[1]);}
return o;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i;if(l){for(i=0;i<ls.length;i=i+1){if(ls[i]==l){unique=false;break;}}
if(unique){ls.push(l);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var L=YAHOO.lang,ARRAY_TOSTRING='[object Array]',FUNCTION_TOSTRING='[object Function]',OP=Object.prototype,ADD=["toString","valueOf"],OB={isArray:function(o){return OP.toString.apply(o)===ARRAY_TOSTRING;},isBoolean:function(o){return typeof o==='boolean';},isFunction:function(o){return OP.toString.apply(o)===FUNCTION_TOSTRING;},isNull:function(o){return o===null;},isNumber:function(o){return typeof o==='number'&&isFinite(o);},isObject:function(o){return(o&&(typeof o==='object'||L.isFunction(o)))||false;},isString:function(o){return typeof o==='string';},isUndefined:function(o){return typeof o==='undefined';},_IEEnumFix:(YAHOO.env.ua.ie)?function(r,s){var i,fname,f;for(i=0;i<ADD.length;i=i+1){fname=ADD[i];f=s[fname];if(L.isFunction(f)&&f!=OP[fname]){r[fname]=f;}}}:function(){},extend:function(subc,superc,overrides){if(!superc||!subc){throw new Error("extend failed, please check that "+"all dependencies are included.");}
var F=function(){},i;F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==OP.constructor){superc.prototype.constructor=superc;}
if(overrides){for(i in overrides){if(L.hasOwnProperty(overrides,i)){subc.prototype[i]=overrides[i];}}
L._IEEnumFix(subc.prototype,overrides);}},augmentObject:function(r,s){if(!s||!r){throw new Error("Absorb failed, verify dependencies.");}
var a=arguments,i,p,overrideList=a[2];if(overrideList&&overrideList!==true){for(i=2;i<a.length;i=i+1){r[a[i]]=s[a[i]];}}else{for(p in s){if(overrideList||!(p in r)){r[p]=s[p];}}
L._IEEnumFix(r,s);}},augmentProto:function(r,s){if(!s||!r){throw new Error("Augment failed, verify dependencies.");}
var a=[r.prototype,s.prototype],i;for(i=2;i<arguments.length;i=i+1){a.push(arguments[i]);}
L.augmentObject.apply(this,a);},dump:function(o,d){var i,len,s=[],OBJ="{...}",FUN="f(){...}",COMMA=', ',ARROW=' => ';if(!L.isObject(o)){return o+"";}else if(o instanceof Date||("nodeType"in o&&"tagName"in o)){return o;}else if(L.isFunction(o)){return FUN;}
d=(L.isNumber(d))?d:3;if(L.isArray(o)){s.push("[");for(i=0,len=o.length;i<len;i=i+1){if(L.isObject(o[i])){s.push((d>0)?L.dump(o[i],d-1):OBJ);}else{s.push(o[i]);}
s.push(COMMA);}
if(s.length>1){s.pop();}
s.push("]");}else{s.push("{");for(i in o){if(L.hasOwnProperty(o,i)){s.push(i+ARROW);if(L.isObject(o[i])){s.push((d>0)?L.dump(o[i],d-1):OBJ);}else{s.push(o[i]);}
s.push(COMMA);}}
if(s.length>1){s.pop();}
s.push("}");}
return s.join("");},substitute:function(s,o,f){var i,j,k,key,v,meta,saved=[],token,DUMP='dump',SPACE=' ',LBRACE='{',RBRACE='}',dump;for(;;){i=s.lastIndexOf(LBRACE);if(i<0){break;}
j=s.indexOf(RBRACE,i);if(i+1>=j){break;}
token=s.substring(i+1,j);key=token;meta=null;k=key.indexOf(SPACE);if(k>-1){meta=key.substring(k+1);key=key.substring(0,k);}
v=o[key];if(f){v=f(key,v,meta);}
if(L.isObject(v)){if(L.isArray(v)){v=L.dump(v,parseInt(meta,10));}else{meta=meta||"";dump=meta.indexOf(DUMP);if(dump>-1){meta=meta.substring(4);}
if(v.toString===OP.toString||dump>-1){v=L.dump(v,parseInt(meta,10));}else{v=v.toString();}}}else if(!L.isString(v)&&!L.isNumber(v)){v="~-"+saved.length+"-~";saved[saved.length]=token;}
s=s.substring(0,i)+v+s.substring(j+1);}
for(i=saved.length-1;i>=0;i=i-1){s=s.replace(new RegExp("~-"+i+"-~"),"{"+saved[i]+"}","g");}
return s;},trim:function(s){try{return s.replace(/^\s+|\s+$/g,"");}catch(e){return s;}},merge:function(){var o={},a=arguments,l=a.length,i;for(i=0;i<l;i=i+1){L.augmentObject(o,a[i],true);}
return o;},later:function(when,o,fn,data,periodic){when=when||0;o=o||{};var m=fn,d=data,f,r;if(L.isString(fn)){m=o[fn];}
if(!m){throw new TypeError("method undefined");}
if(!L.isArray(d)){d=[data];}
f=function(){m.apply(o,d);};r=(periodic)?setInterval(f,when):setTimeout(f,when);return{interval:periodic,cancel:function(){if(this.interval){clearInterval(r);}else{clearTimeout(r);}}};},isValue:function(o){return(L.isObject(o)||L.isString(o)||L.isNumber(o)||L.isBoolean(o));}};L.hasOwnProperty=(OP.hasOwnProperty)?function(o,prop){return o&&o.hasOwnProperty(prop);}:function(o,prop){return!L.isUndefined(o[prop])&&o.constructor.prototype[prop]!==o[prop];};OB.augmentObject(L,OB,true);YAHOO.util.Lang=L;L.augment=L.augmentProto;YAHOO.augment=L.augmentProto;YAHOO.extend=L.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.7.0",build:"1799"});
YAHOO.lang.JSON=(function(){var l=YAHOO.lang,_UNICODE_EXCEPTIONS=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_ESCAPES=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,_VALUES=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_BRACKETS=/(?:^|:|,)(?:\s*\[)+/g,_INVALID=/^[\],:{}\s]*$/,_SPECIAL_CHARS=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_CHARS={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};function _revive(data,reviver){var walk=function(o,key){var k,v,value=o[key];if(value&&typeof value==='object'){for(k in value){if(l.hasOwnProperty(value,k)){v=walk(value,k);if(v===undefined){delete value[k];}else{value[k]=v;}}}}
return reviver.call(o,key,value);};return typeof reviver==='function'?walk({'':data},''):data;}
function _char(c){if(!_CHARS[c]){_CHARS[c]='\\u'+('0000'+(+(c.charCodeAt(0))).toString(16)).slice(-4);}
return _CHARS[c];}
function _prepare(s){return s.replace(_UNICODE_EXCEPTIONS,_char);}
function _isValid(str){return l.isString(str)&&_INVALID.test(str.replace(_ESCAPES,'@').replace(_VALUES,']').replace(_BRACKETS,''));}
function _string(s){return'"'+s.replace(_SPECIAL_CHARS,_char)+'"';}
function _stringify(h,key,d,w,pstack){var o=typeof w==='function'?w.call(h,key,h[key]):h[key],i,len,j,k,v,isArray,a;if(o instanceof Date){o=l.JSON.dateToString(o);}else if(o instanceof String||o instanceof Boolean||o instanceof Number){o=o.valueOf();}
switch(typeof o){case'string':return _string(o);case'number':return isFinite(o)?String(o):'null';case'boolean':return String(o);case'object':if(o===null){return'null';}
for(i=pstack.length-1;i>=0;--i){if(pstack[i]===o){return'null';}}
pstack[pstack.length]=o;a=[];isArray=l.isArray(o);if(d>0){if(isArray){for(i=o.length-1;i>=0;--i){a[i]=_stringify(o,i,d-1,w,pstack)||'null';}}else{j=0;if(l.isArray(w)){for(i=0,len=w.length;i<len;++i){k=w[i];v=_stringify(o,k,d-1,w,pstack);if(v){a[j++]=_string(k)+':'+v;}}}else{for(k in o){if(typeof k==='string'&&l.hasOwnProperty(o,k)){v=_stringify(o,k,d-1,w,pstack);if(v){a[j++]=_string(k)+':'+v;}}}}
a.sort();}}
pstack.pop();return isArray?'['+a.join(',')+']':'{'+a.join(',')+'}';}
return undefined;}
return{isValid:function(s){return _isValid(_prepare(s));},parse:function(s,reviver){s=_prepare(s);if(_isValid(s)){return _revive(eval('('+s+')'),reviver);}
throw new SyntaxError('parseJSON');},stringify:function(o,w,d){if(o!==undefined){if(l.isArray(w)){w=(function(a){var uniq=[],map={},v,i,j,len;for(i=0,j=0,len=a.length;i<len;++i){v=a[i];if(typeof v==='string'&&map[v]===undefined){uniq[(map[v]=j++)]=v;}}
return uniq;})(w);}
d=d>=0?d:1/0;return _stringify({'':o},'',d,w,[]);}
return undefined;},dateToString:function(d){function _zeroPad(v){return v<10?'0'+v:v;}
return d.getUTCFullYear()+'-'+
_zeroPad(d.getUTCMonth()+1)+'-'+
_zeroPad(d.getUTCDate())+'T'+
_zeroPad(d.getUTCHours())+':'+
_zeroPad(d.getUTCMinutes())+':'+
_zeroPad(d.getUTCSeconds())+'Z';},stringToDate:function(str){if(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/.test(str)){var d=new Date();d.setUTCFullYear(RegExp.$1,(RegExp.$2|0)-1,RegExp.$3);d.setUTCHours(RegExp.$4,RegExp.$5,RegExp.$6);return d;}
return str;}};})();YAHOO.register("json",YAHOO.lang.JSON,{version:"2.7.0",build:"1799"});
YAHOO.util.CustomEvent=function(type,context,silent,signature){this.type=type;this.scope=context||window;this.silent=silent;this.signature=signature||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}
var onsubscribeType="_YUICEOnSubscribe";if(type!==onsubscribeType){this.subscribeEvent=new YAHOO.util.CustomEvent(onsubscribeType,this,true);}
this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,overrideContext){if(!fn){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}
if(this.subscribeEvent){this.subscribeEvent.fire(fn,obj,overrideContext);}
this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,overrideContext));},unsubscribe:function(fn,obj){if(!fn){return this.unsubscribeAll();}
var found=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,obj)){this._delete(i);found=true;}}
return found;},fire:function(){this.lastError=null;var errors=[],len=this.subscribers.length;if(!len&&this.silent){return true;}
var args=[].slice.call(arguments,0),ret=true,i,rebuild=false;if(!this.silent){}
var subs=this.subscribers.slice(),throwErrors=YAHOO.util.Event.throwErrors;for(i=0;i<len;++i){var s=subs[i];if(!s){rebuild=true;}else{if(!this.silent){}
var scope=s.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var param=null;if(args.length>0){param=args[0];}
try{ret=s.fn.call(scope,param,s.obj);}catch(e){this.lastError=e;if(throwErrors){throw e;}}}else{try{ret=s.fn.call(scope,this.type,args,s.obj);}catch(ex){this.lastError=ex;if(throwErrors){throw ex;}}}
if(false===ret){if(!this.silent){}
break;}}}
return(ret!==false);},unsubscribeAll:function(){var l=this.subscribers.length,i;for(i=l-1;i>-1;i--){this._delete(i);}
this.subscribers=[];return l;},_delete:function(index){var s=this.subscribers[index];if(s){delete s.fn;delete s.obj;}
this.subscribers.splice(index,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"context: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,overrideContext){this.fn=fn;this.obj=YAHOO.lang.isUndefined(obj)?null:obj;this.overrideContext=overrideContext;};YAHOO.util.Subscriber.prototype.getScope=function(defaultScope){if(this.overrideContext){if(this.overrideContext===true){return this.obj;}else{return this.overrideContext;}}
return defaultScope;};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return(this.fn==fn&&this.obj==obj);}else{return(this.fn==fn);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", overrideContext: "+(this.overrideContext||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var loadComplete=false;var listeners=[];var unloadListeners=[];var legacyEvents=[];var legacyHandlers=[];var retryCount=0;var onAvailStack=[];var legacyMap=[];var counter=0;var webkitKeymap={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};var _FOCUS=YAHOO.env.ua.ie?"focusin":"focus";var _BLUR=YAHOO.env.ua.ie?"focusout":"blur";return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var self=this;var callback=function(){self._tryPreloadAttach();};this._interval=setInterval(callback,this.POLL_INTERVAL);}},onAvailable:function(id,fn,obj,overrideContext,checkContent){var a=(YAHOO.lang.isString(id))?[id]:id;for(var i=0;i<a.length;i=i+1){onAvailStack.push({id:a[i],fn:fn,obj:obj,overrideContext:overrideContext,checkReady:checkContent});}
retryCount=this.POLL_RETRYS;this.startInterval();},onContentReady:function(id,fn,obj,overrideContext){this.onAvailable(id,fn,obj,overrideContext,true);},onDOMReady:function(fn,obj,overrideContext){if(this.DOMReady){setTimeout(function(){var s=window;if(overrideContext){if(overrideContext===true){s=obj;}else{s=overrideContext;}}
fn.call(s,"DOMReady",[],obj);},0);}else{this.DOMReadyEvent.subscribe(fn,obj,overrideContext);}},_addListener:function(el,sType,fn,obj,overrideContext,bCapture){if(!fn||!fn.call){return false;}
if(this._isValidCollection(el)){var ok=true;for(var i=0,len=el.length;i<len;++i){ok=this.on(el[i],sType,fn,obj,overrideContext)&&ok;}
return ok;}else if(YAHOO.lang.isString(el)){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,sType,fn,obj,overrideContext);});return true;}}
if(!el){return false;}
if("unload"==sType&&obj!==this){unloadListeners[unloadListeners.length]=[el,sType,fn,obj,overrideContext];return true;}
var context=el;if(overrideContext){if(overrideContext===true){context=obj;}else{context=overrideContext;}}
var wrappedFn=function(e){return fn.call(context,YAHOO.util.Event.getEvent(e,el),obj);};var li=[el,sType,fn,wrappedFn,context,obj,overrideContext];var index=listeners.length;listeners[index]=li;if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);if(legacyIndex==-1||el!=legacyEvents[legacyIndex][0]){legacyIndex=legacyEvents.length;legacyMap[el.id+sType]=legacyIndex;legacyEvents[legacyIndex]=[el,sType,el["on"+sType]];legacyHandlers[legacyIndex]=[];el["on"+sType]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),legacyIndex);};}
legacyHandlers[legacyIndex].push(li);}else{try{this._simpleAdd(el,sType,wrappedFn,bCapture);}catch(ex){this.lastError=ex;this.removeListener(el,sType,fn);return false;}}
return true;},addListener:function(el,sType,fn,obj,overrideContext){return this._addListener(el,sType,fn,obj,overrideContext,false);},addFocusListener:function(el,fn,obj,overrideContext){return this._addListener(el,_FOCUS,fn,obj,overrideContext,true);},removeFocusListener:function(el,fn){return this.removeListener(el,_FOCUS,fn);},addBlurListener:function(el,fn,obj,overrideContext){return this._addListener(el,_BLUR,fn,obj,overrideContext,true);},removeBlurListener:function(el,fn){return this.removeListener(el,_BLUR,fn);},fireLegacyEvent:function(e,legacyIndex){var ok=true,le,lh,li,context,ret;lh=legacyHandlers[legacyIndex].slice();for(var i=0,len=lh.length;i<len;++i){li=lh[i];if(li&&li[this.WFN]){context=li[this.ADJ_SCOPE];ret=li[this.WFN].call(context,e);ok=(ok&&ret);}}
le=legacyEvents[legacyIndex];if(le&&le[2]){le[2](e);}
return ok;},getLegacyIndex:function(el,sType){var key=this.generateId(el)+sType;if(typeof legacyMap[key]=="undefined"){return-1;}else{return legacyMap[key];}},useLegacyEvent:function(el,sType){return(this.webkit&&this.webkit<419&&("click"==sType||"dblclick"==sType));},removeListener:function(el,sType,fn){var i,len,li;if(typeof el=="string"){el=this.getEl(el);}else if(this._isValidCollection(el)){var ok=true;for(i=el.length-1;i>-1;i--){ok=(this.removeListener(el[i],sType,fn)&&ok);}
return ok;}
if(!fn||!fn.call){return this.purgeElement(el,false,sType);}
if("unload"==sType){for(i=unloadListeners.length-1;i>-1;i--){li=unloadListeners[i];if(li&&li[0]==el&&li[1]==sType&&li[2]==fn){unloadListeners.splice(i,1);return true;}}
return false;}
var cacheItem=null;var index=arguments[3];if("undefined"===typeof index){index=this._getCacheIndex(el,sType,fn);}
if(index>=0){cacheItem=listeners[index];}
if(!el||!cacheItem){return false;}
if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);var llist=legacyHandlers[legacyIndex];if(llist){for(i=0,len=llist.length;i<len;++i){li=llist[i];if(li&&li[this.EL]==el&&li[this.TYPE]==sType&&li[this.FN]==fn){llist.splice(i,1);break;}}}}else{try{this._simpleRemove(el,sType,cacheItem[this.WFN],false);}catch(ex){this.lastError=ex;return false;}}
delete listeners[index][this.WFN];delete listeners[index][this.FN];listeners.splice(index,1);return true;},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(n){try{if(n&&3==n.nodeType){return n.parentNode;}}catch(e){}
return n;},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}
return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}
return y;},getXY:function(ev){return[this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else if(ev.type=="mouseover"){t=ev.fromElement;}}
return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(ex){this.lastError=ex;return t;}}
return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},getEvent:function(e,boundEl){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}
c=c.caller;}}
return ev;},getCharCode:function(ev){var code=ev.keyCode||ev.charCode||0;if(YAHOO.env.ua.webkit&&(code in webkitKeymap)){code=webkitKeymap[code];}
return code;},_getCacheIndex:function(el,sType,fn){for(var i=0,l=listeners.length;i<l;i=i+1){var li=listeners[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==sType){return i;}}
return-1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+counter;++counter;el.id=id;}
return id;},_isValidCollection:function(o){try{return(o&&typeof o!=="string"&&o.length&&!o.tagName&&!o.alert&&typeof o[0]!=="undefined");}catch(ex){return false;}},elCache:{},getEl:function(id){return(typeof id==="string")?document.getElementById(id):id;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(e){if(!loadComplete){loadComplete=true;var EU=YAHOO.util.Event;EU._ready();EU._tryPreloadAttach();}},_ready:function(e){var EU=YAHOO.util.Event;if(!EU.DOMReady){EU.DOMReady=true;EU.DOMReadyEvent.fire();EU._simpleRemove(document,"DOMContentLoaded",EU._ready);}},_tryPreloadAttach:function(){if(onAvailStack.length===0){retryCount=0;if(this._interval){clearInterval(this._interval);this._interval=null;}
return;}
if(this.locked){return;}
if(this.isIE){if(!this.DOMReady){this.startInterval();return;}}
this.locked=true;var tryAgain=!loadComplete;if(!tryAgain){tryAgain=(retryCount>0&&onAvailStack.length>0);}
var notAvail=[];var executeItem=function(el,item){var context=el;if(item.overrideContext){if(item.overrideContext===true){context=item.obj;}else{context=item.overrideContext;}}
item.fn.call(context,item.obj);};var i,len,item,el,ready=[];for(i=0,len=onAvailStack.length;i<len;i=i+1){item=onAvailStack[i];if(item){el=this.getEl(item.id);if(el){if(item.checkReady){if(loadComplete||el.nextSibling||!tryAgain){ready.push(item);onAvailStack[i]=null;}}else{executeItem(el,item);onAvailStack[i]=null;}}else{notAvail.push(item);}}}
for(i=0,len=ready.length;i<len;i=i+1){item=ready[i];executeItem(this.getEl(item.id),item);}
retryCount--;if(tryAgain){for(i=onAvailStack.length-1;i>-1;i--){item=onAvailStack[i];if(!item||!item.id){onAvailStack.splice(i,1);}}
this.startInterval();}else{if(this._interval){clearInterval(this._interval);this._interval=null;}}
this.locked=false;},purgeElement:function(el,recurse,sType){var oEl=(YAHOO.lang.isString(el))?this.getEl(el):el;var elListeners=this.getListeners(oEl,sType),i,len;if(elListeners){for(i=elListeners.length-1;i>-1;i--){var l=elListeners[i];this.removeListener(oEl,l.type,l.fn);}}
if(recurse&&oEl&&oEl.childNodes){for(i=0,len=oEl.childNodes.length;i<len;++i){this.purgeElement(oEl.childNodes[i],recurse,sType);}}},getListeners:function(el,sType){var results=[],searchLists;if(!sType){searchLists=[listeners,unloadListeners];}else if(sType==="unload"){searchLists=[unloadListeners];}else{searchLists=[listeners];}
var oEl=(YAHOO.lang.isString(el))?this.getEl(el):el;for(var j=0;j<searchLists.length;j=j+1){var searchList=searchLists[j];if(searchList){for(var i=0,len=searchList.length;i<len;++i){var l=searchList[i];if(l&&l[this.EL]===oEl&&(!sType||sType===l[this.TYPE])){results.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.OVERRIDE],scope:l[this.ADJ_SCOPE],index:i});}}}}
return(results.length)?results:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index,ul=unloadListeners.slice(),context;for(i=0,len=unloadListeners.length;i<len;++i){l=ul[i];if(l){context=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){context=l[EU.UNLOAD_OBJ];}else{context=l[EU.ADJ_SCOPE];}}
l[EU.FN].call(context,EU.getEvent(e,l[EU.EL]),l[EU.UNLOAD_OBJ]);ul[i]=null;}}
l=null;context=null;unloadListeners=null;if(listeners){for(j=listeners.length-1;j>-1;j--){l=listeners[j];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],j);}}
l=null;}
legacyEvents=null;EU._simpleRemove(window,"unload",EU._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return[dd.scrollTop,dd.scrollLeft];}else if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(el,sType,fn,capture){el.addEventListener(sType,fn,(capture));};}else if(window.attachEvent){return function(el,sType,fn,capture){el.attachEvent("on"+sType,fn);};}else{return function(){};}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,sType,fn,capture){el.removeEventListener(sType,fn,(capture));};}else if(window.detachEvent){return function(el,sType,fn){el.detachEvent("on"+sType,fn);};}else{return function(){};}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener;if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement('p');EU._dri=setInterval(function(){try{n.doScroll('left');clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}else if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}
EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}
YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(p_type,p_fn,p_obj,overrideContext){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){ce.subscribe(p_fn,p_obj,overrideContext);}else{this.__yui_subscribers=this.__yui_subscribers||{};var subs=this.__yui_subscribers;if(!subs[p_type]){subs[p_type]=[];}
subs[p_type].push({fn:p_fn,obj:p_obj,overrideContext:overrideContext});}},unsubscribe:function(p_type,p_fn,p_obj){this.__yui_events=this.__yui_events||{};var evts=this.__yui_events;if(p_type){var ce=evts[p_type];if(ce){return ce.unsubscribe(p_fn,p_obj);}}else{var ret=true;for(var i in evts){if(YAHOO.lang.hasOwnProperty(evts,i)){ret=ret&&evts[i].unsubscribe(p_fn,p_obj);}}
return ret;}
return false;},unsubscribeAll:function(p_type){return this.unsubscribe(p_type);},createEvent:function(p_type,p_config){this.__yui_events=this.__yui_events||{};var opts=p_config||{};var events=this.__yui_events;if(events[p_type]){}else{var scope=opts.scope||this;var silent=(opts.silent);var ce=new YAHOO.util.CustomEvent(p_type,scope,silent,YAHOO.util.CustomEvent.FLAT);events[p_type]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}
this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[p_type];if(qs){for(var i=0;i<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].overrideContext);}}}
return events[p_type];},fireEvent:function(p_type,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(!ce){return null;}
var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}
return ce.fire.apply(ce,args);},hasEvent:function(type){if(this.__yui_events){if(this.__yui_events[type]){return true;}}
return false;}};(function(){var Event=YAHOO.util.Event,Lang=YAHOO.lang;YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!attachTo){}else if(!keyData){}else if(!handler){}
if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}
var keyEvent=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(Lang.isString(attachTo)){attachTo=document.getElementById(attachTo);}
if(Lang.isFunction(handler)){keyEvent.subscribe(handler);}else{keyEvent.subscribe(handler.fn,handler.scope,handler.correctScope);}
function handleKeyPress(e,obj){if(!keyData.shift){keyData.shift=false;}
if(!keyData.alt){keyData.alt=false;}
if(!keyData.ctrl){keyData.ctrl=false;}
if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){var dataItem,keys=keyData.keys,key;if(YAHOO.lang.isArray(keys)){for(var i=0;i<keys.length;i++){dataItem=keys[i];key=Event.getCharCode(e);if(dataItem==key){keyEvent.fire(key,e);break;}}}else{key=Event.getCharCode(e);if(keys==key){keyEvent.fire(key,e);}}}}
this.enable=function(){if(!this.enabled){Event.on(attachTo,event,handleKeyPress);this.enabledEvent.fire(keyData);}
this.enabled=true;};this.disable=function(){if(this.enabled){Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}
this.enabled=false;};this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+
(attachTo.id?"["+attachTo.id+"]":"");};};var KeyListener=YAHOO.util.KeyListener;KeyListener.KEYDOWN="keydown";KeyListener.KEYUP="keyup";KeyListener.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};})();YAHOO.register("event",YAHOO.util.Event,{version:"2.7.0",build:"1799"});
YAHOO.util.Connect={_msxml_progid:['Microsoft.XMLHTTP','MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP'],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:'application/x-www-form-urlencoded; charset=UTF-8',_default_form_header:'application/x-www-form-urlencoded',_use_default_xhr_header:true,_default_xhr_header:'XMLHttpRequest',_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,_submitElementValue:null,_hasSubmitListener:(function()
{if(YAHOO.util.Event){YAHOO.util.Event.addListener(document,'click',function(e){var obj=YAHOO.util.Event.getTarget(e),name=obj.nodeName.toLowerCase();if((name==='input'||name==='button')&&(obj.type&&obj.type.toLowerCase()=='submit')){YAHOO.util.Connect._submitElementValue=encodeURIComponent(obj.name)+"="+encodeURIComponent(obj.value);}});return true;}
return false;})(),startEvent:new YAHOO.util.CustomEvent('start'),completeEvent:new YAHOO.util.CustomEvent('complete'),successEvent:new YAHOO.util.CustomEvent('success'),failureEvent:new YAHOO.util.CustomEvent('failure'),uploadEvent:new YAHOO.util.CustomEvent('upload'),abortEvent:new YAHOO.util.CustomEvent('abort'),_customEvents:{onStart:['startEvent','start'],onComplete:['completeEvent','complete'],onSuccess:['successEvent','success'],onFailure:['failureEvent','failure'],onUpload:['uploadEvent','upload'],onAbort:['abortEvent','abort']},setProgId:function(id)
{this._msxml_progid.unshift(id);},setDefaultPostHeader:function(b)
{if(typeof b=='string'){this._default_post_header=b;}
else if(typeof b=='boolean'){this._use_default_post_header=b;}},setDefaultXhrHeader:function(b)
{if(typeof b=='string'){this._default_xhr_header=b;}
else{this._use_default_xhr_header=b;}},setPollingInterval:function(i)
{if(typeof i=='number'&&isFinite(i)){this._polling_interval=i;}},createXhrObject:function(transactionId)
{var obj,http;try
{http=new XMLHttpRequest();obj={conn:http,tId:transactionId};}
catch(e)
{for(var i=0;i<this._msxml_progid.length;++i){try
{http=new ActiveXObject(this._msxml_progid[i]);obj={conn:http,tId:transactionId};break;}
catch(e2){}}}
finally
{return obj;}},getConnectionObject:function(isFileUpload)
{var o;var tId=this._transaction_id;try
{if(!isFileUpload){o=this.createXhrObject(tId);}
else{o={};o.tId=tId;o.isUpload=true;}
if(o){this._transaction_id++;}}
catch(e){}
finally
{return o;}},asyncRequest:function(method,uri,callback,postData)
{var o=(this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();var args=(callback&&callback.argument)?callback.argument:null;if(!o){return null;}
else{if(callback&&callback.customevents){this.initCustomEvents(o,callback);}
if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(o,callback,uri,postData);return o;}
if(method.toUpperCase()=='GET'){if(this._sFormData.length!==0){uri+=((uri.indexOf('?')==-1)?'?':'&')+this._sFormData;}}
else if(method.toUpperCase()=='POST'){postData=postData?this._sFormData+"&"+postData:this._sFormData;}}
if(method.toUpperCase()=='GET'&&(callback&&callback.cache===false)){uri+=((uri.indexOf('?')==-1)?'?':'&')+"rnd="+new Date().valueOf().toString();}
o.conn.open(method,uri,true);if(this._use_default_xhr_header){if(!this._default_headers['X-Requested-With']){this.initHeader('X-Requested-With',this._default_xhr_header,true);}}
if((method.toUpperCase()==='POST'&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader('Content-Type',this._default_post_header);}
if(this._has_default_headers||this._has_http_headers){this.setHeader(o);}
this.handleReadyState(o,callback);o.conn.send(postData||'');if(this._isFormSubmit===true){this.resetFormState();}
this.startEvent.fire(o,args);if(o.startEvent){o.startEvent.fire(o,args);}
return o;}},initCustomEvents:function(o,callback)
{var prop;for(prop in callback.customevents){if(this._customEvents[prop][0]){o[this._customEvents[prop][0]]=new YAHOO.util.CustomEvent(this._customEvents[prop][1],(callback.scope)?callback.scope:null);o[this._customEvents[prop][0]].subscribe(callback.customevents[prop]);}}},handleReadyState:function(o,callback)
{var oConn=this;var args=(callback&&callback.argument)?callback.argument:null;if(callback&&callback.timeout){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true);},callback.timeout);}
this._poll[o.tId]=window.setInterval(function(){if(o.conn&&o.conn.readyState===4){window.clearInterval(oConn._poll[o.tId]);delete oConn._poll[o.tId];if(callback&&callback.timeout){window.clearTimeout(oConn._timeOut[o.tId]);delete oConn._timeOut[o.tId];}
oConn.completeEvent.fire(o,args);if(o.completeEvent){o.completeEvent.fire(o,args);}
oConn.handleTransactionResponse(o,callback);}},this._polling_interval);},handleTransactionResponse:function(o,callback,isAbort)
{var httpStatus,responseObject;var args=(callback&&callback.argument)?callback.argument:null;try
{if(o.conn.status!==undefined&&o.conn.status!==0){httpStatus=o.conn.status;}
else{httpStatus=13030;}}
catch(e){httpStatus=13030;}
if(httpStatus>=200&&httpStatus<300||httpStatus===1223){responseObject=this.createResponseObject(o,args);if(callback&&callback.success){if(!callback.scope){callback.success(responseObject);}
else{callback.success.apply(callback.scope,[responseObject]);}}
this.successEvent.fire(responseObject);if(o.successEvent){o.successEvent.fire(responseObject);}}
else{switch(httpStatus){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:responseObject=this.createExceptionObject(o.tId,args,(isAbort?isAbort:false));if(callback&&callback.failure){if(!callback.scope){callback.failure(responseObject);}
else{callback.failure.apply(callback.scope,[responseObject]);}}
break;default:responseObject=this.createResponseObject(o,args);if(callback&&callback.failure){if(!callback.scope){callback.failure(responseObject);}
else{callback.failure.apply(callback.scope,[responseObject]);}}}
this.failureEvent.fire(responseObject);if(o.failureEvent){o.failureEvent.fire(responseObject);}}
this.releaseObject(o);responseObject=null;},createResponseObject:function(o,callbackArg)
{var obj={};var headerObj={};try
{var headerStr=o.conn.getAllResponseHeaders();var header=headerStr.split('\n');for(var i=0;i<header.length;i++){var delimitPos=header[i].indexOf(':');if(delimitPos!=-1){headerObj[header[i].substring(0,delimitPos)]=header[i].substring(delimitPos+2);}}}
catch(e){}
obj.tId=o.tId;obj.status=(o.conn.status==1223)?204:o.conn.status;obj.statusText=(o.conn.status==1223)?"No Content":o.conn.statusText;obj.getResponseHeader=headerObj;obj.getAllResponseHeaders=headerStr;obj.responseText=o.conn.responseText;obj.responseXML=o.conn.responseXML;if(callbackArg){obj.argument=callbackArg;}
return obj;},createExceptionObject:function(tId,callbackArg,isAbort)
{var COMM_CODE=0;var COMM_ERROR='communication failure';var ABORT_CODE=-1;var ABORT_ERROR='transaction aborted';var obj={};obj.tId=tId;if(isAbort){obj.status=ABORT_CODE;obj.statusText=ABORT_ERROR;}
else{obj.status=COMM_CODE;obj.statusText=COMM_ERROR;}
if(callbackArg){obj.argument=callbackArg;}
return obj;},initHeader:function(label,value,isDefault)
{var headerObj=(isDefault)?this._default_headers:this._http_headers;headerObj[label]=value;if(isDefault){this._has_default_headers=true;}
else{this._has_http_headers=true;}},setHeader:function(o)
{var prop;if(this._has_default_headers){for(prop in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,prop)){o.conn.setRequestHeader(prop,this._default_headers[prop]);}}}
if(this._has_http_headers){for(prop in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,prop)){o.conn.setRequestHeader(prop,this._http_headers[prop]);}}
delete this._http_headers;this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){delete this._default_headers;this._default_headers={};this._has_default_headers=false;},setForm:function(formId,isUpload,secureUri)
{var oForm,oElement,oName,oValue,oDisabled,hasSubmit=false,data=[],item=0,i,len,j,jlen,opt;this.resetFormState();if(typeof formId=='string'){oForm=(document.getElementById(formId)||document.forms[formId]);}
else if(typeof formId=='object'){oForm=formId;}
else{return;}
if(isUpload){this.createFrame(secureUri?secureUri:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=oForm;return;}
for(i=0,len=oForm.elements.length;i<len;++i){oElement=oForm.elements[i];oDisabled=oElement.disabled;oName=oElement.name;if(!oDisabled&&oName)
{oName=encodeURIComponent(oName)+'=';oValue=encodeURIComponent(oElement.value);switch(oElement.type)
{case'select-one':if(oElement.selectedIndex>-1){opt=oElement.options[oElement.selectedIndex];data[item++]=oName+encodeURIComponent((opt.attributes.value&&opt.attributes.value.specified)?opt.value:opt.text);}
break;case'select-multiple':if(oElement.selectedIndex>-1){for(j=oElement.selectedIndex,jlen=oElement.options.length;j<jlen;++j){opt=oElement.options[j];if(opt.selected){data[item++]=oName+encodeURIComponent((opt.attributes.value&&opt.attributes.value.specified)?opt.value:opt.text);}}}
break;case'radio':case'checkbox':if(oElement.checked){data[item++]=oName+oValue;}
break;case'file':case undefined:case'reset':case'button':break;case'submit':if(hasSubmit===false){if(this._hasSubmitListener&&this._submitElementValue){data[item++]=this._submitElementValue;}
hasSubmit=true;}
break;default:data[item++]=oName+oValue;}}}
this._isFormSubmit=true;this._sFormData=data.join('&');this.initHeader('Content-Type',this._default_form_header);return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(secureUri){var frameId='yuiIO'+this._transaction_id;var io;if(YAHOO.env.ua.ie){io=document.createElement('<iframe id="'+frameId+'" name="'+frameId+'" />');if(typeof secureUri=='boolean'){io.src='javascript:false';}}
else{io=document.createElement('iframe');io.id=frameId;io.name=frameId;}
io.style.position='absolute';io.style.top='-1000px';io.style.left='-1000px';document.body.appendChild(io);},appendPostData:function(postData)
{var formElements=[],postMessage=postData.split('&'),i,delimitPos;for(i=0;i<postMessage.length;i++){delimitPos=postMessage[i].indexOf('=');if(delimitPos!=-1){formElements[i]=document.createElement('input');formElements[i].type='hidden';formElements[i].name=decodeURIComponent(postMessage[i].substring(0,delimitPos));formElements[i].value=decodeURIComponent(postMessage[i].substring(delimitPos+1));this._formNode.appendChild(formElements[i]);}}
return formElements;},uploadFile:function(o,callback,uri,postData){var frameId='yuiIO'+o.tId,uploadEncoding='multipart/form-data',io=document.getElementById(frameId),oConn=this,args=(callback&&callback.argument)?callback.argument:null,oElements,i,prop,obj;var rawFormAttributes={action:this._formNode.getAttribute('action'),method:this._formNode.getAttribute('method'),target:this._formNode.getAttribute('target')};this._formNode.setAttribute('action',uri);this._formNode.setAttribute('method','POST');this._formNode.setAttribute('target',frameId);if(YAHOO.env.ua.ie){this._formNode.setAttribute('encoding',uploadEncoding);}
else{this._formNode.setAttribute('enctype',uploadEncoding);}
if(postData){oElements=this.appendPostData(postData);}
this._formNode.submit();this.startEvent.fire(o,args);if(o.startEvent){o.startEvent.fire(o,args);}
if(callback&&callback.timeout){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true);},callback.timeout);}
if(oElements&&oElements.length>0){for(i=0;i<oElements.length;i++){this._formNode.removeChild(oElements[i]);}}
for(prop in rawFormAttributes){if(YAHOO.lang.hasOwnProperty(rawFormAttributes,prop)){if(rawFormAttributes[prop]){this._formNode.setAttribute(prop,rawFormAttributes[prop]);}
else{this._formNode.removeAttribute(prop);}}}
this.resetFormState();var uploadCallback=function()
{if(callback&&callback.timeout){window.clearTimeout(oConn._timeOut[o.tId]);delete oConn._timeOut[o.tId];}
oConn.completeEvent.fire(o,args);if(o.completeEvent){o.completeEvent.fire(o,args);}
obj={tId:o.tId,argument:callback.argument};try
{obj.responseText=io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:io.contentWindow.document.documentElement.textContent;obj.responseXML=io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;}
catch(e){}
if(callback&&callback.upload){if(!callback.scope){callback.upload(obj);}
else{callback.upload.apply(callback.scope,[obj]);}}
oConn.uploadEvent.fire(obj);if(o.uploadEvent){o.uploadEvent.fire(obj);}
YAHOO.util.Event.removeListener(io,"load",uploadCallback);setTimeout(function(){document.body.removeChild(io);oConn.releaseObject(o);},100);};YAHOO.util.Event.addListener(io,"load",uploadCallback);},abort:function(o,callback,isTimeout)
{var abortStatus;var args=(callback&&callback.argument)?callback.argument:null;if(o&&o.conn){if(this.isCallInProgress(o)){o.conn.abort();window.clearInterval(this._poll[o.tId]);delete this._poll[o.tId];if(isTimeout){window.clearTimeout(this._timeOut[o.tId]);delete this._timeOut[o.tId];}
abortStatus=true;}}
else if(o&&o.isUpload===true){var frameId='yuiIO'+o.tId;var io=document.getElementById(frameId);if(io){YAHOO.util.Event.removeListener(io,"load");document.body.removeChild(io);if(isTimeout){window.clearTimeout(this._timeOut[o.tId]);delete this._timeOut[o.tId];}
abortStatus=true;}}
else{abortStatus=false;}
if(abortStatus===true){this.abortEvent.fire(o,args);if(o.abortEvent){o.abortEvent.fire(o,args);}
this.handleTransactionResponse(o,callback,true);}
return abortStatus;},isCallInProgress:function(o)
{if(o&&o.conn){return o.conn.readyState!==4&&o.conn.readyState!==0;}
else if(o&&o.isUpload===true){var frameId='yuiIO'+o.tId;return document.getElementById(frameId)?true:false;}
else{return false;}},releaseObject:function(o)
{if(o&&o.conn){o.conn=null;o=null;}}};YAHOO.register("connection",YAHOO.util.Connect,{version:"2.7.0",build:"1799"});
function GameCore_Config(){this.config={};this.get=function(key){if(typeof this.config=='object'&&typeof this.config[key]!='undefined'){return this.config[key];}
return null;};this.set=function(key,value){this.config[key]=value;};}
function GameCore(){this.sizeOfObject=function(object){var length=0;for(var key in object){length++;}
return length;};this.mergeObject=function(object1,object2){for(var key in object2){object1[key]=object2[key];}
return object1;};this.arrayIntersectKey=function(array1,array2,ignoreValues){var retVal={'length':0,'elements':{}};if(typeof array1!='object'||typeof array2!='object'){return retVal;}
if(typeof ignoreValues!='object'){ignoreValues={};}
for(var key in array1){if(typeof array2[key]!='undefined'&&ignoreValues[array1[key]]!==true){retVal['length']++;retVal['elements'][key]=array1[key];}}
return retVal;};this.unsetArrayElementsByValue=function(array,value){var newArray=null;if(typeof array=='object'){newArray={};}else if(typeof array=='array'){newArray=[];}
for(var key in array){if(array[key]!=value){newArray[key]=array[key];}}
return newArray;};this.unsetArrayElementsByKey=function(array,searchKey){var newArray=null;if(typeof array=='object'){newArray={};}else if(typeof array=='array'){newArray=[];}
for(var key in array){if(key!=searchKey){newArray[key]=array[key];}}
return newArray;};this.Popup=function(url,width,height,specialAttributes){var popup=window.open(url,'POPUP','height='+height+', width='+width+', '+(specialAttributes?specialAttributes:'scrollbars=yes'));popup.focus();};this.DEBUG=function(debugSource,message,debugLevel){if(DEBUG&&DEBUG!==false&&console){if(!debugLevel){debugLevel=1;}
if(DEBUG>=debugLevel){console.group('DEBUG FROM "'+debugSource+'" WITH LEVEL '+debugLevel);if(typeof message=='string'){console.log(message);}else if(typeof message=='object'){for(var i=0;i<message.length;i++){console.log(message[i]);}}
console.groupEnd();}}};this.Rand=function(min,max){var argc=arguments.length;if(argc===0){min=0;max=2147483647;}else if(argc===1){throw'Warning: rand() expects exactly 2 parameters, 1 given';}
return Math.floor(Math.random()*(max-min+1))+min;};this.NumberFormat=function(number,decimals,dec_point,thousands_sep){var n=number,prec=decimals;var toFixedFix=function(n,prec){var k=Math.pow(10,prec);return(Math.round(n*k)/k).toString();};n=!isFinite(+n)?0:+n;prec=!isFinite(+prec)?0:Math.abs(prec);var sep=(typeof thousands_sep==='undefined')?(gettext&&gettext('THOUSANDS_SEPERATOR')!='THOUSANDS_SEPERATOR'?gettext('THOUSANDS_SEPERATOR'):','):thousands_sep;var dec=(typeof dec_point==='undefined')?(gettext&&gettext('DECIMAL_POINTDECIMAL_POINT')!='DECIMAL_POINT'?gettext('DECIMAL_POINT'):'.'):dec_point;var s=(prec>0)?toFixedFix(n,prec):toFixedFix(Math.round(n),prec);var abs=toFixedFix(Math.abs(n),prec);var _,i;if(abs>=1000){_=abs.split(/\D/);i=_[0].length%3||3;_[0]=s.slice(0,i+(n<0))+
_[0].slice(i).replace(/(\d{3})/g,sep+'$1');s=_.join(dec);}else{s=s.replace('.',dec);}
var decPos=s.indexOf(dec);if(prec>=1&&decPos!==-1&&(s.length-decPos-1)<prec){s+=new Array(prec-(s.length-decPos-1)).join(0)+'0';}
else if(prec>=1&&decPos===-1){s+=dec+new Array(prec).join(0)+'0';}
return s;};this.lcfirst=function(str){str+='';var f=str.charAt(0).toLowerCase();return f+str.substr(1);};this.ucfirst=function(str){str+='';var f=str.charAt(0).toUpperCase();return f+str.substr(1);};this.ArraySearch=function(needle,haystack,argStrict){var strict=!!argStrict;var key='';for(key in haystack){if((strict&&haystack[key]===needle)||(!strict&&haystack[key]==needle)){return key;}}
return false;};this.ArrayKeys=function(input,search_value,argStrict){var tmp_arr={},strict=!!argStrict,include=true,cnt=0;var key='';for(key in input){include=true;if(search_value!=undefined){if(strict&&input[key]!==search_value){include=false;}else if(input[key]!=search_value){include=false;}}
if(include){tmp_arr[cnt]=key;cnt++;}}
return tmp_arr;};this.setCookie=function(name,value,expires,path,domain,secure){return this.setRawCookie(name,encodeURIComponent(value),expires,path,domain,secure);};this.setRawCookie=function(name,value,expires,path,domain,secure){if(expires instanceof Date){expires=expires.toGMTString();}else if(typeof(expires)=='number'){expires=(new Date(+(new Date())+expires*1e3)).toGMTString();}
var r=[name+"="+value],s={},i='';s={expires:expires,path:path,domain:domain};for(i in s){s[i]&&r.push(i+"="+s[i]);}
return secure&&r.push("secure"),document.cookie=r.join(";"),true;};this.sprintf=function(){var regex=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuidfegEG])/g;var a=arguments,i=0,format=a[i++];var pad=function(str,len,chr,leftJustify){if(!chr){chr=' ';}
var padding=(str.length>=len)?'':Array(1+len-str.length>>>0).join(chr);return leftJustify?str+padding:padding+str;};var justify=function(value,prefix,leftJustify,minWidth,zeroPad,customPadChar){var diff=minWidth-value.length;if(diff>0){if(leftJustify||!zeroPad){value=pad(value,minWidth,customPadChar,leftJustify);}else{value=value.slice(0,prefix.length)+pad('',diff,'0',true)+value.slice(prefix.length);}}
return value;};var formatBaseX=function(value,base,prefix,leftJustify,minWidth,precision,zeroPad){var number=value>>>0;prefix=prefix&&number&&{'2':'0b','8':'0','16':'0x'}[base]||'';value=prefix+pad(number.toString(base),precision||0,'0',false);return justify(value,prefix,leftJustify,minWidth,zeroPad);};var formatString=function(value,leftJustify,minWidth,precision,zeroPad,customPadChar){if(precision!=null){value=value.slice(0,precision);}
return justify(value,'',leftJustify,minWidth,zeroPad,customPadChar);};var doFormat=function(substring,valueIndex,flags,minWidth,_,precision,type){var number;var prefix;var method;var textTransform;var value;if(substring=='%%'){return'%';}
var leftJustify=false,positivePrefix='',zeroPad=false,prefixBaseX=false,customPadChar=' ';var flagsl=flags.length;for(var j=0;flags&&j<flagsl;j++){switch(flags.charAt(j)){case' ':positivePrefix=' ';break;case'+':positivePrefix='+';break;case'-':leftJustify=true;break;case"'":customPadChar=flags.charAt(j+1);break;case'0':zeroPad=true;break;case'#':prefixBaseX=true;break;}}
if(!minWidth){minWidth=0;}else if(minWidth=='*'){minWidth=+a[i++];}else if(minWidth.charAt(0)=='*'){minWidth=+a[minWidth.slice(1,-1)];}else{minWidth=+minWidth;}
if(minWidth<0){minWidth=-minWidth;leftJustify=true;}
if(!isFinite(minWidth)){throw new Error('sprintf: (minimum-)width must be finite');}
if(!precision){precision='fFeE'.indexOf(type)>-1?6:(type=='d')?0:undefined;}else if(precision=='*'){precision=+a[i++];}else if(precision.charAt(0)=='*'){precision=+a[precision.slice(1,-1)];}else{precision=+precision;}
value=valueIndex?a[valueIndex.slice(0,-1)]:a[i++];switch(type){case's':return formatString(String(value),leftJustify,minWidth,precision,zeroPad,customPadChar);case'c':return formatString(String.fromCharCode(+value),leftJustify,minWidth,precision,zeroPad);case'b':return formatBaseX(value,2,prefixBaseX,leftJustify,minWidth,precision,zeroPad);case'o':return formatBaseX(value,8,prefixBaseX,leftJustify,minWidth,precision,zeroPad);case'x':return formatBaseX(value,16,prefixBaseX,leftJustify,minWidth,precision,zeroPad);case'X':return formatBaseX(value,16,prefixBaseX,leftJustify,minWidth,precision,zeroPad).toUpperCase();case'u':return formatBaseX(value,10,prefixBaseX,leftJustify,minWidth,precision,zeroPad);case'i':case'd':number=parseInt(+value,10);prefix=number<0?'-':positivePrefix;value=prefix+pad(String(Math.abs(number)),precision,'0',false);return justify(value,prefix,leftJustify,minWidth,zeroPad);case'e':case'E':case'f':case'F':case'g':case'G':number=+value;prefix=number<0?'-':positivePrefix;method=['toExponential','toFixed','toPrecision']['efg'.indexOf(type.toLowerCase())];textTransform=['toString','toUpperCase']['eEfFgG'.indexOf(type)%2];value=prefix+Math.abs(number)[method](precision);return justify(value,prefix,leftJustify,minWidth,zeroPad)[textTransform]();default:return substring;}};return format.replace(regex,doFormat);}
this.strToUpper=function(str){return(str+'').toUpperCase();};this.Date=function(format,timestamp){var that=this;var jsdate=((typeof(timestamp)=='undefined')?new Date():(typeof(timestamp)=='object')?new Date(timestamp):new Date(timestamp*1000));var _pad=function(n,c){if((n=n+"").length<c){return new Array(++c-n.length).join("0")+n;}else{return n;}};var _dst=function(t){var dst=0;var jan1=new Date(t.getFullYear(),0,1,0,0,0,0);var june1=new Date(t.getFullYear(),6,1,0,0,0,0);var temp=jan1.toUTCString();var jan2=new Date(temp.slice(0,temp.lastIndexOf(' ')-1));temp=june1.toUTCString();var june2=new Date(temp.slice(0,temp.lastIndexOf(' ')-1));var std_time_offset=(jan1-jan2)/(1000*60*60);var daylight_time_offset=(june1-june2)/(1000*60*60);if(std_time_offset===daylight_time_offset){dst=0;}else{var hemisphere=std_time_offset-daylight_time_offset;if(hemisphere>=0){std_time_offset=daylight_time_offset;}
dst=1;}
return dst;};var ret='';var txt_weekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var txt_ordin={1:"st",2:"nd",3:"rd",21:"st",22:"nd",23:"rd",31:"st"};var txt_months=["","January","February","March","April","May","June","July","August","September","October","November","December"];var f={d:function(){return _pad(f.j(),2);},D:function(){var t=f.l();return t.substr(0,3);},j:function(){return jsdate.getDate();},l:function(){return txt_weekdays[f.w()];},N:function(){return f.w()?f.w():7;},S:function(){return txt_ordin[f.j()]?txt_ordin[f.j()]:'th';},w:function(){return jsdate.getDay();},z:function(){return(jsdate-new Date(jsdate.getFullYear()+"/1/1"))/864e5>>0;},W:function(){var a=f.z(),b=364+f.L()-a;var nd2,nd=(new Date(jsdate.getFullYear()+"/1/1").getDay()||7)-1;if(b<=2&&((jsdate.getDay()||7)-1)<=2-b){return 1;}
if(a<=2&&nd>=4&&a>=(6-nd)){nd2=new Date(jsdate.getFullYear()-1+"/12/31");return that.date("W",Math.round(nd2.getTime()/1000));}
var w=(1+(nd<=3?((a+nd)/7):(a-(7-nd))/7)>>0);return(w?w:53);},F:function(){return txt_months[f.n()];},m:function(){return _pad(f.n(),2);},M:function(){var t=f.F();return t.substr(0,3);},n:function(){return jsdate.getMonth()+1;},t:function(){return(new Date((f.n()+1)+'/0/'+f.Y())).getDate();},L:function(){var y=f.Y();return(!(y&3)&&(y%1e2||!(y%4e2)))?1:0;},o:function(){if(f.n()===12&&f.W()===1){return jsdate.getFullYear()+1;}
if(f.n()===1&&f.W()>=52){return jsdate.getFullYear()-1;}
return jsdate.getFullYear();},Y:function(){return jsdate.getFullYear();},y:function(){return(jsdate.getFullYear()+"").slice(2);},a:function(){return jsdate.getHours()>11?"pm":"am";},A:function(){return f.a().toUpperCase();},B:function(){return _pad(Math.floor(((jsdate.getUTCHours()*36e2)+(jsdate.getUTCMinutes()*60)+jsdate.getUTCSeconds()+36e2)/86.4)%1e3,3);},g:function(){return jsdate.getHours()%12||12;},G:function(){return jsdate.getHours();},h:function(){return _pad(f.g(),2);},H:function(){return _pad(jsdate.getHours(),2);},i:function(){return _pad(jsdate.getMinutes(),2);},s:function(){return _pad(jsdate.getSeconds(),2);},u:function(){return _pad(jsdate.getMilliseconds()*1000,6);},e:function(){return'UTC';},I:function(){return _dst(jsdate);},O:function(){var t=_pad(Math.abs(jsdate.getTimezoneOffset()/60*100),4);t=(jsdate.getTimezoneOffset()>0)?"-"+t:"+"+t;return t;},P:function(){var O=f.O();return(O.substr(0,3)+":"+O.substr(3,2));},T:function(){return'UTC';},Z:function(){return-jsdate.getTimezoneOffset()*60;},c:function(){return f.Y()+"-"+f.m()+"-"+f.d()+"T"+f.h()+":"+f.i()+":"+f.s()+f.P();},r:function(){return f.D()+', '+f.d()+' '+f.M()+' '+f.Y()+' '+f.H()+':'+f.i()+':'+f.s()+' '+f.O();},U:function(){return Math.round(jsdate.getTime()/1000);}};return format.replace(/[\\]?([a-zA-Z])/g,function(t,s){if(t!=s){ret=s;}else if(f[s]){ret=f[s]();}else{ret=s;}
return ret;});};this.get_html_translation_table=function(table,quote_style){var entities={},hash_map={},decimal=0,symbol='';var constMappingTable={},constMappingQuoteStyle={};var useTable={},useQuoteStyle={};constMappingTable[0]='HTML_SPECIALCHARS';constMappingTable[1]='HTML_ENTITIES';constMappingQuoteStyle[0]='ENT_NOQUOTES';constMappingQuoteStyle[2]='ENT_COMPAT';constMappingQuoteStyle[3]='ENT_QUOTES';useTable=!isNaN(table)?constMappingTable[table]:table?table.toUpperCase():'HTML_SPECIALCHARS';useQuoteStyle=!isNaN(quote_style)?constMappingQuoteStyle[quote_style]:quote_style?quote_style.toUpperCase():'ENT_COMPAT';if(useTable!=='HTML_SPECIALCHARS'&&useTable!=='HTML_ENTITIES'){throw new Error("Table: "+useTable+' not supported');}
entities['38']='&amp;';if(useTable==='HTML_ENTITIES'){entities['160']='&nbsp;';entities['161']='&iexcl;';entities['162']='&cent;';entities['163']='&pound;';entities['164']='&curren;';entities['165']='&yen;';entities['166']='&brvbar;';entities['167']='&sect;';entities['168']='&uml;';entities['169']='&copy;';entities['170']='&ordf;';entities['171']='&laquo;';entities['172']='&not;';entities['173']='&shy;';entities['174']='&reg;';entities['175']='&macr;';entities['176']='&deg;';entities['177']='&plusmn;';entities['178']='&sup2;';entities['179']='&sup3;';entities['180']='&acute;';entities['181']='&micro;';entities['182']='&para;';entities['183']='&middot;';entities['184']='&cedil;';entities['185']='&sup1;';entities['186']='&ordm;';entities['187']='&raquo;';entities['188']='&frac14;';entities['189']='&frac12;';entities['190']='&frac34;';entities['191']='&iquest;';entities['192']='&Agrave;';entities['193']='&Aacute;';entities['194']='&Acirc;';entities['195']='&Atilde;';entities['196']='&Auml;';entities['197']='&Aring;';entities['198']='&AElig;';entities['199']='&Ccedil;';entities['200']='&Egrave;';entities['201']='&Eacute;';entities['202']='&Ecirc;';entities['203']='&Euml;';entities['204']='&Igrave;';entities['205']='&Iacute;';entities['206']='&Icirc;';entities['207']='&Iuml;';entities['208']='&ETH;';entities['209']='&Ntilde;';entities['210']='&Ograve;';entities['211']='&Oacute;';entities['212']='&Ocirc;';entities['213']='&Otilde;';entities['214']='&Ouml;';entities['215']='&times;';entities['216']='&Oslash;';entities['217']='&Ugrave;';entities['218']='&Uacute;';entities['219']='&Ucirc;';entities['220']='&Uuml;';entities['221']='&Yacute;';entities['222']='&THORN;';entities['223']='&szlig;';entities['224']='&agrave;';entities['225']='&aacute;';entities['226']='&acirc;';entities['227']='&atilde;';entities['228']='&auml;';entities['229']='&aring;';entities['230']='&aelig;';entities['231']='&ccedil;';entities['232']='&egrave;';entities['233']='&eacute;';entities['234']='&ecirc;';entities['235']='&euml;';entities['236']='&igrave;';entities['237']='&iacute;';entities['238']='&icirc;';entities['239']='&iuml;';entities['240']='&eth;';entities['241']='&ntilde;';entities['242']='&ograve;';entities['243']='&oacute;';entities['244']='&ocirc;';entities['245']='&otilde;';entities['246']='&ouml;';entities['247']='&divide;';entities['248']='&oslash;';entities['249']='&ugrave;';entities['250']='&uacute;';entities['251']='&ucirc;';entities['252']='&uuml;';entities['253']='&yacute;';entities['254']='&thorn;';entities['255']='&yuml;';}
if(useQuoteStyle!=='ENT_NOQUOTES'){entities['34']='&quot;';}
if(useQuoteStyle==='ENT_QUOTES'){entities['39']='&#39;';}
entities['60']='&lt;';entities['62']='&gt;';for(decimal in entities){symbol=String.fromCharCode(decimal);hash_map[symbol]=entities[decimal];}
return hash_map;};this.htmlentities=function(string,quote_style){var hash_map={},symbol='',tmp_str='',entity='';tmp_str=string.toString();if(false===(hash_map=this.get_html_translation_table('HTML_ENTITIES',quote_style))){return false;}
hash_map["'"]='&#039;';for(symbol in hash_map){entity=hash_map[symbol];tmp_str=tmp_str.split(symbol).join(entity);}
return tmp_str;};this.bbcode=function(S){if(S.indexOf('[')<0)return S;function X(p,f){return new RegExp(p,f)}
function D(s){return rD.exec(s)}
function R(s){return s.replace(rB,P)}
function A(s,p){for(var i in p)s=s.replace(X(i,'gi'),p[i]);return s;}
function P($0,$1,$2,$3){if($3&&$3.indexOf('[')>-1)$3=R($3);switch($1){case'left':case'right':case'center':case'justify':return'<div style="text-align: '+$1+'">'+$3+'</div>';case'b':case'i':case'u':case's':case'sup':case'sub':return'<'+$1+'>'+$3+'</'+$1+'>';case'acronym':case'abbr':return'<'+$1+' title="'+$2+'">'+$3+'</'+$1+'>';}
return'['+$1+($2?'='+$2:'')+']'+$3+'[/'+$1+']';}
var rB=X('\\[([a-z][a-z0-9]*)(?:=([^\\]]+))?]((?:.|[\r\n])*?)\\[/\\1]','gi'),rD=X('^(\\d+)x(\\d+)$');var L={url:'href="','anchor':'name="',email:'href="mailto: '};var G={google:'http://www.google.com/search?q=',wikipedia:'http://www.wikipedia.org/wiki/'};var Y={youtube:'http://www.youtube.com/v/',flash:''};var T={row:'tr',r:'tr',header:'th',head:'th',h:'th',col:'td',c:'td'};var F={font:'font-family:$1',size:'font-size:$1px',color:'color:$1'};var U={c:'circle',d:'disc',s:'square','1':'decimal',a:'lower-alpha',A:'upper-alpha',i:'lower-roman',I:'upper-roman'};var I={},B={};for(var i in F){B['\\['+i+'=([^\\]]+)]']='<span style="'+F[i]+'">';B['\\[/'+i+']']='</span>';}
B['\\[list]']='<ul>';B['\\[list=(\\w)]']=function($0,$1){return'<ul style="list-style-type: '+(U[$1]||'disc')+'">'};B['\\[/list]']='</ul>';B['\\[\\*]']='<li>';B['\\[quote(?:=([^\\]]+))?]']=function($0,$1){return'<div class="bb-quote">'+($1?$1+' wrote':'Quote')+':<blockquote>'};B['\\[/quote]']='</blockquote></div>';B['\\[(hr|br)]']='<$1 />';B['\\[sp]']='&nbsp;';return R(A(A(S,I),B));};this.trim=function(str,charlist){var whitespace,l=0,i=0;str+='';if(!charlist){whitespace=" \n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000";}else{charlist+='';whitespace=charlist.replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g,'$1');}
l=str.length;for(i=0;i<l;i++){if(whitespace.indexOf(str.charAt(i))===-1){str=str.substring(i);break;}}
l=str.length;for(i=l-1;i>=0;i--){if(whitespace.indexOf(str.charAt(i))===-1){str=str.substring(0,i+1);break;}}
return whitespace.indexOf(str.charAt(0))===-1?str:'';};if(typeof GameCore_Config=='function'){this.Config=new GameCore_Config();};}
GameCore=new GameCore();
function GameCore_Math(){this.Gauss=function(base,value,expFactor){if(typeof expFactor=='undefined'){expFactor=1;}
expFactor*=-1;var ret=Math.pow(2/Math.PI,base*Math.exp(expFactor*value*value));return ret;};this.decbin=function(number){if(number<0){number=0xFFFFFFFF+number+1;}
return parseInt(number,10).toString(2);};}
GameCore.Math=new GameCore_Math();
function GameCore_Dom(){this.updateLayerPositionByAddition=function(layerId,pixel){var layer=$(layerId);if(layer){var attributes=['left','top','opacity','fontSize','backgroundPosition'];var style={};var positions={};for(var i=0;i<attributes.length;i++){if(typeof pixel[attributes[i]]=='number'){if(attributes[i]=='opacity'){positions[attributes[i]]=(1*layer.getStyle(attributes[i]))+(1*pixel[attributes[i]]);}else{positions[attributes[i]]=(parseInt(layer.getStyle(attributes[i]))+pixel[attributes[i]]);}
switch(attributes[i]){case'fontSize':case'left':case'top':positions[attributes[i]]+='px';break;};}else if(typeof pixel[attributes[i]]=='object'){switch(attributes[i]){case'backgroundPosition':if(!pixel[attributes[i]].left){pixel[attributes[i]].left=0;}
if(!pixel[attributes[i]].top){pixel[attributes[i]].top=0;}
try{var currentBackgroundPosition=layer.getStyle('backgroundPosition');if(!currentBackgroundPosition){currentBackgroundPosition=this.getStylesheetByStyleClass(layer.className).style.backgroundPosition;}
currentBackgroundPosition=currentBackgroundPosition.split(' ');positions['backgroundPosition']=(parseInt(currentBackgroundPosition[0])+pixel[attributes[i]].left)+'px '+(parseInt(currentBackgroundPosition[1])+pixel[attributes[i]].top+'px');}catch(e){document.open();document.write('GameCore.Dom.updateLayerPositionByAddition() javascript error: '+e.message+' ('+e.toString()+')'+'<br/>');document.write('----<br/>');document.write('layer id: '+layerId+'<br/>');document.write('layer: '+layer.getStyle('backgroundPosition')+'<br/>');document.write('layer.style: '+layer.style+'<br/>');document.write('iterating throug layer.style:<br/>');for(var key in layer.style){document.write(key+': '+layer[key]);}
document.close();}
break;}}}
layer.setStyle(positions);}else{document.open();document.write('LAYER NOT FOUND: '+layerId);document.close();}
delete layer;delete attributes;delete style;return positions;};this.getStylesheetByStyleClass=function(styleClass,checkExactly){if(checkExactly=='undefined')checkExactly=true;try{if(document.styleSheets){for(var i=0;i<document.styleSheets.length;i++){var stylesheets=document.styleSheets[i];if(stylesheets){var rules=(stylesheets.cssRules?stylesheets.cssRules:stylesheets.rules);for(var a=0;a<rules.length;a++){var stylesheet=rules[a];if(stylesheet&&stylesheet.selectorText&&stylesheet.selectorText.indexOf&&stylesheet.selectorText.indexOf(styleClass)!=-1){if(((stylesheet.selectorText.indexOf(styleClass+',')!=-1||stylesheet.selectorText.indexOf(styleClass+' ')!=-1||stylesheet.selectorText.indexOf(styleClass+'{')!=-1||(stylesheet.selectorText.indexOf(styleClass)!=-1&&stylesheet.selectorText.indexOf(styleClass)+styleClass.length==stylesheet.selectorText.length))&&(checkExactly===false||stylesheet.selectorText.indexOf('.'+styleClass)!=-1||stylesheet.selectorText.indexOf('#'+styleClass)!=-1||stylesheet.selectorText.indexOf(' '+styleClass)!=-1))){return stylesheet;}}}}}}}catch(ex){console.log('exception, styleClass: '+styleClass+': ');console.log(ex);}
return null;};this.parseEvent=function(event,tillDomId){if(!event&&window.event){event=window.event;}
if(event){if(!event.layerX&&event.offsetX)event.layerX=event.offsetX;if(!event.layerY&&event.offsetY)event.layerY=event.offsetY;if(!event.target)event.target=event.srcElement;if(YAHOO.env.ua.ie>=6&&event.target){}
event.requestedLayerX=event.layerX;event.requestedLayerY=event.layerY;var tillDomElement=null;if(event.target&&tillDomId&&(tillDomElement=$(tillDomId))&&event.target.id!=tillDomId){var target=event.target;while(target&&target.id!=tillDomElement.id){if(target.style){event.requestedLayerX+=parseInt(target.style.left);event.requestedLayerY+=parseInt(target.style.top);}
target=target.parentNode;}
if(target&&target.id==tillDomElement.id){event.requestedLayerId=tillDomElement.id;event.requestedLayerFound=true;}else{event.requestedLayerFound=false;}}else if(tillDomId&&(event&&event.target&&event.target.id==tillDomId)){event.requestedLayerFound=true;}}
return event;};this.Builder={NODEMAP:{AREA:'map',CAPTION:'table',COL:'table',COLGROUP:'table',LEGEND:'fieldset',OPTGROUP:'select',OPTION:'select',PARAM:'object',TBODY:'table',TD:'table',TFOOT:'table',TH:'table',THEAD:'table',TR:'table'},node:function(elementName){elementName=elementName.toUpperCase();var parentTag=this.NODEMAP[elementName]||'div';var parentElement=document.createElement(parentTag);try{parentElement.innerHTML="<"+elementName+"></"+elementName+">";}catch(e){}
var element=parentElement.firstChild||null;if(element&&(element.tagName.toUpperCase()!=elementName))
element=element.getElementsByTagName(elementName)[0];if(!element)element=document.createElement(elementName);if(!element)return;if(arguments[1])
if(this._isStringOrNumber(arguments[1])||(arguments[1]instanceof Array)||arguments[1].tagName){this._children(element,arguments[1]);}else{var attrs=this._attributes(arguments[1]);if(attrs.length){try{parentElement.innerHTML="<"+elementName+" "+
attrs+"></"+elementName+">";}catch(e){}
element=parentElement.firstChild||null;if(!element){element=document.createElement(elementName);for(attr in arguments[1])
element[attr=='class'?'className':attr]=arguments[1][attr];}
if(element.tagName.toUpperCase()!=elementName)
element=parentElement.getElementsByTagName(elementName)[0];}}
if(arguments[2])
this._children(element,arguments[2]);return $(element);},_text:function(text){return document.createTextNode(text);},ATTR_MAP:{'className':'class','htmlFor':'for'},_attributes:function(attributes){var attrs=[];for(attribute in attributes)
attrs.push((attribute in this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+'="'+attributes[attribute].toString().replace(/"/,'&quot;')+'"');return attrs.join(" ");},_children:function(element,children){if(children.tagName){element.appendChild(children);return;}
if(typeof children=='object'){children.flatten().each(function(e){if(typeof e=='object')
element.appendChild(e);else
if(Builder._isStringOrNumber(e))
element.appendChild(Builder._text(e));});}else
if(Builder._isStringOrNumber(children))
element.appendChild(Builder._text(children));},_isStringOrNumber:function(param){return(typeof param=='string'||typeof param=='number');},build:function(html){var element=this.node('div');$(element).update(html.strip());return element.down();},dump:function(scope){if(typeof scope!='object'&&typeof scope!='function')scope=window;var tags=("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY "+"BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET "+"FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+"KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+"PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+"TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);tags.each(function(tag){scope[tag]=function(){return Builder.node.apply(Builder,[tag].concat($A(arguments)));};});}};};GameCore.Dom=new GameCore_Dom();
function __Router(routerType,qualifiedLinkPrefix,routeStartPath,defaultParameters,currentPath,seperator){this.qualifiedLinkPrefix=qualifiedLinkPrefix;this.currentPath=currentPath;this.routeStartPath=routeStartPath;this.defaultParameters=defaultParameters;this.seperator=seperator;if(GameCore&&GameCore.Config){GameCore.Config.set('Router',{'type':routerType,'qualifiedLinkPrefix':qualifiedLinkPrefix,'routeStartPath':routeStartPath,'defaultParameters':defaultParameters});}
this.link=function(path,args){return this.getLink(path,args);};this.linkWithDomain=function(path,args){return this.qualifiedLinkPrefix+this.link(path,args);};};
function Router_Simple(qualifiedLinkPrefix,routeStartPath,defaultParameters,currentPath,seperator){this.constructor('Router_Simple',qualifiedLinkPrefix,routeStartPath,defaultParameters,currentPath,seperator);this.getLink=function(path,arguments){var pathArray=path.split(/::/);var route=pathArray.join(this.seperator);route=this.routeStartPath+'route='+route;if(GameCore.sizeOfObject(arguments)>0||GameCore.sizeOfObject(this.defaultParameters)>0){if(this.defaultParameters){arguments=GameCore.mergeObject(this.defaultParameters,arguments);}
route+='&';for(var key in arguments){route+=encodeURI(key+'='+arguments[key]+'&');}
route=route.substr(0,route.length-1);}
return route;};};Router_Simple.prototype=new __Router();
function Router_TidyURL(qualifiedLinkPrefix,routeStartPath,defaultParameters,currentPath,seperator){this.constructor('Router_TidyURL',qualifiedLinkPrefix,routeStartPath,defaultParameters,currentPath,seperator);this.getLink=function(path,arguments){var pathArray=path.split(/::/);var route=pathArray.join('/');route=this.routeStartPath+route+'/';if(GameCore.sizeOfObject(arguments)>0||GameCore.sizeOfObject(this.defaultParameters)>0){if(this.defaultParameters){arguments=GameCore.mergeObject(this.defaultParameters,arguments);}
route+='?';for(var key in arguments){route+=encodeURI(key+'='+arguments[key]+'&');}
route=route.substr(0,route.length-1);}
return route;};};Router_TidyURL.prototype=new __Router();
var __i18nMessageData={"javascript":{"":{"Project-Id-Version":"$Id: javascript.po 3503 2010-07-19 14:40:57Z degola $","Report-Msgid-Bugs-To":"Sebastian Lagemann <sebastian.lagemann@mediatainment.de>","POT-Creation-Date":"2008-12-15 17:39+0100","PO-Revision-Date":"$LastChangedDate: 2010-07-19 16:40:57 +0200 (Mon, 19 Jul 2010) $","Last-Translator":"$LastChangedBy: degola $","Language-Team":"de_DE <LL@li.org>","MIME-Version":"1.0","Content-Type":"text\/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Plural-Forms":"nplurals=3; plural=(n==0 ? 0 : (n==1?1:2));"},"msgid":[null,"msgstr"],"DECIMAL_POINT":[null,","],"THOUSANDS_SEPERATOR":[null,"."],"CHARACTER_XP":[null,"Erfahrung"],"LABEL_IS_IN_INVENTORY":[null,"angelegt"],"LABEL_CHARACTER_SIGNATURE_1":[null,"Signatur 1"],"LABEL_CHARACTER_SIGNATURE_2":[null,"Signatur 2"],"LABEL_IS_SPECIAL_BALANCING_FREE_UPDATE":[null,"Kostenlos"],"LABEL_IS_CRAFTED":[null,"aufgewertet"],"LABEL_IS_QUEST_ITEM":[null,"Quest Item"],"LABEL_LEVEL":[null,"Level"],"LABEL_GOLD":[null,"Dinare"],"LABEL_HEALTH_REGENERATION":[null,"Regeneration pro Stunde"],"LABEL_NEXT_EXPEDITION_POINT":[null,"N\u00e4chster Expeditionspunkt in %1$s"],"GOLD_ITEM":["GOLD_ITEM_PLURAL","Dinare","Dinar","Dinare"],"SIZE0":[null,"Sehr wenig"],"SIZE1":[null,"Ein bisschen"],"SIZE2":[null,"Viel"],"SIZE3":[null,"Unermesslich viel"],"LABEL_HEAVYATTACK":[null,"Schwerer Treffer"],"LABEL_CRITICALATTACK":[null,"Kritischer Treffer"],"LABEL_NORMALATTACK":[null,"Treffer"],"LABEL_LIGHTATTACK":[null,"Leichter Treffer"],"LABEL_LUCKYATTACK":[null,"Gl\u00fcckstreffer"],"LABEL_FAILED":[null,"Verfehlt"],"LABEL_DEFEND":[null,"Pariert"],"LABEL_BLOCK":[null,"Geblockt"],"LABEL_PREMIUM_CREDITS":[null,"Saphire"],"LABEL_ARMOR":[null,"R\u00fcstung"],"LABEL_DAMAGE":[null,"Schaden"],"LABEL_STRENGTH":[null,"St\u00e4rke"],"LABEL_ENDURANCE":[null,"Ausdauer"],"LABEL_ABILITY":[null,"Geschick"],"LABEL_CHARISMA":[null,"Charisma"],"LABEL_FOOD_HEALTH_VALUE":[null,"Heilung"],"LABEL_HEALTH_POINTS":[null,"Lebenspunkte"],"LABEL_TOOLTIP_CRAFTING_AFFECT":[null,"durch Crafting\/\/\/DELETE_ME???"],"LABEL_COUNTDOWN_DAYS_SINGULAR":["LABEL_COUNTDOWN_DAYS_PLURAL","keinen Tag","%1$s Tag","%1$s Tage"],"LABEL_COUNTDOWN_HOURS_SINGULAR":["LABEL_COUNTDOWN_HOURS_PLURAL","keine Stunde","%1$s Stunde","%1$s Stunden"],"LABEL_COUNTDOWN_MINUTES_SINGULAR":["LABEL_COUNTDOWN_MINUTES_PLURAL","keine Min,","%1$s Min,","%1$s Min, "],"LABEL_COUNTDOWN_MINUTES_ONLY_SINGULAR":["LABEL_COUNTDOWN_MINUTES_ONLY_PLURAL","0 Minuten","%1$s Minute","%1$s Minuten"],"LABEL_COUNTDOWN_MINUTES_WITHOUT_APPENDIX_SINGULAR":["LABEL_COUNTDOWN_MINUTES_WITHOUT_APPENDIX_PLURAL","keine Min.","%1$s Minute","%1$s Min."],"LABEL_COUNTDOWN_SECONDS_SINGULAR":["LABEL_COUNTDOWN_SECONDS_PLURAL","0 Sek.","%1$s Sek.","%1$s Sek."],"LABEL_CHARACTER_CRAFTING_EFFECT_DURATION":[null,"Gegenstand wirkt %1$s"],"LABEL_CHARACTER_CRAFTING_COUNTDOWN":[null,"Gegenstand wirkt noch %1$s"],"LABEL_HEALTH_TOOLTIP_MAX":[null,"Es handelt sich bei den angegebenen Werten um die Anzahl der maximal zu erreichenden Lebenspunkte. Die zur Verf\u00fcgung stehenden Lebenspunkte regenerieren sich automatisch."],"LABEL_ITEMS_REACHED_MAXIMUM_POSSIBLE_SKILL_VALUE":[null,"Die Boni der angelegten Gegenst\u00e4nde \u00fcberschreiten den maximal zul\u00e4ssigen Wert f\u00fcr die Eigenschaft. Trainiere die Eigenschaft um mehr Boni von den Gegenst\u00e4nden in Anspruch nehmen zu k\u00f6nnen."],"LABEL_ACHIEVEMENT_RANKING_REACHED_FIRST":[null,"Als erstes: %1$s"],"LABEL_ACHIEVEMENT_RANKING_REACHED_LAST":[null,"Als letztes: %1$s (vor %2$s)"],"LABEL_ACHIEVEMENT_RANKING_REACHED_FASTEST":[null,"Als schnellster: %1$s (%2$s)"],"LABEL_ACHIEVEMENT_RANKING_NOT_REACHED":[null,"Bisher von keinem erreicht."],"LABEL_SKILL_VALUE_TRAINING":[null,"Durch Training"],"LABEL_SKILL_VALUE_ITEMS":[null,"Durch Gegenst\u00e4nde"],"LABEL_SKILL_VALUE_SKILLS":[null,"Durch Attribute"],"ACHIEVEMENT_SHOP_ITEMS_PURCHASED":[null,"Gekaufte Items"],"ACHIEVEMENT_SHOP_ITEMS_SOLD":[null,"Verkaufte Items"],"ACHIEVEMENT_GOLD_FOR_ITEM_PURCHASES":[null,"Dinare f\u00fcr gekaufte Items"],"ACHIEVEMENT_GOLD_FOR_ITEM_SALES":[null,"Dinare f\u00fcr verkaufte Items"],"ACHIEVEMENT_GOLD_FOR_TRAINING_STRENGTH":[null,"Dinare f\u00fcr St\u00e4rke"],"ACHIEVEMENT_GOLD_FOR_TRAINING_ABILITY":[null,"Dinare f\u00fcr Geschick"],"ACHIEVEMENT_GOLD_FOR_TRAINING_ENDURANCE":[null,"Dinare f\u00fcr Ausdauer"],"ACHIEVEMENT_GOLD_FOR_TRAINING_CHARISMA":[null,"Dinare f\u00fcr Charisma"],"ACHIEVEMENT_ITEM_FOOD_BOUGHT":[null,"Gekauftes Essen"],"ACHIEVEMENT_ALLIANCE_GOLD_SPENT":[null,"Gespendete Dinare an die Gilde"],"ACHIEVEMENT_ARENA_JACKPOT_WON":[null,"Sieger beim Arena Jackpot"],"ACHIEVEMENT_ARENA_JACKPOT_GOLD_AMOUNT":[null,"Gold aus Arena-Jackpot gewonnen"],"ACHIEVEMENT_FIGHTS_NPC_WON":[null,"Besiegte Gegner insgesamt"],"ACHIEVEMENT_FIGHTS_WON_ARENA":[null,"Siege in der Arena"],"ACHIEVEMENT_FIGHTS_WON_ARENA_IN_ROW":[null,"Siege ohne Niederlage in der Arena"],"ACHIEVEMENT_FIGHTS_WON_AREA_PALACE_GARDEN":[null,"Besiegte Gegner im Palastgarten"],"ACHIEVEMENT_FIGHTS_WON_AREA_BEDOUIN_CAMP":[null,"Besiegte Gegner im Beduinenlager"],"ACHIEVEMENT_FIGHTS_WON_AREA_HARBOR":[null,"Besiegte Gegner im Hafen"],"ACHIEVEMENT_FIGHTS_WON_AREA_TEMPLE_DISTRICT":[null,"Besiegte Gegner im Tempelbezirk"],"ACHIEVEMENT_FIGHTS_WON_AREA_RUINS_OF_MALAKEI":[null,"Besiegte Gegner in den Ruinen"],"ACHIEVEMENT_FIGHTS_WON_AREA_VILLAGE_KABUZIM":[null,"Besiegte Gegner im Dorf Kabuzim"],"ACHIEVEMENT_FIGHTS_WON_AREA_BURROW_OF_GUMBAR":[null,"Besiegte Gegner in den H\u00f6hlen Gumbars"],"ACHIEVEMENT_FIGHTS_WON_AREA_OASIS_OF_SOUTH_WIND":[null,"Besiegte Gegner in der Oase"],"ACHIEVEMENT_FIGHTS_WON_AREA_GATE_OF_THE_WEST":[null,"Besiegte Gegner am Tor des Westens"],"ACHIEVEMENT_FIGHTS_WON_AREA_MOUNTAINS_OF_NORTHERN_LIGHTS":[null,"Besiegte Gegner in den Bergen des Nordlichts"],"ACHIEVEMENT_FIGHTS_WON_AREA_ROCKY_DESERT":[null,"Besiegte Gegner in der Steinw\u00fcste"],"ACHIEVEMENT_FIGHTS_TOTAL_AREA_PALACE_GARDEN":[null,"Expeditionen im Palastgarten"],"ACHIEVEMENT_FIGHTS_TOTAL_AREA_BEDOUIN_CAMP":[null,"Expeditionen im Beduinenlager"],"ACHIEVEMENT_FIGHTS_TOTAL_AREA_HARBOR":[null,"Expeditionen im Hafen"],"ACHIEVEMENT_FIGHTS_TOTAL_AREA_TEMPLE_DISTRICT":[null,"Expeditionen im Tempelbezirk"],"ACHIEVEMENT_FIGHTS_TOTAL_AREA_RUINS_OF_MALAKEI":[null,"Expeditionen in den Ruinen"],"ACHIEVEMENT_FIGHTS_TOTAL_AREA_VILLAGE_KABUZIM":[null,"Expeditionen im Dorf Kabuzim"],"ACHIEVEMENT_FIGHTS_TOTAL_AREA_BURROW_OF_GUMBAR":[null,"Expeditionen in den H\u00f6hlen Gumbars"],"ACHIEVEMENT_FIGHTS_TOTAL_AREA_OASIS_OF_SOUTH_WIND":[null,"Expeditionen in der Oase"],"ACHIEVEMENT_FIGHTS_TOTAL_AREA_GATE_OF_THE_WEST":[null,"Expeditionen am Tor des Westens"],"ACHIEVEMENT_FIGHTS_TOTAL_AREA_MOUNTAINS_OF_NORTHERN_LIGHTS":[null,"Expeditionen in den Bergen des Nordlichts"],"ACHIEVEMENT_FIGHTS_TOTAL_AREA_ROCKY_DESERT":[null,"Expeditionen in der Steinw\u00fcste"],"ACHIEVEMENT_BOSSFIGHTS_WON":[null,"Besiegte Boss Gegner"],"ACHIEVEMENT_BOSSFIGHTS_WON_BEL_HASSAR":[null,"Besiegter Bel Hassar"],"ACHIEVEMENT_BOSSFIGHTS_WON_GOLEM":[null,"Besiegter steinerner W\u00e4chter"],"ACHIEVEMENT_BOSSFIGHTS_WON_DEMON_DORKAN":[null,"Besiegter Unhold Dorkan"],"ACHIEVEMENT_BOSSFIGHTS_WON_NAGA":[null,"Besiegte Naga"],"ACHIEVEMENT_BOSSFIGHTS_WON_DEMON":[null,"Besiegte D\u00e4monen"],"ACHIEVEMENT_BOSSFIGHTS_WON_VIZIER_OF_MAKTULLAR":[null,"Besiegte Wesir Maktullars"],"ACHIEVEMENT_BOSSFIGHTS_WON_EFREET_OF_THE_SOUTH":[null,"Besiegte Efreets des S\u00fcdwindes"],"ACHIEVEMENT_BOSSFIGHTS_WON_SPIRIT_OF_DOORS":[null,"Besiegte Geister der Tore"],"ACHIEVEMENT_BOSSFIGHTS_WON_DJINN_OF_THE_NORTH_STAR":[null,"Besiegte Dschinni des Nordsterns"],"ACHIEVEMENT_BOSSFIGHTS_WON_GOLEM_OF_THE_EAST":[null,"Besiegte Steinriesen des Ostens"],"ACHIEVEMENT_BOSSFIGHTS_WON_SUKKUBI":[null,"Besiegte Sukkubis"],"LABEL_ACHIEVEMENT_VALUE_REACHED_SINCE":[null,"Du hast diese Stufe erreicht am %1$s um %2$s."],"LABEL_ACHIEVEMENT_VALUE_REQUIRED_THIS_LEVEL":[null,"Ben\u00f6tigt f\u00fcr diese Stufe: %2$s"],"LABEL_ACHIEVEMENT_VALUE_NOT_REACHED":[null,"Du hast diese Stufe bisher noch nicht erreicht."],"LABEL_ACHIEVEMENT_CURRENT_VALUE":[null,"Du hast bereits: %2$s"],"LABEL_GOTO_PALACE":[null,"Zum Palast..."],"LABEL_CLOSE":[null,"schliessen"],"DATE_FORMAT_YEAR_MONTH_DAY":[null,"d.m.Y"],"TITLE_NOT_ENOUGH_GOLD":[null,"Dinare nicht ausreichend"],"DIALOG_MESSAGE_NOT_ENOUGH_GOLD_BUY_ITEM":[null,"Du hast leider zu wenig Dinare um das gew\u00fcnschte Item zu kaufen.\\n\\nGehe Arbeiten oder auf eine Expedition um dir mehr Dinare zu verdienen."],"TITLE_NOT_ENOUGH_PREMIUM_CREDITS":[null,"Saphire nicht ausreichend"],"DIALOG_MESSAGE_NOT_ENOUGH_PREMIUM_CREDITS_BUY_ITEM":[null,"Du hast leider nicht gen\u00fcgend Saphire um das gew\u00fcnschte Item zu kaufen.\\n\\nGehe jetzt zum Palast und lade weitere Saphire auf."],"DIALOG_MESSAGE_NOT_ENOUGH_PREMIUM_CREDITS_RESET_FIGHT_BLOCKTIME":[null,"Du hast leider nicht gen\u00fcgend Saphire um die Zeit zu verk\u00fcrzen.\\n\\nGehe jetzt zum Palast und lade weitere Saphire auf."],"DIALOG_MESSAGE_SENT_FAILED_TITLE":[null,"Nachrichtenversand fehlgeschlagen"],"DIALOG_MESSAGE_SENT_FAILED_MESSAGE":[null,"Die Nachricht konnte leider nicht verschickt werden.\\n\\nBitte behebe folgende Fehler:\\n\\n%1$s"],"LABEL_FLASH_MESSAGE_NOTICE":[null,"Hinweis"],"LABEL_CHALLENGE":[null,"Herausfordern"],"ARENA_START_FIGHT_BUTTON":[null,"Kampf starten"],"ARENA_WIN_BONUS":[null,"Siegpr\u00e4mie"],"ARENA_WIN_BONUS_DESCRIPTION":[null,"Um die Siegpr\u00e4mie zu erhalten, mu\u00dft du gegen diesen Spieler gewinnen, darfst aber nicht mehr als 4 Pl\u00e4tze unter dem Besiegten sein!"],"LABEL_WRITE_MESSAGE":[null,"Nachricht schreiben"],"ALLIANCE_APPLY_BUTTON":[null,"bewerben"],"LABEL_AREA_AVAILABLE":[null,"Gebiet kann betreten werden."],"LABEL_AREA_NOT_AVAILABLE":[null,"Gebiet kann noch nicht betreten werden."],"LABEL_SHOP_WEAPON":[null,"Waffenschmied"],"LABEL_SHOP_FOOD":[null,"Gemischtwarenh\u00e4ndler"],"LABEL_SHOP_ARMOR":[null,"R\u00fcstungsh\u00e4ndler"],"LABEL_SHOP_JEWELRY":[null,"Juwelier"],"LABEL_SHOP_CRAFTING":[null,"Alchemist"],"LABEL_WORK":[null,"Brunnen"],"LABEL_ARENA":[null,"Die Arena"],"LABEL_PREMIUM":[null,"Der Palast"],"LABEL_TRAINING":[null,"Hallen der Weisheit"],"LABEL_AUCTION":[null,"Basar"],"LABEL_ALLIANCE":[null,"Gilde"],"LABEL_ALLIANCE_LEADERS":[null,"Gildenleiter"],"LABEL_QUESTS":[null,"Teehaus"],"LABEL_PALACE":[null,"Palast"],"CONFIG_AREA_NAME_PALACE_GARDEN":[null,"Palastgarten"],"CONFIG_AREA_NAME_BEDOUIN_CAMP":[null,"Beduinenlager"],"CONFIG_AREA_NAME_HARBOR":[null,"Hafen von Jahar"],"CONFIG_AREA_NAME_TEMPLE_DISTRICT":[null,"Tempelbezirk Jahars"],"CONFIG_AREA_NAME_RUINS_OF_MALAKEI":[null,"Ruinen von Malakai"],"CONFIG_AREA_NAME_VILLAGE_KABUZIM":[null,"Dorf Kabuzim"],"CONFIG_AREA_NAME_BURROW_OF_GUMBAR":[null,"H\u00f6hlen von Gumbar"],"CONFIG_AREA_NAME_OASIS_OF_SOUTH_WIND":[null,"Oase des S\u00fcdwindes"],"CONFIG_AREA_NAME_GATE_OF_THE_WEST":[null,"Tor des Westens"],"CONFIG_AREA_NAME_MOUNTAINS_OF_NORTHERN_LIGHTS":[null,"Berge des Nordlichts"],"CONFIG_AREA_NAME_ROCKY_DESERT":[null,"Steinw\u00fcste"],"RANKING_YOUR_ALLIANCE":[null,"Deine Gilde"],"RANKING_ALLIANCE_PROFILE_BUTTON":[null,"Gildenprofil"],"LABEL_NO_PROFILE_TEXT":[null,"%1$s hat bisher keinen Profiltext angegeben."],"LABEL_CHANGE_PROFILE":[null,"Profil \u00e4ndern"],"FIGHT_ARENA_POSSIBLE_NOW":[null,"Du kannst nun wieder k\u00e4mpfen"],"LABEL_MESSAGES_NEW_COUNTER_SINGULAR":["LABEL_MESSAGES_NEW_COUNTER_PLURAL","0 neue Nachrichten","Eine neue Nachricht","%1$s neue Nachrichten"],"IGNORE_LIST_ADD":[null,"Spieler ignorieren"],"IGNORE_LIST_REMOVE":[null,"von Liste entfernen"],"LABEL_IGNORE":[null,"Ignorierte Spieler"],"DIALOG_MESSAGE_IGNORE_LIST_USER_TITLE":[null,"Spieler ignorieren"],"DIALOG_MESSAGE_IGNORE_LIST_USER_ADDED_MESSAGE":[null,"Du ignorierst nun den Spieler %1$s."],"DIALOG_MESSAGE_IGNORE_LIST_USER_ALREADY_ADDED_MESSAGE":[null,"Du ignorierst den Spieler %1$s bereits."],"MESSAGE_WRITE_ERROR_SENDER_IS_ON_RECIPIENTS_IGNORELIST":[null,"Du befindest Dich auf der Ignoreliste des Spielers und kannst ihm somit keine Nachrichten schicken. Wenn du dort entfernt werden m\u00f6chtest, bitte einen Freund, diesen Spieler anzuschreiben."],"DIALOG_MESSAGE_FRIEND_LIST_USER_TITLE":[null,"Freundesliste"],"DIALOG_MESSAGE_FRIEND_LIST_USER_ADDED_MESSAGE":[null,"%1$s wurde zu deiner Freundesliste hinzugf\u00fcgt"],"DIALOG_MESSAGE_FRIEND_LIST_USER_ALREADY_ADDED_MESSAGE":[null,"%1$s is bereits auf deiner Freundesliste"],"LABEL_GUILD_QUEST_NO_DATA":[null,"Bisher wurde der Gegner <strong>%1$s<\/strong> noch von keinem Gildenmitglied besiegt."],"LABEL_WINS":[null,"Siege"],"LABEL_USERNAME_FRIENDLY":[null,"Spielername"],"LABEL_ALLIANCE_ENEMY":[null,"Verfeindete Gilden"],"LABEL_ALLIANCE_ENEMY_ADD":[null,"Krieg erkl\u00e4ren"],"LABEL_ALLIANCE_ENEMY_REMOVE":[null,"Frieden anbieten"],"LABEL_CURRENT_GOLD_REWARD":[null,"Erreichte Dinare"],"ALLIANCE_QUEST_WINS_FOR_SELECTED_OPPONENT":[null,"Folgende Tabelle enth\u00e4lt die Auflistung der bereits erreichten Siege gegen den Gegner <strong>%1$s<\/strong> durch die jeweiligen Gildenmitglieder."],"TITLE_FREE_ITEM":[null,"Kostenlosen Gegenstand best\u00e4tigen"],"LABEL_ABORT":[null,"Abbrechen"],"LABEL_BUY_FREE_ITEM":[null,"Kostenlos verwenden"],"DIALOG_MESSAGE_FREE_ITEM_SINGULAR":["DIALOG_MESSAGE_FREE_ITEM_PLURAL","Lala","%1$sDer gew\u00e4hlte Gegenstand im Wert von %2$s ist f\u00fcr dich kostenlos, du kannst nur <strong>einmal<\/strong> einen Gegenstand dieser Art <strong>kostenlos erhalten<\/strong>.<br\/><br\/>Weitere Informationen findest du auch im %3$s.","%1$sDer gew\u00e4hlte Gegenstand im Wert von %2$s ist f\u00fcr dich kostenlos, du kannst dann noch <strong>einen weiteren Gegenstand dieser Art kostenlos erhalten<\/strong>.<br\/><br\/>Weitere Informationen findest du auch im %3$s."],"LABEL_BOARD":[null,"Forum"],"SOCIAL_NEXT_ACTION":[null,"Du kannst erst am %1$s wieder mit %2$s Wasserpfeife rauchen"]}};var __i18nSelectedLanguage='de_DE.utf-8';
Gettext=function(args){this.domain='messages';this.locale_data=undefined;var options=["domain","locale_data"];if(this.isValidObject(args)){for(var i in args){for(var j=0;j<options.length;j++){if(i==options[j]){if(this.isValidObject(args[i]))
this[i]=args[i];}}}}
this.try_load_lang();return this;}
Gettext.context_glue="\004";Gettext._locale_data={};Gettext.prototype.try_load_lang=function(){if(typeof(this.locale_data)!='undefined'){var locale_copy=this.locale_data;this.locale_data=undefined;this.parse_locale_data(locale_copy);if(typeof(Gettext._locale_data[this.domain])=='undefined'){throw new Error("Error: Gettext 'locale_data' does not contain the domain '"+this.domain+"'");}}
var lang_link=this.get_lang_refs();if(typeof(lang_link)=='object'&&lang_link.length>0){for(var i=0;i<lang_link.length;i++){var link=lang_link[i];if(link.type=='application/json'){if(!this.try_load_lang_json(link.href)){throw new Error("Error: Gettext 'try_load_lang_json' failed. Unable to exec xmlhttprequest for link ["+link.href+"]");}}else if(link.type=='application/x-po'){if(!this.try_load_lang_po(link.href)){throw new Error("Error: Gettext 'try_load_lang_po' failed. Unable to exec xmlhttprequest for link ["+link.href+"]");}}else{throw new Error("TODO: link type ["+link.type+"] found, and support is planned, but not implemented at this time.");}}}};Gettext.prototype.parse_locale_data=function(locale_data){if(typeof(Gettext._locale_data)=='undefined'){Gettext._locale_data={};}
for(var domain in locale_data){if((!locale_data.hasOwnProperty(domain))||(!this.isValidObject(locale_data[domain])))
continue;var has_msgids=false;for(var msgid in locale_data[domain]){has_msgids=true;break;}
if(!has_msgids)continue;var data=locale_data[domain];if(domain=="")domain="messages";if(!this.isValidObject(Gettext._locale_data[domain]))
Gettext._locale_data[domain]={};if(!this.isValidObject(Gettext._locale_data[domain].head))
Gettext._locale_data[domain].head={};if(!this.isValidObject(Gettext._locale_data[domain].msgs))
Gettext._locale_data[domain].msgs={};for(var key in data){if(key==""){var header=data[key];for(var head in header){var h=head.toLowerCase();Gettext._locale_data[domain].head[h]=header[head];}}else{Gettext._locale_data[domain].msgs[key]=data[key];}}}
for(var domain in Gettext._locale_data){if(this.isValidObject(Gettext._locale_data[domain].head['plural-forms'])&&typeof(Gettext._locale_data[domain].head.plural_func)=='undefined'){var plural_forms=Gettext._locale_data[domain].head['plural-forms'];var pf_re=new RegExp('^(\\s*nplurals\\s*=\\s*[0-9]+\\s*;\\s*plural\\s*=\\s*(?:\\s|[-\\?\\|&=!<>+*/%:;a-zA-Z0-9_\(\)])+)','m');if(pf_re.test(plural_forms)){var pf=Gettext._locale_data[domain].head['plural-forms'];if(!/;\s*$/.test(pf))pf=pf.concat(';');var code='var plural; var nplurals; '+pf+' return { "nplural" : nplurals, "plural" : (plural === true ? 1 : plural ? plural : 0) };';Gettext._locale_data[domain].head.plural_func=new Function("n",code);}else{throw new Error("Syntax error in language file. Plural-Forms header is invalid ["+plural_forms+"]");}}else if(typeof(Gettext._locale_data[domain].head.plural_func)=='undefined'){Gettext._locale_data[domain].head.plural_func=function(n){var p=(n!=1)?1:0;return{'nplural':2,'plural':p};};}}
return;};Gettext.prototype.try_load_lang_po=function(uri){var data=this.sjax(uri);if(!data)return;var domain=this.uri_basename(uri);var parsed=this.parse_po(data);var rv={};if(parsed){if(!parsed[""])parsed[""]={};if(!parsed[""]["domain"])parsed[""]["domain"]=domain;domain=parsed[""]["domain"];rv[domain]=parsed;this.parse_locale_data(rv);}
return 1;};Gettext.prototype.uri_basename=function(uri){var rv;if(rv=uri.match(/^(.*\/)?(.*)/)){var ext_strip;if(ext_strip=rv[2].match(/^(.*)\..+$/))
return ext_strip[1];else
return rv[2];}else{return"";}};Gettext.prototype.parse_po=function(data){var rv={};var buffer={};var lastbuffer="";var errors=[];var lines=data.split("\n");for(var i=0;i<lines.length;i++){lines[i]=lines[i].replace(/(\n|\r)+$/,'');var match;if(/^$/.test(lines[i])){if(typeof(buffer['msgid'])!='undefined'){var msg_ctxt_id=(typeof(buffer['msgctxt'])!='undefined'&&buffer['msgctxt'].length)?buffer['msgctxt']+Gettext.context_glue+buffer['msgid']:buffer['msgid'];var msgid_plural=(typeof(buffer['msgid_plural'])!='undefined'&&buffer['msgid_plural'].length)?buffer['msgid_plural']:null;var trans=[];for(var str in buffer){var match;if(match=str.match(/^msgstr_(\d+)/))
trans[parseInt(match[1])]=buffer[str];}
trans.unshift(msgid_plural);if(trans.length>1)rv[msg_ctxt_id]=trans;buffer={};lastbuffer="";}}else if(/^#/.test(lines[i])){continue;}else if(match=lines[i].match(/^msgctxt\s+(.*)/)){lastbuffer='msgctxt';buffer[lastbuffer]=this.parse_po_dequote(match[1]);}else if(match=lines[i].match(/^msgid\s+(.*)/)){lastbuffer='msgid';buffer[lastbuffer]=this.parse_po_dequote(match[1]);}else if(match=lines[i].match(/^msgid_plural\s+(.*)/)){lastbuffer='msgid_plural';buffer[lastbuffer]=this.parse_po_dequote(match[1]);}else if(match=lines[i].match(/^msgstr\s+(.*)/)){lastbuffer='msgstr_0';buffer[lastbuffer]=this.parse_po_dequote(match[1]);}else if(match=lines[i].match(/^msgstr\[0\]\s+(.*)/)){lastbuffer='msgstr_0';buffer[lastbuffer]=this.parse_po_dequote(match[1]);}else if(match=lines[i].match(/^msgstr\[(\d+)\]\s+(.*)/)){lastbuffer='msgstr_'+match[1];buffer[lastbuffer]=this.parse_po_dequote(match[2]);}else if(/^"/.test(lines[i])){buffer[lastbuffer]+=this.parse_po_dequote(lines[i]);}else{errors.push("Strange line ["+i+"] : "+lines[i]);}}
if(typeof(buffer['msgid'])!='undefined'){var msg_ctxt_id=(typeof(buffer['msgctxt'])!='undefined'&&buffer['msgctxt'].length)?buffer['msgctxt']+Gettext.context_glue+buffer['msgid']:buffer['msgid'];var msgid_plural=(typeof(buffer['msgid_plural'])!='undefined'&&buffer['msgid_plural'].length)?buffer['msgid_plural']:null;var trans=[];for(var str in buffer){var match;if(match=str.match(/^msgstr_(\d+)/))
trans[parseInt(match[1])]=buffer[str];}
trans.unshift(msgid_plural);if(trans.length>1)rv[msg_ctxt_id]=trans;buffer={};lastbuffer="";}
if(rv[""]&&rv[""][1]){var cur={};var hlines=rv[""][1].split(/\\n/);for(var i=0;i<hlines.length;i++){if(!hlines.length)continue;var pos=hlines[i].indexOf(':',0);if(pos!=-1){var key=hlines[i].substring(0,pos);var val=hlines[i].substring(pos+1);var keylow=key.toLowerCase();if(cur[keylow]&&cur[keylow].length){errors.push("SKIPPING DUPLICATE HEADER LINE: "+hlines[i]);}else if(/#-#-#-#-#/.test(keylow)){errors.push("SKIPPING ERROR MARKER IN HEADER: "+hlines[i]);}else{val=val.replace(/^\s+/,'');cur[keylow]=val;}}else{errors.push("PROBLEM LINE IN HEADER: "+hlines[i]);cur[hlines[i]]='';}}
rv[""]=cur;}else{rv[""]={};}
return rv;};Gettext.prototype.parse_po_dequote=function(str){var match;if(match=str.match(/^"(.*)"/)){str=match[1];}
str=str.replace(/\\"/,"");return str;};Gettext.prototype.try_load_lang_json=function(uri){var data=this.sjax(uri);if(!data)return;var rv=this.JSON(data);this.parse_locale_data(rv);return 1;};Gettext.prototype.get_lang_refs=function(){var langs=new Array();var links=document.getElementsByTagName("link");for(var i=0;i<links.length;i++){if(links[i].rel=='gettext'&&links[i].href){if(typeof(links[i].type)=='undefined'||links[i].type==''){if(/\.json$/i.test(links[i].href)){links[i].type='application/json';}else if(/\.js$/i.test(links[i].href)){links[i].type='application/json';}else if(/\.po$/i.test(links[i].href)){links[i].type='application/x-po';}else if(/\.mo$/i.test(links[i].href)){links[i].type='application/x-mo';}else{throw new Error("LINK tag with rel=gettext found, but the type and extension are unrecognized.");}}
links[i].type=links[i].type.toLowerCase();if(links[i].type=='application/json'){links[i].type='application/json';}else if(links[i].type=='text/javascript'){links[i].type='application/json';}else if(links[i].type=='application/x-po'){links[i].type='application/x-po';}else if(links[i].type=='application/x-mo'){links[i].type='application/x-mo';}else{throw new Error("LINK tag with rel=gettext found, but the type attribute ["+links[i].type+"] is unrecognized.");}
langs.push(links[i]);}}
return langs;};Gettext.prototype.textdomain=function(domain){if(domain&&domain.length)this.domain=domain;return this.domain;}
Gettext.prototype.gettext=function(msgid){var msgctxt;var msgid_plural;var n;var category;return this.dcnpgettext(null,msgctxt,msgid,msgid_plural,n,category);};Gettext.prototype.dgettext=function(domain,msgid){var msgctxt;var msgid_plural;var n;var category;return this.dcnpgettext(domain,msgctxt,msgid,msgid_plural,n,category);};Gettext.prototype.dcgettext=function(domain,msgid,category){var msgctxt;var msgid_plural;var n;return this.dcnpgettext(domain,msgctxt,msgid,msgid_plural,n,category);};Gettext.prototype.ngettext=function(msgid,msgid_plural,n){var msgctxt;var category;return this.dcnpgettext(null,msgctxt,msgid,msgid_plural,n,category);};Gettext.prototype.dngettext=function(domain,msgid,msgid_plural,n){var msgctxt;var category;return this.dcnpgettext(domain,msgctxt,msgid,msgid_plural,n,category);};Gettext.prototype.dcngettext=function(domain,msgid,msgid_plural,n,category){var msgctxt;return this.dcnpgettext(domain,msgctxt,msgid,msgid_plural,n,category,category);};Gettext.prototype.pgettext=function(msgctxt,msgid){var msgid_plural;var n;var category;return this.dcnpgettext(null,msgctxt,msgid,msgid_plural,n,category);};Gettext.prototype.dpgettext=function(domain,msgctxt,msgid){var msgid_plural;var n;var category;return this.dcnpgettext(domain,msgctxt,msgid,msgid_plural,n,category);};Gettext.prototype.dcpgettext=function(domain,msgctxt,msgid,category){var msgid_plural;var n;return this.dcnpgettext(domain,msgctxt,msgid,msgid_plural,n,category);};Gettext.prototype.npgettext=function(msgctxt,msgid,msgid_plural,n){var category;return this.dcnpgettext(null,msgctxt,msgid,msgid_plural,n,category);};Gettext.prototype.dnpgettext=function(domain,msgctxt,msgid,msgid_plural,n){var category;return this.dcnpgettext(domain,msgctxt,msgid,msgid_plural,n,category);};Gettext.prototype.dcnpgettext=function(domain,msgctxt,msgid,msgid_plural,n,category){if(!this.isValidObject(msgid))return'';var plural=this.isValidObject(msgid_plural);var msg_ctxt_id=this.isValidObject(msgctxt)?msgctxt+Gettext.context_glue+msgid:msgid;var domainname=this.isValidObject(domain)?domain:this.isValidObject(this.domain)?this.domain:'messages';var category_name='LC_MESSAGES';var category=5;var locale_data=new Array();if(typeof(Gettext._locale_data)!='undefined'&&this.isValidObject(Gettext._locale_data[domainname])){locale_data.push(Gettext._locale_data[domainname]);}else if(typeof(Gettext._locale_data)!='undefined'){for(var dom in Gettext._locale_data){locale_data.push(Gettext._locale_data[dom]);}}
var trans=[];var found=false;var domain_used;if(locale_data.length){for(var i=0;i<locale_data.length;i++){var locale=locale_data[i];if(this.isValidObject(locale.msgs[msg_ctxt_id])){for(var j=0;j<locale.msgs[msg_ctxt_id].length;j++){trans[j]=locale.msgs[msg_ctxt_id][j];}
trans.shift();domain_used=locale;found=true;break;}}}
if(!trans.length){trans=[msgid,msgid_plural];}
var translation=trans[0];if(plural){var p;if(found&&this.isValidObject(domain_used.head.plural_func)){var rv=domain_used.head.plural_func(n);if(!rv.plural)rv.plural=0;if(!rv.nplural)rv.nplural=0;if(rv.nplural<=rv.plural)rv.plural=0;p=rv.plural;}else{p=(n!=1)?1:0;}
if(this.isValidObject(trans[p]))
translation=trans[p];}
return translation;};Gettext.strargs=function(str,args){if(null==args||'undefined'==typeof(args)){args=[];}else if(args.constructor!=Array){args=[args];}
var newstr="";while(true){var i=str.indexOf('%');var match_n;if(i==-1){newstr+=str;break;}
newstr+=str.substr(0,i);if(str.substr(i,2)=='%%'){newstr+='%';str=str.substr((i+2));}else if(match_n=str.substr(i).match(/^%(\d+)/)){var arg_n=parseInt(match_n[1]);var length_n=match_n[1].length;if(arg_n>0&&args[arg_n-1]!=null&&typeof(args[arg_n-1])!='undefined')
newstr+=args[arg_n-1];str=str.substr((i+1+length_n));}else{newstr+='%';str=str.substr((i+1));}}
return newstr;}
Gettext.prototype.strargs=function(str,args){return Gettext.strargs(str,args);}
Gettext.prototype.isArray=function(thisObject){return this.isValidObject(thisObject)&&thisObject.constructor==Array;};Gettext.prototype.isValidObject=function(thisObject){if(null==thisObject){return false;}else if('undefined'==typeof(thisObject)){return false;}else{return true;}};Gettext.prototype.sjax=function(uri){var xmlhttp;if(window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();}else if(navigator.userAgent.toLowerCase().indexOf('msie 5')!=-1){xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}else{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}
if(!xmlhttp)
throw new Error("Your browser doesn't do Ajax. Unable to support external language files.");xmlhttp.open('GET',uri,false);try{xmlhttp.send(null);}
catch(e){return;}
var sjax_status=xmlhttp.status;if(sjax_status==200||sjax_status==0){return xmlhttp.responseText;}else{var error=xmlhttp.statusText+" (Error "+xmlhttp.status+")";if(xmlhttp.responseText.length){error+="\n"+xmlhttp.responseText;}
alert(error);return;}}
Gettext.prototype.JSON=function(data){return eval('('+data+')');}
var __i18nGettextObject=new Gettext({'domain':'javascript','locale_data':__i18nMessageData});function gettext(msgId){return __i18nGettextObject.gettext(msgId);}
function ngettext(msgIdSingular,msgIdPlural,count){return __i18nGettextObject.ngettext(msgIdSingular,msgIdPlural,count);}
function sprintf(string,arguments){return __i18nGettextObject.strargs(string,arguments);}
function __handleAjaxResponse(transport,dontUpdateContent){if(!dontUpdateContent&&!transport.responseJSON){if((YAHOO.env.ua.ie>0)&&transport.headers['X-IE-REDIRECT']){top.location.href=transport.headers['X-IE-REDIRECT'];return false;}else{document.open();document.write(transport.responseText);document.close();}
return false;}
if(transport.responseJSON){GameCore.ServerTime.setServerTime(transport.responseJSON.ServerTime);if(transport.responseJSON.SecurityToken){GameCore.Config.set('SecurityToken',transport.responseJSON.SecurityToken);}
if(transport.responseJSON.Flash){var MessageType=null;var MessageData=[];for(var currentMessageType in transport.responseJSON.Flash){if(transport.responseJSON.Flash[currentMessageType]&&transport.responseJSON.Flash[currentMessageType].length>0){for(var i=0;i<transport.responseJSON.Flash[currentMessageType].length;i++){MessageData.push({'type':currentMessageType,'text':transport.responseJSON.Flash[currentMessageType][i]});}}}
ShowFlashMessages(MessageData);}}
return true;}
function Game_Character(name,level,xp,health,gold,premium,attributes){this.name=name;this.level=level;this.xp=xp;this.health=health;this.gold=gold;this.premium=premium;this.attributes=attributes;this.attributesLayerBaseName='BarCharacter';this.attributesLayerValuesBaseName='Character';this.getGold=function(){return this.gold.value;};this.getPremium=function(){return this.premium.value;};this.getHealth=function(){return this.health.value;};this.getHealthInPercent=function(){return this.getHealth()*100/this.getMaxHealth();};this.getMaxHealth=function(){return this.health.max;};this.setMaxHealth=function(value){this.health.max=value;}
this.getHealthRegeneration=function(){return this.health.regeneration;};this.setHealth=function(health){if(health>this.getMaxHealth())health=this.getMaxHealth();if(health<0)health=0;this.health.value=parseInt(health);this.updateHealthLayer();return this.getHealth();};this.decreaseHealth=function(value){return this.setHealth(this.getHealth()-parseInt(value));};this.getDamage=function(){var modificator=Math.floor(this.getAttributeValue('Strength')*0.3);var Value=this.getAttributeValue('Damage');var ValueWithoutRaw={'Min':Value.Min-this.attributes.Damage.RawValue.Min,'Max':Value.Max-this.attributes.Damage.RawValue.Max};this.attributes.Damage.RawValue={'Min':modificator,'Max':modificator};return{'Min':ValueWithoutRaw.Min+this.attributes.Damage.RawValue.Min,'Max':ValueWithoutRaw.Max+this.attributes.Damage.RawValue.Max};};this.getArmor=function(){var modificator=Math.floor(this.getAttributeValue('Ability')*0.3*10);var Value=this.getAttributeValue('Armor');var ValueWithoutRaw=Value-this.attributes.Armor.RawValue;this.attributes.Armor.RawValue=modificator;return ValueWithoutRaw+this.attributes.Armor.RawValue;};this.increaseHealth=function(value){return this.setHealth(this.getHealth()+parseInt(value));};this.updateHealthLayer=function(){if(this.health.layer){var layer=$(this.health.layer.Percentage);if(layer){layer.setStyle({'width':this.getHealthInPercent()+'%'});}
layer=$(this.health.layer.Title);if(layer){layer.update(this.getHealth()+' / '+this.getMaxHealth());}
delete layer;}};this.increaseGold=function(value){return this.setGold(this.getGold()+parseInt(value));};this.decreaseGold=function(value){return this.increaseGold(value*-1);};this.setGold=function(value){this.gold.value=parseInt(value);this.updateGoldLayer();return this.getGold();};this.updateGoldLayer=function(){$(this.gold.layerId).update(GameCore.NumberFormat(this.gold.value));};this.increasePremium=function(value){return this.setPremium(this.getPremium()+parseInt(value));};this.decreasePremium=function(value){return this.increasePremium(value*-1);};this.setPremium=function(value){this.premium.value=parseInt(value);this.updatePremiumLayer();return this.getPremium();};this.updatePremiumLayer=function(){$(this.premium.layerId).update(GameCore.NumberFormat(this.premium.value));};this.getAttribute=function(attribute,key){if(this.attributes[attribute]){return this.attributes[attribute][key];}
return null;};this.getAttributeValue=function(attribute,raw){return this.getAttribute(attribute,(raw===true?'RawValue':'Value'));};this.getMaxAttributeValue=function(attribute){return this.getAttribute(attribute,'Max');};this.getAttributeInPercent=function(attribute){return this.getAttributeValue(attribute)*100/this.getMaxAttributeValue(attribute);};this.setAttributeValue=function(attribute,value){if(this.attributes[attribute]){if(typeof value!='object'){this.attributes[attribute].Value=parseInt(value);if(this.attributes[attribute].Value>this.getMaxAttributeValue(attribute)){this.attributes[attribute].Value=parseInt(this.attributes[attribute].Max);}
if(this.attributes[attribute].Value<this.attributes[attribute].MinValue){this.attributes[attribute].Value=parseInt(this.attributes[attribute].MinValue);}}else{this.attributes[attribute].Value=value;}
if(attribute=='Endurance'){var skillAdditor=Math.floor((this.getAttributeValue('Endurance')-2)*this.health.MaxEnduranceAdditorFactor);var ItemHealthBonus=this.getItemAttributeValues().Health;this.setMaxHealth(Math.round(this.health.BaseValue+Math.floor(this.level*this.health.MaxBaseFactor)+skillAdditor+(ItemHealthBonus?ItemHealthBonus:0)));this.setHealth(this.getHealth());this.updateHealthLayer();}
this.updateAttributeLayer(attribute);return this.getAttributeValue(attribute);}
return false;};this.updateAttributeLayer=function(attribute){var baseName=GameCore.lcfirst(attribute)+this.attributesLayerBaseName;var baseNameValues=GameCore.lcfirst(attribute)+this.attributesLayerValuesBaseName;var layerDescription=$(baseName+'Value')?$(baseName+'Value'):$(baseNameValues+'Value');var layerPercent=$(baseName+'Percent');if(layerDescription){var descriptionText='';switch(attribute){case'Damage':var damage=this.getDamage();descriptionText=damage.Min+' - '+damage.Max;break;case'Armor':descriptionText=this.getArmor();break;default:descriptionText=this.getAttributeValue(attribute)+' / '+this.getMaxAttributeValue(attribute);}
layerDescription.update(descriptionText);}
if(layerPercent){layerPercent.setStyle({'width':(this.getAttributeInPercent(attribute))+'%'});}
delete baseName;delete layerDescription;delete layerPercent;};this.increaseAttributeValue=function(attribute,value){if(this.attributes[attribute]){return this.setAttributeValue(attribute,parseInt(this.getAttributeValue(attribute))+parseInt(value));}
return null;};this.decreaseAttributeValue=function(attribute,value){if(this.attributes[attribute]){return this.setAttributeValue(attribute,Math.min(this.getAttributeValue(attribute,true),parseInt(this.getAttributeValue(attribute))-parseInt(value)));}
return null;};this.updateAttributesByItem=function(){var attributes=this.getItemAttributeValues();for(var attribute in this.attributes){if(typeof this.getAttributeValue(attribute,true)!='object'){this.setAttributeValue(attribute,parseInt(this.getAttributeValue(attribute,true))+(attributes[attribute]?parseInt(attributes[attribute]):0));}else{var value=this.getAttributeValue(attribute,true);var setValue={};for(var entity in value){setValue[entity]=value[entity];}
delete value;for(var entity in attributes[attribute]){setValue[entity]=parseInt(setValue[entity]?setValue[entity]:0)+parseInt(attributes[attribute][entity]?attributes[attribute][entity]:0);}
this.setAttributeValue(attribute,setValue);}}
delete attributes;};this.getItemAttributeValues=function(){var retArray={};for(var itemLayerId in itemMap.Inventory.byItem){var item=ItemUtilities.getItemDataByLayerId(itemLayerId)
for(var attribute in item.attributes){var itemAttribute=item.attributes[attribute];var BaseValue=parseInt(this.getAttributeValue(attribute,true));if(!retArray[attribute]){retArray[attribute]=typeof itemAttribute.Min!='undefined'&&typeof itemAttribute.Max!='undefined'?{'Min':0,'Max':0}:0;}
if(itemAttribute.Value&&typeof itemAttribute.Value!='object'){retArray[attribute]+=parseInt(itemAttribute.Value);}else if(typeof itemAttribute.Min!='undefined'&&typeof itemAttribute.Max!='undefined'){retArray[attribute].Min+=itemAttribute.Min;retArray[attribute].Max+=itemAttribute.Max;}
if(itemAttribute.Percent){retArray[attribute]+=BaseValue/100*parseInt(itemAttribute.Percent);}
delete BaseValue;delete itemAttribute;}
delete attribute;delete item;}
delete itemLayerId;for(var attribute in retArray){if(typeof retArray[attribute]!='object')
retArray[attribute]=Math.floor(retArray[attribute]);}
return retArray;};this.getFormattedAllianceTag=function(data){if(parseInt(data.allianceId)>0){return'['+data.allianceTag+']';}
return'';};};
function Game_Item_Tooltip(TooltipLayer,ItemsBlubber){this.ItemUtilities=ItemsBlubber;this.TooltipLayer=TooltipLayer;this.Offset={'x':8,'y':8};this.Countdown=null;this.itemsToCompare=0;this.prepareCache=function(){ngettext('LABEL_COUNTDOWN_DAYS_SINGULAR','LABEL_COUNTDOWN_DAYS_PLURAL',0);ngettext('LABEL_COUNTDOWN_HOURS_SINGULAR','LABEL_HOURS_DAYS_PLURAL',0);ngettext('LABEL_COUNTDOWN_MINUTES_SINGULAR','LABEL_MINUTES_DAYS_PLURAL',0);ngettext('LABEL_COUNTDOWN_SECONDS_SINGULAR','LABEL_SECONDS_DAYS_PLURAL',0);gettext('LABEL_CHARACTER_CRAFTING_EFFECT_DURATION');};this.AttributesList={'Strength':{'translation':gettext('LABEL_STRENGTH')},'Ability':{'translation':gettext('LABEL_ABILITY')},'Endurance':{'translation':gettext('LABEL_ENDURANCE')},'Charisma':{'translation':gettext('LABEL_CHARISMA')},'Health':{'translation':gettext('LABEL_FOOD_HEALTH_VALUE'),'translationAlternative':gettext('LABEL_HEALTH_POINTS')},'Armor':{'translation':gettext('LABEL_ARMOR')},'Damage':{'translation':gettext('LABEL_DAMAGE')}};this.pointer=function(event){var docElement=document.documentElement,body=document.body||{scrollLeft:0,scrollTop:0};return{x:event.pageX||(event.clientX+
(docElement.scrollLeft||body.scrollLeft)-
(docElement.clientLeft||0)),y:event.pageY||(event.clientY+
(docElement.scrollTop||body.scrollTop)-
(docElement.clientTop||0))};};this.assignTooltips=function(){var self=this;if(GameCore.sizeOfObject(this.ItemUtilities.Items)>0){for(var containerId in this.ItemUtilities.Items){for(var itemLayerId in this.ItemUtilities.Items[containerId].byItem){if($(itemLayerId)){try{$(itemLayerId).onmouseover=function(event){if(!event){event=window.event;}
self.show(this.id);self.move(Event.pointerX(event),Event.pointerY(event));};$(itemLayerId).onmousemove=function(event){if(!event){event=window.event;}
self.move(Event.pointerX(event),Event.pointerY(event));};$(itemLayerId).onmouseout=function(event){if(!event){event=window.event;}
self.hide(this.id);};}catch(ex){if(console&&console.log){console.log('Exception for itemLayerId '+itemLayerId);console.log(ex);}}}}}}};this.hide=function(layerId){this.TooltipLayer.hide();if(this.Countdown){this.Countdown.stop();this.Countdown=null;}};this.show=function(layerId){var self=this;var Item=this.ItemUtilities.getItemDataByLayerId(layerId);var isInventoryItem=(Item.containerId=='Inventory')?true:false;var byType=this.ItemUtilities.getInventorySlotsToCompareByType(Item.type);var width=282;this.itemsToCompare=0;var Content='<div class="tooltipBg"></div><div class="tooltip">';Content+='<div id="selectedItemTT" class="main">'+this.getItemNameText(Item);Content+='<div class="itemImage">'+this.getImageLayer(Item)+'</div>';if(Item.type!='QUEST_ITEM'){Content+=this.getItemAttributesText(Item,true);if(Item.type=='CHARACTER_CRAFTING'){if(Item.siv>0){Content+='<br/><br/><br/>';Content+='<p id="__INTERNAL_TOOLTIP_COUNTDOWN_LAYER__" class="EFFECT_DURATION"></p>';this.Countdown=new GameCore_Utilities_Countdown({'LayerId':'__INTERNAL_TOOLTIP_COUNTDOWN_LAYER__','TidySecondsPostFilter':self.getCountdownLabel,'CountdownLayerUpdateFilter':function(Layer,text){Layer.update(GameCore.sprintf(gettext('LABEL_CHARACTER_CRAFTING_COUNTDOWN'),text));},'CurrentTime':GameCore.ServerTime.getCurrentTime(),'CountdownTo':Item.siv},true);Content+='<br/>';}else{Content+='<br/><br/><br/>';Content+='<p class="EFFECT_DURATION">'+GameCore.sprintf(gettext('LABEL_CHARACTER_CRAFTING_EFFECT_DURATION'),GameCore.ServerTime.getTimeString(Item.affectDuration,function(days,hours,minutes,seconds){return self.getCountdownLabel(days,hours,minutes,seconds,true);}))+'</p>';}}
Content+='</div>';if(!isInventoryItem&&Item.type!='SPECIAL_INT_VALUE'&&byType!=null){var gridName='';for(var i=0;i<byType.length;i++){gridName=ItemUtilities.Items.Inventory.grid[byType[i].id];Content+=this.addCompareLayerContent(gridName);}}}
Content+='</div>';if(!isInventoryItem&&Item.type!='SPECIAL_INT_VALUE'&&byType!=null){width+=(this.itemsToCompare)*161;}
$(TooltipLayer.id).style.width=width+"px";this.TooltipLayer.update(Content);this.TooltipLayer.show();if(this.Countdown){this.Countdown.start();}};this.addCompareLayerContent=function(gridName){var string="";if(!(ItemUtilities.Items.Inventory.byItem[gridName]==null||ItemUtilities.Items.Inventory.byItem[gridName]==undefined)){this.itemsToCompare++;var CompareItem=ItemUtilities.Items.Inventory.byItem[gridName];string='<div class="main2">'+this.getItemNameText(CompareItem,true);string+='<div class="itemImage">'+this.getImageLayer(CompareItem,true)+'</div>';string+=this.getItemAttributesText(CompareItem,true);string+='</div>';}
return string;};this.getCountdownLabel=function(days,hours,minutes,seconds,hideNullValues){var string='';if(days>0){string+=GameCore.sprintf(ngettext('LABEL_COUNTDOWN_DAYS_SINGULAR','LABEL_COUNTDOWN_DAYS_PLURAL',days),days);string+=', ';}
if(hours*1>0){string+=GameCore.sprintf(ngettext('LABEL_COUNTDOWN_HOURS_SINGULAR','LABEL_COUNTDOWN_HOURS_PLURAL',parseInt(hours)),parseInt(hours))+(hideNullValues!==true||minutes>0||seconds>0?', ':'');}
if(parseInt(minutes)>0){string+=GameCore.sprintf(ngettext((hideNullValues!==true?'LABEL_COUNTDOWN_MINUTES_SINGULAR':'LABEL_COUNTDOWN_MINUTES_WITHOUT_APPENDIX_SINGULAR'),(hideNullValues!==true?'LABEL_COUNTDOWN_MINUTES_PLURAL':'LABEL_COUNTDOWN_MINUTES_WITHOUT_APPENDIX_PLURAL'),parseInt(minutes)),parseInt(minutes));}
if(hideNullValues!==true||parseInt(seconds)>0){string+=GameCore.sprintf(ngettext('LABEL_COUNTDOWN_SECONDS_SINGULAR','LABEL_COUNTDOWN_SECONDS_PLURAL',seconds*1),seconds*1);}
return string;};this.getImageLayer=function(Item,getAsImageTag){if(getAsImageTag===true){var zoomFactor=1.4;var maxHeight=35;var imageStyle=GameCore.Dom.getStylesheetByStyleClass('Item_'+Item.item).style;var imageUrl=imageStyle.backgroundImage;imageUrl=imageUrl.substr(4,imageUrl.length-5).replace(/"/,'');var width=parseInt(imageStyle.width);var height=parseInt(imageStyle.height);if(height>maxHeight){width=width/(height/maxHeight);height=maxHeight;width*=zoomFactor;height*=zoomFactor;}
return'<img width="'+width+'px" height="'+height+'px" src="'+imageUrl+'"/>';}
return'<div class="Item_'+Item.item+'"></div>';};this.getItemNameText=function(Item,isInventoryItem){var string='';var name=Item.name;if((name==''||name=='GOLD_ITEM_PLURAL')&&Item.type=='SPECIAL_INT_VALUE'&&Item.siv>0){var size='';if(Item.siv>5000)size='SIZE3';else{if(Item.siv>1000)size='SIZE1';if(Item.siv>2000)size='SIZE2';if(Item.siv<80)size='SIZE0';}
if(size!='')size=gettext(size);name=size+' '+ngettext('GOLD_ITEM','GOLD_ITEM_PLURAL',0);}
var color=ItemUtilities.getItemTagColor(Item);string+='<div class="title" ';if(color!==false)string+='style="color: '+color+';" ';delete color;string+='>'+name+'<br/>';var containerName=Item.containerId+' ';containerName=containerName.substring(0,5);if(GameCore.Config.get('SHOP_FREE_ITEMS_BY_TYPE_'+Item.type)>0&&containerName=='Shop_'){string+='<span class="special_balancing_free_update">'+gettext('LABEL_IS_SPECIAL_BALANCING_FREE_UPDATE')+'</span>';}
if(Item.containerId=="Inventory"||isInventoryItem===true){string+='<span class="attached"> '+gettext('LABEL_IS_IN_INVENTORY')+' </span>';}
if(Item.craftingItem&&Item.craftingItem.attributes){string+='<span class="crafted"> '+gettext('LABEL_IS_CRAFTED')+' </span>';}
if(Item.type=='QUEST_ITEM'){string+='<span class="questitem"> '+gettext('LABEL_IS_QUEST_ITEM')+' </span>';}
return string+'</div>';};this.getItemPriceText=function(Item){var Content='<tr class="highlightPrice"  style="line-height:16px;"><td>';if(Item.type=='SPECIAL_INT_VALUE'){Content+=gettext('LABEL_GOLD')+'</td><td colspan="3"><span class="goldIcon_sprite">'+GameCore.NumberFormat(Item.siv,0)+'</span>';}else{Content+=gettext('LABEL_GOLD')+'</td><td colspan="3"><span class="goldIcon_sprite">'+GameCore.NumberFormat(Item.price_gold,0)+'</span>';if(Item.price_premium>0){Content+='<span class="premiumIcon_sprite">'+Item.price_premium+'</span>';}}
Content+='</td></tr>';return Content;};this.getItemAttributesText=function(Item,showLabels){var Content='<div class="skill"><table style="text-align:right;">';if(Item.level&&Item.level>=1){Content+='<tr class="highlight0">';if(showLabels===true)Content+='<td>'+gettext('LABEL_LEVEL')+'</td>';Content+='<td>'+Item.level+'</td><td>&nbsp;</td><td>&nbsp;</td></tr>';}
var i=0;for(var attribute in this.AttributesList){Content+='<tr class="AttLine'+i+'">';if(Item.attributes[attribute]&&((typeof Item.attributes[attribute].Value!='undefined'&&Item.attributes[attribute].Value!=0)||(typeof Item.attributes[attribute].Percent!='undefined'&&Item.attributes[attribute].Percent!=0)||(typeof Item.attributes[attribute].Value=='undefined'&&Item.attributes[attribute].Min=='undefined')||(typeof Item.attributes[attribute].Value=='undefined'&&Item.attributes[attribute].Min!='undefined'&&Item.attributes[attribute].Min>=0&&Item.attributes[attribute].Max>0))){if(showLabels===true){if(attribute!='Health'||(attribute=='Health'&&Item.type=='FOOD'))
Content+='<td>'+this.AttributesList[attribute].translation+'</td>';else if(attribute=='Health')
Content+='<td>'+this.AttributesList[attribute].translationAlternative+'</td>';}
if(typeof Item.attributes[attribute].Min!='undefined'){Content+='<td colspan="3" style="overflow:display; text-align:left;">'+this.getAttributeValueText(Item.attributes[attribute],true)+'</td>';}
else{Content+='<td>'+this.getAttributeValueText(Item.attributes[attribute],true)+'</td>';if(Item.craftingItem&&Item.craftingItem.attributes&&Item.craftingItem.attributes[attribute]){Content+='<td> ('+this.getAttributeValueText(Item.craftingItem.attributes[attribute],false)+') </td>';}}}else{Content+='<td colspan="4">&nbsp; </td>';}
Content+='</tr>';i++;}
Content+=this.getItemPriceText(Item);Content+='</table></div>';if(Item.craftingItem&&Item.craftingItem.item&&this.itemsToCompare==0){var imageUrl=GameCore.Dom.getStylesheetByStyleClass('Item_'+Item.craftingItem.item).style['backgroundImage'];imageUrl=imageUrl.substr(4,imageUrl.length-5);Content+='<br/><div class="craftedWith crafted"><sup><span>+</span></sup><img src="'+imageUrl+'"></div>';}
return Content;};this.getAttributeValueText=function(attributeValue,detailedInfo){var Content='';if(typeof attributeValue.Min!='undefined'){Content+=attributeValue.Min+' - '+attributeValue.Max;}
if(attributeValue.Value){Content+=parseInt(attributeValue.Value);}
if(detailedInfo===true){Content+='</td><td>';if(attributeValue.Percent){Content+=parseInt(attributeValue.Percent)+'%';}}
return Content;};this.move=function(x,y){var w=parseInt($(TooltipLayer.id).style.width)+10;if(YAHOO.util.Dom.getViewportWidth()<=(x+w)){this.TooltipLayer.style.left=x-w-this.Offset.x+'px';if($('selectedItemTT')){$('selectedItemTT').setStyle({'cssFloat':'right'});}}else{this.TooltipLayer.style.left=x+this.Offset.x+'px';if($('selectedItemTT')){$('selectedItemTT').setStyle({'cssFloat':'left'});}}
var TtCss=GameCore.Dom.getStylesheetByStyleClass('tooltipBg');var h=parseInt(TtCss.style.height)+20;if(YAHOO.util.Dom.getViewportHeight()<=(y+h)){this.TooltipLayer.style.top=y-h-this.Offset.y+'px';}
else{this.TooltipLayer.style.top=y+this.Offset.y+'px';}};this.prepareCache();this.assignTooltips();};
function menuLinks(urlString){window.location.href=urlString;}
var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;function ControlVersion()
{var version;var axo;var e;try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");version=axo.GetVariable("$version");}catch(e){}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");version="WIN 6,0,21,0";axo.AllowScriptAccess="always";version=axo.GetVariable("$version");}catch(e){}}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");version=axo.GetVariable("$version");}catch(e){}}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");version="WIN 3,0,18,0";}catch(e){}}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");version="WIN 2,0,0,11";}catch(e){version=-1;}}
return version;}
function GetSwfVer(){var flashVer=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var swVer2=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var flashDescription=navigator.plugins["Shockwave Flash"+swVer2].description;var descArray=flashDescription.split(" ");var tempArrayMajor=descArray[2].split(".");var versionMajor=tempArrayMajor[0];var versionMinor=tempArrayMajor[1];var versionRevision=descArray[3];if(versionRevision==""){versionRevision=descArray[4];}
if(versionRevision[0]=="d"){versionRevision=versionRevision.substring(1);}else if(versionRevision[0]=="r"){versionRevision=versionRevision.substring(1);if(versionRevision.indexOf("d")>0){versionRevision=versionRevision.substring(0,versionRevision.indexOf("d"));}}
var flashVer=versionMajor+"."+versionMinor+"."+versionRevision;}}
else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1)flashVer=4;else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1)flashVer=3;else if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1)flashVer=2;else if(isIE&&isWin&&!isOpera){flashVer=ControlVersion();}
return flashVer;}
function DetectFlashVer(reqMajorVer,reqMinorVer,reqRevision)
{versionStr=GetSwfVer();if(versionStr==-1){return false;}else if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",");}else{versionArray=versionStr.split(".");}
var versionMajor=versionArray[0];var versionMinor=versionArray[1];var versionRevision=versionArray[2];if(versionMajor>parseFloat(reqMajorVer)){return true;}else if(versionMajor==parseFloat(reqMajorVer)){if(versionMinor>parseFloat(reqMinorVer))
return true;else if(versionMinor==parseFloat(reqMinorVer)){if(versionRevision>=parseFloat(reqRevision))
return true;}}
return false;}}
function AC_AddExtension(src,ext)
{if(src.indexOf('?')!=-1)
return src.replace(/\?/,ext+'?');else
return src+ext;}
function AC_Generateobj(objAttrs,params,embedAttrs)
{var str='';if(isIE&&isWin&&!isOpera)
{str+='<object ';for(var i in objAttrs)
{str+=i+'="'+objAttrs[i]+'" ';}
str+='>';for(var i in params)
{str+='<param name="'+i+'" value="'+params[i]+'" /> ';}
str+='</object>';}
else
{str+='<embed ';for(var i in embedAttrs)
{str+=i+'="'+embedAttrs[i]+'" ';}
str+='> </embed>';}
document.write(str);}
function AC_FL_RunContent(){var ret=AC_GetArgs
(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");AC_Generateobj(ret.objAttrs,ret.params,ret.embedAttrs);}
function AC_SW_RunContent(){var ret=AC_GetArgs
(arguments,".dcr","src","clsid:166B1BCA-3F9C-11CF-8075-444553540000",null);AC_Generateobj(ret.objAttrs,ret.params,ret.embedAttrs);}
function AC_GetArgs(args,ext,srcParamName,classid,mimeType){var ret=new Object();ret.embedAttrs=new Object();ret.params=new Object();ret.objAttrs=new Object();for(var i=0;i<args.length;i=i+2){var currArg=args[i].toLowerCase();switch(currArg){case"classid":break;case"pluginspage":ret.embedAttrs[args[i]]=args[i+1];break;case"src":case"movie":args[i+1]=AC_AddExtension(args[i+1],ext);ret.embedAttrs["src"]=args[i+1];ret.params[srcParamName]=args[i+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblClick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":case"id":ret.objAttrs[args[i]]=args[i+1];break;case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":ret.embedAttrs[args[i]]=ret.objAttrs[args[i]]=args[i+1];break;default:ret.embedAttrs[args[i]]=ret.params[args[i]]=args[i+1];}}
ret.objAttrs["classid"]=classid;if(mimeType)ret.embedAttrs["type"]=mimeType;return ret;}
(function(){var Y=YAHOO.util;Y.Selector={_foundCache:[],_regexCache:{},_re:{nth:/^(?:([-]?\d*)(n){1}|(odd|even)$)*([-+]?\d*)$/,attr:/(\[.*\])/g,urls:/^(?:href|src)/},document:window.document,attrAliases:{},shorthand:{'\\#(-?[_a-z]+[-\\w]*)':'[id=$1]','\\.(-?[_a-z]+[-\\w]*)':'[class~=$1]'},operators:{'=':function(attr,val){return attr===val;},'!=':function(attr,val){return attr!==val;},'~=':function(attr,val){var s=' ';return(s+attr+s).indexOf((s+val+s))>-1;},'|=':function(attr,val){return attr===val||attr.slice(0,val.length+1)===val+'-';},'^=':function(attr,val){return attr.indexOf(val)===0;},'$=':function(attr,val){return attr.slice(-val.length)===val;},'*=':function(attr,val){return attr.indexOf(val)>-1;},'':function(attr,val){return attr;}},pseudos:{'root':function(node){return node===node.ownerDocument.documentElement;},'nth-child':function(node,val){return Y.Selector._getNth(node,val);},'nth-last-child':function(node,val){return Y.Selector._getNth(node,val,null,true);},'nth-of-type':function(node,val){return Y.Selector._getNth(node,val,node.tagName);},'nth-last-of-type':function(node,val){return Y.Selector._getNth(node,val,node.tagName,true);},'first-child':function(node){return Y.Selector._getChildren(node.parentNode)[0]===node;},'last-child':function(node){var children=Y.Selector._getChildren(node.parentNode);return children[children.length-1]===node;},'first-of-type':function(node,val){return Y.Selector._getChildren(node.parentNode,node.tagName)[0];},'last-of-type':function(node,val){var children=Y.Selector._getChildren(node.parentNode,node.tagName);return children[children.length-1];},'only-child':function(node){var children=Y.Selector._getChildren(node.parentNode);return children.length===1&&children[0]===node;},'only-of-type':function(node){return Y.Selector._getChildren(node.parentNode,node.tagName).length===1;},'empty':function(node){return node.childNodes.length===0;},'not':function(node,simple){return!Y.Selector.test(node,simple);},'contains':function(node,str){var text=node.innerText||node.textContent||'';return text.indexOf(str)>-1;},'checked':function(node){return node.checked===true;}},test:function(node,selector){node=Y.Selector.document.getElementById(node)||node;if(!node){return false;}
var groups=selector?selector.split(','):[];if(groups.length){for(var i=0,len=groups.length;i<len;++i){if(Y.Selector._test(node,groups[i])){return true;}}
return false;}
return Y.Selector._test(node,selector);},_test:function(node,selector,token,deDupe){token=token||Y.Selector._tokenize(selector).pop()||{};if(!node.tagName||(token.tag!=='*'&&node.tagName!==token.tag)||(deDupe&&node._found)){return false;}
if(token.attributes.length){var val,ieFlag,re_urls=Y.Selector._re.urls;if(!node.attributes||!node.attributes.length){return false;}
for(var i=0,attr;attr=token.attributes[i++];){ieFlag=(re_urls.test(attr[0]))?2:0;val=node.getAttribute(attr[0],ieFlag);if(val===null||val===undefined){return false;}
if(Y.Selector.operators[attr[1]]&&!Y.Selector.operators[attr[1]](val,attr[2])){return false;}}}
if(token.pseudos.length){for(var i=0,len=token.pseudos.length;i<len;++i){if(Y.Selector.pseudos[token.pseudos[i][0]]&&!Y.Selector.pseudos[token.pseudos[i][0]](node,token.pseudos[i][1])){return false;}}}
return(token.previous&&token.previous.combinator!==',')?Y.Selector._combinators[token.previous.combinator](node,token):true;},filter:function(nodes,selector){nodes=nodes||[];var node,result=[],tokens=Y.Selector._tokenize(selector);if(!nodes.item){for(var i=0,len=nodes.length;i<len;++i){if(!nodes[i].tagName){node=Y.Selector.document.getElementById(nodes[i]);if(node){nodes[i]=node;}else{}}}}
result=Y.Selector._filter(nodes,Y.Selector._tokenize(selector)[0]);return result;},_filter:function(nodes,token,firstOnly,deDupe){var result=firstOnly?null:[],foundCache=Y.Selector._foundCache;for(var i=0,len=nodes.length;i<len;i++){if(!Y.Selector._test(nodes[i],'',token,deDupe)){continue;}
if(firstOnly){return nodes[i];}
if(deDupe){if(nodes[i]._found){continue;}
nodes[i]._found=true;foundCache[foundCache.length]=nodes[i];}
result[result.length]=nodes[i];}
return result;},query:function(selector,root,firstOnly){var result=Y.Selector._query(selector,root,firstOnly);return result;},_query:function(selector,root,firstOnly,deDupe){var result=(firstOnly)?null:[],node;if(!selector){return result;}
var groups=selector.split(',');if(groups.length>1){var found;for(var i=0,len=groups.length;i<len;++i){found=arguments.callee(groups[i],root,firstOnly,true);result=firstOnly?found:result.concat(found);}
Y.Selector._clearFoundCache();return result;}
if(root&&!root.nodeName){root=Y.Selector.document.getElementById(root);if(!root){return result;}}
root=root||Y.Selector.document;if(root.nodeName!=='#document'){Y.Dom.generateId(root);selector=root.tagName+'#'+root.id+' '+selector;node=root;root=root.ownerDocument;}
var tokens=Y.Selector._tokenize(selector);var idToken=tokens[Y.Selector._getIdTokenIndex(tokens)],nodes=[],id,token=tokens.pop()||{};if(idToken){id=Y.Selector._getId(idToken.attributes);}
if(id){node=node||Y.Selector.document.getElementById(id);if(node&&(root.nodeName==='#document'||Y.Dom.isAncestor(root,node))){if(Y.Selector._test(node,null,idToken)){if(idToken===token){nodes=[node];}else if(idToken.combinator===' '||idToken.combinator==='>'){root=node;}}}else{return result;}}
if(root&&!nodes.length){nodes=root.getElementsByTagName(token.tag);}
if(nodes.length){result=Y.Selector._filter(nodes,token,firstOnly,deDupe);}
return result;},_clearFoundCache:function(){var foundCache=Y.Selector._foundCache;for(var i=0,len=foundCache.length;i<len;++i){try{delete foundCache[i]._found;}catch(e){foundCache[i].removeAttribute('_found');}}
foundCache=[];},_getRegExp:function(str,flags){var regexCache=Y.Selector._regexCache;flags=flags||'';if(!regexCache[str+flags]){regexCache[str+flags]=new RegExp(str,flags);}
return regexCache[str+flags];},_getChildren:function(){if(document.documentElement.children){return function(node,tag){return(tag)?node.children.tags(tag):node.children||[];};}else{return function(node,tag){if(node._children){return node._children;}
var children=[],childNodes=node.childNodes;for(var i=0,len=childNodes.length;i<len;++i){if(childNodes[i].tagName){if(!tag||childNodes[i].tagName===tag){children[children.length]=childNodes[i];}}}
node._children=children;return children;};}}(),_combinators:{' ':function(node,token){while((node=node.parentNode)){if(Y.Selector._test(node,'',token.previous)){return true;}}
return false;},'>':function(node,token){return Y.Selector._test(node.parentNode,null,token.previous);},'+':function(node,token){var sib=node.previousSibling;while(sib&&sib.nodeType!==1){sib=sib.previousSibling;}
if(sib&&Y.Selector._test(sib,null,token.previous)){return true;}
return false;},'~':function(node,token){var sib=node.previousSibling;while(sib){if(sib.nodeType===1&&Y.Selector._test(sib,null,token.previous)){return true;}
sib=sib.previousSibling;}
return false;}},_getNth:function(node,expr,tag,reverse){Y.Selector._re.nth.test(expr);var a=parseInt(RegExp.$1,10),n=RegExp.$2,oddeven=RegExp.$3,b=parseInt(RegExp.$4,10)||0,result=[],op;var siblings=Y.Selector._getChildren(node.parentNode,tag);if(oddeven){a=2;op='+';n='n';b=(oddeven==='odd')?1:0;}else if(isNaN(a)){a=(n)?1:0;}
if(a===0){if(reverse){b=siblings.length-b+1;}
if(siblings[b-1]===node){return true;}else{return false;}}else if(a<0){reverse=!!reverse;a=Math.abs(a);}
if(!reverse){for(var i=b-1,len=siblings.length;i<len;i+=a){if(i>=0&&siblings[i]===node){return true;}}}else{for(var i=siblings.length-b,len=siblings.length;i>=0;i-=a){if(i<len&&siblings[i]===node){return true;}}}
return false;},_getId:function(attr){for(var i=0,len=attr.length;i<len;++i){if(attr[i][0]=='id'&&attr[i][1]==='='){return attr[i][2];}}},_getIdTokenIndex:function(tokens){for(var i=0,len=tokens.length;i<len;++i){if(Y.Selector._getId(tokens[i].attributes)){return i;}}
return-1;},_patterns:{tag:/^((?:-?[_a-z]+[\w-]*)|\*)/i,attributes:/^\[([a-z]+\w*)+([~\|\^\$\*!=]=?)?['"]?([^\]]*?)['"]?\]/i,pseudos:/^:([-\w]+)(?:\(['"]?(.+)['"]?\))*/i,combinator:/^\s*([>+~]|\s)\s*/},_tokenize:function(selector){var token={},tokens=[],id,found=false,patterns=Y.Selector._patterns,match;selector=Y.Selector._replaceShorthand(selector);do{found=false;for(var re in patterns){if(YAHOO.lang.hasOwnProperty(patterns,re)){if(re!='tag'&&re!='combinator'){token[re]=token[re]||[];}
if((match=patterns[re].exec(selector))){found=true;if(re!='tag'&&re!='combinator'){if(re==='attributes'&&match[1]==='id'){token.id=match[3];}
token[re].push(match.slice(1));}else{token[re]=match[1];}
selector=selector.replace(match[0],'');if(re==='combinator'||!selector.length){token.attributes=Y.Selector._fixAttributes(token.attributes);token.pseudos=token.pseudos||[];token.tag=token.tag?token.tag.toUpperCase():'*';tokens.push(token);token={previous:token};}}}}}while(found);return tokens;},_fixAttributes:function(attr){var aliases=Y.Selector.attrAliases;attr=attr||[];for(var i=0,len=attr.length;i<len;++i){if(aliases[attr[i][0]]){attr[i][0]=aliases[attr[i][0]];}
if(!attr[i][1]){attr[i][1]='';}}
return attr;},_replaceShorthand:function(selector){var shorthand=Y.Selector.shorthand;var attrs=selector.match(Y.Selector._re.attr);if(attrs){selector=selector.replace(Y.Selector._re.attr,'REPLACED_ATTRIBUTE');}
for(var re in shorthand){if(YAHOO.lang.hasOwnProperty(shorthand,re)){selector=selector.replace(Y.Selector._getRegExp(re,'gi'),shorthand[re]);}}
if(attrs){for(var i=0,len=attrs.length;i<len;++i){selector=selector.replace('REPLACED_ATTRIBUTE',attrs[i]);}}
return selector;}};if(YAHOO.env.ua.ie&&YAHOO.env.ua.ie<8){Y.Selector.attrAliases['class']='className';Y.Selector.attrAliases['for']='htmlFor';}})();YAHOO.register("selector",YAHOO.util.Selector,{version:"2.7.0",build:"1799"});
if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=(""+A[C]).split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules,B,H,G,F,C;if(!I[A]){I[A]={versions:[],builds:[]};}B=I[A];H=D.version;G=D.build;F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0,caja:0},B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}A=B.match(/AdobeAIR\/([^\s]*)/);if(A){C.air=A[0];}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}A=B.match(/Caja\/([^\s]*)/);if(A&&A[1]){C.caja=parseFloat(A[1]);}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var B=YAHOO.lang,F="[object Array]",C="[object Function]",A=Object.prototype,E=["toString","valueOf"],D={isArray:function(G){return A.toString.apply(G)===F;},isBoolean:function(G){return typeof G==="boolean";},isFunction:function(G){return A.toString.apply(G)===C;},isNull:function(G){return G===null;},isNumber:function(G){return typeof G==="number"&&isFinite(G);},isObject:function(G){return(G&&(typeof G==="object"||B.isFunction(G)))||false;},isString:function(G){return typeof G==="string";},isUndefined:function(G){return typeof G==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(I,H){var G,K,J;for(G=0;G<E.length;G=G+1){K=E[G];J=H[K];if(B.isFunction(J)&&J!=A[K]){I[K]=J;}}}:function(){},extend:function(J,K,I){if(!K||!J){throw new Error("extend failed, please check that "+"all dependencies are included.");}var H=function(){},G;H.prototype=K.prototype;J.prototype=new H();J.prototype.constructor=J;J.superclass=K.prototype;if(K.prototype.constructor==A.constructor){K.prototype.constructor=K;}if(I){for(G in I){if(B.hasOwnProperty(I,G)){J.prototype[G]=I[G];}}B._IEEnumFix(J.prototype,I);}},augmentObject:function(K,J){if(!J||!K){throw new Error("Absorb failed, verify dependencies.");}var G=arguments,I,L,H=G[2];if(H&&H!==true){for(I=2;I<G.length;I=I+1){K[G[I]]=J[G[I]];}}else{for(L in J){if(H||!(L in K)){K[L]=J[L];}}B._IEEnumFix(K,J);}},augmentProto:function(J,I){if(!I||!J){throw new Error("Augment failed, verify dependencies.");}var G=[J.prototype,I.prototype],H;for(H=2;H<arguments.length;H=H+1){G.push(arguments[H]);}B.augmentObject.apply(this,G);},dump:function(G,L){var I,K,N=[],O="{...}",H="f(){...}",M=", ",J=" => ";if(!B.isObject(G)){return G+"";}else{if(G instanceof Date||("nodeType"in G&&"tagName"in G)){return G;}else{if(B.isFunction(G)){return H;}}}L=(B.isNumber(L))?L:3;if(B.isArray(G)){N.push("[");for(I=0,K=G.length;I<K;I=I+1){if(B.isObject(G[I])){N.push((L>0)?B.dump(G[I],L-1):O);}else{N.push(G[I]);}N.push(M);}if(N.length>1){N.pop();}N.push("]");}else{N.push("{");for(I in G){if(B.hasOwnProperty(G,I)){N.push(I+J);if(B.isObject(G[I])){N.push((L>0)?B.dump(G[I],L-1):O);}else{N.push(G[I]);}N.push(M);}}if(N.length>1){N.pop();}N.push("}");}return N.join("");},substitute:function(V,H,O){var L,K,J,R,S,U,Q=[],I,M="dump",P=" ",G="{",T="}",N;for(;;){L=V.lastIndexOf(G);if(L<0){break;}K=V.indexOf(T,L);if(L+1>=K){break;}I=V.substring(L+1,K);R=I;U=null;J=R.indexOf(P);if(J>-1){U=R.substring(J+1);R=R.substring(0,J);}S=H[R];if(O){S=O(R,S,U);}if(B.isObject(S)){if(B.isArray(S)){S=B.dump(S,parseInt(U,10));}else{U=U||"";N=U.indexOf(M);if(N>-1){U=U.substring(4);}if(S.toString===A.toString||N>-1){S=B.dump(S,parseInt(U,10));}else{S=S.toString();}}}else{if(!B.isString(S)&&!B.isNumber(S)){S="~-"+Q.length+"-~";Q[Q.length]=I;}}V=V.substring(0,L)+S+V.substring(K+1);}for(L=Q.length-1;L>=0;L=L-1){V=V.replace(new RegExp("~-"+L+"-~"),"{"+Q[L]+"}","g");}return V;},trim:function(G){try{return G.replace(/^\s+|\s+$/g,"");}catch(H){return G;}},merge:function(){var J={},H=arguments,G=H.length,I;for(I=0;I<G;I=I+1){B.augmentObject(J,H[I],true);}return J;},later:function(N,H,O,J,K){N=N||0;H=H||{};var I=O,M=J,L,G;if(B.isString(O)){I=H[O];}if(!I){throw new TypeError("method undefined");}if(!B.isArray(M)){M=[J];}L=function(){I.apply(H,M);};G=(K)?setInterval(L,N):setTimeout(L,N);return{interval:K,cancel:function(){if(this.interval){clearInterval(G);}else{clearTimeout(G);}}};},isValue:function(G){return(B.isObject(G)||B.isString(G)||B.isNumber(G)||B.isBoolean(G));}};B.hasOwnProperty=(A.hasOwnProperty)?function(G,H){return G&&G.hasOwnProperty(H);}:function(G,H){return!B.isUndefined(G[H])&&G.constructor.prototype[H]!==G[H];};D.augmentObject(B,D,true);YAHOO.util.Lang=B;B.augment=B.augmentProto;YAHOO.augment=B.augmentProto;YAHOO.extend=B.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.7.0",build:"1799"});(function(){YAHOO.env._id_counter=YAHOO.env._id_counter||0;var E=YAHOO.util,L=YAHOO.lang,m=YAHOO.env.ua,A=YAHOO.lang.trim,d={},h={},N=/^t(?:able|d|h)$/i,X=/color$/i,K=window.document,W=K.documentElement,e="ownerDocument",n="defaultView",v="documentElement",t="compatMode",b="offsetLeft",P="offsetTop",u="offsetParent",Z="parentNode",l="nodeType",C="tagName",O="scrollLeft",i="scrollTop",Q="getBoundingClientRect",w="getComputedStyle",a="currentStyle",M="CSS1Compat",c="BackCompat",g="class",F="className",J="",B=" ",s="(?:^|\\s)",k="(?= |$)",U="g",p="position",f="fixed",V="relative",j="left",o="top",r="medium",q="borderLeftWidth",R="borderTopWidth",D=m.opera,I=m.webkit,H=m.gecko,T=m.ie;E.Dom={CUSTOM_ATTRIBUTES:(!W.hasAttribute)?{"for":"htmlFor","class":F}:{"htmlFor":"for","className":g},get:function(y){var AA,Y,z,x,G;if(y){if(y[l]||y.item){return y;}if(typeof y==="string"){AA=y;y=K.getElementById(y);if(y&&y.id===AA){return y;}else{if(y&&K.all){y=null;Y=K.all[AA];for(x=0,G=Y.length;x<G;++x){if(Y[x].id===AA){return Y[x];}}}}return y;}if(y.DOM_EVENTS){y=y.get("element");}if("length"in y){z=[];for(x=0,G=y.length;x<G;++x){z[z.length]=E.Dom.get(y[x]);}return z;}return y;}return null;},getComputedStyle:function(G,Y){if(window[w]){return G[e][n][w](G,null)[Y];}else{if(G[a]){return E.Dom.IE_ComputedStyle.get(G,Y);}}},getStyle:function(G,Y){return E.Dom.batch(G,E.Dom._getStyle,Y);},_getStyle:function(){if(window[w]){return function(G,y){y=(y==="float")?y="cssFloat":E.Dom._toCamel(y);var x=G.style[y],Y;if(!x){Y=G[e][n][w](G,null);if(Y){x=Y[y];}}return x;};}else{if(W[a]){return function(G,y){var x;switch(y){case"opacity":x=100;try{x=G.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(z){try{x=G.filters("alpha").opacity;}catch(Y){}}return x/100;case"float":y="styleFloat";default:y=E.Dom._toCamel(y);x=G[a]?G[a][y]:null;return(G.style[y]||x);}};}}}(),setStyle:function(G,Y,x){E.Dom.batch(G,E.Dom._setStyle,{prop:Y,val:x});},_setStyle:function(){if(T){return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){switch(x){case"opacity":if(L.isString(Y.style.filter)){Y.style.filter="alpha(opacity="+y*100+")";if(!Y[a]||!Y[a].hasLayout){Y.style.zoom=1;}}break;case"float":x="styleFloat";default:Y.style[x]=y;}}else{}};}else{return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){if(x=="float"){x="cssFloat";}Y.style[x]=y;}else{}};}}(),getXY:function(G){return E.Dom.batch(G,E.Dom._getXY);},_canPosition:function(G){return(E.Dom._getStyle(G,"display")!=="none"&&E.Dom._inDoc(G));},_getXY:function(){if(K[v][Q]){return function(y){var z,Y,AA,AF,AE,AD,AC,G,x,AB=Math.floor,AG=false;if(E.Dom._canPosition(y)){AA=y[Q]();AF=y[e];z=E.Dom.getDocumentScrollLeft(AF);Y=E.Dom.getDocumentScrollTop(AF);AG=[AB(AA[j]),AB(AA[o])];if(T&&m.ie<8){AE=2;AD=2;AC=AF[t];G=S(AF[v],q);x=S(AF[v],R);if(m.ie===6){if(AC!==c){AE=0;AD=0;}}if((AC==c)){if(G!==r){AE=parseInt(G,10);}if(x!==r){AD=parseInt(x,10);}}AG[0]-=AE;AG[1]-=AD;}if((Y||z)){AG[0]+=z;AG[1]+=Y;}AG[0]=AB(AG[0]);AG[1]=AB(AG[1]);}else{}return AG;};}else{return function(y){var x,Y,AA,AB,AC,z=false,G=y;if(E.Dom._canPosition(y)){z=[y[b],y[P]];x=E.Dom.getDocumentScrollLeft(y[e]);Y=E.Dom.getDocumentScrollTop(y[e]);AC=((H||m.webkit>519)?true:false);while((G=G[u])){z[0]+=G[b];z[1]+=G[P];if(AC){z=E.Dom._calcBorders(G,z);}}if(E.Dom._getStyle(y,p)!==f){G=y;while((G=G[Z])&&G[C]){AA=G[i];AB=G[O];if(H&&(E.Dom._getStyle(G,"overflow")!=="visible")){z=E.Dom._calcBorders(G,z);}if(AA||AB){z[0]-=AB;z[1]-=AA;}}z[0]+=x;z[1]+=Y;}else{if(D){z[0]-=x;z[1]-=Y;}else{if(I||H){z[0]+=x;z[1]+=Y;}}}z[0]=Math.floor(z[0]);z[1]=Math.floor(z[1]);}else{}return z;};}}(),getX:function(G){var Y=function(x){return E.Dom.getXY(x)[0];};return E.Dom.batch(G,Y,E.Dom,true);},getY:function(G){var Y=function(x){return E.Dom.getXY(x)[1];};return E.Dom.batch(G,Y,E.Dom,true);},setXY:function(G,x,Y){E.Dom.batch(G,E.Dom._setXY,{pos:x,noRetry:Y});},_setXY:function(G,z){var AA=E.Dom._getStyle(G,p),y=E.Dom.setStyle,AD=z.pos,Y=z.noRetry,AB=[parseInt(E.Dom.getComputedStyle(G,j),10),parseInt(E.Dom.getComputedStyle(G,o),10)],AC,x;if(AA=="static"){AA=V;y(G,p,AA);}AC=E.Dom._getXY(G);if(!AD||AC===false){return false;}if(isNaN(AB[0])){AB[0]=(AA==V)?0:G[b];}if(isNaN(AB[1])){AB[1]=(AA==V)?0:G[P];}if(AD[0]!==null){y(G,j,AD[0]-AC[0]+AB[0]+"px");}if(AD[1]!==null){y(G,o,AD[1]-AC[1]+AB[1]+"px");}if(!Y){x=E.Dom._getXY(G);if((AD[0]!==null&&x[0]!=AD[0])||(AD[1]!==null&&x[1]!=AD[1])){E.Dom._setXY(G,{pos:AD,noRetry:true});}}},setX:function(Y,G){E.Dom.setXY(Y,[G,null]);},setY:function(G,Y){E.Dom.setXY(G,[null,Y]);},getRegion:function(G){var Y=function(x){var y=false;if(E.Dom._canPosition(x)){y=E.Region.getRegion(x);}else{}return y;};return E.Dom.batch(G,Y,E.Dom,true);},getClientWidth:function(){return E.Dom.getViewportWidth();},getClientHeight:function(){return E.Dom.getViewportHeight();},getElementsByClassName:function(AB,AF,AC,AE,x,AD){AB=L.trim(AB);AF=AF||"*";AC=(AC)?E.Dom.get(AC):null||K;if(!AC){return[];}var Y=[],G=AC.getElementsByTagName(AF),z=E.Dom.hasClass;for(var y=0,AA=G.length;y<AA;++y){if(z(G[y],AB)){Y[Y.length]=G[y];}}if(AE){E.Dom.batch(Y,AE,x,AD);}return Y;},hasClass:function(Y,G){return E.Dom.batch(Y,E.Dom._hasClass,G);},_hasClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom.getAttribute(x,F)||J;if(Y.exec){G=Y.test(y);}else{G=Y&&(B+y+B).indexOf(B+Y+B)>-1;}}else{}return G;},addClass:function(Y,G){return E.Dom.batch(Y,E.Dom._addClass,G);},_addClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom.getAttribute(x,F)||J;if(!E.Dom._hasClass(x,Y)){E.Dom.setAttribute(x,F,A(y+B+Y));G=true;}}else{}return G;},removeClass:function(Y,G){return E.Dom.batch(Y,E.Dom._removeClass,G);},_removeClass:function(y,x){var Y=false,AA,z,G;if(y&&x){AA=E.Dom.getAttribute(y,F)||J;E.Dom.setAttribute(y,F,AA.replace(E.Dom._getClassRegex(x),J));z=E.Dom.getAttribute(y,F);if(AA!==z){E.Dom.setAttribute(y,F,A(z));Y=true;if(E.Dom.getAttribute(y,F)===""){G=(y.hasAttribute&&y.hasAttribute(g))?g:F;y.removeAttribute(G);}}}else{}return Y;},replaceClass:function(x,Y,G){return E.Dom.batch(x,E.Dom._replaceClass,{from:Y,to:G});},_replaceClass:function(y,x){var Y,AB,AA,G=false,z;if(y&&x){AB=x.from;AA=x.to;if(!AA){G=false;}else{if(!AB){G=E.Dom._addClass(y,x.to);}else{if(AB!==AA){z=E.Dom.getAttribute(y,F)||J;Y=(B+z.replace(E.Dom._getClassRegex(AB),B+AA)).split(E.Dom._getClassRegex(AA));Y.splice(1,0,B+AA);E.Dom.setAttribute(y,F,A(Y.join(J)));G=true;}}}}else{}return G;},generateId:function(G,x){x=x||"yui-gen";var Y=function(y){if(y&&y.id){return y.id;}var z=x+YAHOO.env._id_counter++;if(y){if(y[e].getElementById(z)){return E.Dom.generateId(y,z+x);}y.id=z;}return z;};return E.Dom.batch(G,Y,E.Dom,true)||Y.apply(E.Dom,arguments);},isAncestor:function(Y,x){Y=E.Dom.get(Y);x=E.Dom.get(x);var G=false;if((Y&&x)&&(Y[l]&&x[l])){if(Y.contains&&Y!==x){G=Y.contains(x);}else{if(Y.compareDocumentPosition){G=!!(Y.compareDocumentPosition(x)&16);}}}else{}return G;},inDocument:function(G,Y){return E.Dom._inDoc(E.Dom.get(G),Y);},_inDoc:function(Y,x){var G=false;if(Y&&Y[C]){x=x||Y[e];G=E.Dom.isAncestor(x[v],Y);}else{}return G;},getElementsBy:function(Y,AF,AB,AD,y,AC,AE){AF=AF||"*";AB=(AB)?E.Dom.get(AB):null||K;if(!AB){return[];}var x=[],G=AB.getElementsByTagName(AF);for(var z=0,AA=G.length;z<AA;++z){if(Y(G[z])){if(AE){x=G[z];break;}else{x[x.length]=G[z];}}}if(AD){E.Dom.batch(x,AD,y,AC);}return x;},getElementBy:function(x,G,Y){return E.Dom.getElementsBy(x,G,Y,null,null,null,true);},batch:function(x,AB,AA,z){var y=[],Y=(z)?AA:window;x=(x&&(x[C]||x.item))?x:E.Dom.get(x);if(x&&AB){if(x[C]||x.length===undefined){return AB.call(Y,x,AA);}for(var G=0;G<x.length;++G){y[y.length]=AB.call(Y,x[G],AA);}}else{return false;}return y;},getDocumentHeight:function(){var Y=(K[t]!=M||I)?K.body.scrollHeight:W.scrollHeight,G=Math.max(Y,E.Dom.getViewportHeight());return G;},getDocumentWidth:function(){var Y=(K[t]!=M||I)?K.body.scrollWidth:W.scrollWidth,G=Math.max(Y,E.Dom.getViewportWidth());return G;},getViewportHeight:function(){var G=self.innerHeight,Y=K[t];if((Y||T)&&!D){G=(Y==M)?W.clientHeight:K.body.clientHeight;}return G;},getViewportWidth:function(){var G=self.innerWidth,Y=K[t];if(Y||T){G=(Y==M)?W.clientWidth:K.body.clientWidth;}return G;},getAncestorBy:function(G,Y){while((G=G[Z])){if(E.Dom._testElement(G,Y)){return G;}}return null;},getAncestorByClassName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null;}var x=function(y){return E.Dom.hasClass(y,G);};return E.Dom.getAncestorBy(Y,x);},getAncestorByTagName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null;}var x=function(y){return y[C]&&y[C].toUpperCase()==G.toUpperCase();};return E.Dom.getAncestorBy(Y,x);},getPreviousSiblingBy:function(G,Y){while(G){G=G.previousSibling;if(E.Dom._testElement(G,Y)){return G;}}return null;},getPreviousSibling:function(G){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getPreviousSiblingBy(G);},getNextSiblingBy:function(G,Y){while(G){G=G.nextSibling;if(E.Dom._testElement(G,Y)){return G;}}return null;},getNextSibling:function(G){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getNextSiblingBy(G);},getFirstChildBy:function(G,x){var Y=(E.Dom._testElement(G.firstChild,x))?G.firstChild:null;return Y||E.Dom.getNextSiblingBy(G.firstChild,x);},getFirstChild:function(G,Y){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getFirstChildBy(G);},getLastChildBy:function(G,x){if(!G){return null;}var Y=(E.Dom._testElement(G.lastChild,x))?G.lastChild:null;return Y||E.Dom.getPreviousSiblingBy(G.lastChild,x);},getLastChild:function(G){G=E.Dom.get(G);return E.Dom.getLastChildBy(G);},getChildrenBy:function(Y,y){var x=E.Dom.getFirstChildBy(Y,y),G=x?[x]:[];E.Dom.getNextSiblingBy(x,function(z){if(!y||y(z)){G[G.length]=z;}return false;});return G;},getChildren:function(G){G=E.Dom.get(G);if(!G){}return E.Dom.getChildrenBy(G);},getDocumentScrollLeft:function(G){G=G||K;return Math.max(G[v].scrollLeft,G.body.scrollLeft);},getDocumentScrollTop:function(G){G=G||K;return Math.max(G[v].scrollTop,G.body.scrollTop);},insertBefore:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null;}return G[Z].insertBefore(Y,G);},insertAfter:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null;}if(G.nextSibling){return G[Z].insertBefore(Y,G.nextSibling);}else{return G[Z].appendChild(Y);}},getClientRegion:function(){var x=E.Dom.getDocumentScrollTop(),Y=E.Dom.getDocumentScrollLeft(),y=E.Dom.getViewportWidth()+Y,G=E.Dom.getViewportHeight()+x;return new E.Region(x,y,G,Y);},setAttribute:function(Y,G,x){G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;Y.setAttribute(G,x);},getAttribute:function(Y,G){G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;return Y.getAttribute(G);},_toCamel:function(Y){var x=d;function G(y,z){return z.toUpperCase();}return x[Y]||(x[Y]=Y.indexOf("-")===-1?Y:Y.replace(/-([a-z])/gi,G));},_getClassRegex:function(Y){var G;if(Y!==undefined){if(Y.exec){G=Y;}else{G=h[Y];if(!G){Y=Y.replace(E.Dom._patterns.CLASS_RE_TOKENS,"\\$1");G=h[Y]=new RegExp(s+Y+k,U);}}}return G;},_patterns:{ROOT_TAG:/^body|html$/i,CLASS_RE_TOKENS:/([\.\(\)\^\$\*\+\?\|\[\]\{\}])/g},_testElement:function(G,Y){return G&&G[l]==1&&(!Y||Y(G));},_calcBorders:function(x,y){var Y=parseInt(E.Dom[w](x,R),10)||0,G=parseInt(E.Dom[w](x,q),10)||0;if(H){if(N.test(x[C])){Y=0;G=0;}}y[0]+=G;y[1]+=Y;return y;}};var S=E.Dom[w];if(m.opera){E.Dom[w]=function(Y,G){var x=S(Y,G);if(X.test(G)){x=E.Dom.Color.toRGB(x);}return x;};}if(m.webkit){E.Dom[w]=function(Y,G){var x=S(Y,G);if(x==="rgba(0, 0, 0, 0)"){x="transparent";}return x;};}})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this.y=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this.x=B;this[0]=B;this.width=this.right-this.left;this.height=this.bottom-this.top;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top),D=Math.min(this.right,E.right),A=Math.min(this.bottom,E.bottom),B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top),D=Math.max(this.right,E.right),A=Math.max(this.bottom,E.bottom),B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+", height: "+this.height+", width: "+this.width+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D),C=F[1],E=F[0]+D.offsetWidth,A=F[1]+D.offsetHeight,B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}YAHOO.util.Point.superclass.constructor.call(this,B,A,B,A);};YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);(function(){var B=YAHOO.util,A="clientTop",F="clientLeft",J="parentNode",K="right",W="hasLayout",I="px",U="opacity",L="auto",D="borderLeftWidth",G="borderTopWidth",P="borderRightWidth",V="borderBottomWidth",S="visible",Q="transparent",N="height",E="width",H="style",T="currentStyle",R=/^width|height$/,O=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,M={get:function(X,Z){var Y="",a=X[T][Z];if(Z===U){Y=B.Dom.getStyle(X,U);}else{if(!a||(a.indexOf&&a.indexOf(I)>-1)){Y=a;}else{if(B.Dom.IE_COMPUTED[Z]){Y=B.Dom.IE_COMPUTED[Z](X,Z);}else{if(O.test(a)){Y=B.Dom.IE.ComputedStyle.getPixel(X,Z);}else{Y=a;}}}}return Y;},getOffset:function(Z,e){var b=Z[T][e],X=e.charAt(0).toUpperCase()+e.substr(1),c="offset"+X,Y="pixel"+X,a="",d;if(b==L){d=Z[c];if(d===undefined){a=0;}a=d;if(R.test(e)){Z[H][e]=d;if(Z[c]>d){a=d-(Z[c]-d);}Z[H][e]=L;}}else{if(!Z[H][Y]&&!Z[H][e]){Z[H][e]=b;}a=Z[H][Y];}return a+I;},getBorderWidth:function(X,Z){var Y=null;if(!X[T][W]){X[H].zoom=1;}switch(Z){case G:Y=X[A];break;case V:Y=X.offsetHeight-X.clientHeight-X[A];break;case D:Y=X[F];break;case P:Y=X.offsetWidth-X.clientWidth-X[F];break;}return Y+I;},getPixel:function(Y,X){var a=null,b=Y[T][K],Z=Y[T][X];Y[H][K]=Z;a=Y[H].pixelRight;Y[H][K]=b;return a+I;},getMargin:function(Y,X){var Z;if(Y[T][X]==L){Z=0+I;}else{Z=B.Dom.IE.ComputedStyle.getPixel(Y,X);}return Z;},getVisibility:function(Y,X){var Z;while((Z=Y[T])&&Z[X]=="inherit"){Y=Y[J];}return(Z)?Z[X]:S;},getColor:function(Y,X){return B.Dom.Color.toRGB(Y[T][X])||Q;},getBorderColor:function(Y,X){var Z=Y[T],a=Z[X]||Z.color;return B.Dom.Color.toRGB(B.Dom.Color.toHex(a));}},C={};C.top=C.right=C.bottom=C.left=C[E]=C[N]=M.getOffset;C.color=M.getColor;C[G]=C[P]=C[V]=C[D]=M.getBorderWidth;C.marginTop=C.marginRight=C.marginBottom=C.marginLeft=M.getMargin;C.visibility=M.getVisibility;C.borderColor=C.borderTopColor=C.borderRightColor=C.borderBottomColor=C.borderLeftColor=M.getBorderColor;B.Dom.IE_COMPUTED=C;B.Dom.IE_ComputedStyle=M;})();(function(){var C="toString",A=parseInt,B=RegExp,D=YAHOO.util;D.Dom.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(E){if(!D.Dom.Color.re_RGB.test(E)){E=D.Dom.Color.toHex(E);}if(D.Dom.Color.re_hex.exec(E)){E="rgb("+[A(B.$1,16),A(B.$2,16),A(B.$3,16)].join(", ")+")";}return E;},toHex:function(H){H=D.Dom.Color.KEYWORDS[H]||H;if(D.Dom.Color.re_RGB.exec(H)){var G=(B.$1.length===1)?"0"+B.$1:Number(B.$1),F=(B.$2.length===1)?"0"+B.$2:Number(B.$2),E=(B.$3.length===1)?"0"+B.$3:Number(B.$3);H=[G[C](16),F[C](16),E[C](16)].join("");}if(H.length<6){H=H.replace(D.Dom.Color.re_hex3,"$1$1");}if(H!=="transparent"&&H.indexOf("#")<0){H="#"+H;}return H.toLowerCase();}};}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.7.0",build:"1799"});YAHOO.util.CustomEvent=function(D,C,B,A){this.type=D;this.scope=C||window;this.silent=B;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(A,B,C){if(!A){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(A,B,C);}this.subscribers.push(new YAHOO.util.Subscriber(A,B,C));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){this.lastError=null;var K=[],E=this.subscribers.length;if(!E&&this.silent){return true;}var I=[].slice.call(arguments,0),G=true,D,J=false;if(!this.silent){}var C=this.subscribers.slice(),A=YAHOO.util.Event.throwErrors;for(D=0;D<E;++D){var M=C[D];if(!M){J=true;}else{if(!this.silent){}var L=M.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var B=null;if(I.length>0){B=I[0];}try{G=M.fn.call(L,B,M.obj);}catch(F){this.lastError=F;if(A){throw F;}}}else{try{G=M.fn.call(L,this.type,I,M.obj);}catch(H){this.lastError=H;if(A){throw H;}}}if(false===G){if(!this.silent){}break;}}}return(G!==false);},unsubscribeAll:function(){var A=this.subscribers.length,B;for(B=A-1;B>-1;B--){this._delete(B);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"context: "+this.scope;}};YAHOO.util.Subscriber=function(A,B,C){this.fn=A;this.obj=YAHOO.lang.isUndefined(B)?null:B;this.overrideContext=C;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.overrideContext){if(this.overrideContext===true){return this.obj;}else{return this.overrideContext;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", overrideContext: "+(this.overrideContext||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};var K=YAHOO.env.ua.ie?"focusin":"focus";var L=YAHOO.env.ua.ie?"focusout":"blur";return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var M=this;var N=function(){M._tryPreloadAttach();};this._interval=setInterval(N,this.POLL_INTERVAL);}},onAvailable:function(S,O,Q,R,P){var M=(YAHOO.lang.isString(S))?[S]:S;for(var N=0;N<M.length;N=N+1){F.push({id:M[N],fn:O,obj:Q,overrideContext:R,checkReady:P});}C=this.POLL_RETRYS;this.startInterval();},onContentReady:function(P,M,N,O){this.onAvailable(P,M,N,O,true);},onDOMReady:function(M,N,O){if(this.DOMReady){setTimeout(function(){var P=window;if(O){if(O===true){P=N;}else{P=O;}}M.call(P,"DOMReady",[],N);},0);}else{this.DOMReadyEvent.subscribe(M,N,O);}},_addListener:function(O,M,Y,S,W,b){if(!Y||!Y.call){return false;}if(this._isValidCollection(O)){var Z=true;for(var T=0,V=O.length;T<V;++T){Z=this.on(O[T],M,Y,S,W)&&Z;}return Z;}else{if(YAHOO.lang.isString(O)){var R=this.getEl(O);if(R){O=R;}else{this.onAvailable(O,function(){YAHOO.util.Event.on(O,M,Y,S,W);});return true;}}}if(!O){return false;}if("unload"==M&&S!==this){J[J.length]=[O,M,Y,S,W];return true;}var N=O;if(W){if(W===true){N=S;}else{N=W;}}var P=function(c){return Y.call(N,YAHOO.util.Event.getEvent(c,O),S);};var a=[O,M,Y,P,N,S,W];var U=I.length;I[U]=a;if(this.useLegacyEvent(O,M)){var Q=this.getLegacyIndex(O,M);if(Q==-1||O!=G[Q][0]){Q=G.length;B[O.id+M]=Q;G[Q]=[O,M,O["on"+M]];E[Q]=[];O["on"+M]=function(c){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(c),Q);};}E[Q].push(a);}else{try{this._simpleAdd(O,M,P,b);}catch(X){this.lastError=X;this.removeListener(O,M,Y);return false;}}return true;},addListener:function(N,Q,M,O,P){return this._addListener(N,Q,M,O,P,false);},addFocusListener:function(N,M,O,P){return this._addListener(N,K,M,O,P,true);},removeFocusListener:function(N,M){return this.removeListener(N,K,M);},addBlurListener:function(N,M,O,P){return this._addListener(N,L,M,O,P,true);},removeBlurListener:function(N,M){return this.removeListener(N,L,M);},fireLegacyEvent:function(R,P){var T=true,M,V,U,N,S;V=E[P].slice();for(var O=0,Q=V.length;O<Q;++O){U=V[O];if(U&&U[this.WFN]){N=U[this.ADJ_SCOPE];S=U[this.WFN].call(N,R);T=(T&&S);}}M=G[P];if(M&&M[2]){M[2](R);}return T;},getLegacyIndex:function(N,O){var M=this.generateId(N)+O;if(typeof B[M]=="undefined"){return-1;}else{return B[M];}},useLegacyEvent:function(M,N){return(this.webkit&&this.webkit<419&&("click"==N||"dblclick"==N));},removeListener:function(N,M,V){var Q,T,X;if(typeof N=="string"){N=this.getEl(N);}else{if(this._isValidCollection(N)){var W=true;for(Q=N.length-1;Q>-1;Q--){W=(this.removeListener(N[Q],M,V)&&W);}return W;}}if(!V||!V.call){return this.purgeElement(N,false,M);}if("unload"==M){for(Q=J.length-1;Q>-1;Q--){X=J[Q];if(X&&X[0]==N&&X[1]==M&&X[2]==V){J.splice(Q,1);return true;}}return false;}var R=null;var S=arguments[3];if("undefined"===typeof S){S=this._getCacheIndex(N,M,V);}if(S>=0){R=I[S];}if(!N||!R){return false;}if(this.useLegacyEvent(N,M)){var P=this.getLegacyIndex(N,M);var O=E[P];if(O){for(Q=0,T=O.length;Q<T;++Q){X=O[Q];if(X&&X[this.EL]==N&&X[this.TYPE]==M&&X[this.FN]==V){O.splice(Q,1);break;}}}}else{try{this._simpleRemove(N,M,R[this.WFN],false);}catch(U){this.lastError=U;return false;}}delete I[S][this.WFN];delete I[S][this.FN];I.splice(S,1);return true;},getTarget:function(O,N){var M=O.target||O.srcElement;return this.resolveTextNode(M);},resolveTextNode:function(N){try{if(N&&3==N.nodeType){return N.parentNode;}}catch(M){}return N;},getPageX:function(N){var M=N.pageX;if(!M&&0!==M){M=N.clientX||0;if(this.isIE){M+=this._getScrollLeft();}}return M;},getPageY:function(M){var N=M.pageY;if(!N&&0!==N){N=M.clientY||0;if(this.isIE){N+=this._getScrollTop();}}return N;},getXY:function(M){return[this.getPageX(M),this.getPageY(M)];},getRelatedTarget:function(N){var M=N.relatedTarget;if(!M){if(N.type=="mouseout"){M=N.toElement;}else{if(N.type=="mouseover"){M=N.fromElement;}}}return this.resolveTextNode(M);},getTime:function(O){if(!O.time){var N=new Date().getTime();try{O.time=N;}catch(M){this.lastError=M;return N;}}return O.time;},stopEvent:function(M){this.stopPropagation(M);this.preventDefault(M);},stopPropagation:function(M){if(M.stopPropagation){M.stopPropagation();}else{M.cancelBubble=true;}},preventDefault:function(M){if(M.preventDefault){M.preventDefault();}else{M.returnValue=false;}},getEvent:function(O,M){var N=O||window.event;if(!N){var P=this.getEvent.caller;while(P){N=P.arguments[0];if(N&&Event==N.constructor){break;}P=P.caller;}}return N;},getCharCode:function(N){var M=N.keyCode||N.charCode||0;if(YAHOO.env.ua.webkit&&(M in D)){M=D[M];}return M;},_getCacheIndex:function(Q,R,P){for(var O=0,N=I.length;O<N;O=O+1){var M=I[O];if(M&&M[this.FN]==P&&M[this.EL]==Q&&M[this.TYPE]==R){return O;}}return-1;},generateId:function(M){var N=M.id;if(!N){N="yuievtautoid-"+A;++A;M.id=N;}return N;},_isValidCollection:function(N){try{return(N&&typeof N!=="string"&&N.length&&!N.tagName&&!N.alert&&typeof N[0]!=="undefined");}catch(M){return false;}},elCache:{},getEl:function(M){return(typeof M==="string")?document.getElementById(M):M;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(N){if(!H){H=true;var M=YAHOO.util.Event;M._ready();M._tryPreloadAttach();}},_ready:function(N){var M=YAHOO.util.Event;if(!M.DOMReady){M.DOMReady=true;M.DOMReadyEvent.fire();M._simpleRemove(document,"DOMContentLoaded",M._ready);}},_tryPreloadAttach:function(){if(F.length===0){C=0;if(this._interval){clearInterval(this._interval);this._interval=null;}return;}if(this.locked){return;}if(this.isIE){if(!this.DOMReady){this.startInterval();return;}}this.locked=true;var S=!H;if(!S){S=(C>0&&F.length>0);}var R=[];var T=function(V,W){var U=V;if(W.overrideContext){if(W.overrideContext===true){U=W.obj;}else{U=W.overrideContext;}}W.fn.call(U,W.obj);};var N,M,Q,P,O=[];for(N=0,M=F.length;N<M;N=N+1){Q=F[N];if(Q){P=this.getEl(Q.id);if(P){if(Q.checkReady){if(H||P.nextSibling||!S){O.push(Q);F[N]=null;}}else{T(P,Q);F[N]=null;}}else{R.push(Q);}}}for(N=0,M=O.length;N<M;N=N+1){Q=O[N];T(this.getEl(Q.id),Q);}C--;if(S){for(N=F.length-1;N>-1;N--){Q=F[N];if(!Q||!Q.id){F.splice(N,1);}}this.startInterval();}else{if(this._interval){clearInterval(this._interval);this._interval=null;}}this.locked=false;},purgeElement:function(Q,R,T){var O=(YAHOO.lang.isString(Q))?this.getEl(Q):Q;var S=this.getListeners(O,T),P,M;if(S){for(P=S.length-1;P>-1;P--){var N=S[P];this.removeListener(O,N.type,N.fn);}}if(R&&O&&O.childNodes){for(P=0,M=O.childNodes.length;P<M;++P){this.purgeElement(O.childNodes[P],R,T);}}},getListeners:function(O,M){var R=[],N;if(!M){N=[I,J];}else{if(M==="unload"){N=[J];}else{N=[I];}}var T=(YAHOO.lang.isString(O))?this.getEl(O):O;for(var Q=0;Q<N.length;Q=Q+1){var V=N[Q];if(V){for(var S=0,U=V.length;S<U;++S){var P=V[S];if(P&&P[this.EL]===T&&(!M||M===P[this.TYPE])){R.push({type:P[this.TYPE],fn:P[this.FN],obj:P[this.OBJ],adjust:P[this.OVERRIDE],scope:P[this.ADJ_SCOPE],index:S});}}}}return(R.length)?R:null;},_unload:function(T){var N=YAHOO.util.Event,Q,P,O,S,R,U=J.slice(),M;for(Q=0,S=J.length;Q<S;++Q){O=U[Q];if(O){M=window;if(O[N.ADJ_SCOPE]){if(O[N.ADJ_SCOPE]===true){M=O[N.UNLOAD_OBJ];}else{M=O[N.ADJ_SCOPE];}}O[N.FN].call(M,N.getEvent(T,O[N.EL]),O[N.UNLOAD_OBJ]);U[Q]=null;}}O=null;M=null;J=null;if(I){for(P=I.length-1;P>-1;P--){O=I[P];if(O){N.removeListener(O[N.EL],O[N.TYPE],O[N.FN],P);}}O=null;}G=null;N._simpleRemove(window,"unload",N._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var M=document.documentElement,N=document.body;if(M&&(M.scrollTop||M.scrollLeft)){return[M.scrollTop,M.scrollLeft];}else{if(N){return[N.scrollTop,N.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(O,P,N,M){O.addEventListener(P,N,(M));};}else{if(window.attachEvent){return function(O,P,N,M){O.attachEvent("on"+P,N);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(O,P,N,M){O.removeEventListener(P,N,(M));};}else{if(window.detachEvent){return function(N,O,M){N.detachEvent("on"+O,M);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener;if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,overrideContext:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C<F.length;++C){B.subscribe(F[C].fn,F[C].obj,F[C].overrideContext);}}}return I[G];},fireEvent:function(E,D,A,C){this.__yui_events=this.__yui_events||{};var G=this.__yui_events[E];if(!G){return null;}var B=[];for(var F=1;F<arguments.length;++F){B.push(arguments[F]);}return G.fire.apply(G,B);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};(function(){var A=YAHOO.util.Event,C=YAHOO.lang;YAHOO.util.KeyListener=function(D,I,E,F){if(!D){}else{if(!I){}else{if(!E){}}}if(!F){F=YAHOO.util.KeyListener.KEYDOWN;}var G=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(C.isString(D)){D=document.getElementById(D);}if(C.isFunction(E)){G.subscribe(E);}else{G.subscribe(E.fn,E.scope,E.correctScope);}function H(O,N){if(!I.shift){I.shift=false;}if(!I.alt){I.alt=false;}if(!I.ctrl){I.ctrl=false;}if(O.shiftKey==I.shift&&O.altKey==I.alt&&O.ctrlKey==I.ctrl){var J,M=I.keys,L;if(YAHOO.lang.isArray(M)){for(var K=0;K<M.length;K++){J=M[K];L=A.getCharCode(O);if(J==L){G.fire(L,O);break;}}}else{L=A.getCharCode(O);if(M==L){G.fire(L,O);}}}}this.enable=function(){if(!this.enabled){A.on(D,F,H);this.enabledEvent.fire(I);}this.enabled=true;};this.disable=function(){if(this.enabled){A.removeListener(D,F,H);this.disabledEvent.fire(I);}this.enabled=false;};this.toString=function(){return"KeyListener ["+I.keys+"] "+D.tagName+(D.id?"["+D.id+"]":"");};};var B=YAHOO.util.KeyListener;B.KEYDOWN="keydown";B.KEYUP="keyup";B.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};})();YAHOO.register("event",YAHOO.util.Event,{version:"2.7.0",build:"1799"});YAHOO.register("yahoo-dom-event",YAHOO,{version:"2.7.0",build:"1799"});
if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var Event=YAHOO.util.Event,Dom=YAHOO.util.Dom;return{useShim:false,_shimActive:false,_shimState:false,_debugShim:false,_createShim:function(){var s=document.createElement('div');s.id='yui-ddm-shim';if(document.body.firstChild){document.body.insertBefore(s,document.body.firstChild);}else{document.body.appendChild(s);}
s.style.display='none';s.style.backgroundColor='red';s.style.position='absolute';s.style.zIndex='99999';Dom.setStyle(s,'opacity','0');this._shim=s;Event.on(s,"mouseup",this.handleMouseUp,this,true);Event.on(s,"mousemove",this.handleMouseMove,this,true);Event.on(window,'scroll',this._sizeShim,this,true);},_sizeShim:function(){if(this._shimActive){var s=this._shim;s.style.height=Dom.getDocumentHeight()+'px';s.style.width=Dom.getDocumentWidth()+'px';s.style.top='0';s.style.left='0';}},_activateShim:function(){if(this.useShim){if(!this._shim){this._createShim();}
this._shimActive=true;var s=this._shim,o='0';if(this._debugShim){o='.5';}
Dom.setStyle(s,'opacity',o);this._sizeShim();s.style.display='block';}},_deactivateShim:function(){this._shim.style.display='none';this._shimActive=false;},_shim:null,ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(sMethod,args){for(var i in this.ids){for(var j in this.ids[i]){var oDD=this.ids[i][j];if(!this.isTypeOfDD(oDD)){continue;}
oDD[sMethod].apply(oDD,args);}}},_onLoad:function(){this.init();Event.on(document,"mouseup",this.handleMouseUp,this,true);Event.on(document,"mousemove",this.handleMouseMove,this,true);Event.on(window,"unload",this._onUnload,this,true);Event.on(window,"resize",this._onResize,this,true);},_onResize:function(e){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,fromTimeout:false,regDragDrop:function(oDD,sGroup){if(!this.initialized){this.init();}
if(!this.ids[sGroup]){this.ids[sGroup]={};}
this.ids[sGroup][oDD.id]=oDD;},removeDDFromGroup:function(oDD,sGroup){if(!this.ids[sGroup]){this.ids[sGroup]={};}
var obj=this.ids[sGroup];if(obj&&obj[oDD.id]){delete obj[oDD.id];}},_remove:function(oDD){for(var g in oDD.groups){if(g){var item=this.ids[g];if(item&&item[oDD.id]){delete item[oDD.id];}}}
delete this.handleIds[oDD.id];},regHandle:function(sDDId,sHandleId){if(!this.handleIds[sDDId]){this.handleIds[sDDId]={};}
this.handleIds[sDDId][sHandleId]=sHandleId;},isDragDrop:function(id){return(this.getDDById(id))?true:false;},getRelated:function(p_oDD,bTargetsOnly){var oDDs=[];for(var i in p_oDD.groups){for(var j in this.ids[i]){var dd=this.ids[i][j];if(!this.isTypeOfDD(dd)){continue;}
if(!bTargetsOnly||dd.isTarget){oDDs[oDDs.length]=dd;}}}
return oDDs;},isLegalTarget:function(oDD,oTargetDD){var targets=this.getRelated(oDD,true);for(var i=0,len=targets.length;i<len;++i){if(targets[i].id==oTargetDD.id){return true;}}
return false;},isTypeOfDD:function(oDD){return(oDD&&oDD.__ygDragDrop);},isHandle:function(sDDId,sHandleId){return(this.handleIds[sDDId]&&this.handleIds[sDDId][sHandleId]);},getDDById:function(id){for(var i in this.ids){if(this.ids[i][id]){return this.ids[i][id];}}
return null;},handleMouseDown:function(e,oDD){this.currentTarget=YAHOO.util.Event.getTarget(e);this.dragCurrent=oDD;var el=oDD.getEl();this.startX=YAHOO.util.Event.getPageX(e);this.startY=YAHOO.util.Event.getPageY(e);this.deltaX=this.startX-el.offsetLeft;this.deltaY=this.startY-el.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var DDM=YAHOO.util.DDM;DDM.startDrag(DDM.startX,DDM.startY);DDM.fromTimeout=true;},this.clickTimeThresh);},startDrag:function(x,y){if(this.dragCurrent&&this.dragCurrent.useShim){this._shimState=this.useShim;this.useShim=true;}
this._activateShim();clearTimeout(this.clickTimeout);var dc=this.dragCurrent;if(dc&&dc.events.b4StartDrag){dc.b4StartDrag(x,y);dc.fireEvent('b4StartDragEvent',{x:x,y:y});}
if(dc&&dc.events.startDrag){dc.startDrag(x,y);dc.fireEvent('startDragEvent',{x:x,y:y});}
this.dragThreshMet=true;},handleMouseUp:function(e){if(this.dragCurrent){clearTimeout(this.clickTimeout);if(this.dragThreshMet){if(this.fromTimeout){this.fromTimeout=false;this.handleMouseMove(e);}
this.fromTimeout=false;this.fireEvents(e,true);}else{}
this.stopDrag(e);this.stopEvent(e);}},stopEvent:function(e){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(e);}
if(this.preventDefault){YAHOO.util.Event.preventDefault(e);}},stopDrag:function(e,silent){var dc=this.dragCurrent;if(dc&&!silent){if(this.dragThreshMet){if(dc.events.b4EndDrag){dc.b4EndDrag(e);dc.fireEvent('b4EndDragEvent',{e:e});}
if(dc.events.endDrag){dc.endDrag(e);dc.fireEvent('endDragEvent',{e:e});}}
if(dc.events.mouseUp){dc.onMouseUp(e);dc.fireEvent('mouseUpEvent',{e:e});}}
if(this._shimActive){this._deactivateShim();if(this.dragCurrent&&this.dragCurrent.useShim){this.useShim=this._shimState;this._shimState=false;}}
this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(e){var dc=this.dragCurrent;if(dc){if(YAHOO.util.Event.isIE&&!e.button){this.stopEvent(e);return this.handleMouseUp(e);}else{if(e.clientX<0||e.clientY<0){}}
if(!this.dragThreshMet){var diffX=Math.abs(this.startX-YAHOO.util.Event.getPageX(e));var diffY=Math.abs(this.startY-YAHOO.util.Event.getPageY(e));if(diffX>this.clickPixelThresh||diffY>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}
if(this.dragThreshMet){if(dc&&dc.events.b4Drag){dc.b4Drag(e);dc.fireEvent('b4DragEvent',{e:e});}
if(dc&&dc.events.drag){dc.onDrag(e);dc.fireEvent('dragEvent',{e:e});}
if(dc){this.fireEvents(e,false);}}
this.stopEvent(e);}},fireEvents:function(e,isDrop){var dc=this.dragCurrent;if(!dc||dc.isLocked()||dc.dragOnly){return;}
var x=YAHOO.util.Event.getPageX(e),y=YAHOO.util.Event.getPageY(e),pt=new YAHOO.util.Point(x,y),pos=dc.getTargetCoord(pt.x,pt.y),el=dc.getDragEl(),events=['out','over','drop','enter'],curRegion=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x),oldOvers=[],inGroupsObj={},inGroups=[],data={outEvts:[],overEvts:[],dropEvts:[],enterEvts:[]};for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;}
if(!this.isOverTarget(pt,ddo,this.mode,curRegion)){data.outEvts.push(ddo);}
oldOvers[i]=true;delete this.dragOvers[i];}
for(var sGroup in dc.groups){if("string"!=typeof sGroup){continue;}
for(i in this.ids[sGroup]){var oDD=this.ids[sGroup][i];if(!this.isTypeOfDD(oDD)){continue;}
if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){if(this.isOverTarget(pt,oDD,this.mode,curRegion)){inGroupsObj[sGroup]=true;if(isDrop){data.dropEvts.push(oDD);}else{if(!oldOvers[oDD.id]){data.enterEvts.push(oDD);}else{data.overEvts.push(oDD);}
this.dragOvers[oDD.id]=oDD;}}}}}
this.interactionInfo={out:data.outEvts,enter:data.enterEvts,over:data.overEvts,drop:data.dropEvts,point:pt,draggedRegion:curRegion,sourceRegion:this.locationCache[dc.id],validDrop:isDrop};for(var inG in inGroupsObj){inGroups.push(inG);}
if(isDrop&&!data.dropEvts.length){this.interactionInfo.validDrop=false;if(dc.events.invalidDrop){dc.onInvalidDrop(e);dc.fireEvent('invalidDropEvent',{e:e});}}
for(i=0;i<events.length;i++){var tmp=null;if(data[events[i]+'Evts']){tmp=data[events[i]+'Evts'];}
if(tmp&&tmp.length){var type=events[i].charAt(0).toUpperCase()+events[i].substr(1),ev='onDrag'+type,b4='b4Drag'+type,cev='drag'+type+'Event',check='drag'+type;if(this.mode){if(dc.events[b4]){dc[b4](e,tmp,inGroups);dc.fireEvent(b4+'Event',{event:e,info:tmp,group:inGroups});}
if(dc.events[check]){dc[ev](e,tmp,inGroups);dc.fireEvent(cev,{event:e,info:tmp,group:inGroups});}}else{for(var b=0,len=tmp.length;b<len;++b){if(dc.events[b4]){dc[b4](e,tmp[b].id,inGroups[0]);dc.fireEvent(b4+'Event',{event:e,info:tmp[b].id,group:inGroups[0]});}
if(dc.events[check]){dc[ev](e,tmp[b].id,inGroups[0]);dc.fireEvent(cev,{event:e,info:tmp[b].id,group:inGroups[0]});}}}}}},getBestMatch:function(dds){var winner=null;var len=dds.length;if(len==1){winner=dds[0];}else{for(var i=0;i<len;++i){var dd=dds[i];if(this.mode==this.INTERSECT&&dd.cursorIsOver){winner=dd;break;}else{if(!winner||!winner.overlap||(dd.overlap&&winner.overlap.getArea()<dd.overlap.getArea())){winner=dd;}}}}
return winner;},refreshCache:function(groups){var g=groups||this.ids;for(var sGroup in g){if("string"!=typeof sGroup){continue;}
for(var i in this.ids[sGroup]){var oDD=this.ids[sGroup][i];if(this.isTypeOfDD(oDD)){var loc=this.getLocation(oDD);if(loc){this.locationCache[oDD.id]=loc;}else{delete this.locationCache[oDD.id];}}}}},verifyEl:function(el){try{if(el){var parent=el.offsetParent;if(parent){return true;}}}catch(e){}
return false;},getLocation:function(oDD){if(!this.isTypeOfDD(oDD)){return null;}
var el=oDD.getEl(),pos,x1,x2,y1,y2,t,r,b,l;try{pos=YAHOO.util.Dom.getXY(el);}catch(e){}
if(!pos){return null;}
x1=pos[0];x2=x1+el.offsetWidth;y1=pos[1];y2=y1+el.offsetHeight;t=y1-oDD.padding[0];r=x2+oDD.padding[1];b=y2+oDD.padding[2];l=x1-oDD.padding[3];return new YAHOO.util.Region(t,r,b,l);},isOverTarget:function(pt,oTarget,intersect,curRegion){var loc=this.locationCache[oTarget.id];if(!loc||!this.useCache){loc=this.getLocation(oTarget);this.locationCache[oTarget.id]=loc;}
if(!loc){return false;}
oTarget.cursorIsOver=loc.contains(pt);var dc=this.dragCurrent;if(!dc||(!intersect&&!dc.constrainX&&!dc.constrainY)){return oTarget.cursorIsOver;}
oTarget.overlap=null;if(!curRegion){var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();curRegion=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);}
var overlap=curRegion.intersect(loc);if(overlap){oTarget.overlap=overlap;return(intersect)?true:oTarget.cursorIsOver;}else{return false;}},_onUnload:function(e,me){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}
this._execOnAll("unreg",[]);this.ids={};},elementCache:{},getElWrapper:function(id){var oWrapper=this.elementCache[id];if(!oWrapper||!oWrapper.el){oWrapper=this.elementCache[id]=new this.ElementWrapper(YAHOO.util.Dom.get(id));}
return oWrapper;},getElement:function(id){return YAHOO.util.Dom.get(id);},getCss:function(id){var el=YAHOO.util.Dom.get(id);return(el)?el.style:null;},ElementWrapper:function(el){this.el=el||null;this.id=this.el&&el.id;this.css=this.el&&el.style;},getPosX:function(el){return YAHOO.util.Dom.getX(el);},getPosY:function(el){return YAHOO.util.Dom.getY(el);},swapNode:function(n1,n2){if(n1.swapNode){n1.swapNode(n2);}else{var p=n2.parentNode;var s=n2.nextSibling;if(s==n1){p.insertBefore(n1,n2);}else if(n2==n1.nextSibling){p.insertBefore(n2,n1);}else{n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s);}}},getScroll:function(){var t,l,dde=document.documentElement,db=document.body;if(dde&&(dde.scrollTop||dde.scrollLeft)){t=dde.scrollTop;l=dde.scrollLeft;}else if(db){t=db.scrollTop;l=db.scrollLeft;}else{}
return{top:t,left:l};},getStyle:function(el,styleProp){return YAHOO.util.Dom.getStyle(el,styleProp);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(moveEl,targetEl){var aCoord=YAHOO.util.Dom.getXY(targetEl);YAHOO.util.Dom.setXY(moveEl,aCoord);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(a,b){return(a-b);},_timeoutCount:0,_addListeners:function(){var DDM=YAHOO.util.DDM;if(YAHOO.util.Event&&document){DDM._onLoad();}else{if(DDM._timeoutCount>2000){}else{setTimeout(DDM._addListeners,10);if(document&&document.body){DDM._timeoutCount+=1;}}}},handleWasClicked:function(node,id){if(this.isHandle(id,node.id)){return true;}else{var p=node.parentNode;while(p){if(this.isHandle(id,p.id)){return true;}else{p=p.parentNode;}}}
return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}
(function(){var Event=YAHOO.util.Event;var Dom=YAHOO.util.Dom;YAHOO.util.DragDrop=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.util.DragDrop.prototype={events:null,on:function(){this.subscribe.apply(this,arguments);},id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,dragOnly:false,useShim:false,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(x,y){},startDrag:function(x,y){},b4Drag:function(e){},onDrag:function(e){},onDragEnter:function(e,id){},b4DragOver:function(e){},onDragOver:function(e,id){},b4DragOut:function(e){},onDragOut:function(e,id){},b4DragDrop:function(e){},onDragDrop:function(e,id){},onInvalidDrop:function(e){},b4EndDrag:function(e){},endDrag:function(e){},b4MouseDown:function(e){},onMouseDown:function(e){},onMouseUp:function(e){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=Dom.get(this.id);}
return this._domRef;},getDragEl:function(){return Dom.get(this.dragElId);},init:function(id,sGroup,config){this.initTarget(id,sGroup,config);Event.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);for(var i in this.events){this.createEvent(i+'Event');}},initTarget:function(id,sGroup,config){this.config=config||{};this.events={};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof id!=="string"){this._domRef=id;id=Dom.generateId(id);}
this.id=id;this.addToGroup((sGroup)?sGroup:"default");this.handleElId=id;Event.onAvailable(id,this.handleOnAvailable,this,true);this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.events={mouseDown:true,b4MouseDown:true,mouseUp:true,b4StartDrag:true,startDrag:true,b4EndDrag:true,endDrag:true,drag:true,b4Drag:true,invalidDrop:true,b4DragOut:true,dragOut:true,dragEnter:true,b4DragOver:true,dragOver:true,b4DragDrop:true,dragDrop:true};if(this.config.events){for(var i in this.config.events){if(this.config.events[i]===false){this.events[i]=false;}}}
this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);this.dragOnly=((this.config.dragOnly===true)?true:false);this.useShim=((this.config.useShim===true)?true:false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(iTop,iRight,iBot,iLeft){if(!iRight&&0!==iRight){this.padding=[iTop,iTop,iTop,iTop];}else if(!iBot&&0!==iBot){this.padding=[iTop,iRight,iTop,iRight];}else{this.padding=[iTop,iRight,iBot,iLeft];}},setInitPosition:function(diffX,diffY){var el=this.getEl();if(!this.DDM.verifyEl(el)){if(el&&el.style&&(el.style.display=='none')){}else{}
return;}
var dx=diffX||0;var dy=diffY||0;var p=Dom.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p);},setStartPosition:function(pos){var p=pos||Dom.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(sGroup){this.groups[sGroup]=true;this.DDM.regDragDrop(this,sGroup);},removeFromGroup:function(sGroup){if(this.groups[sGroup]){delete this.groups[sGroup];}
this.DDM.removeDDFromGroup(this,sGroup);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
this.handleElId=id;this.DDM.regHandle(this.id,id);},setOuterHandleElId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
Event.on(id,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(id);this.hasOuterHandles=true;},unreg:function(){Event.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,oDD){var button=e.which||e.button;if(this.primaryButtonOnly&&button>1){return;}
if(this.isLocked()){return;}
var b4Return=this.b4MouseDown(e),b4Return2=true;if(this.events.b4MouseDown){b4Return2=this.fireEvent('b4MouseDownEvent',e);}
var mDownReturn=this.onMouseDown(e),mDownReturn2=true;if(this.events.mouseDown){mDownReturn2=this.fireEvent('mouseDownEvent',e);}
if((b4Return===false)||(mDownReturn===false)||(b4Return2===false)||(mDownReturn2===false)){return;}
this.DDM.refreshCache(this.groups);var pt=new YAHOO.util.Point(Event.getPageX(e),Event.getPageY(e));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(pt,this)){}else{if(this.clickValidator(e)){this.setStartPosition();this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}else{}}},clickValidator:function(e){var target=YAHOO.util.Event.getTarget(e);return(this.isValidHandleChild(target)&&(this.id==this.handleElId||this.DDM.handleWasClicked(target,this.id)));},getTargetCoord:function(iPageX,iPageY){var x=iPageX-this.deltaX;var y=iPageY-this.deltaY;if(this.constrainX){if(x<this.minX){x=this.minX;}
if(x>this.maxX){x=this.maxX;}}
if(this.constrainY){if(y<this.minY){y=this.minY;}
if(y>this.maxY){y=this.maxY;}}
x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return{x:x,y:y};},addInvalidHandleType:function(tagName){var type=tagName.toUpperCase();this.invalidHandleTypes[type]=type;},addInvalidHandleId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(cssClass){this.invalidHandleClasses.push(cssClass);},removeInvalidHandleType:function(tagName){var type=tagName.toUpperCase();delete this.invalidHandleTypes[type];},removeInvalidHandleId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(cssClass){for(var i=0,len=this.invalidHandleClasses.length;i<len;++i){if(this.invalidHandleClasses[i]==cssClass){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(node){var valid=true;var nodeName;try{nodeName=node.nodeName.toUpperCase();}catch(e){nodeName=node.nodeName;}
valid=valid&&!this.invalidHandleTypes[nodeName];valid=valid&&!this.invalidHandleIds[node.id];for(var i=0,len=this.invalidHandleClasses.length;valid&&i<len;++i){valid=!Dom.hasClass(node,this.invalidHandleClasses[i]);}
return valid;},setXTicks:function(iStartX,iTickSize){this.xTicks=[];this.xTickSize=iTickSize;var tickMap={};for(var i=this.initPageX;i>=this.minX;i=i-iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}
for(i=this.initPageX;i<=this.maxX;i=i+iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}
this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(iStartY,iTickSize){this.yTicks=[];this.yTickSize=iTickSize;var tickMap={};for(var i=this.initPageY;i>=this.minY;i=i-iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}
for(i=this.initPageY;i<=this.maxY;i=i+iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}
this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(iLeft,iRight,iTickSize){this.leftConstraint=parseInt(iLeft,10);this.rightConstraint=parseInt(iRight,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(iTickSize){this.setXTicks(this.initPageX,iTickSize);}
this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(iUp,iDown,iTickSize){this.topConstraint=parseInt(iUp,10);this.bottomConstraint=parseInt(iDown,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(iTickSize){this.setYTicks(this.initPageY,iTickSize);}
this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else{this.setInitPosition();}
if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}
if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(val,tickArray){if(!tickArray){return val;}else if(tickArray[0]>=val){return tickArray[0];}else{for(var i=0,len=tickArray.length;i<len;++i){var next=i+1;if(tickArray[next]&&tickArray[next]>=val){var diff1=val-tickArray[i];var diff2=tickArray[next]-val;return(diff2>diff1)?tickArray[i]:tickArray[next];}}
return tickArray[tickArray.length-1];}},toString:function(){return("DragDrop "+this.id);}};YAHOO.augment(YAHOO.util.DragDrop,YAHOO.util.EventProvider);})();YAHOO.util.DD=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(iPageX,iPageY){var x=iPageX-this.startPageX;var y=iPageY-this.startPageY;this.setDelta(x,y);},setDelta:function(iDeltaX,iDeltaY){this.deltaX=iDeltaX;this.deltaY=iDeltaY;},setDragElPos:function(iPageX,iPageY){var el=this.getDragEl();this.alignElWithMouse(el,iPageX,iPageY);},alignElWithMouse:function(el,iPageX,iPageY){var oCoord=this.getTargetCoord(iPageX,iPageY);if(!this.deltaSetXY){var aCoord=[oCoord.x,oCoord.y];YAHOO.util.Dom.setXY(el,aCoord);var newLeft=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var newTop=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);this.deltaSetXY=[newLeft-oCoord.x,newTop-oCoord.y];}else{YAHOO.util.Dom.setStyle(el,"left",(oCoord.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(el,"top",(oCoord.y+this.deltaSetXY[1])+"px");}
this.cachePosition(oCoord.x,oCoord.y);var self=this;setTimeout(function(){self.autoScroll.call(self,oCoord.x,oCoord.y,el.offsetHeight,el.offsetWidth);},0);},cachePosition:function(iPageX,iPageY){if(iPageX){this.lastPageX=iPageX;this.lastPageY=iPageY;}else{var aCoord=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=aCoord[0];this.lastPageY=aCoord[1];}},autoScroll:function(x,y,h,w){if(this.scroll){var clientH=this.DDM.getClientHeight();var clientW=this.DDM.getClientWidth();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var right=w+x;var toBot=(clientH+st-y-this.deltaY);var toRight=(clientW+sl-x-this.deltaX);var thresh=40;var scrAmt=(document.all)?80:30;if(bot>clientH&&toBot<thresh){window.scrollTo(sl,st+scrAmt);}
if(y<st&&st>0&&y-st<thresh){window.scrollTo(sl,st-scrAmt);}
if(right>clientW&&toRight<thresh){window.scrollTo(sl+scrAmt,st);}
if(x<sl&&sl>0&&x-sl<thresh){window.scrollTo(sl-scrAmt,st);}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(e){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},b4Drag:function(e){this.setDragElPos(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(id,sGroup,config){if(id){this.init(id,sGroup,config);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var self=this,body=document.body;if(!body||!body.firstChild){setTimeout(function(){self.createFrame();},50);return;}
var div=this.getDragEl(),Dom=YAHOO.util.Dom;if(!div){div=document.createElement("div");div.id=this.dragElId;var s=div.style;s.position="absolute";s.visibility="hidden";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;s.height="25px";s.width="25px";var _data=document.createElement('div');Dom.setStyle(_data,'height','100%');Dom.setStyle(_data,'width','100%');Dom.setStyle(_data,'background-color','#ccc');Dom.setStyle(_data,'opacity','0');div.appendChild(_data);body.insertBefore(div,body.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(iPageX,iPageY){var el=this.getEl();var dragEl=this.getDragEl();var s=dragEl.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));}
this.setDragElPos(iPageX,iPageY);YAHOO.util.Dom.setStyle(dragEl,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var DOM=YAHOO.util.Dom;var el=this.getEl();var dragEl=this.getDragEl();var bt=parseInt(DOM.getStyle(dragEl,"borderTopWidth"),10);var br=parseInt(DOM.getStyle(dragEl,"borderRightWidth"),10);var bb=parseInt(DOM.getStyle(dragEl,"borderBottomWidth"),10);var bl=parseInt(DOM.getStyle(dragEl,"borderLeftWidth"),10);if(isNaN(bt)){bt=0;}
if(isNaN(br)){br=0;}
if(isNaN(bb)){bb=0;}
if(isNaN(bl)){bl=0;}
var newWidth=Math.max(0,el.offsetWidth-br-bl);var newHeight=Math.max(0,el.offsetHeight-bt-bb);DOM.setStyle(dragEl,"width",newWidth+"px");DOM.setStyle(dragEl,"height",newHeight+"px");}},b4MouseDown:function(e){this.setStartPosition();var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.autoOffset(x,y);},b4StartDrag:function(x,y){this.showFrame(x,y);},b4EndDrag:function(e){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(e){var DOM=YAHOO.util.Dom;var lel=this.getEl();var del=this.getDragEl();DOM.setStyle(del,"visibility","");DOM.setStyle(lel,"visibility","hidden");YAHOO.util.DDM.moveToEl(lel,del);DOM.setStyle(del,"visibility","hidden");DOM.setStyle(lel,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(id,sGroup,config){if(id){this.initTarget(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.7.0",build:"1799"});
(function(){var getXY=YAHOO.util.Dom.getXY,Event=YAHOO.util.Event,_AS=Array.prototype.slice;function Slider(sElementId,sGroup,oThumb,sType){Slider.ANIM_AVAIL=(!YAHOO.lang.isUndefined(YAHOO.util.Anim));if(sElementId){this.init(sElementId,sGroup,true);this.initSlider(sType);this.initThumb(oThumb);}}
YAHOO.lang.augmentObject(Slider,{getHorizSlider:function(sBGElId,sHandleElId,iLeft,iRight,iTickSize){return new Slider(sBGElId,sBGElId,new YAHOO.widget.SliderThumb(sHandleElId,sBGElId,iLeft,iRight,0,0,iTickSize),"horiz");},getVertSlider:function(sBGElId,sHandleElId,iUp,iDown,iTickSize){return new Slider(sBGElId,sBGElId,new YAHOO.widget.SliderThumb(sHandleElId,sBGElId,0,0,iUp,iDown,iTickSize),"vert");},getSliderRegion:function(sBGElId,sHandleElId,iLeft,iRight,iUp,iDown,iTickSize){return new Slider(sBGElId,sBGElId,new YAHOO.widget.SliderThumb(sHandleElId,sBGElId,iLeft,iRight,iUp,iDown,iTickSize),"region");},SOURCE_UI_EVENT:1,SOURCE_SET_VALUE:2,SOURCE_KEY_EVENT:3,ANIM_AVAIL:false},true);YAHOO.extend(Slider,YAHOO.util.DragDrop,{_mouseDown:false,dragOnly:true,initSlider:function(sType){this.type=sType;this.createEvent("change",this);this.createEvent("slideStart",this);this.createEvent("slideEnd",this);this.isTarget=false;this.animate=Slider.ANIM_AVAIL;this.backgroundEnabled=true;this.tickPause=40;this.enableKeys=true;this.keyIncrement=20;this.moveComplete=true;this.animationDuration=0.2;this.SOURCE_UI_EVENT=1;this.SOURCE_SET_VALUE=2;this.valueChangeSource=0;this._silent=false;this.lastOffset=[0,0];},initThumb:function(t){var self=this;this.thumb=t;t.cacheBetweenDrags=true;if(t._isHoriz&&t.xTicks&&t.xTicks.length){this.tickPause=Math.round(360/t.xTicks.length);}else if(t.yTicks&&t.yTicks.length){this.tickPause=Math.round(360/t.yTicks.length);}
t.onAvailable=function(){return self.setStartSliderState();};t.onMouseDown=function(){self._mouseDown=true;return self.focus();};t.startDrag=function(){self._slideStart();};t.onDrag=function(){self.fireEvents(true);};t.onMouseUp=function(){self.thumbMouseUp();};},onAvailable:function(){this._bindKeyEvents();},_bindKeyEvents:function(){Event.on(this.id,"keydown",this.handleKeyDown,this,true);Event.on(this.id,"keypress",this.handleKeyPress,this,true);},handleKeyPress:function(e){if(this.enableKeys){var kc=Event.getCharCode(e);switch(kc){case 0x25:case 0x26:case 0x27:case 0x28:case 0x24:case 0x23:Event.preventDefault(e);break;default:}}},handleKeyDown:function(e){if(this.enableKeys){var kc=Event.getCharCode(e),t=this.thumb,h=this.getXValue(),v=this.getYValue(),changeValue=true;switch(kc){case 0x25:h-=this.keyIncrement;break;case 0x26:v-=this.keyIncrement;break;case 0x27:h+=this.keyIncrement;break;case 0x28:v+=this.keyIncrement;break;case 0x24:h=t.leftConstraint;v=t.topConstraint;break;case 0x23:h=t.rightConstraint;v=t.bottomConstraint;break;default:changeValue=false;}
if(changeValue){if(t._isRegion){this._setRegionValue(Slider.SOURCE_KEY_EVENT,h,v,true);}else{this._setValue(Slider.SOURCE_KEY_EVENT,(t._isHoriz?h:v),true);}
Event.stopEvent(e);}}},setStartSliderState:function(){this.setThumbCenterPoint();this.baselinePos=getXY(this.getEl());this.thumb.startOffset=this.thumb.getOffsetFromParent(this.baselinePos);if(this.thumb._isRegion){if(this.deferredSetRegionValue){this._setRegionValue.apply(this,this.deferredSetRegionValue);this.deferredSetRegionValue=null;}else{this.setRegionValue(0,0,true,true,true);}}else{if(this.deferredSetValue){this._setValue.apply(this,this.deferredSetValue);this.deferredSetValue=null;}else{this.setValue(0,true,true,true);}}},setThumbCenterPoint:function(){var el=this.thumb.getEl();if(el){this.thumbCenterPoint={x:parseInt(el.offsetWidth/2,10),y:parseInt(el.offsetHeight/2,10)};}},lock:function(){this.thumb.lock();this.locked=true;},unlock:function(){this.thumb.unlock();this.locked=false;},thumbMouseUp:function(){this._mouseDown=false;if(!this.isLocked()&&!this.moveComplete){this.endMove();}},onMouseUp:function(){this._mouseDown=false;if(this.backgroundEnabled&&!this.isLocked()&&!this.moveComplete){this.endMove();}},getThumb:function(){return this.thumb;},focus:function(){this.valueChangeSource=Slider.SOURCE_UI_EVENT;var el=this.getEl();if(el.focus){try{el.focus();}catch(e){}}
this.verifyOffset();return!this.isLocked();},onChange:function(firstOffset,secondOffset){},onSlideStart:function(){},onSlideEnd:function(){},getValue:function(){return this.thumb.getValue();},getXValue:function(){return this.thumb.getXValue();},getYValue:function(){return this.thumb.getYValue();},setValue:function(){var args=_AS.call(arguments);args.unshift(Slider.SOURCE_SET_VALUE);return this._setValue.apply(this,args);},_setValue:function(source,newOffset,skipAnim,force,silent){var t=this.thumb,newX,newY;if(!t.available){this.deferredSetValue=arguments;return false;}
if(this.isLocked()&&!force){return false;}
if(isNaN(newOffset)){return false;}
if(t._isRegion){return false;}
this._silent=silent;this.valueChangeSource=source||Slider.SOURCE_SET_VALUE;t.lastOffset=[newOffset,newOffset];this.verifyOffset(true);this._slideStart();if(t._isHoriz){newX=t.initPageX+newOffset+this.thumbCenterPoint.x;this.moveThumb(newX,t.initPageY,skipAnim);}else{newY=t.initPageY+newOffset+this.thumbCenterPoint.y;this.moveThumb(t.initPageX,newY,skipAnim);}
return true;},setRegionValue:function(){var args=_AS.call(arguments);args.unshift(Slider.SOURCE_SET_VALUE);return this._setRegionValue.apply(this,args);},_setRegionValue:function(source,newOffset,newOffset2,skipAnim,force,silent){var t=this.thumb,newX,newY;if(!t.available){this.deferredSetRegionValue=arguments;return false;}
if(this.isLocked()&&!force){return false;}
if(isNaN(newOffset)){return false;}
if(!t._isRegion){return false;}
this._silent=silent;this.valueChangeSource=source||Slider.SOURCE_SET_VALUE;t.lastOffset=[newOffset,newOffset2];this.verifyOffset(true);this._slideStart();newX=t.initPageX+newOffset+this.thumbCenterPoint.x;newY=t.initPageY+newOffset2+this.thumbCenterPoint.y;this.moveThumb(newX,newY,skipAnim);return true;},verifyOffset:function(checkPos){var xy=getXY(this.getEl()),t=this.thumb;if(!this.thumbCenterPoint||!this.thumbCenterPoint.x){this.setThumbCenterPoint();}
if(xy){if(xy[0]!=this.baselinePos[0]||xy[1]!=this.baselinePos[1]){this.setInitPosition();this.baselinePos=xy;t.initPageX=this.initPageX+t.startOffset[0];t.initPageY=this.initPageY+t.startOffset[1];t.deltaSetXY=null;this.resetThumbConstraints();return false;}}
return true;},moveThumb:function(x,y,skipAnim,midMove){var t=this.thumb,self=this,p,_p,anim;if(!t.available){return;}
t.setDelta(this.thumbCenterPoint.x,this.thumbCenterPoint.y);_p=t.getTargetCoord(x,y);p=[Math.round(_p.x),Math.round(_p.y)];if(this.animate&&t._graduated&&!skipAnim){this.lock();this.curCoord=getXY(this.thumb.getEl());this.curCoord=[Math.round(this.curCoord[0]),Math.round(this.curCoord[1])];setTimeout(function(){self.moveOneTick(p);},this.tickPause);}else if(this.animate&&Slider.ANIM_AVAIL&&!skipAnim){this.lock();anim=new YAHOO.util.Motion(t.id,{points:{to:p}},this.animationDuration,YAHOO.util.Easing.easeOut);anim.onComplete.subscribe(function(){self.unlock();if(!self._mouseDown){self.endMove();}});anim.animate();}else{t.setDragElPos(x,y);if(!midMove&&!this._mouseDown){this.endMove();}}},_slideStart:function(){if(!this._sliding){if(!this._silent){this.onSlideStart();this.fireEvent("slideStart");}
this._sliding=true;}},_slideEnd:function(){if(this._sliding&&this.moveComplete){var silent=this._silent;this._sliding=false;this._silent=false;this.moveComplete=false;if(!silent){this.onSlideEnd();this.fireEvent("slideEnd");}}},moveOneTick:function(finalCoord){var t=this.thumb,self=this,nextCoord=null,tmpX,tmpY;if(t._isRegion){nextCoord=this._getNextX(this.curCoord,finalCoord);tmpX=(nextCoord!==null)?nextCoord[0]:this.curCoord[0];nextCoord=this._getNextY(this.curCoord,finalCoord);tmpY=(nextCoord!==null)?nextCoord[1]:this.curCoord[1];nextCoord=tmpX!==this.curCoord[0]||tmpY!==this.curCoord[1]?[tmpX,tmpY]:null;}else if(t._isHoriz){nextCoord=this._getNextX(this.curCoord,finalCoord);}else{nextCoord=this._getNextY(this.curCoord,finalCoord);}
if(nextCoord){this.curCoord=nextCoord;this.thumb.alignElWithMouse(t.getEl(),nextCoord[0]+this.thumbCenterPoint.x,nextCoord[1]+this.thumbCenterPoint.y);if(!(nextCoord[0]==finalCoord[0]&&nextCoord[1]==finalCoord[1])){setTimeout(function(){self.moveOneTick(finalCoord);},this.tickPause);}else{this.unlock();if(!this._mouseDown){this.endMove();}}}else{this.unlock();if(!this._mouseDown){this.endMove();}}},_getNextX:function(curCoord,finalCoord){var t=this.thumb,thresh,tmp=[],nextCoord=null;if(curCoord[0]>finalCoord[0]){thresh=t.tickSize-this.thumbCenterPoint.x;tmp=t.getTargetCoord(curCoord[0]-thresh,curCoord[1]);nextCoord=[tmp.x,tmp.y];}else if(curCoord[0]<finalCoord[0]){thresh=t.tickSize+this.thumbCenterPoint.x;tmp=t.getTargetCoord(curCoord[0]+thresh,curCoord[1]);nextCoord=[tmp.x,tmp.y];}else{}
return nextCoord;},_getNextY:function(curCoord,finalCoord){var t=this.thumb,thresh,tmp=[],nextCoord=null;if(curCoord[1]>finalCoord[1]){thresh=t.tickSize-this.thumbCenterPoint.y;tmp=t.getTargetCoord(curCoord[0],curCoord[1]-thresh);nextCoord=[tmp.x,tmp.y];}else if(curCoord[1]<finalCoord[1]){thresh=t.tickSize+this.thumbCenterPoint.y;tmp=t.getTargetCoord(curCoord[0],curCoord[1]+thresh);nextCoord=[tmp.x,tmp.y];}else{}
return nextCoord;},b4MouseDown:function(e){if(!this.backgroundEnabled){return false;}
this.thumb.autoOffset();this.resetThumbConstraints();},onMouseDown:function(e){if(!this.backgroundEnabled||this.isLocked()){return false;}
this._mouseDown=true;var x=Event.getPageX(e),y=Event.getPageY(e);this.focus();this._slideStart();this.moveThumb(x,y);},onDrag:function(e){if(this.backgroundEnabled&&!this.isLocked()){var x=Event.getPageX(e),y=Event.getPageY(e);this.moveThumb(x,y,true,true);this.fireEvents();}},endMove:function(){this.unlock();this.fireEvents();this.moveComplete=true;this._slideEnd();},resetThumbConstraints:function(){var t=this.thumb;t.setXConstraint(t.leftConstraint,t.rightConstraint,t.xTickSize);t.setYConstraint(t.topConstraint,t.bottomConstraint,t.xTickSize);},fireEvents:function(thumbEvent){var t=this.thumb,newX,newY,newVal;if(!thumbEvent){t.cachePosition();}
if(!this.isLocked()){if(t._isRegion){newX=t.getXValue();newY=t.getYValue();if(newX!=this.previousX||newY!=this.previousY){if(!this._silent){this.onChange(newX,newY);this.fireEvent("change",{x:newX,y:newY});}}
this.previousX=newX;this.previousY=newY;}else{newVal=t.getValue();if(newVal!=this.previousVal){if(!this._silent){this.onChange(newVal);this.fireEvent("change",newVal);}}
this.previousVal=newVal;}}},toString:function(){return("Slider ("+this.type+") "+this.id);}});YAHOO.lang.augmentProto(Slider,YAHOO.util.EventProvider);YAHOO.widget.Slider=Slider;})();YAHOO.widget.SliderThumb=function(id,sGroup,iLeft,iRight,iUp,iDown,iTickSize){if(id){YAHOO.widget.SliderThumb.superclass.constructor.call(this,id,sGroup);this.parentElId=sGroup;}
this.isTarget=false;this.tickSize=iTickSize;this.maintainOffset=true;this.initSlider(iLeft,iRight,iUp,iDown,iTickSize);this.scroll=false;};YAHOO.extend(YAHOO.widget.SliderThumb,YAHOO.util.DD,{startOffset:null,dragOnly:true,_isHoriz:false,_prevVal:0,_graduated:false,getOffsetFromParent0:function(parentPos){var myPos=YAHOO.util.Dom.getXY(this.getEl()),ppos=parentPos||YAHOO.util.Dom.getXY(this.parentElId);return[(myPos[0]-ppos[0]),(myPos[1]-ppos[1])];},getOffsetFromParent:function(parentPos){var el=this.getEl(),newOffset,myPos,ppos,l,t,deltaX,deltaY,newLeft,newTop;if(!this.deltaOffset){myPos=YAHOO.util.Dom.getXY(el);ppos=parentPos||YAHOO.util.Dom.getXY(this.parentElId);newOffset=[(myPos[0]-ppos[0]),(myPos[1]-ppos[1])];l=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);t=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);deltaX=l-newOffset[0];deltaY=t-newOffset[1];if(isNaN(deltaX)||isNaN(deltaY)){}else{this.deltaOffset=[deltaX,deltaY];}}else{newLeft=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);newTop=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);newOffset=[newLeft+this.deltaOffset[0],newTop+this.deltaOffset[1]];}
return newOffset;},initSlider:function(iLeft,iRight,iUp,iDown,iTickSize){this.initLeft=iLeft;this.initRight=iRight;this.initUp=iUp;this.initDown=iDown;this.setXConstraint(iLeft,iRight,iTickSize);this.setYConstraint(iUp,iDown,iTickSize);if(iTickSize&&iTickSize>1){this._graduated=true;}
this._isHoriz=(iLeft||iRight);this._isVert=(iUp||iDown);this._isRegion=(this._isHoriz&&this._isVert);},clearTicks:function(){YAHOO.widget.SliderThumb.superclass.clearTicks.call(this);this.tickSize=0;this._graduated=false;},getValue:function(){return(this._isHoriz)?this.getXValue():this.getYValue();},getXValue:function(){if(!this.available){return 0;}
var newOffset=this.getOffsetFromParent();if(YAHOO.lang.isNumber(newOffset[0])){this.lastOffset=newOffset;return(newOffset[0]-this.startOffset[0]);}else{return(this.lastOffset[0]-this.startOffset[0]);}},getYValue:function(){if(!this.available){return 0;}
var newOffset=this.getOffsetFromParent();if(YAHOO.lang.isNumber(newOffset[1])){this.lastOffset=newOffset;return(newOffset[1]-this.startOffset[1]);}else{return(this.lastOffset[1]-this.startOffset[1]);}},toString:function(){return"SliderThumb "+this.id;},onChange:function(x,y){}});(function(){var Event=YAHOO.util.Event,YW=YAHOO.widget;function DualSlider(minSlider,maxSlider,range,initVals){var self=this,ready={min:false,max:false},minThumbOnMouseDown,maxThumbOnMouseDown;this.minSlider=minSlider;this.maxSlider=maxSlider;this.activeSlider=minSlider;this.isHoriz=minSlider.thumb._isHoriz;minThumbOnMouseDown=this.minSlider.thumb.onMouseDown;maxThumbOnMouseDown=this.maxSlider.thumb.onMouseDown;this.minSlider.thumb.onMouseDown=function(){self.activeSlider=self.minSlider;minThumbOnMouseDown.apply(this,arguments);};this.maxSlider.thumb.onMouseDown=function(){self.activeSlider=self.maxSlider;maxThumbOnMouseDown.apply(this,arguments);};this.minSlider.thumb.onAvailable=function(){minSlider.setStartSliderState();ready.min=true;if(ready.max){self.fireEvent('ready',self);}};this.maxSlider.thumb.onAvailable=function(){maxSlider.setStartSliderState();ready.max=true;if(ready.min){self.fireEvent('ready',self);}};minSlider.onMouseDown=maxSlider.onMouseDown=function(e){return this.backgroundEnabled&&self._handleMouseDown(e);};minSlider.onDrag=maxSlider.onDrag=function(e){self._handleDrag(e);};minSlider.onMouseUp=maxSlider.onMouseUp=function(e){self._handleMouseUp(e);};minSlider._bindKeyEvents=function(){self._bindKeyEvents(this);};maxSlider._bindKeyEvents=function(){};minSlider.subscribe("change",this._handleMinChange,minSlider,this);minSlider.subscribe("slideStart",this._handleSlideStart,minSlider,this);minSlider.subscribe("slideEnd",this._handleSlideEnd,minSlider,this);maxSlider.subscribe("change",this._handleMaxChange,maxSlider,this);maxSlider.subscribe("slideStart",this._handleSlideStart,maxSlider,this);maxSlider.subscribe("slideEnd",this._handleSlideEnd,maxSlider,this);this.createEvent("ready",this);this.createEvent("change",this);this.createEvent("slideStart",this);this.createEvent("slideEnd",this);initVals=YAHOO.lang.isArray(initVals)?initVals:[0,range];initVals[0]=Math.min(Math.max(parseInt(initVals[0],10)|0,0),range);initVals[1]=Math.max(Math.min(parseInt(initVals[1],10)|0,range),0);if(initVals[0]>initVals[1]){initVals.splice(0,2,initVals[1],initVals[0]);}
this.minVal=initVals[0];this.maxVal=initVals[1];this.minSlider.setValue(this.minVal,true,true,true);this.maxSlider.setValue(this.maxVal,true,true,true);}
DualSlider.prototype={minVal:-1,maxVal:-1,minRange:0,_handleSlideStart:function(data,slider){this.fireEvent("slideStart",slider);},_handleSlideEnd:function(data,slider){this.fireEvent("slideEnd",slider);},_handleDrag:function(e){YW.Slider.prototype.onDrag.call(this.activeSlider,e);},_handleMinChange:function(){this.activeSlider=this.minSlider;this.updateValue();},_handleMaxChange:function(){this.activeSlider=this.maxSlider;this.updateValue();},_bindKeyEvents:function(slider){Event.on(slider.id,'keydown',this._handleKeyDown,this,true);Event.on(slider.id,'keypress',this._handleKeyPress,this,true);},_handleKeyDown:function(e){this.activeSlider.handleKeyDown.apply(this.activeSlider,arguments);},_handleKeyPress:function(e){this.activeSlider.handleKeyPress.apply(this.activeSlider,arguments);},setValues:function(min,max,skipAnim,force,silent){var mins=this.minSlider,maxs=this.maxSlider,mint=mins.thumb,maxt=maxs.thumb,self=this,done={min:false,max:false};if(mint._isHoriz){mint.setXConstraint(mint.leftConstraint,maxt.rightConstraint,mint.tickSize);maxt.setXConstraint(mint.leftConstraint,maxt.rightConstraint,maxt.tickSize);}else{mint.setYConstraint(mint.topConstraint,maxt.bottomConstraint,mint.tickSize);maxt.setYConstraint(mint.topConstraint,maxt.bottomConstraint,maxt.tickSize);}
this._oneTimeCallback(mins,'slideEnd',function(){done.min=true;if(done.max){self.updateValue(silent);setTimeout(function(){self._cleanEvent(mins,'slideEnd');self._cleanEvent(maxs,'slideEnd');},0);}});this._oneTimeCallback(maxs,'slideEnd',function(){done.max=true;if(done.min){self.updateValue(silent);setTimeout(function(){self._cleanEvent(mins,'slideEnd');self._cleanEvent(maxs,'slideEnd');},0);}});mins.setValue(min,skipAnim,force,false);maxs.setValue(max,skipAnim,force,false);},setMinValue:function(min,skipAnim,force,silent){var mins=this.minSlider,self=this;this.activeSlider=mins;self=this;this._oneTimeCallback(mins,'slideEnd',function(){self.updateValue(silent);setTimeout(function(){self._cleanEvent(mins,'slideEnd');},0);});mins.setValue(min,skipAnim,force);},setMaxValue:function(max,skipAnim,force,silent){var maxs=this.maxSlider,self=this;this.activeSlider=maxs;this._oneTimeCallback(maxs,'slideEnd',function(){self.updateValue(silent);setTimeout(function(){self._cleanEvent(maxs,'slideEnd');},0);});maxs.setValue(max,skipAnim,force);},updateValue:function(silent){var min=this.minSlider.getValue(),max=this.maxSlider.getValue(),changed=false,mint,maxt,dim,minConstraint,maxConstraint,thumbInnerWidth;if(min!=this.minVal||max!=this.maxVal){changed=true;mint=this.minSlider.thumb;maxt=this.maxSlider.thumb;dim=this.isHoriz?'x':'y';thumbInnerWidth=this.minSlider.thumbCenterPoint[dim]+
this.maxSlider.thumbCenterPoint[dim];minConstraint=Math.max(max-thumbInnerWidth-this.minRange,0);maxConstraint=Math.min(-min-thumbInnerWidth-this.minRange,0);if(this.isHoriz){minConstraint=Math.min(minConstraint,maxt.rightConstraint);mint.setXConstraint(mint.leftConstraint,minConstraint,mint.tickSize);maxt.setXConstraint(maxConstraint,maxt.rightConstraint,maxt.tickSize);}else{minConstraint=Math.min(minConstraint,maxt.bottomConstraint);mint.setYConstraint(mint.leftConstraint,minConstraint,mint.tickSize);maxt.setYConstraint(maxConstraint,maxt.bottomConstraint,maxt.tickSize);}}
this.minVal=min;this.maxVal=max;if(changed&&!silent){this.fireEvent("change",this);}},selectActiveSlider:function(e){var min=this.minSlider,max=this.maxSlider,minLocked=min.isLocked()||!min.backgroundEnabled,maxLocked=max.isLocked()||!min.backgroundEnabled,Ev=YAHOO.util.Event,d;if(minLocked||maxLocked){this.activeSlider=minLocked?max:min;}else{if(this.isHoriz){d=Ev.getPageX(e)-min.thumb.initPageX-min.thumbCenterPoint.x;}else{d=Ev.getPageY(e)-min.thumb.initPageY-min.thumbCenterPoint.y;}
this.activeSlider=d*2>max.getValue()+min.getValue()?max:min;}},_handleMouseDown:function(e){if(!e._handled){e._handled=true;this.selectActiveSlider(e);return YW.Slider.prototype.onMouseDown.call(this.activeSlider,e);}else{return false;}},_handleMouseUp:function(e){YW.Slider.prototype.onMouseUp.apply(this.activeSlider,arguments);},_oneTimeCallback:function(o,evt,fn){o.subscribe(evt,function(){o.unsubscribe(evt,arguments.callee);fn.apply({},[].slice.apply(arguments));});},_cleanEvent:function(o,evt){var ce,i,len,j,subs,newSubs;if(o.__yui_events&&o.events[evt]){for(i=o.__yui_events.length;i>=0;--i){if(o.__yui_events[i].type===evt){ce=o.__yui_events[i];break;}}
if(ce){subs=ce.subscribers;newSubs=[];j=0;for(i=0,len=subs.length;i<len;++i){if(subs[i]){newSubs[j++]=subs[i];}}
ce.subscribers=newSubs;}}}};YAHOO.lang.augmentProto(DualSlider,YAHOO.util.EventProvider);YW.Slider.getHorizDualSlider=function(bg,minthumb,maxthumb,range,iTickSize,initVals){var mint=new YW.SliderThumb(minthumb,bg,0,range,0,0,iTickSize),maxt=new YW.SliderThumb(maxthumb,bg,0,range,0,0,iTickSize);return new DualSlider(new YW.Slider(bg,bg,mint,"horiz"),new YW.Slider(bg,bg,maxt,"horiz"),range,initVals);};YW.Slider.getVertDualSlider=function(bg,minthumb,maxthumb,range,iTickSize,initVals){var mint=new YW.SliderThumb(minthumb,bg,0,0,0,range,iTickSize),maxt=new YW.SliderThumb(maxthumb,bg,0,0,0,range,iTickSize);return new YW.DualSlider(new YW.Slider(bg,bg,mint,"vert"),new YW.Slider(bg,bg,maxt,"vert"),range,initVals);};YAHOO.widget.DualSlider=DualSlider;})();YAHOO.register("slider",YAHOO.widget.Slider,{version:"2.7.0",build:"1799"});
function GameCore_UI(){this.config=null;this.LoadConfig=function(){if(this.config===null)
this.config=GameCore.Config.get('UserInterface');if(!this.config)
throw new"GameCore_UI: could not load configuration GameCore.Config.get('UserInterface');"};this.ModalDialog=function(DialogConfig){return this.__Dialog('ModalDialog',DialogConfig);};this.Dialog=function(DialogConfig){return this.__Dialog('Dialog',DialogConfig);};this.__Dialog=function(DialogType,DialogConfig){this.LoadConfig();var self=this;var DialogTypeConfig=this.config[DialogType];if(DialogTypeConfig){if(DialogTypeConfig.TitleLayer)
DialogTypeConfig.TitleLayer.update(DialogConfig.Title);else throw new DialogType+" has no title layer defined.";if(DialogTypeConfig.ContentLayer)
DialogTypeConfig.ContentLayer.update(DialogConfig.Message);else throw new DialogType+" has no content layer defined.";if(!DialogConfig.Buttons||DialogConfig.Buttons.length==0)DialogConfig.Buttons=[{'Type':'Close'}];if(DialogTypeConfig.ButtonZone){DialogTypeConfig.ButtonZone.show();}
if(DialogTypeConfig.Buttons){for(var ButtonId in DialogTypeConfig.Buttons){DialogTypeConfig.Buttons[ButtonId].hide();}
for(var i=0;i<DialogConfig.Buttons.length;i++){var ButtonConfig=DialogConfig.Buttons[i];var Button=DialogTypeConfig.Buttons[ButtonConfig.Type];if(Button){if(ButtonConfig.Link||ButtonConfig.Click)Button.onclick=function(){if(DialogTypeConfig.ButtonZone){DialogTypeConfig.ButtonZone.hide();}
if(ButtonConfig.Link){document.location.href=ButtonConfig.Link;}
if(ButtonConfig.Click){ButtonConfig.Click(DialogTypeConfig,DialogConfig);}};else{if(ButtonConfig.Type=='Close'){Button.onclick=function(){var HideLayer=true;if(DialogConfig&&DialogConfig.onClose){HideLayer=DialogConfig.onClose(DialogConfig,DialogTypeConfig.ContainerLayer.hide);}
if(HideLayer==true){DialogTypeConfig.ContainerLayer.hide();}}}}
if(ButtonConfig.Label)Button.update(ButtonConfig.Label);Button.show();}else throw new DialogType+" has no button with id "+DialogConfig.Buttons[i].Type;}
if(DialogTypeConfig.onType&&DialogConfig.Type){DialogTypeConfig.onType(DialogConfig);}
DialogTypeConfig.ContainerLayer.show('block');}else throw new DialogType+" has no buttons defined.";return;}
throw new DialogType+" not configured, set config GameCore.Config.set('UserInterface', {'"+DialogType+"': {}});";};};if(GameCore){GameCore.UI=new GameCore_UI();}
function GameCore_ServerTime(){this.currentServerTime=null;this.Timer=null;this.setServerTime=function(time){var self=this;this.currentServerTime=parseInt(time);if(this.Timer===null){this.Timer=window.setInterval(function(){self.currentServerTime++;},1000);}};this.getCurrentTime=function(){return this.currentServerTime;};this.getTimeString=function(value,callback){var days=Math.floor((value/86400));var hours=Math.floor((value/3600)%24);var minutes=Math.floor((value/60)%60);var seconds=Math.floor(value%60);if(days<=9&&days>=0)days='0'+days;if(hours<=9&&hours>=0)hours='0'+hours;if(minutes<=9&&minutes>=0)minutes='0'+minutes;if(seconds<=9&&seconds>=0)seconds='0'+seconds;if(!callback){return(hours!='00'?hours+':':'')+minutes+':'+seconds;}else{return callback(days,hours,minutes,seconds);}};};GameCore.ServerTime=new GameCore_ServerTime();
function GameCore_Utilities_CheckBox(config){this.config=config;this.SelectorCondition=(this.config.SelectorCondition?this.config.SelectorCondition:'*[checkbox]');this.Nodes=null;this.lastSelectedNode=null;this.lastSelectionWasMulti=null;this.Init=function(){var self=this;this.Nodes=YAHOO.util.Selector.query(this.SelectorCondition);if(this.Nodes&&this.Nodes.length>0){for(var i=0;i<this.Nodes.length;i++){this.Nodes[i].backupOnClick=this.Nodes[i].onclick;this.Nodes[i].onclick=function(event){self.onClick(event,this);if(this.backupOnClick)
this.backupOnClick();};}}};this.setRowHighlight=function(row){if(row&&!row.className.match(' '+this.config.HighlightClass)){row.isSelected=true;row.className+=' '+this.config.HighlightClass;}};this.unsetRowHighlight=function(row){if(row){row.isSelected=false;if(row.className){row.className=row.className.replace(' '+this.config.HighlightClass,'');}}};this.toggleRowHighlight=function(row){if(row.isSelected===true){this.unsetRowHighlight(row);return false;}else
this.setRowHighlight(row);return true;};this.onClick=function(event,node){if(!event)event=window.event;var lastSelectedCheckbox=(this.lastSelectedNode?this.lastSelectedNode.getAttribute('checkbox'):null);var lastSelectedCheckboxId=(this.lastSelectedNode?this.lastSelectedNode.getAttribute('checkboxId'):null);var currentSelectedCheckbox=node.getAttribute('checkbox');var currentSelectedCheckboxId=node.getAttribute('checkboxId');var check=false;var elementsSelected=false;var selectedElements={};var elements='';for(var i=0;i<node.parentNode.childNodes.length;i++){var currentNodeCheckbox=null,currentNodeCheckboxId=null,currentNode=node.parentNode.childNodes[i];var currentNodeCheck=false,lastNodeCheck=false;if(currentNode&&currentNode.getAttribute&&(currentNodeCheckbox=currentNode.getAttribute('checkbox'))&&(currentNodeCheckboxId=currentNode.getAttribute('checkboxId'))){if(event.shiftKey===true&&this.lastSelectedNode){if(((currentNodeCheck=(currentNodeCheckbox==currentSelectedCheckbox&&currentNodeCheckboxId==currentSelectedCheckboxId))||(lastNodeCheck=(currentNodeCheckbox==lastSelectedCheckbox&&currentNodeCheckboxId==lastSelectedCheckboxId)))||(check===true)){this.setRowHighlight(currentNode);if(currentNodeCheck||lastNodeCheck){if(check===true)check=false;else check=true;}}else{this.unsetRowHighlight(currentNode);}}else{if(currentNodeCheckbox!=currentSelectedCheckbox||currentNodeCheckboxId!=currentSelectedCheckboxId){if(!event.altKey&&!event.ctrlKey){this.unsetRowHighlight(currentNode);}}else{if((event.altKey||event.ctrlKey)&&currentNodeCheckbox==currentSelectedCheckbox&&currentNodeCheckboxId==currentSelectedCheckboxId&&currentNode.isSelected===true){this.unsetRowHighlight(currentNode);}else{this.setRowHighlight(currentNode);this.lastSelectedNode=currentNode;}}}
if(currentNode.isSelected===true){elementsSelected=true;if(!selectedElements[currentNodeCheckboxId])selectedElements[currentNodeCheckboxId]=[];selectedElements[currentNodeCheckboxId].push(currentNode);elements+='<input type="hidden" name="'+currentNodeCheckboxId+'[]" value="'+currentNodeCheckbox+'"></input>';var inputElement=$('__CHECKBOX_HIDDEN_INPUT_FIELD-'+currentNodeCheckboxId+'#'+currentNodeCheckbox);if(!inputElement){var inputField=GameCore.Dom.Builder.node('input',{'type':'hidden','name':currentNodeCheckboxId+'[]','value':currentNodeCheckbox,'id':'__CHECKBOX_HIDDEN_INPUT_FIELD-'+currentNodeCheckboxId+'#'+currentNodeCheckbox});currentNode.appendChild(inputField);}}else{var inputElement=$('__CHECKBOX_HIDDEN_INPUT_FIELD-'+currentNodeCheckboxId+'#'+currentNodeCheckbox);if(inputElement)inputElement.remove();}}
node.focus();}
if(elementsSelected===true&&this.config.onSelectedElements)
this.config.onSelectedElements(selectedElements);else if(elementsSelected===false&&this.config.onNoSelectedElements)
this.config.onNoSelectedElements();};this.Init();};
function Goto(url){top.location.href=url;};function ShowFlashMessages(FlashMessages){if(FlashMessages&&FlashMessages.length>0){var MessageString='';var Type='default';for(var i=0;i<FlashMessages.length;i++){if(FlashMessages[i]){MessageString+='<p>'+FlashMessages[i].text+'</p>';if(Type!=FlashMessages[i].type){Type=FlashMessages[i].type}}}
GameCore.UI.ModalDialog({'Type':Type,'Title':gettext('LABEL_FLASH_MESSAGE_NOTICE'),'Message':MessageString});}};
function Game_Tooltip(config){this.config=config;this.Offset={'x':8,'y':8};this.Countdown=null;this.Move=function(event){if(!event){event=window.event;}
var x=Event.pointerX(event);var y=Event.pointerY(event);x+=this.Offset.x;y+=this.Offset.y;var w=parseInt((this.config.TooltipLayer.offsetWidth?this.config.TooltipLayer.offsetWidth:300))+10;if(YAHOO.util.Dom.getViewportWidth()<=(x+w)){x=x-w-this.Offset.x;}
var h=parseInt((this.config.TooltipLayer.offsetHeight?this.config.TooltipLayer.offsetHeight:200))+10;if(YAHOO.util.Dom.getViewportHeight()<=(y+h)){y=y-h-this.Offset.y;}
this.config.TooltipLayer.style.top=y+'px';this.config.TooltipLayer.style.left=x+'px';}
this.Show=function(event,type,content){var displayContent='';displayContent+='<div class="TTbackground"></div>';displayContent+='<div class="TTcontent" style="">';if(!content){'<span class="error">no content given</span>'}
switch(type){case'XP':displayContent+='<p class="Title">'+gettext('CHARACTER_XP')+'</p><p class="Name">'+content+'</p>';break;case'Achievement':displayContent+=this.designAchievementLayer(gettext(content.AchievementName));break;case'Health':case'Skill':displayContent+=this.getSkillContent(content);break;case'Item':displayContent+='<div class="Item_'+content.Item+'" style="position: relative;"></div><p>'+content.Name+'</p>';break;case'ExpeditionPoints':displayContent+=this.designTextLayer(content.text);if(content.nextExpeditionPoint&&content.nextExpeditionPoint>GameCore.ServerTime.getCurrentTime()){var self=this;displayContent+=this.designTextLayer('','NEXT_EXPEDITION_POINT_REACHED_COUNTDOWN','Description');this.Countdown=new GameCore_Utilities_Countdown({'LayerId':'NEXT_EXPEDITION_POINT_REACHED_COUNTDOWN','TidySecondsPostFilter':self.getCountdownLabel,'CountdownLayerUpdateFilter':function(Layer,text){Layer.update(GameCore.sprintf(gettext('LABEL_NEXT_EXPEDITION_POINT'),text));},'Countdown':content.nextExpeditionPoint-GameCore.ServerTime.getCurrentTime()},true);}
break;case'text':displayContent+=this.designTextLayer(content);break;default:displayContent+=content+'<span class="error">no type defined</span>';}
displayContent+='</div>';this.config.TooltipLayer.update(displayContent);this.config.TooltipLayer.show();this.Move(event);if(this.Countdown){this.Countdown.start();}};this.Hide=function(){this.config.TooltipLayer.hide();if(this.Countdown){this.Countdown.stop();this.Countdown=null;}};this.getCountdownLabel=function(days,hours,minutes,seconds,hideNullValues){var string='';if(days>0){string+=days+':';}
if(hours*1>0){string+=hours+':';}
string+=minutes+':';string+=seconds;return string;};this.designTextLayer=function(data,specialId,specialClass){var content='';content+='<p class="'+(specialClass?specialClass:'Name')+'"'+(specialId?' id="'+specialId+'"':'')+'>'+data+'</p>';return content;}
this.designAchievementLayer=function(data){var content='';content+='<p class="Name">'+data+'</p>';return content;}
this.getSkillContent=function(data){var content='<p class="Title">'+data.name+'</p>';var ItemAttributeValues=Character.getItemAttributeValues();var Value=(ItemAttributeValues&&ItemAttributeValues[GameCore.ucfirst(data.skill)]?ItemAttributeValues[GameCore.ucfirst(data.skill)]:null);switch(data.skill){case'health':var ItemValue=(Value===null?0:Value);content+=this.getSkillValueLine('ValueFromTraining',gettext('LABEL_SKILL_VALUE_TRAINING'),Math.round(Character.getMaxHealth()-ItemValue));content+=this.getSkillValueLine('ValueFromItems',gettext('LABEL_SKILL_VALUE_ITEMS'),Math.round(ItemValue));content+=this.getSkillValueLine('ValueFromTraining HealthRegeneration',gettext('LABEL_HEALTH_REGENERATION'),Math.round(Character.getHealthRegeneration()));content+='<p class="Notice">'+gettext('LABEL_HEALTH_TOOLTIP_MAX')+'</p>';break;case'damage':var CharacterValue=Character.getAttributeValue(GameCore.ucfirst(data.skill),true);content+=this.getSkillValueLine('ValueFromTraining',gettext('LABEL_SKILL_VALUE_SKILLS'),CharacterValue.Min+' - '+CharacterValue.Max);var ItemDamageValue='';if(ItemAttributeValues&&ItemAttributeValues.Damage){ItemDamageValue=ItemAttributeValues.Damage.Min+' - '+ItemAttributeValues.Damage.Max;}else{ItemDamageValue='0 - 0';}
content+=this.getSkillValueLine('ValueFromTraining',gettext('LABEL_SKILL_VALUE_ITEMS'),ItemDamageValue);break;default:var TrainingsValue=Math.round(Character.getAttributeValue(GameCore.ucfirst(data.skill),true));var ItemValue=Math.round((Value===null?0:Value));content+=this.getSkillValueLine('ValueFromTraining',gettext('LABEL_SKILL_VALUE_SKILLS'),TrainingsValue);content+=this.getSkillValueLine('ValueFromItems',gettext('LABEL_SKILL_VALUE_ITEMS'),ItemValue);if(TrainingsValue+ItemValue>Character.getMaxAttributeValue(GameCore.ucfirst(data.skill))){content+='<p class="Notice">'+gettext('LABEL_ITEMS_REACHED_MAXIMUM_POSSIBLE_SKILL_VALUE')+'</p>';}}
return content;};this.getSkillValueLine=function(styleClass,title,value){return'<p class="'+styleClass+'">'+title+': '+value+'</p>';};};
function Game_Item_Utilities(ItemList,ItemContainerInventoryCharacterCraftingSlots,ItemValidCraftingTargetTypes,ItemInventorySlots){this.Items=ItemList;this.ItemContainerInventoryCharacterCraftingSlots=ItemContainerInventoryCharacterCraftingSlots;this.ItemValidCraftingTargetTypes=ItemValidCraftingTargetTypes;this.ItemInventorySlots=ItemInventorySlots;this.Cache={};this.ItemTagColors={'prefix':{10001:{'Weight':1,'Color':'#a00'}},'appendix':{10001:{'Weight':1,'Color':'#a00'},10002:{'Weight':2,'Color':'#0a0'}}};this.getItemDataByLayerId=function(layerId){for(var containerId in this.Items){for(var itemLayerId in this.Items[containerId].byItem){if(itemLayerId==layerId){var tmp=this.Items[containerId].byItem[layerId];tmp.containerId=containerId;return tmp;}}}
return null;};this.getInventorySlotsToCompareByType=function(type){switch(type){case'ARMOR':return new Array(this.ItemInventorySlots.Inventory_Slot_Armor);break;case'BELT':return new Array(this.ItemInventorySlots.Inventory_Slot_Belt);break;case'BOOTS':return new Array(this.ItemInventorySlots.Inventory_Slot_Foot);break;case'HELMET':return new Array(this.ItemInventorySlots.Inventory_Slot_Helmet);break;case'NECKLACE':return new Array(this.ItemInventorySlots.Inventory_Slot_Necklace);break;case'PANTS':return new Array(this.ItemInventorySlots.Inventory_Slot_Pants);break;case'BOOTS':return new Array(this.ItemInventorySlots.Inventory_Slot_Foot);break;case'RING':return new Array(this.ItemInventorySlots.Inventory_Slot_Ring1,this.ItemInventorySlots.Inventory_Slot_Ring2);break;case'WEAPON':return new Array(this.ItemInventorySlots.Inventory_Slot_Weapon1,this.ItemInventorySlots.Inventory_Slot_Weapon2);break;default:return null;}}
this.getInventorySlotById=function(id){for(var name in this.ItemInventorySlots){if(this.ItemInventorySlots[name].id==id){this.ItemInventorySlots.internalName=name;return this.ItemInventorySlots[name];}}
return null;};this.getInventorySlotByName=function(name){if(this.ItemInventorySlots&&this.ItemInventorySlots[name]){this.ItemInventorySlots[name].internalName=name;return this.ItemInventorySlots[name];}
return null;};this.getInventoryItemBySlot=function(name){var slot=this.getInventorySlotByName(name);var Item=null;if(slot!=null&&this.Items&&this.Items.Inventory){if(this.Items.Inventory.grid[slot.id]){Item=this.Items.Inventory.byItem[this.Items.Inventory.grid[slot.id]];}}
return Item;};this.removeItem=function(layerId){var item=null;for(var containerId in this.Items){for(var itemLayerId in this.Items[containerId].byItem){if(itemLayerId==layerId){item=this.Items[containerId].byItem[layerId];item.containerId=containerId;for(var gridId in this.Items[containerId].grid){if(this.Items[containerId].grid[gridId]==layerId){delete this.Items[containerId].byItem[layerId];delete this.Items[containerId].grid[gridId];}}}}}
return item;};this.addItem=function(itemLayerId,itemData,containerId,gridId){if(!this.Items[containerId])this.clearContainer(containerId);this.Items[containerId].byItem[itemLayerId]=itemData;this.Items[containerId].grid[gridId]=itemLayerId;};this.updateItemDataByLayerId=function(layerId,itemData){for(var containerId in this.Items){for(var itemLayerId in this.Items[containerId].byItem){if(itemLayerId==layerId){this.Items[containerId].byItem[layerId]=itemData;return true;}}}
return false;};this.visualItemEffect=function(layerBaseId,basePos,elementData){var elem=$(layerBaseId);var id=layerBaseId+'_'+elementData.id;var newElement=elem.cloneNode(true);newElement.id=id;document.body.appendChild(newElement);new PeriodicalExecuter(function(pe){var element=$(id);if(!element.updated){element.className=element.className.replace(/Invisible/,'Visible');element.setStyle({'position':'absolute','top':String(basePos.top)+'px','left':String(basePos.left)+'px'});element.update(elementData.Value);element.updated=true;};var top=parseInt(element.getStyle('top'))-15;var left=parseInt(element.getStyle('left'));var opacity=element.getStyle('opacity')-0.04;element.setStyle({'top':String(top)+'px','left':String(left)+'px','opacity':opacity});if(top<=0||opacity<=0){element.remove();pe.stop();}},0.05);};this.getCharacterCraftingContainerIds=function(){return this.ItemContainerInventoryCharacterCraftingSlots;};this.getOutdatedCharacterCraftingItems=function(){var ItemList=[];var craftingContainerIds=this.getCharacterCraftingContainerIds();for(var internalId in craftingContainerIds){var craftingContainerId=craftingContainerIds[internalId];var craftingItemId=this.Items.Inventory.grid[craftingContainerId];if(craftingItemId){var Item=this.getItemDataByLayerId(craftingItemId);if(Item.siv>0&&Item.siv<=GameCore.ServerTime.getCurrentTime()){Item.internalCraftingContainerId=internalId;Item.layerId=craftingItemId;ItemList.push(Item);}}}
return ItemList;};this.getNextOutdatedCharacterCraftingItem=function(){var lastItem=null;var craftingContainerIds=this.getCharacterCraftingContainerIds();for(var internalId in craftingContainerIds){var craftingContainerId=craftingContainerIds[internalId];var craftingItemId=this.Items.Inventory.grid[craftingContainerId];if(craftingItemId){var Item=this.getItemDataByLayerId(craftingItemId);if(Item.siv>0&&Item.siv>GameCore.ServerTime.getCurrentTime()&&(lastItem==null||lastItem.siv>Item.siv)){Item.internalCraftingContainerId=internalId;Item.layerId=craftingItemId;lastItem=Item;}}}
return lastItem;};this.getFreeCharacterCraftingContainerId=function(){var CharacterCraftingContainerIds=this.getCharacterCraftingContainerIds();if(this.Items&&this.Items.Inventory&&this.Items.Inventory.grid){var CurrentAssignedPositions=GameCore.ArrayKeys(this.Items.Inventory.grid);for(var key in CharacterCraftingContainerIds){var currPos=CharacterCraftingContainerIds[key];if(GameCore.ArraySearch(currPos,CurrentAssignedPositions)===false){delete CharacterCraftingContainerIds;delete CurrentAssignedPositions;return currPos;}}
delete CharacterCraftingContainerIds;delete CurrentAssignedPositions;return false;}
return CharacterCraftingContainerIds[0];};this.clearContainer=function(id){this.Items[id]={'grid':{},'byItem':{}};};this.getItemTagColor=function(item){var config=null;if(item.itemTagAppendix>0&&this.ItemTagColors&&this.ItemTagColors.appendix&&this.ItemTagColors.appendix[item.itemTagPrefix]){config=this.ItemTagColors.appendix[item.itemTagAppendix];}
if(item.itemTagPrefix>0&&this.ItemTagColors&&this.ItemTagColors.prefix&&this.ItemTagColors.prefix[item.itemTagPrefix]){if(!config||this.ItemTagColors.prefix[item.itemTagPrefix].Weight>=config.Weight){config=this.ItemTagColors.prefix[item.itemTagPrefix];}}
if(config&&config.Color)return config.Color;return false;};this.getAjaxParameters=function(fromContainer,toContainer,data){var item=this.getItemDataByLayerId(data.el.id);var targetItem=ItemUtilities.getItemDataByLayerId(toContainer.id);return{'fromContainer':fromContainer.id,'fromContainerAdditionalInfo':fromContainer.config.additionalInfo,'fromContainerType':fromContainer.config.type,'toContainer':toContainer.id,'toContainerAdditionalInfo':toContainer.config.additionalInfo,'toContainerType':toContainer.config.type,'slot':$(toContainer.id).slot,'position':data.itemContainerPosition,'itemId':(item.itemId?item.itemId:null),'shopItemId':item.shopItemId,'targetItemId':(targetItem?targetItem.itemId:null)};};this.increaseItemAttributesByItem=function(targetItem,item,factor){if(typeof factor=='undefined'){factor=1;}
for(var attribute in item.attributes){for(var type in item.attributes[attribute]){if(targetItem.attributes&&targetItem.attributes[attribute]&&targetItem.attributes[attribute][type]&&targetItem.attributes[attribute][type]){targetItem.attributes[attribute][type]+=parseInt(item.attributes[attribute][type])*factor;}else{if(!targetItem.attributes)targetItem.attributes={};if(!targetItem.attributes[attribute])targetItem.attributes[attribute]={};targetItem.attributes[attribute][type]=parseInt(item.attributes[attribute][type])*factor;}}}
return targetItem;};this.decreaseItemAttributesByItem=function(targetItem,item){return this.increaseItemAttributesByItem(targetItem,item,-1);};this.changeItemId=function(itemLayerId,itemId,itemContainerId){if(this.Items&&this.Items[itemContainerId]&&this.Items[itemContainerId]['byItem']&&this.Items[itemContainerId]['byItem'][itemLayerId]){this.Items[itemContainerId]['byItem'][itemLayerId].shopItemId=null;this.Items[itemContainerId]['byItem'][itemLayerId].itemId=itemId;}};};
function Game_ItemContainer(baseLayerId,currentSlot,slots,shopType){this.baseLayerId=baseLayerId;this.shopType=shopType;this.currentSlot=currentSlot;this.lastSlot=null;this.slots=slots;this.switchSlot=function(newSlot){if(newSlot!=this.currentSlot&&newSlot){var newSlotTabLayer=$(this.getLayerId('tab',newSlot));var oldSlotTabLayer=$(this.getLayerId('tab',this.currentSlot));newSlotTabLayer.className=newSlotTabLayer.className.replace('Inactive','Active');oldSlotTabLayer.className=oldSlotTabLayer.className.replace('Active','Inactive');var newSlotLayer=$(this.getLayerId('items',newSlot));newSlotLayer.slot=newSlot;var oldSlotLayer=$(this.getLayerId('items',this.currentSlot));oldSlotLayer.slot=this.currentSlot;newSlotLayer.className=newSlotLayer.className.replace('Invisible','Visible');newSlotLayer.slot=newSlot;oldSlotLayer.className=oldSlotLayer.className.replace('Visible','Invisible');oldSlotLayer.slot=this.currentSlot;this.currentItemSlotLayerId=newSlotLayer.id;this.lastSlot=this.currentSlot;this.currentSlot=newSlot;GameCore.setCookie('current'+baseLayerId+'Slot',newSlot,null,'/');}};this.switchSlotToLayerId=function(layerId){var targetSlot=$(layerId);return this.switchSlot(targetSlot.slot);};this.revertSwitchSlot=function(){if(this.lastSlot!=null){this.switchSlot(this.lastSlot);}};this.getCurrentLayerId=function(type){return this.getLayerId(type,this.currentSlot);};this.getLayerId=function(type,slot){var ret=this.baseLayerId+'_'+'Slot_'+slot;switch(type){case'tab':ret+='_Tab';break;}
return ret;};this.createDraggableItems=function(container,data){if(data.length==undefined){for(var itemLayerId in data){var item=data[itemLayerId];new YAHOO.DraggableItems.DDPlayer(itemLayerId,(this.shopType&&!item.type?this.shopType:item.type),{'itemId':item.itemId,'shopItemId':item.shopItemId,'currentContainer':container});}}};this.createDroppables=function(slotId,groups,itemContainerWidth,itemContainerHeight,droppableType,config){var self=this;var ownConfig=config;var tab=new YAHOO.util.DDTarget(this.getLayerId('tab',slotId),'Items',{'slotId':slotId,'type':'dummy','additionalCheck':function(){return false;},'onMouseOverHook':function(e,targetElement){self.switchSlot(targetElement.config.slotId);}});var itemLayer=$(this.getLayerId('items',slotId));itemLayer.slot=this.currentSlot;var slot=new YAHOO.util.DDTarget(itemLayer,'Items',{'mapId':config.mapId,'onInvalidDrop':function(e,originalContainer){self.switchSlotToLayerId(originalContainer.id);},'onValidDropFrom':config.onValidDropFrom,'onValidDrop':config.onValidDrop,'dropCallUrl':config.dropCallUrl,'additionalCheck':function(targetElement,fromElement,element){if(targetElement.id==self.getCurrentLayerId('items')){if(fromElement&&fromElement.config&&fromElement.config.additionalFromCheck&&fromElement.config.additionalFromCheck(targetElement,fromElement,element)!==true){return false;}
return true;}
return false;},'additionalFromCheck':config.additionalFromCheck,'multi':true,'type':droppableType,'LoadingContainerLayer':config.LoadingContainerLayer,'additionalInfo':config.additionalInfo,'containerDimension':{'height':itemContainerHeight,'width':itemContainerWidth}});for(var i=0;i<groups.length;i++){var group=groups[i];tab.addToGroup(group);slot.addToGroup(group);}};this.currentItemSlotLayerId=this.getLayerId('item',this.currentSlot);};
function Game_Item_Reward(config){var self=this;this.config=config;this.createDraggableItems=function(container,data,lastViewableRewardItemId){for(var itemLayerId in data){var item=data[itemLayerId];new YAHOO.DraggableItems.DDPlayer(itemLayerId,item.type,{'shopItemId':item.shopItemId,'currentContainer':container});}};this.createDroppable=function(layerId,config){var self=this;var slot=new YAHOO.util.DDTarget(layerId,'Items',{'mapId':config.mapId,'position':config.position,'onValidDropFrom':function(fromContainer,targetContainer,data){if(config&&config.onValidDropFrom){config.onValidDropFrom(fromContainer,targetContainer,data,self);}},'dropCallUrl':config.dropCallUrl,'multi':false,'type':'Reward','containerDimension':config.containerDimension,'additionalInfo':config.additionalInfo});};this.onValidDropFrom=function(fromContainer,toContainer,data,self){if(fromContainer.config.dropCallUrl){if(self.config&&self.config.LoadingContainerLayer){$(self.config.LoadingContainerLayer).show('block');}
new Ajax.Request(fromContainer.config.dropCallUrl,{'method':'post','parameters':ItemUtilities.getAjaxParameters(fromContainer,toContainer,data),'onSuccess':function(transport){if(transport&&transport.headers&&transport.headers['X-GC-JS-EVAL']){eval(transport.responseText);}else{var parentNode=$('rewardContainer').parentNode;$('rewardContainer').remove();parentNode.innerHTML+=transport.responseText;var containerElements=$('Reward').childNodes;ItemUtilities.clearContainer('Reward');if(containerElements.length>0){for(var i=0;i<containerElements.length;i++){if(containerElements[i]&&containerElements[i].getAttribute&&containerElements[i].getAttribute('itemData')){var itemData=null;eval('itemData = '+containerElements[i].getAttribute('itemData'));ItemUtilities.Items.Reward.byItem[containerElements[i].getAttribute('itemId')]=itemData;}}
self.createDraggableItems('Reward',ItemUtilities.Items['Reward']['byItem']);}
ItemTooltip.assignTooltips();}
if(self.config&&self.config.LoadingContainerLayer){$(self.config.LoadingContainerLayer).hide();}}});var Item=ItemUtilities.getItemDataByLayerId(data.el.id);if(Item&&Item.type=='SPECIAL_INT_VALUE'){var pos={'top':data.currentEvent.clientY-15,'left':data.currentEvent.clientX};ItemUtilities.visualItemEffect('GoldCashEffectLayer',pos,{'id':data.el.id,'Value':Item.siv});Character.increaseGold(Item.siv);ItemUtilities.removeItem(data.el.id);$(data.el.id).remove();delete pos;}
delete Item;}};};
function Game_Map(config){this.config=config;this.MapLayer=null;this.MapLayerDimension={};this.ViewLayer=null;this.TooltipLayer=null;this.Tiles={};this.MouseFollowerDiv=null;this.currentMouseState='standard';this.startPosition=null;this.ElementsOnMap={};this.MapTileContainer=null;this.Init=function(){this.MapLayer=$(this.config.MapLayerId);this.MapLayerDimension={'x':parseInt(this.MapLayer.style.width),'y':parseInt(this.MapLayer.style.height)};if(this.config.MinPosition){this.MapLayerDimension.x-=this.config.MinPosition.x;this.MapLayerDimension.y-=this.config.MinPosition.y;}
if(this.config.MaxPosition){this.MapLayerDimension.x=this.config.MaxPosition.x-dimension.x;this.MapLayerDimension.y=this.config.MaxPosition.y-dimension.y;}
if(this.config.ViewLayerId){this.ViewLayer=$(this.config.ViewLayerId);}
if(this.config.TooltipLayerId){this.TooltipLayer=$(this.config.TooltipLayerId);}
if(this.config.MapTiles)this.InitTiles();document.body.appendChild(GameCore.Dom.Builder.node('input',{'type':'text','id':'__MAP_DUMMY_INPUT_FOCUS_FIELD','style':'position: absolute; top: -50px;'}));this.registerEventListeners();if(this.config.onInit){this.config.onInit(this);}else{this.setMapPosition({'x':0,'y':0});}};this.InitTiles=function(){var viewDimension={'x':parseInt(this.ViewLayer.style.width),'y':parseInt(this.ViewLayer.style.height)};this.Tiles.MaxTiles={'x':Math.ceil(viewDimension.x/this.config.MapTiles.Dimension.x)+1,'y':Math.ceil(viewDimension.y/this.config.MapTiles.Dimension.y)+1,'Width':Math.ceil(parseInt(this.MapLayer.style.width)/this.config.MapTiles.Dimension.x),'Height':Math.ceil(parseInt(this.MapLayer.style.height)/this.config.MapTiles.Dimension.y)};this.Tiles.MaxTiles.Complete=(this.Tiles.MaxTiles.Width)*(this.Tiles.MaxTiles.Height);this.MapTileContainer=GameCore.Dom.Builder.node('div',{'id':'__MAP_TILE_CONTAINER','style':'position: absolute; width: '+(this.config.MapTiles.Dimension.x*this.Tiles.MaxTiles.x)+'px; height: '+(this.config.MapTiles.Dimension.y*this.Tiles.MaxTiles.y)+'px;'})
this.MapLayer.appendChild(this.MapTileContainer);for(var y=0;y<this.Tiles.MaxTiles.y;y++){for(var x=0;x<this.Tiles.MaxTiles.x;x++){this.MapTileContainer.appendChild(GameCore.Dom.Builder.node('div',{'id':'__MAP_TILE_'+x+'x'+y,'style':'position: absolute; left: '+(x*this.config.MapTiles.Dimension.x)+'px; top: '+(y*this.config.MapTiles.Dimension.y)+'px; width: '+this.config.MapTiles.Dimension.x+'px; height: '+this.config.MapTiles.Dimension.y+'px;'}));}}};this.getElements=function(){return this.config.Elements;};this.registerEventListeners=function(){var self=this;document.body.onmousemove=function(event){$('__MAP_DUMMY_INPUT_FOCUS_FIELD').select();event=GameCore.Dom.parseEvent(event,self.config.MapLayerId);if(YAHOO.env.ua.ie>=6&&self.currentMouseState=='pressed'&&event.button==0){document.body.onmouseup(event);}
self.MouseMoveHandler(event);};document.body.onmouseup=function(event){self.MouseUpHandler(GameCore.Dom.parseEvent(event,self.config.MapLayerId));self.currentMouseState='standard';};document.body.ondragstart=function(){return false;};window.onmousemove=document.body.onmousemove;window.onmouseup=document.body.onmouseup;window.onblur=document.body.onmouseup;this.MapLayer.onmousedown=function(event){self.MouseDownHandler(GameCore.Dom.parseEvent(event));self.currentMouseState='pressed';return false;};this.MapLayer.onclick=function(event){event=GameCore.Dom.parseEvent(event,self.config.MapLayerId);var diff={'x':event.clientX-self.startPosition.Mouse.x,'y':event.clientY-self.startPosition.Mouse.y};if(diff.x>20||diff.x<-20||diff.y>20||diff.y<-20)
return false;self.currentMouseState='click';self.MouseClickHandler(event);self.currentMouseState='standard';return false;};};this.MouseDownHandler=function(event){this.startPosition={'Mouse':{'x':event.clientX,'y':event.clientY},'Map':{'x':parseInt(this.MapLayer.style.left),'y':parseInt(this.MapLayer.style.top)}};if(this.config.onDragStart){this.config.onDragStart(this,event);}};this.MouseClickHandler=function(event){if(event.requestedLayerFound===true){var element=this.testPosition({'x':event.requestedLayerX,'y':event.requestedLayerY});if(element!=null){if(element.Link){Goto(Router.link(element.Link));}else{if(this.config.onElementClick){this.config.onElementClick(this,event,element);}}
return;}}
if(this.config.onNoElementClick){this.config.onNoElementClick(this,event);}
return;};this.MouseUpHandler=function(event){this.MouseMoveHandler(event);if(this&&this.config&&this.config.onDragEnd)this.config.onDragEnd(this,event);};this.MouseMoveHandler=function(event){if(this.currentMouseState=='pressed'){var diff={'x':event.clientX-this.startPosition.Mouse.x,'y':event.clientY-this.startPosition.Mouse.y};if(this.config.MapMoveFactor){if(this.config.MapMoveFactor.x)
diff.x*=this.config.MapMoveFactor.x;if(this.config.MapMoveFactor.y)
diff.y*=this.config.MapMoveFactor.y;}
var newPosition=this.setMapPosition({'x':this.startPosition.Map.x+diff.x,'y':this.startPosition.Map.y+diff.y});if(this.config.onDragMove)this.config.onDragMove(this,event,newPosition,diff);}else{if(event.requestedLayerFound===true){var element=this.testPosition({'x':event.requestedLayerX,'y':event.requestedLayerY});if(element!=null){if(element.AreaType&&element.AreaType=='Kidding'&&this.config.TooltipKiddingLayer){$(this.config.TooltipKiddingLayer.id+'Text').update(element.Texts);if(!event){event=window.event;}
this.config.TooltipKiddingLayer.style.left=(Event.pointerX(event))+'px';this.config.TooltipKiddingLayer.style.top=(Event.pointerY(event))+'px';var self=this;this.config.TooltipKiddingLayer.onmouseover=function(){self.config.TooltipKiddingLayer.hide();};this.config.TooltipKiddingLayer.show();}else{if(this.TooltipLayer){var tooltipContent='';if(this.config.onTooltipUpdate){tooltipContent=this.config.onTooltipUpdate(this,element);}else{tooltipContent=gettext(element.Name);}
this.TooltipLayer.update(tooltipContent);this.TooltipLayer.style.top=event.client
this.TooltipLayer.show('block');}}
if(this.config.onElementMouseOver){this.config.onElementMouseOver(this,event,element);}}else{if(this.config.onNoElementMouseOver){this.config.onNoElementMouseOver(this,event,element);}
if(this.TooltipLayer){this.TooltipLayer.hide();}
if(this.config.TooltipKiddingLayer){this.config.TooltipKiddingLayer.hide();}}}else{if(this.config.onOutsideMapMouseMove){this.config.onOutsideMapMouseMove(this,event);}}}};this.testPosition=function(position){for(var areaId in this.config.Elements){var element=this.config.Elements[areaId]
var elementData=element.MapData;elementData.Position.X=parseInt(elementData.Position.X);elementData.Position.Y=parseInt(elementData.Position.Y);elementData.Width=parseInt(elementData.Width);elementData.Height=parseInt(elementData.Height);if((position.x>=elementData.Position.X&&position.x<=(elementData.Position.X+elementData.Width))&&(position.y>=elementData.Position.Y&&position.y<=(elementData.Position.Y+elementData.Height))){return element;}}
return null;};this.getMapElementByArea=function(AreaType,AreaId){for(var key in this.config.Elements){if(this.config.Elements[key].AreaType==AreaType&&this.config.Elements[key].AreaId==AreaId){return this.config.Elements[key];}}
return null;};this.focus=function(AreaType,AreaId){var MapElement=this.getMapElementByArea(AreaType,AreaId);if(MapElement!=null){var position={'x':((parseInt(MapElement.MapData.Position.X)+(parseInt(MapElement.MapData.Width)/2))-(parseInt(this.ViewLayer.style.width)/2))*-1,'y':((parseInt(MapElement.MapData.Position.Y)+(parseInt(MapElement.MapData.Height)/2))-(parseInt(this.ViewLayer.style.height)/2))*-1};this.setMapPosition(position);if(this.config.onFocus)this.config.onFocus(this,MapElement,position);}};this.setMapPosition=function(position,origin){position=this.validateNewMapPosition(position);this.updateTiles(position);this.MapLayer.setStyle({'top':position.y+'px','left':position.x+'px'});if(this.config.onSetMapPosition){this.config.onSetMapPosition(this,position,origin);}
return position;};this.scroll=function(x,y){var currentX=parseInt(this.MapLayer.style.left);var currentY=parseInt(this.MapLayer.style.top);this.setMapPosition({'x':currentX+x,'y':currentY+y},'Scroll');};this.getViewableDimension=function(){return this.MapLayerDimension;};this.getMinStartPosition=function(){if(this.config.MinPosition){return{'x':parseInt(this.config.MinPosition.x),'y':parseInt(this.config.MinPosition.y)};}
return{'x':0,'y':0};};this.validateNewMapPosition=function(position){var MaxPosition=this.config.MinPosition;if(!MaxPosition)MaxPosition={};else MaxPosition={'x':MaxPosition.x*-1,'y':MaxPosition.y*-1};var MinPosition=this.config.MaxPosition;if(!MinPosition)MinPosition={};if(!MinPosition.x)MinPosition.x=(parseInt(this.MapLayer.style.width)-(this.ViewLayer?parseInt(this.ViewLayer.style.width):100))*-1;if(!MinPosition.y)MinPosition.y=(parseInt(this.MapLayer.style.height)-(this.ViewLayer?parseInt(this.ViewLayer.style.height):100))*-1;if(!MaxPosition.x)MaxPosition.x=0;if(!MaxPosition.y)MaxPosition.y=0;if(position.x<MinPosition.x)position.x=MinPosition.x;if(position.y<MinPosition.y)position.y=MinPosition.y
if(position.x>MaxPosition.x)position.x=MaxPosition.x;if(position.y>MaxPosition.y)position.y=MaxPosition.y;return position;};this.updateTiles=function(position){if(this.MapTileContainer&&this.config.MapTiles){var FirstTilePosition={'x':Math.floor(position.x*-1/this.config.MapTiles.Dimension.x),'y':Math.floor(position.y*-1/this.config.MapTiles.Dimension.y)};for(var y=0;y<this.Tiles.MaxTiles.y;y++){for(var x=0;x<this.Tiles.MaxTiles.x;x++){var tileId=(x+FirstTilePosition.x+((y+FirstTilePosition.y)*this.Tiles.MaxTiles.Width));if(tileId>=0&&tileId<this.Tiles.MaxTiles.Complete){if($('__MAP_TILE_'+x+'x'+y).style.backgroundImage!='url('+GameCore.sprintf(this.config.MapTiles.Path.replace(/http:\/\//i,'http://h'+(tileId%4)+'.'),tileId)+')'){$('__MAP_TILE_'+x+'x'+y).style.backgroundImage='url('+GameCore.sprintf(this.config.MapTiles.Path.replace(/http:\/\//i,'http://h'+(tileId%4)+'.'),tileId)+')';}}else{$('__MAP_TILE_'+x+'x'+y).backgroundImage='';}}}
this.MapTileContainer.setStyle({'left':(FirstTilePosition.x*this.config.MapTiles.Dimension.x)+'px','top':(FirstTilePosition.y*this.config.MapTiles.Dimension.y)+'px'});};};}
function Game_MiniMap(config){this.config=config;this.ClickZoneLayer=null;this.MarkerContainerLayer=null;this.Map=null;this.MapLayer=null;this.ViewLayer=null;this.CurrentViewLayer=null;this.CurrentViewBoxDimension={};this.MiniMapFactor={};this.customFactor=null;this.MiniMapViewBoxFactor={'x':0,'y':0};this.Init=function(){this.ClickZoneLayer=$(this.config.ClickZoneLayerId);this.Map=this.config.Map;this.MapLayer=$(this.config.MapLayerId);this.ViewLayer=$(this.config.ViewLayerId);this.CurrentViewLayer=$(this.config.CurrentViewLayerId);this.MarkerContainerLayer=$(this.config.MarkerContainerLayerId);if(!this.ClickZoneLayer.style.width&&this.ClickZoneLayer.className){var style=GameCore.Dom.getStylesheetByStyleClass(this.ClickZoneLayer.className).style;this.ClickZoneLayer.style.width=style.width;this.ClickZoneLayer.style.height=style.height;}
var internalMapDimension=this.Map.getViewableDimension();this.customFactor={'x':1,'y':1};if(this.config.MiniMapSizeFactor)
this.customFactor=this.config.MiniMapSizeFactor;if(this.config.MiniMapViewBoxFactor){this.MiniMapViewBoxFactor=this.config.MiniMapViewBoxFactor;}
this.MiniMapFactor={'x':internalMapDimension.x/(parseInt(this.ClickZoneLayer.style.width))*this.customFactor.x,'y':internalMapDimension.y/(parseInt(this.ClickZoneLayer.style.height))*this.customFactor.y};this.CurrentViewBoxDimension={'x':(parseInt(this.ViewLayer.style.width)/this.MiniMapFactor.x),'y':(parseInt(this.ViewLayer.style.height)/this.MiniMapFactor.y)};this.CurrentViewLayer.setStyle({'width':this.CurrentViewBoxDimension.x+'px','height':this.CurrentViewBoxDimension.y+'px'});this.setMarkers();this.registerEventListeners();};this.registerEventListeners=function(){var self=this;this.ClickZoneLayer.onclick=function(event){return self.MouseClickHandler(GameCore.Dom.parseEvent(event,self.config.ClickZoneLayerId));};};this.setMarkers=function(){var Elements=this.Map.getElements();var sawCity=false;for(var areaId in Elements){try{var Element=Elements[areaId];if(Element.AreaType!='Kidding'&&Element.MapData.Position.X>=this.Map.getMinStartPosition().x&&Element.MapData.Position.Y>=this.Map.getMinStartPosition().y){var Position={'x':((Element.MapData.Position.X-this.Map.getMinStartPosition().x)/this.MiniMapFactor.x)+(Element.MapData.Width/2/this.MiniMapFactor.x),'y':((Element.MapData.Position.Y-this.Map.getMinStartPosition().y)/this.MiniMapFactor.y)+(Element.MapData.Height/2/this.MiniMapFactor.y)};var ClassName='Marker '+Element.AreaType;if((Element.AreaType=='City'&&sawCity===false)||(Element.AreaType!='City')){var newMarkerElem=GameCore.Dom.Builder.node('div',{'id':'__MARKER_'+Element.AreaType+'-'+Element.AreaId,'class':ClassName,'style':'left: '+Position.x+'px; top: '+Position.y+'px;'});if(this.config&&this.config.onAddMarker)
newMarkerElem=this.config.onAddMarker(newMarkerElem,Element);this.MarkerContainerLayer.appendChild(newMarkerElem);if(Element.AreaType=='City')
sawCity=true;}}}catch(e){}}};this.setHighlight=function(elementId){if($('__MARKER_'+elementId)){$('__MARKER_'+elementId).className+=' Highlight';}};this.MouseClickHandler=function(event){if(!this.CurrentViewLayer)this.CurrentViewLayer=$(this.config.CurrentViewLayerId);if(event.requestedLayerX&&event.requestedLayerY){var newPosition={'x':(event.requestedLayerX-(this.CurrentViewBoxDimension.x/2))-this.MiniMapViewBoxFactor.x,'y':(event.requestedLayerY-(this.CurrentViewBoxDimension.y/2))-this.MiniMapViewBoxFactor.y};this.showPosition(newPosition,true);}
return false;};this.validateNewMapPosition=function(position){if(position.x<0)position.x=0;if(position.y<0)position.y=0;if((position.x+parseInt(this.CurrentViewLayer.style.width))>parseInt(this.ClickZoneLayer.style.width))position.x=parseInt(this.ClickZoneLayer.style.width)-parseInt(this.CurrentViewLayer.style.width);if((position.y+parseInt(this.CurrentViewLayer.style.height))>parseInt(this.ClickZoneLayer.style.height))position.y=parseInt(this.ClickZoneLayer.style.height)-parseInt(this.CurrentViewLayer.style.height);return position;};this.showPosition=function(position,updateMap){position=this.validateNewMapPosition(position);this.CurrentViewLayer.setStyle({'left':position.x+'px','top':position.y+'px'});if(updateMap===true&&this.Map){this.Map.setMapPosition({'x':(position.x*this.MiniMapFactor.x*-1)-this.Map.getMinStartPosition().x,'y':(position.y*this.MiniMapFactor.y*-1)-this.Map.getMinStartPosition().y},'MiniMap');}};this.showPositionByMapCoordinates=function(position){position.x=parseInt(position.x);position.y=parseInt(position.y);position.x+=this.Map.getMinStartPosition().x;position.y+=this.Map.getMinStartPosition().y;return this.showPosition({'x':-1*position.x/this.MiniMapFactor.x,'y':-1*position.y/this.MiniMapFactor.y},false);};};
function Game_Messages(config){this.config=config;this.recipientFieldId='recipient';this.Init=function(){document.body.appendChild(GameCore.Dom.Builder.node('input',{'type':'text','id':'__MESSAGES_DUMMY_INPUT_FOCUS_FIELD','style':'position: absolute; top: -50px;'}));};this.MarkAsRead=function(messageId,messageNode){if(messageNode.className&&messageNode.className.match(this.config.StyleClassNew)){messageNode.className=messageNode.className.replace(' '+this.config.StyleClassNew,'');var element=$(this.config.MessageCounterLayerId);var newMessagesCount=Math.max(0,parseInt(element.getAttribute('newmessages'))-1);if(newMessagesCount==0&&$(this.config.MessageCounterBlinkLayerId)){if(typeof this.config.MessageCounterBlinkLayerId=='object'){for(var i=0;i<this.config.MessageCounterBlinkLayerId.length;i++){if($(this.config.MessageCounterBlinkLayerId[i])&&$(this.config.MessageCounterBlinkLayerId[i]).className){$(this.config.MessageCounterBlinkLayerId[i]).className=$(this.config.MessageCounterBlinkLayerId[i]).className.replace(/ Blink/,'');}}}else{$(this.config.MessageCounterBlinkLayerId).className=$(this.config.MessageCounterBlinkLayerId).className.replace(/ Blink/,'');}}
element.update((newMessagesCount>0?'<b>':'')+GameCore.sprintf(ngettext('LABEL_MESSAGES_NEW_COUNTER_SINGULAR','LABEL_MESSAGES_NEW_COUNTER_PLURAL',newMessagesCount),newMessagesCount)+(newMessagesCount>0?'</b>':''));element.setAttribute('newmessages',newMessagesCount);new Ajax.Request(Router.link(GameCore.sprintf(this.config.MarkAsReadUrl,messageId)),{'method':'post','parameters':{'messageId':messageId},'onSuccess':function(transport){if(__handleAjaxResponse(transport)===true){}}});}};this.HideAll=function(){if(this.config.ReadMessageLayerId){$(this.config.ReadMessageLayerId).hide();$(this.config.ReadMessageLayerId+'Buttons').hide();}
if(this.config.NewMessageLayerId){$(this.config.NewMessageLayerId).hide();$(this.config.NewMessageLayerId+'Buttons').hide();}
if(this.config.NewMessageSentLayerId)
$(this.config.NewMessageSentLayerId).hide();if(this.config.DefaultMessageLayerId)
$(this.config.DefaultMessageLayerId).hide();if(this.config.NoMessageLayerId)
$(this.config.NoMessageLayerId).hide();if(this.config.MessageNewFromButtonLayerId)
$(this.config.MessageNewFromButtonLayerId).hide();this.UnsetErrorMarkers();};this.NewMessage=function(recipient,subject,body){document[this.config.NewMessageFormularId].recipient.value=(recipient?recipient.substr(0,30):'');document[this.config.NewMessageFormularId].subject.value=(subject?subject.substr(0,35):'');document[this.config.NewMessageFormularId].body.value=(body?body:'');this.HideAll();$(this.config.NewMessageLayerId).show();$(this.config.NewMessageLayerId+'Buttons').show();if(body){document[this.config.NewMessageFormularId].body.focus();document[this.config.NewMessageFormularId].body.setSelectionRange(0,0);}else{if(!recipient)
document[this.config.NewMessageFormularId].recipient.focus();else
document[this.config.NewMessageFormularId].subject.focus();}};this.toggleMessageTypes=function(){$('asGuildMsgBtn').toggle();$('asUserMsgBtn').toggle();$(document[this.config.NewMessageFormularId].recipient.id).toggle();$(document[this.config.NewMessageFormularId].recipientGuild.id).toggle();if(this.recipientFieldId=='recipient'){this.recipientFieldId='recipientGuild';}else{this.recipientFieldId='recipient'}}
this.UnsetErrorMarkers=function(){for(var fieldId in['body',this.recipientFieldId,'subject']){if(document[this.config.NewMessageFormularId][fieldId].className)
document[this.config.NewMessageFormularId][fieldId].className=document[this.config.NewMessageFormularId][fieldId].className.replace(/ error/,'');}};this.getSelectedRecipientValue=function(parent,field){if(this.recipientFieldId=='recipient'){if(field=='user')return parent.recipient.value;return null;}
if(field=='guild')return parent.recipientGuild.value;return null;}
this.SendMessage=function(formular){var self=this;var params={'data':{'recipient':this.getSelectedRecipientValue(formular,'user'),'recipientGuild':this.getSelectedRecipientValue(formular,'guild'),'text':formular.body.value,'subject':formular.subject.value}};new Ajax.Request(Router.link(this.config.MessageSendUrl),{'method':'post','parameters':{'data[recipient]':this.getSelectedRecipientValue(formular,'user'),'data[recipientGuild]':this.getSelectedRecipientValue(formular,'guild'),'data[text]':formular.body.value,'data[subject]':formular.subject.value},'onSuccess':function(transport){if(__handleAjaxResponse(transport)===true){var response=transport.responseJSON;if(response.status=='ok'){self.HideAll();$(self.config.NewMessageSentLayerId).show();self.UnsetErrorMarkers();}else{var errorMessages='<ul>';self.UnsetErrorMarkers();for(var errorFieldId in response.error){errorMessages+='<li>'+response.error[errorFieldId]+'</li>';switch(errorFieldId){case'text':formular.body.className+=' error';break;default:if(formular[errorFieldId])
formular[errorFieldId].className+=' error';}}
errorMessages+='</ul>';GameCore.UI.ModalDialog({'Title':gettext('DIALOG_MESSAGE_SENT_FAILED_TITLE'),'Message':GameCore.sprintf(gettext('DIALOG_MESSAGE_SENT_FAILED_MESSAGE'),errorMessages).replace(/\\n/g,'<br />')});}}}});};this.Ignore=function(userId,name){new Ajax.Request(Router.link(this.config.UserSocialPathAdd.replace(/%USER_ID%/,userId)),{'method':'get','onSuccess':function(transport){if(__handleAjaxResponse(transport)===true){var response=transport.responseJSON;if(response.status=='ok'){GameCore.UI.ModalDialog({'Title':gettext('DIALOG_MESSAGE_IGNORE_LIST_USER_TITLE'),'Message':GameCore.sprintf(gettext('DIALOG_MESSAGE_IGNORE_LIST_USER_ADDED_MESSAGE'),name).replace(/\\n/g,'<br />')});}else{GameCore.UI.ModalDialog({'Title':gettext('DIALOG_MESSAGE_IGNORE_LIST_USER_TITLE'),'Message':GameCore.sprintf(gettext(response.statusMessage),name).replace(/\\n/g,'<br />')});}}}});};this.Open=function(messageId,messageType,date,subject,body,sender){var self=this;var partnerContent='';this.HideAll();$(this.config.ReadMessageLayerId+'Buttons').show();if(messageType=='user'){partnerContent='<a href="'+Router.link(this.config.UserProfileByNamePath.replace(/%CHARACTER_NAME%/,sender.Name))+'">'+sender.Name+'</a><a class="submitButton" style="top:25px; left:285px; position:absolute;" href="'+this.config.IgnoreButtonAction.replace(/%USER_ID%/,sender.Id).replace(/%USERNAME%/,sender.Name)+'">'+gettext("IGNORE_LIST_ADD")+'</a>';if(sender.isRecipient!==true){$(this.config.MessageReplyToButtonLayerId).show();$(this.config.MessageReplyToButtonLayerId).onclick=function(){var replyBody=GameCore.sprintf(self.config.ReplyToPrefixes.BodyStart,date,sender.Name)+"\n> ";replyBody+=body.replace(/<br \/>\n/g,"\n> ");self.NewMessage(sender.Name,(subject.match(self.config.ReplyToPrefixes.Subject)?subject:self.config.ReplyToPrefixes.Subject+' '+subject),"\n\n"+replyBody);};}else{$(this.config.MessageReplyToButtonLayerId).hide();}
if(this.config.MessageNewFromButtonLayerId){$(this.config.MessageNewFromButtonLayerId).onclick=function(){var replyBody=GameCore.sprintf(self.config.ReplyToPrefixes.BodyStart,date,sender.Name)+"\n> ";replyBody+=body.replace(/<br \/>\n/g,"\n> ");self.NewMessage('',(subject.match(self.config.ForwardToPrefix)?subject:self.config.ForwardToPrefix+' '+subject),"\n\n"+replyBody);};$(this.config.MessageNewFromButtonLayerId).show();}
$(this.config.UserSignatureLayerId).update('<a href="'+Router.link(this.config.UserProfileByNamePath.replace(/%CHARACTER_NAME%/,sender.Name))+'"><img src="'+Router.link(this.config.UserSignaturePath.replace(/%USER_ID%/,sender.Id))+'"/></a>');subject=GameCore.htmlentities(subject);}else{partnerContent=sender.Name;$(this.config.MessageReplyToButtonLayerId).hide();$(this.config.UserSignatureLayerId).update('');}
$(this.config.ReadMessageLayerId).show();$(this.config.DateLayerId).update(date);$(this.config.SubjectLayerId).update(subject);$(this.config.PartnerLayerId).update(partnerContent);$(this.config.BodyLayerId).update((messageType=='user'?GameCore.htmlentities(body.replace(/<br \/>/g,'')).replace(/\n/g,'<br />'):body));$(this.config.MessageDeleteButtonLayerId).setAttribute('href',GameCore.sprintf(Router.link(this.config.MessageDeleteUrl),messageId));$('__MESSAGES_DUMMY_INPUT_FOCUS_FIELD').select();};this.SocialAction=function(userId,name,id){new Ajax.Request(Router.link(this.config.UserSocialPathSocialAction.replace(/%USER_ID%/,userId)),{'method':'get','onSuccess':function(transport){if(__handleAjaxResponse(transport)===true){var response=transport.responseJSON;if(id!==undefined){$(id).toggle();}}}});};this.Friend=function(userId,name,id){new Ajax.Request(Router.link(this.config.UserSocialPathFriend.replace(/%USER_ID%/,userId)),{'method':'get','onSuccess':function(transport){if(__handleAjaxResponse(transport)===true){var response=transport.responseJSON;if(id!==undefined){$(id).toggle();}}}});};this.Init();};
function Game_Alliance_Members(config){this.config=config;this.lastSelectedRow=null;};Game_Alliance_Members.prototype=new Game_Ranking;
function Alliance_Chat(config){this.config=config;this.callActive=false;this.lastMessage=null;this.Start=function(){this.startRefreshing();};this.startRefreshing=function(){var self=this;window.setTimeout(function(){if(self.callActive===false){self.callActive=true;new Ajax.Request(self.config.RefreshPath,{'method':'post','parameters':{'LastMessageTimestamp':self.lastMessage},'onSuccess':function(transport){if(__handleAjaxResponse(transport,true)===true){if(transport.responseText){$(self.config.MessageContainer).innerHTML=transport.responseText;self.UpdateTooltips();}}
self.lastMessage=transport.headers['X-LASTMESSAGETIMESTAMP'];self.startRefreshing();self.callActive=false;}});}else{self.startRefreshing();}},Math.max(1,this.config.RefreshInterval)*1000);};this.Write=function(form){var self=this;var message=GameCore.trim(form.message.value);if($(this.config.ChatMessageSubmitButton).visible()===true&&message.length>3){form.message.value='';this.callActive=true;$(this.config.ChatMessageSubmitButton).hide();new Ajax.Request(this.config.WritePath,{'method':'post','parameters':{'message':message},'onSuccess':function(transport){if(__handleAjaxResponse(transport,true)===true){$(self.config.MessageContainer).innerHTML=transport.responseText;$(self.config.ChatMessageSubmitButton).show();self.UpdateTooltips();}
self.lastMessage=transport.headers['X-LASTMESSAGETIMESTAMP'];self.callActive=false;}});}
return false;};this.UpdateTooltips=function(){var containerElements=$(this.config.MessageContainer).childNodes;if(containerElements.length>0){for(var i=0;i<containerElements.length;i++){if(containerElements[i]&&containerElements[i].getAttribute&&containerElements[i].getAttribute('alt')){containerElements[i].onmousemove=function(event){if(!event)event=window.event;if(event.currentTarget){Tooltip.Show(event,'text',event.currentTarget.getAttribute('alt'));}else if(this.getAttribute('alt')){Tooltip.Show(event,'text',this.getAttribute('alt'));}};containerElements[i].onmouseout=function(element){Tooltip.Hide();};}}}};};
function Game_Alliance_Quest(config){this.config=config;this.lastNpcName=null;this.getUserLink=function(characterId){return Router.link(this.config.AttackLink.replace(/%CHARACTER_ID%/,characterId));};this.ShowMonsterDetail=function(row,npcName,data){if(npcName!=this.lastNpcName){this.SelectRow(row);this.config.QuestDetailLayer.hide();var html='';html+=this.config.GlobalInformationText;html+='<p class="MonsterDetailTitle">'+GameCore.sprintf(gettext('ALLIANCE_QUEST_WINS_FOR_SELECTED_OPPONENT'),npcName)+'</p>';html+='<table class="MonsterDetail DetailTable">';html+=' <tr class="headline">';html+='  <th>'+gettext('LABEL_USERNAME_FRIENDLY')+'</th>';html+='  <th>'+gettext('LABEL_WINS')+'</th>';html+='  <th>'+gettext('LABEL_CURRENT_GOLD_REWARD')+'</th>';html+=' </tr>';if(data){var last='second';for(var id in data){var record=data[id];last=(last=='second'?'first':'second');html+=' <tr class="Entry '+last+'" onclick="Goto('+this.config.ObjectVarName+'.getUserLink('+record.characterId+'));">';html+='  <td><span class="HrefLink">'+record.username+'</span></td>';html+='  <td class="Number">'+GameCore.NumberFormat(record.count,0)+'</td>';html+='  <td class="Number"><span class="goldIcon_sprite_inline">'+GameCore.NumberFormat(record.sum,0)+'</span></td>';html+=' </tr>';}}else{html+=' <tr>';html+='  <td align="center" colspan="3">'+GameCore.sprintf(gettext('LABEL_GUILD_QUEST_NO_DATA'),npcName)+'</td>';html+=' </tr>';}
html+='</table><br/><br/>';this.config.MonsterDetailLayer.innerHTML=html;this.config.MonsterDetailLayer.show();this.lastNpcName=npcName;}else{this.UnselectRow(row);this.lastNpcName=null;this.config.MonsterDetailLayer.hide();this.config.QuestDetailLayer.show();}};};Game_Alliance_Quest.prototype=new Game_Ranking;
function Game_Slider(config){this.config=config;this.ScrollTimer=null;this.ScrollStartTimer=null;this.config['Container']['Width']=parseInt(config.Container.Width);this.Layer=$(this.config.Container.LayerId);this.Start=function(){var self=this;this.ScrollStartTimer=window.setInterval(function(){self.Scroll();},this.config.MoveStartInterval);};this.Stop=function(){window.clearInterval(this.ScrollStartTimer);};this.StopScrollTimer=function(){window.clearInterval(this.ScrollTimer);};this.ScrollTo=function(position){this.StopScrollTimer();this.Stop();this.Layer.style.left=(position*this.config.Container.Width*-1)+'px';};this.Scroll=function(){var self=this;var startPosition=parseInt($(this.config.Container.LayerId).style.left);var nextPosition=startPosition-this.config.Container.Width;this.ScrollTimer=window.setInterval(function(){var currentLeft=parseInt(self.Layer.style.left);var newLeft=0;newLeft=currentLeft-10;if(newLeft>=nextPosition){self.Layer.style.left=newLeft+'px';}else{self.StopScrollTimer();if(newLeft*-1>=parseInt(self.Layer.style.width)-self.config.Container.Width){self.Layer.style.left='0px';}}},40);};};
function Game_Social(config){this.config=config;this.Ignore=function(userId,name,id){new Ajax.Request(Router.link(this.config.UserSocialPathIgnore.replace(/%USER_ID%/,userId)),{'method':'get','onSuccess':function(transport){if(__handleAjaxResponse(transport)===true){var response=transport.responseJSON;if(id!==undefined){$(id).toggle();}}}});};this.Friend=function(userId,name,id,layout){new Ajax.Request(Router.link(this.config.UserSocialPathFriend.replace(/%USER_ID%/,userId)),{'method':'get','onSuccess':function(transport){if(__handleAjaxResponse(transport)===true){var response=transport.responseJSON;var content='';if(id!==undefined){if(response.nobutton!==undefined)content=response.nobutton;if(response.button!==undefined)content=response.button;if(response.nextAction!==undefined)content=response.nextAction;if(layout){content='<div  class='+layout+'>'+content+'</div>';}
$($(id).parentNode).update(content);}}}});};this.SocialAction=function(userId,name,id,layout){new Ajax.Request(Router.link(this.config.UserSocialPathSocialAction.replace(/%USER_ID%/,userId)),{'method':'get','onSuccess':function(transport){if(__handleAjaxResponse(transport)===true){var response=transport.responseJSON;if(id!==undefined){if(response.nextAction!=undefined){if(layout===true){response.nextAction='<div class="fullWidth)">'+GameCore.sprintf(gettext('SOCIAL_NEXT_ACTION'),response.nextAction,name)+'</div>';}
$($(id).parentNode).update(response.nextAction);}
else $(id).toggle();}}}});};}
Game_Social.prototype=new Game_Alliance_Members;
if(!GameCore.Utilities){GameCore.Utilities={};}
if(!GameCore.Utilities.DragAndDrop){GameCore.Utilities.DragAndDrop={};}
var itemMap={};(function(){YAHOO.DraggableItems={};YAHOO.DraggableItems.DDPlayer=function(id,sGroup,config){YAHOO.DraggableItems.DDPlayer.superclass.constructor.apply(this,arguments);this.initPlayer(id,sGroup,config);if(!this.getEl().parentNode.id){this.getEl().currentContainer=this.getEl().parentNode.parentNode.id;}else{this.getEl().currentContainer=this.getEl().parentNode.id;}};YAHOO.extend(YAHOO.DraggableItems.DDPlayer,YAHOO.util.DDProxy,{TYPE:"DDPlayer",initPlayer:function(id,sGroup,config){if(!id){return;}
var el=this.getDragEl();YAHOO.util.Dom.setStyle(el,"border","none");YAHOO.util.Dom.setStyle(el,"opacity",0.75);this.isTarget=false;this.originalStyles=[];this.type=YAHOO.DraggableItems.DDPlayer.TYPE;this.slot=null;this.startPos=YAHOO.util.Dom.getXY(this.getEl());this.initConstraints();},initConstraints:function(){if(GameCore.Config&&GameCore.Config.get('DragAndDrop').ZoneId){var region=YAHOO.util.Dom.getRegion(GameCore.Config.get('DragAndDrop').ZoneId);var el=this.getEl();var elPosition=YAHOO.util.Dom.getXY(el);var width=parseInt(YAHOO.util.Dom.getStyle(el,'width'),10);var height=parseInt(YAHOO.util.Dom.getStyle(el,'height'),10);var left=elPosition[0]-region.left;var right=region.right-elPosition[0]-width;var top=elPosition[1]-region.top;var bottom=region.bottom-elPosition[1]-height;this.setXConstraint(left,right);this.setYConstraint(top,bottom);}},startDrag:function(x,y){this.validDrop=false;var dragEl=this.getDragEl();var clickEl=this.getEl();dragEl.innerHTML=clickEl.innerHTML;dragEl.className=clickEl.className;if(GameCore.Config&&GameCore.Config.get('DragAndDrop').StartDragHook){GameCore.Config.get('DragAndDrop').StartDragHook(this,dragEl,clickEl);}},getTargetDomRef:function(oDD){if(oDD.player){return oDD.player.getEl();}else{return oDD.getEl();}},endDrag:function(e){if(GameCore.Config&&GameCore.Config.get('DragAndDrop').EndDragHook){GameCore.Config.get('DragAndDrop').EndDragHook(this,e);}
if(this.validDrop===false){this.onInvalidDrop();}
this.resetTargets();},resetTargets:function(){var targets=YAHOO.util.DDM.getRelated(this,true);for(var key in targets){if(targets[key]&&$(targets[key].id)){$(targets[key].id).setStyle({'border':'none'});}}},refreshItemMap:function(){},fillPositionArray:function(array,value,position,width,height,dimension){for(var y=0;y<height;y++){for(var x=0;x<width;x++){array[(y*dimension.width)+x+position]=value;}}
return array;},checkPosition:function(e,id){var data={'check':false};if("string"==typeof id){data.oDD=YAHOO.util.DDM.getDDById(id);}else{data.oDD=YAHOO.util.DDM.getBestMatch(id);}
data.el=this.getEl();if(data.oDD.config.multi===true){data.type='multiple';if(!ItemUtilities.Items[data.oDD.config.mapId]||!ItemUtilities.Items[data.oDD.config.mapId].grid||!ItemUtilities.Items[data.oDD.config.mapId].byItem){ItemUtilities.Items[data.oDD.config.mapId]={'grid':{},'byItem':{}};}
data.region=YAHOO.util.Dom.getRegion(data.oDD.id);data.elementDimension={'width':Math.floor(parseInt(data.region.width)/data.oDD.config.containerDimension.width),'height':Math.floor(parseInt(data.region.height)/data.oDD.config.containerDimension.height)};data.relativePosition={'top':parseInt($(this.getDragEl().id).style.top)-parseInt(data.region.top),'left':parseInt($(this.getDragEl().id).style.left)-parseInt(data.region.left)};data.containerPosition={'top':Math.round(data.relativePosition.top/data.elementDimension.height),'left':Math.round(data.relativePosition.left/data.elementDimension.width)};data.itemDimension={'width':Math.round(parseInt($(data.el.id).getStyle('width'))/data.elementDimension.width),'height':Math.round(parseInt($(data.el.id).getStyle('height'))/data.elementDimension.height)};if(data.containerPosition.top<0){data.containerPosition.top=0;}
if(data.containerPosition.left<0){data.containerPosition.left=0;}
if(data.containerPosition.left>(data.oDD.config.containerDimension.width-data.itemDimension.width)){data.containerPosition.left=data.oDD.config.containerDimension.width-data.itemDimension.width;};if(data.containerPosition.top>(data.oDD.config.containerDimension.height-data.itemDimension.height)){data.containerPosition.top=data.oDD.config.containerDimension.height-data.itemDimension.height;}
data.itemContainerPosition=data.containerPosition.left+(data.containerPosition.top*data.oDD.config.containerDimension.width)+1;var ignoreIntersectValues={};ignoreIntersectValues[data.el.id]=true;if(GameCore.arrayIntersectKey(ItemUtilities.Items[data.oDD.config.mapId].grid,this.fillPositionArray({},data.el.id,data.itemContainerPosition,data.itemDimension.width,data.itemDimension.height,data.oDD.config.containerDimension),ignoreIntersectValues).length==0){data.check=true;}}else{if(data.oDD.config.type=='dummy'){data.check=false;}else{data.type='single';if(!ItemUtilities.Items||!ItemUtilities.Items[data.oDD.config.mapId]||(typeof data.oDD.config.position=='undefined'&&!ItemUtilities.Items[data.oDD.config.mapId].grid[0])||(typeof data.oDD.config.position!='undefined'&&!ItemUtilities.Items[data.oDD.config.mapId].grid[data.oDD.config.position])||(typeof data.oDD.config.position!='undefined'&&ItemUtilities.Items[data.oDD.config.mapId].grid[data.oDD.config.position]==data.el.id)){data.itemContainerPosition=(typeof data.oDD.config.position!='undefined'?data.oDD.config.position:0);data.check=true;}}
return data;}
return data;},onDragEnter:function(e,id){},onDragDrop:function(e,id){var data=this.checkPosition(e,id);if(data.check===true){data.currentEvent=e;var oldContainerElement=YAHOO.util.DDM.getDDById(data.el.currentContainer);if(data.oDD.config.additionalCheck&&data.oDD.config.additionalCheck(data.oDD,oldContainerElement,data.el)===true){this.validDrop=true;var mapItem=null;if(data.type=='multiple'){var oldContainer=data.el.currentContainer;data.el.currentContainer=id;var myElement=$(data.el.id).remove();$(id).appendChild(myElement);YAHOO.util.DDM.moveToEl(myElement,data.oDD.id)
$(myElement).setStyle({'position':'absolute','left':String(data.containerPosition.left*data.elementDimension.width)+'px','top':String(data.containerPosition.top*data.elementDimension.height)+'px'});if(data.oDD.config.manipulateItemMap!==false){if(oldContainer&&ItemUtilities.Items[oldContainerElement.config.mapId]){mapItem=ItemUtilities.Items[oldContainerElement.config.mapId].byItem[data.el.id];ItemUtilities.Items[oldContainerElement.config.mapId].grid=GameCore.unsetArrayElementsByValue(ItemUtilities.Items[oldContainerElement.config.mapId].grid,data.el.id);ItemUtilities.Items[oldContainerElement.config.mapId].byItem=GameCore.unsetArrayElementsByKey(ItemUtilities.Items[oldContainerElement.config.mapId].byItem,data.el.id);}
ItemUtilities.Items[data.oDD.config.mapId].grid=this.fillPositionArray(ItemUtilities.Items[data.oDD.config.mapId].grid,data.el.id,data.itemContainerPosition,data.itemDimension.width,data.itemDimension.height,data.oDD.config.containerDimension);if(mapItem!=null){ItemUtilities.Items[data.oDD.config.mapId].byItem[data.el.id]=mapItem;}
if(!ItemUtilities.Items[data.oDD.config.mapId].byItem[data.el.id])ItemUtilities.Items[data.oDD.config.mapId].byItem[data.el.id]=ItemUtilities.getItemDataByLayerId(data.el.id);ItemUtilities.Items[data.oDD.config.mapId].byItem[data.el.id].position=data.itemContainerPosition;}}else{if(data.oDD.config.manipulateItemMap!==false){var oldContainer=data.el.currentContainer;if(oldContainer&&ItemUtilities.Items[oldContainerElement.config.mapId]){mapItem=ItemUtilities.Items[oldContainerElement.config.mapId].byItem[data.el.id];ItemUtilities.Items[oldContainerElement.config.mapId].grid=GameCore.unsetArrayElementsByValue(ItemUtilities.Items[oldContainerElement.config.mapId].grid,data.el.id);ItemUtilities.Items[oldContainerElement.config.mapId].byItem=GameCore.unsetArrayElementsByKey(ItemUtilities.Items[oldContainerElement.config.mapId].byItem,data.el.id);}
data.el.currentContainer=id;var currentContainer=YAHOO.util.DDM.getDDById(data.el.currentContainer);if(!ItemUtilities.Items[currentContainer.config.mapId]){ItemUtilities.Items[currentContainer.config.mapId]={'grid':{},'byItem':{}};}
ItemUtilities.Items[currentContainer.config.mapId].grid[(data.itemContainerPosition?data.itemContainerPosition:0)]=data.el.id;if(mapItem!=null){ItemUtilities.Items[currentContainer.config.mapId].byItem[data.el.id]=mapItem;}
if(!ItemUtilities.Items[currentContainer.config.mapId].byItem[data.el.id])ItemUtilities.Items[currentContainer.config.mapId].byItem[data.el.id]=ItemUtilities.getItemDataByLayerId(data.el.id);ItemUtilities.Items[currentContainer.config.mapId].byItem[data.el.id].position=data.itemContainerPosition;}
var myElement=$(data.el.id).remove();$(id).appendChild(myElement);if(data.oDD.config.ElementOffset){$(myElement).setStyle({'left':String(data.oDD.config.ElementOffset.left)+'px','top':String(data.oDD.config.ElementOffset.top)+'px'});}else{$(myElement).setStyle({'left':'0px','top':'0px'});}}
if(data.el.onDragDropHook){data.el.onDragDropHook(data.el);}
if(oldContainerElement&&oldContainerElement.config&&oldContainerElement.config.onValidDropFrom){oldContainerElement.config.onValidDropFrom(oldContainerElement,data.oDD,data,e);}
if(data.oDD.config.onValidDrop){data.oDD.config.onValidDrop(oldContainerElement,data.oDD,data,e);}}}
this.slot=data.oDD;this.slot.player=this;this.resetTargets();},swap:function(el1,el2){},onInvalidDrop:function(e){var oDD=YAHOO.util.DDM.getDDById(this.getEl().parentNode.id);if(oDD&&oDD.config.onInvalidDrop){oDD.config.onInvalidDrop(e,oDD);}},onDragOver:function(e,id){try{var oDD=YAHOO.util.DDM.getDDById(id);if(oDD.config.onMouseOverHook){oDD.config.onMouseOverHook(e,oDD);}}catch(e){}},onDrag:function(e){}});})();
var Game_Bag={'onValidDropFrom':function(fromContainer,toContainer,data){if(fromContainer.config.dropCallUrl&&toContainer.config.handleFromContainerHook!==false){new Ajax.Request(fromContainer.config.dropCallUrl,{'method':'post','parameters':ItemUtilities.getAjaxParameters(fromContainer,toContainer,data),'onSuccess':function(transport){if(__handleAjaxResponse(transport)===true){if(transport.responseJSON.status!='ok'){alert('javascript::Game::Bag error: response was '+transport.responseJSON.status);top.location.href=Router.link(Router.currentPath,{});}}}});}}};
var Game_Shop={'onValidDropFrom':function(fromContainer,toContainer,data,event){if(fromContainer.config.dropCallUrl){var item=ItemUtilities.getItemDataByLayerId(data.el.id);var FreeItemCounter=GameCore.Config.get('SHOP_FREE_ITEMS_BY_TYPE_'+item.type);if(toContainer.config.type!='shop'&&FreeItemCounter>0){var itemPrice='<span class="goldIcon_sprite_inline">'+GameCore.NumberFormat(item.price_gold)+'</span>';if(item.price_premium>0){itemPrice+='&nbsp;<span class="premiumIcon_sprite_innerText">'+item.price_premium+'</span>';}
GameCore.Config.set('SHOP_ORIGINAL_DROP_FROM',{'fromContainer':fromContainer,'toContainer':toContainer,'data':data,'event':event});GameCore.UI.ModalDialog({'Title':gettext('TITLE_FREE_ITEM'),'Message':GameCore.sprintf(ngettext('DIALOG_MESSAGE_FREE_ITEM_SINGULAR','DIALOG_MESSAGE_FREE_ITEM_PLURAL',FreeItemCounter),'<div class="Item_'+item.item+'" style="position: relative; float: left;"></div>',itemPrice,'<a href="'+GameCore.Config.get('BOARD_ANNOUNCEMENT_PATH')+'" target="_blank">'+gettext('LABEL_BOARD')+'</a>',FreeItemCounter)+'<br/><br/>','Buttons':[{'Type':'Close','Label':gettext('LABEL_ABORT')},{'Type':'Default','Click':function(DialogTypeConfig,DialogConfig){var DropData=GameCore.Config.get('SHOP_ORIGINAL_DROP_FROM');Game_Shop.commitItemBuy(item,DropData.fromContainer,DropData.toContainer,DropData.data,DropData.event,function(){DialogTypeConfig.ContainerLayer.hide();},true);},'Label':gettext('LABEL_BUY_FREE_ITEM')}],'onClose':function(DialogConfig){Game_Shop.rollbackItemBuy();}});}else{Game_Shop.commitItemBuy(item,fromContainer,toContainer,data,event,null,false);}}},'commitItemBuy':function(item,fromContainer,toContainer,data,event,onSuccess,fromFreeModalDialog){if(toContainer.config.type!='shop'){if(!fromFreeModalDialog){if(item.price_premium>0)
Character.decreasePremium(item.price_premium);if(item.price_gold>0)
Character.decreaseGold(item.price_gold);}}
if(fromContainer.config.LoadingContainerLayer&&$(fromContainer.config.LoadingContainerLayer)){$(fromContainer.config.LoadingContainerLayer).show();}
new Ajax.Request(fromContainer.config.dropCallUrl,{'method':'post','parameters':ItemUtilities.getAjaxParameters(fromContainer,toContainer,data),'onSuccess':function(transport){if(__handleAjaxResponse(transport)===true){if(transport.responseJSON.status!='ok'){alert('javascript::Game::Shop error: response was '+transport.responseJSON.status);top.location.href=Router.link(Router.currentPath,{});}else{if(transport.responseJSON.oldShopItemId>0&&transport.responseJSON.oldItemId!=transport.responseJSON.newItemId){var toContainerElement=YAHOO.util.DDM.getDDById(transport.responseJSON.toContainer);ItemUtilities.changeItemId(data.el.id,transport.responseJSON.newItemId,toContainerElement.config.mapId);}}
if(onSuccess){onSuccess(fromContainer,toContainer,data,event,fromFreeModalDialog);}
if(fromContainer.config.LoadingContainerLayer&&$(fromContainer.config.LoadingContainerLayer)){$(fromContainer.config.LoadingContainerLayer).hide();}}}});if(fromContainer.config.type!=toContainer.config.type){if(!fromFreeModalDialog){if(fromContainer.config.type!=toContainer.config.type){Game_Shop.sellAndBuyVisualEffect('buy',item,data);}}else{GameCore.Config.set('SHOP_ORIGINAL_DROP_FROM',null);GameCore.Config.set('SHOP_FREE_ITEMS_BY_TYPE_'+item.type,GameCore.Config.get('SHOP_FREE_ITEMS_BY_TYPE_'+item.type)-1);}
item.price_gold=item.price_gold_sell;item.price_premium=item.price_premium_sell;ItemUtilities.updateItemDataByLayerId(data.el.id,item);}},'rollbackItemBuy':function(DialogConfig,HideHook){Goto(Router.link(Router.currentPath));return false;},'onValidDrop':function(fromContainer,toContainer,data,event){if(toContainer.config.type=='shop'&&fromContainer.config.type!='shop'){var item=ItemUtilities.getItemDataByLayerId(data.el.id);var goldSellPrice=item.price_gold;Character.increaseGold(goldSellPrice);Game_Shop.sellAndBuyVisualEffect('sell',item,data);item.price_gold=goldSellPrice*2;item.price_gold_sell=goldSellPrice;ItemUtilities.updateItemDataByLayerId(data.el.id,item);}},'additionalFromCheck':function(targetContainer,fromContainer,itemElement){if(targetContainer.config.type!='shop'){var item=ItemUtilities.getItemDataByLayerId(itemElement.id);if(GameCore.Config.get('SHOP_FREE_ITEMS_BY_TYPE_'+item.type)>0)return true;if(item.price_gold>Character.getGold()){GameCore.UI.ModalDialog({'Title':gettext('TITLE_NOT_ENOUGH_GOLD'),'Message':gettext('DIALOG_MESSAGE_NOT_ENOUGH_GOLD_BUY_ITEM').replace(/\\n/g,'<br/>'),'Buttons':[]});return false;}
if(item.price_premium>Character.getPremium()){GameCore.UI.ModalDialog({'Type':'CUSTOM1','Title':gettext('TITLE_NOT_ENOUGH_PREMIUM_CREDITS'),'Message':gettext('DIALOG_MESSAGE_NOT_ENOUGH_PREMIUM_CREDITS_BUY_ITEM').replace(/\\n/g,'<br/>'),'Buttons':[{'Type':'Close'},{'Type':'Premium','Link':GameCore.Config.get('PREMIUM_PATH'),'Label':gettext('LABEL_GOTO_PALACE')}]});return false;}
return true;}
return true;},'sellAndBuyVisualEffect':function(type,item,data){var pos={'top':data.currentEvent.clientY-15,'left':data.currentEvent.clientX};var value='-'+item.price_gold;ItemUtilities.visualItemEffect('shopBoughtEffectLayer',pos,{'id':data.el.id,'Value':value});}};
function GameCore_Utilities_Countdown(config,overrideLayerCheck){this.config=config;if(typeof this.config!='object'){throw'config is not an object';}else if(!overrideLayerCheck&&((typeof this.config.Layer!='object'&&!this.config.LayerId)||(this.config.LayerId&&!$(this.config.LayerId)))){throw'config.Layer or config.LayerId not set or layer doesn\'t exist';}else if((!this.config.Countdown)&&(!this.config.CountdownTo||!this.config.CurrentTime)){throw'config.Countdown ('+this.config.Countdown+') not set or config.CountdownTo ('+this.config.CountdownTo+') and config.CurrentTime ('+this.config.CurrentTime+') not set';}
this.TidySecondsPostFilterHook=this.config.TidySecondsPostFilter;this.CountdownLayerUpdateHook=this.config.CountdownLayerUpdateFilter;this.CountdownReachedHook=this.config.CountdownReached;if(this.config.Countdown>=0){this.Countdown=this.config.Countdown;}else if(this.config.CountdownTo&&this.config.CurrentTime){this.Countdown=this.config.CountdownTo-this.config.CurrentTime;}
this.start=function(){if(this.config.LayerId){this.Layer=$(this.config.LayerId);}else if(this.config.Layer){this.Layer=this.config.Layer;}
if(this.Countdown>=0){this.Countdown++;this.update();}};this.stop=function(){this.Countdown=-2;};this.update=function(){var self=this;this.Countdown--;if(this.Countdown>=0){var text=this.getTidySeconds(this.Countdown);if(!this.CountdownLayerUpdateHook){this.Layer.update(text);}else{this.CountdownLayerUpdateHook(this.Layer,text);}
window.setTimeout(function(){self.update();},1000);}else{if(this.Countdown==-1){if(!this.CountdownReachedHook){this.Layer.update('');}else{this.CountdownReachedHook(this.Layer);}}}};this.getTidySeconds=function(value){var days=Math.floor((value/86400));var hours=Math.floor((value/3600)%24);var minutes=Math.floor((value/60)%60);var seconds=Math.floor(value%60);if(days<=9&&days>=0)days='0'+days;if(hours<=9&&hours>=0)hours='0'+hours;if(minutes<=9&&minutes>=0)minutes='0'+minutes;if(seconds<=9&&seconds>=0)seconds='0'+seconds;if(!this.TidySecondsPostFilterHook){return(hours!='00'?hours+':':'')+minutes+':'+seconds;}else{return this.TidySecondsPostFilterHook(days,hours,minutes,seconds);}};}
function Game_Inventory(config){this.config=config;this.createDroppable=function(layerId,droppableType,config){this.createInventorySlotDroppable(layerId,droppableType,config);};this.createInventoryItemDroppables=function(config){if(!this.config.CraftingCallUrl){this.config.CraftingCallUrl=config.dropCallUrl;}
if(ItemUtilities){for(var slotId in ItemUtilities.Items){if(!slotId.match(/Shop|Reward/)){try{var self=this;for(var itemLayerId in ItemUtilities.Items[slotId].byItem){var droppable=new YAHOO.util.DDTarget(itemLayerId,'Items',{'mapId':'CRAFTING-woQ!','position':itemLayerId,'onlyRemoveItemFromItemMap':true,'onValidDrop':function(fromContainer,targetContainer,data){var item=ItemUtilities.getItemDataByLayerId(data.el.id);var targetItem=ItemUtilities.getItemDataByLayerId(targetContainer.id);data.el.remove();self.itemInventoryChangeVisualEffect('apply',item,data);if(targetItem.craftingItem.item>0){targetItem=ItemUtilities.decreaseItemAttributesByItem(targetItem,targetItem.craftingItem);}
targetItem=ItemUtilities.increaseItemAttributesByItem(targetItem,item);ItemUtilities.updateItemDataByLayerId(data.el.id,targetItem);Character.updateAttributesByItem();ItemUtilities.clearContainer('CRAFTING-woQ!');},'dropCallUrl':this.config.CraftingCallUrl,'additionalCheck':function(targetElement,fromElement,element){if(fromElement&&fromElement.config&&fromElement.config.additionalFromCheck&&fromElement.config.additionalFromCheck(targetElement,fromElement,element)!==true){return false;}
var item=ItemUtilities.getItemDataByLayerId(element.id);var targetItem=ItemUtilities.getItemDataByLayerId(targetElement.id);if(GameCore.ArraySearch(targetItem.type,ItemUtilities.ItemValidCraftingTargetTypes)!==false){return true;}
return false;},'multi':false,'type':'crafting'});droppable.addToGroup('CRAFTING');}}catch(ex){if(console&&console.log){console.log(ex);}else{alert('javascript::Game::Inventory: '+ex);}}}}}};this.createInventorySlotDroppable=function(layerId,droppableType,config){var self=this;var slot=new YAHOO.util.DDTarget(layerId,'Items',{'mapId':config.mapId,'position':config.position,'onlyRemoveItemFromItemMap':config.onlyRemoveItemFromItemMap,'onValidDropFrom':function(fromContainer,targetContainer,data){if(targetContainer.config.handleFromContainerHook!==false){if(config&&config.onValidDropFrom){config.onValidDropFrom(fromContainer,targetContainer,data);}
var item=ItemUtilities.getItemDataByLayerId(data.el.id);Character.updateAttributesByItem('decrease',item.attributes)}},'onValidDrop':function(fromContainer,targetContainer,data){try{var item=ItemUtilities.getItemDataByLayerId(data.el.id);switch(item.type){case'FOOD':self.itemInventoryChangeVisualEffect('apply',item,data);var item=ItemUtilities.getItemDataByLayerId(data.el.id);Character.increaseHealth(item.attributes.Health.Value);data.el.remove();ItemUtilities.clearContainer(targetContainer.config.mapId);break;case'CHARACTER_CRAFTING':YAHOO.util.Event.removeListener(data.el,'mousedown');YAHOO.util.Event.removeListener(data.el,'mouseup');var itemHtml=data.el.innerHTML;var itemElement=data.el.remove();var freeRealCraftingPosition=parseInt(ItemUtilities.getFreeCharacterCraftingContainerId());var virtualCraftingPositionId=parseInt(GameCore.ArraySearch(freeRealCraftingPosition,ItemUtilities.getCharacterCraftingContainerIds()))+1;var layerName=''+self.config.CharacterCraftingLayerPrefix+virtualCraftingPositionId;var layer=$(layerName);layer.className+=' SlotActive';layer.appendChild(itemElement);item.siv=parseInt(GameCore.ServerTime.getCurrentTime())+parseInt(item.affectDuration);ItemUtilities.updateItemDataByLayerId(data.el.id,item);itemMap.Inventory.grid[freeRealCraftingPosition]=data.el.id;itemMap.Inventory.byItem[data.el.id]=item;itemMap.Inventory.byItem[data.el.id].position=freeRealCraftingPosition;ItemUtilities.clearContainer(targetContainer.config.mapId);Character.updateAttributesByItem();break;default:data.el.style.top=null;data.el.style.left=null;data.el.className=data.el.className.replace(/ Item\w+Position\_\w+\S*/,' Item_InventoryPosition_'+targetContainer.config.containerDimension+'_'+item.itemDimension.Width+'x'+item.itemDimension.Height+' ');Character.updateAttributesByItem('increase',item.attributes);}}catch(e){alert('problem while moving to correct position: '+e);}},'dropCallUrl':config.dropCallUrl,'additionalCheck':function(targetElement,fromElement,element){if(fromElement&&fromElement.config&&fromElement.config.additionalFromCheck&&fromElement.config.additionalFromCheck(targetElement,fromElement,element)!==true){return false;}
var item=ItemUtilities.getItemDataByLayerId(element.id);if(item.type=='CHARACTER_CRAFTING'){if(ItemUtilities.getFreeCharacterCraftingContainerId()!==false){return true;}
return false;}
return true;},'additionalFromCheck':config.additionalFromCheck,'multi':false,'type':'inventory','containerDimension':config.containerDimension,'additionalInfo':config.additionalInfo});if(typeof droppableType==='object'){for(var key in droppableType){slot.addToGroup(droppableType[key]);}}else{slot.addToGroup(droppableType);}};this.itemInventoryChangeVisualEffect=function(type,item,data){try{if(item.type=='FOOD'){var pos={'top':data.currentEvent.clientY-15,'left':data.currentEvent.clientX};if(type=='apply'){if(item.attributes&&item.attributes.Health&&item.attributes.Health.Value&&item.type=='FOOD'){value='+'+parseInt(item.attributes.Health.Value);}}else{if(item.attributes&&item.attributes.Health&&item.attributes.Health.Value&&item.type=='FOOD'){value='-'+parseInt(item.attributes.Health.Value/2);}}
ItemUtilities.visualItemEffect('inventoryEffectLayer',pos,{'id':data.el.id,'Value':value});}}catch(e){}};this.createDraggableItems=function(container,data){var self=this;var craftingTimeout=null;for(var itemLayerId in data){var item=data[itemLayerId];if(item&&item.type&&$(itemLayerId)){if(item.type=='CHARACTER_CRAFTING'){}else{new YAHOO.DraggableItems.DDPlayer(itemLayerId,item.type,{'shopItemId':item.shopItemId,'currentContainer':container});}}}
window.setTimeout(function(){try{var nextOutdatedItem=ItemUtilities.getNextOutdatedCharacterCraftingItem();if(nextOutdatedItem!=null){var timeout=(1000*(parseInt(nextOutdatedItem.siv)-parseInt(GameCore.ServerTime.getCurrentTime())))+2000;window.setTimeout(function(){self.removeTempCraftingItems();return;},timeout);}}catch(e){}},1000);};this.removeTempCraftingItems=function(){var self=this;var outdatedItems=ItemUtilities.getOutdatedCharacterCraftingItems();for(var internalId in outdatedItems){var outdatedItem=outdatedItems[internalId];var containerLayerName=''+this.config.CharacterCraftingLayerPrefix+(parseInt(outdatedItem.internalCraftingContainerId)+1);var containerLayer=$(containerLayerName);if($(outdatedItem.layerId)){ItemUtilities.removeItem(outdatedItem.layerId);$(outdatedItem.layerId).remove();if(containerLayer&&containerLayer.className){containerLayer.className=containerLayer.className.replace(/ SlotActive/,'');}}}
Character.updateAttributesByItem();var nextOutdatedItem=ItemUtilities.getNextOutdatedCharacterCraftingItem();var timeout=(1000*(parseInt(nextOutdatedItem.siv)-parseInt(GameCore.ServerTime.getCurrentTime())));window.setTimeout(function(){self.removeTempCraftingItems();},timeout);};this.onValidDropFrom=function(fromContainer,toContainer,data){if(fromContainer.config.dropCallUrl&&toContainer.config.handleFromContainerHook!==false){new Ajax.Request(fromContainer.config.dropCallUrl,{'method':'post','parameters':ItemUtilities.getAjaxParameters(fromContainer,toContainer,data),'onSuccess':function(transport){if(__handleAjaxResponse(transport)===true){if(transport.responseJSON.status!='ok'){alert('javascript::Game::Bag error: response was '+transport.responseJSON.status);top.location.href=Router.link(Router.currentPath,{});}}}});}};};
function Game_QuestDroppable(expectedItemData){this.expectedItemData=expectedItemData;if(this.expectedItemData.itemTagPrefix==0||this.expectedItemData.itemTagPrefix==false)this.expectedItemData.itemTagPrefix=null;if(this.expectedItemData.itemTagAppendix==0||this.expectedItemData.itemTagAppendix==false)this.expectedItemData.itemTagAppendix=null;this.createDroppable=function(layerId,droppableType,config){var self=this;var slot=new YAHOO.util.DDTarget($(layerId),'Items',{'mapId':null,'dropCallUrl':null,'additionalCheck':function(targetElement,fromElement,element){var item=ItemUtilities.getItemDataByLayerId(element.id);if(item){if(item.itemTagPrefix==0){item.itemTagPrefix=null;}
if(item.itemTagAppendix==0){item.itemTagAppendix=null;}
if(item.item==self.expectedItemData.item&&(self.expectedItemData.itemTagPrefix==null||item.itemTagPrefix==self.expectedItemData.itemTagPrefix)&&(self.expectedItemData.itemTagAppendix==null||item.itemTagAppendix==self.expectedItemData.itemTagAppendix)){$(config.LoadingContainerLayer).show();return true;}}
return false;},'multi':false,'type':'Quest::bringItem','containerDimension':config.containerDimension,'additionalInfo':config.additionalInfo});slot.addToGroup(droppableType);};this.onValidDropFrom=function(fromContainer,toContainer,data){if(fromContainer.config.dropCallUrl){alert('on valid drop from');}};};
function ImageSelection(imageArray,config){this.imageArray=imageArray;this.config=config;this.previewLayer=$(this.config.previewLayer);this.ImageToBeReplaced=$(this.config.imageToBeReplaced);this.formId=$(this.config.formId);this.defaultPath=this.config.defaultPath;this.getPreviewImages=function(){var content="";for(var i=0;i<this.imageArray.length;i++){content+='<img id="'+i+'" src="'+this.defaultPath+this.imageArray[i]['subPath']+'/'+this.imageArray[i].image+'" class="ImagePreview" onclick="ImageSelection.exchangeImage(this.id)"/>';}
this.previewLayer.innerHTML=content;}
this.exchangeImage=function(id){this.ImageToBeReplaced.src=this.defaultPath+this.imageArray[id].subPath+'/'+this.imageArray[id].image;this.formId.value=id;this.previewLayer.toggle();}}
function GameCore_Action_Queue(config){this.config=config;this.queue={};this.tick=0;this.interval=null;this.Start=function(){var self=this;if(!this.config.TimerType||this.config.TimerType=='prototype'){this.config.TimerType='prototype';this.interval=new PeriodicalExecuter(function(pe){self.Run(pe);},this.config.Interval);}else if(this.config.TimerType=='GlobalTimer'){Timer.Add(function(timerId){self.Run(timerId);},this.config.Interval*1000);}else{this.interval=window.setInterval(function(){self.Run(self.interval);},this.config.Interval*1000);}};this.Run=function(pe){var newQueue=this.queue;var changed=false;for(var key in this.queue){var elementStillExists=true;if(this.queue[key].config&&this.queue[key].callfunc){if(this.queue[key].config.tickCheckFunction(this.tick)===true){this.queue[key].callfunc(this,this.tick,this.queue[key],key);if(this.queue[key]){this.queue[key].config.__numberOfTicksExecuted++;}else{elementStillExists=false;}
changed=true;}
if(elementStillExists===true&&this.queue[key].config.endCheckFunction(this.tick)===true){this.Remove(key);newQueue=GameCore.unsetArrayElementsByKey(newQueue,key);changed=true;}}}
this.tick++;if(changed===true){if(GameCore.sizeOfObject(newQueue)==0){this.Stop();}
this.queue=newQueue;}};this.Reset=function(){this.tick=0;};this.getCurrentTick=function(){return this.tick;};this.Stop=function(){if(this.config.TimerType=='prototype'){this.interval.stop();}else if(this.config.TimerType=='GlobalTimer'){Timer.Stop(pe);}else{window.clearInterval(this.interval);}};this.Add=function(id,config,func){if(this.queue[id]){throw new GameCore_Action_Queue_Exception(1,id);}
config=this.prepareConfig(config);this.queue[id]={'config':config,'callfunc':func};};this.Remove=function(id){var element=this.queue[id];this.queue=GameCore.unsetArrayElementsByKey(this.queue,id);return element;};this.prepareConfig=function(config){var self=this;var currentTick=this.tick;config.original=config;config.__internalStartTick=currentTick;config.__numberOfTicksExecuted=0;if(config.startAfter){config.start=currentTick+config.startAfter;}
if(!config.start){config.start=currentTick;}
if(!config.tickStep){config.tickStep=1;}
if(!config.tickCheckFunction){config.tickCheckFunction=function(currentTick){if(currentTick>=config.start){if((currentTick-config.__internalStartTick)%config.tickStep==0){return true;}}
return false;};};if(!config.endCheckFunction){if(config.endAfterCalls){config.end=config.start+(config.endAfterCalls*config.tickStep)-1;}
if(!config.end){config.end=null;}
config.endCheckFunction=function(currentTick){if(config.end!=null&&self.tick>=config.end){return true;}
return false;};}
return config;};};function GameCore_Action_Queue_Exception(code,p1){this.code=1000000+parseInt(code);this.p1=p1;};
function Game_Sprites(imagePath,elements,config){if(!config||!config.orientation){console.log(config);throw new Game_Sprites_Exception(1);}
this.imagePath=imagePath;this.image=new Image();this.elements=elements;this.config=config;this.spriteDimension={'width':0,'height':0};this.status='loading';this.Init=function(){this.image.src=this.imagePath;this.determineSpriteDimension();GameCore.DEBUG('javascript::Game::Sprites::Init()',['sprite image dimension: '+this.image.width+'x'+this.image.height,'sprite dimension: '+this.spriteDimension.width+'x'+this.spriteDimension.height,'sprite html tag: '+this.getSpriteHTMLTag('test','Stand')],10);};this.determineSpriteDimension=function(){var self=this;this.status='loading';if(this.image.height&&this.image.width){this.status='loaded';if(this.config.orientation=='vertical'){this.spriteDimension.width=this.image.width;this.spriteDimension.height=this.image.height/this.elements.length;}else if(this.config.orientation=='horizontal'){this.spriteDimension.width=this.image.width/this.elements.length;this.spriteDimension.height=this.image.height;}
var elements={};for(var i=0;i<this.elements.length;i++){elements[this.elements[i]]={'type':this.elements[i],'offset':{'x':(this.config.orientation=='vertical'?0:i*this.spriteDimension.width)*-1,'y':(this.config.orientation=='vertical'?i*this.spriteDimension.height:0)*-1}};}
this.elements=elements;if(this.config&&this.config.onLoad){this.config.onLoad(this);}
GameCore.DEBUG('javascript::Game::Sprites::determineSpriteDimension()','sprite '+this.image.src+' successful loaded.',5);}else{GameCore.DEBUG('javascript::Game::Sprites::determineSpriteDimension()','sprite '+this.image.src+' not loaded, adding onLoad hook.',5);this.image.onload=function(){self.determineSpriteDimension();};}};this.getStatus=function(){return this.status;};this.getSpriteHTMLTag=function(elementId,type,spriteFallbackImageClass){var html='<div id="'+elementId+'"';if(this.elements[type]||!spriteFallbackImageClass){html+=' style="';if(this.config.isAlphaPNGImage===true&&YAHOO.env.ua.ie==6){html+='position: absolute;';html+='height: '+this.image.height+'px;';html+='width: '+this.image.width+'px;';html+='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+this.image.src+'\', sizingMethod=\'scale\');';html+='background: none;';}else{html+='height: '+this.spriteDimension.height+'px;';html+='width: '+this.spriteDimension.width+'px;';html+='background-image: url(\''+this.image.src+'\');';}
if(this.elements[type]){var position=this.elements[type].offset;if(this.config.isAlphaPNGImage===true&&YAHOO.env.ua.ie==6){html+='clip: rect('+
(-1*position.y)+'px, '+
((-1*position.x)+this.spriteDimension.width)+'px,'+
((-1*position.y)+this.spriteDimension.height)+'px,'+
(-1*position.x)+'px);';html+='top: '+position.y+'px;';html+='left: '+position.x+'px;';}else{html+='background-position: '+position.x+'px '+position.y+'px;';}
html+='"';}else{html+='background-color: #f00;';html+='color: #fff;';html+='font-weight: bold;';html+='">missing sprite element '+type;}}else if(spriteFallbackImageClass){html+=' class="'+spriteFallbackImageClass+'"';}
html+='></div>';return html;};this.getSpriteData=function(type){if(this.elements[type]){var position=this.elements[type].offset;return{'url':this.imagePath,'position':position,'dimension':this.spriteDimension};}
return false;};};function Game_Sprites_Exception(code,p1){this.code=1001000+parseInt(code);this.p1=p1;this.exceptions={1:'config has not a valid value'};};
function Game_Fight(config){this.config=config;this.ActionQueue=new GameCore_Action_Queue({'Interval':(config.SingleEventQueue===true&&YAHOO.env.ua.ie==6?0.02:0.025)});this.EffectQueueFactor=4;this.BackgroundMovementQueueFactor=4;if(config.SingleEventQueue!==true){this.EffectQueue=new GameCore_Action_Queue({'Interval':0.025});this.BackgroundMovementQueue=new GameCore_Action_Queue({'Interval':0.025});}else{this.EffectQueue=this.ActionQueue;this.BackgroundMovementQueue=this.ActionQueue;};this.Characters={};this.Init=function(){var self=this;if(this.config.WaitingHallLayer){$(this.config.WaitingHallLayer).show();}
for(var characterType in this.config.Images){this.Characters[characterType]=new Game_Sprites((this.config.Images[characterType].FullPath?this.config.Images[characterType].FullPath:Router.link(this.config.Images[characterType].Path)),this.config.Images[characterType].ImageTypes,{'orientation':this.config.Images[characterType].SpriteOrientation,'isAlphaPNGImage':true,'onLoad':function(Sprite){self.InitAfterLoad();}});this.Characters[characterType].Init();}};this.checkLoaded=function(){var completlyLoaded=true;for(var characterType in this.config.Images){if(!this.Characters[characterType]||this.Characters[characterType].getStatus()!='loaded'){completlyLoaded=false;}}
return completlyLoaded;};this.InitAfterLoad=function(){if(this.checkLoaded()===true){for(var key in this.config.CharacterLayer){$(this.config.CharacterLayer[key]).update(this.Characters[key].getSpriteHTMLTag('Char'+key,'Stand'));}
if(this.config.WaitingHallLayer){$(this.config.WaitingHallLayer).hide();}
this.ActionQueue.Start();if(this.config.SingleEventQueue!==true){this.EffectQueue.Start();this.BackgroundMovementQueue.Start();}
if(this.config.onAfterInit){this.config.onAfterInit(this);}}};this.Start=function(){var self=this;var ActionQueueLastTick=this.fillActionQueue();for(var i=0;i<this.config.Winners.length;i++){this.addUpdateImageAction(ActionQueueLastTick+1,this.config.Winners[i],'Winner');}
for(var i=0;i<this.config.Loosers.length;i++){this.addUpdateImageAction(ActionQueueLastTick+1,this.config.Loosers[i],'Looser',{});}
if(this.config&&this.config.Hooks&&this.config.Hooks.onFightFinish){this.addHookCall(ActionQueueLastTick+1,'onFightFinish',this.config.Hooks.onFightFinish);}
return;};this.ShowFinish=function(){var self=this;for(var i=0;i<this.config.Winners.length;i++){this.updateImage(this.config.Winners[i],'Winner');}
for(var i=0;i<this.config.Loosers.length;i++){this.updateImage(this.config.Loosers[i],'Looser');}
if(this.config&&this.config.Hooks&&this.config.Hooks.onFightFinish){this.config.Hooks.onFightFinish(this,null,null,{});}
return;};this.fillActionQueue=function(actions){if(!actions){actions=this.config.Actions;}
var tick=5;for(var i=0;i<actions.length;i++){var action=actions[i];tick+=this.addAction(action.Action,tick,action,actions[i+1]);}
return tick;};this.addHookCall=function(startTick,hookId,hook){var self=this;this.ActionQueue.Add('ActionHookCall-'+hookId+' '+startTick,{'startAfter':startTick*(this.config.SingleEventQueue===true?this.EffectQueueFactor:1),'endAfterCalls':1,'Fight':this,'HookFunction':hook},function(Queue,tick,elementConfig){elementConfig.config.HookFunction(self,Queue,tick,elementConfig);});};this.addUpdateImageAction=function(startTick,target,image,actionData,additionalCall){var self=this;this.ActionQueue.Add(image+'-'+target+'-ImageAction-Tick '+startTick,{'endAfterCalls':1,'startAfter':startTick*(this.config.SingleEventQueue===true?this.EffectQueueFactor:1),'Fight':this},function(Queue,tick,elementConfig){self.updateImage(target,image);if(additionalCall){additionalCall(Queue,tick,elementConfig);}});};this.addAction=function(actionType,tick,action,nextAction){var tickUsage=0;var method='tickUsage = this.addAction'+actionType;eval(method+'(tick, action, nextAction)');this.addFightMessage(tick+1,action,nextAction);return tickUsage;};this.addFightMessage=function(tick,action,nextAction){var self=this;this.EffectQueue.Add('FightMessageInit-'+tick+'-'+action.Initiator+'-'+action.Target+'-'+action.Action+'-'+action.Damage,{'endAfterCalls':1,'startAfter':tick*this.EffectQueueFactor},function(Queue,qTick,elementConfig){var div='<div id="'+'FightMessage-'+tick+'-'+action.Initiator+'-'+action.Target+'-'+action.Action+'-'+action.Damage+'" class="FightAction '+action.Action+' '+action.Target+'">'+gettext('LABEL_'+GameCore.strToUpper(action.Action))+'</div>';$(self.config.EffectsLayer).innerHTML+=div;});this.EffectQueue.Add('FightMessage-'+tick+'-'+action.Initiator+'-'+action.Target+'-'+action.Action+'-'+action.Damage,{'startAfter':1+(tick*this.EffectQueueFactor),'tickStep':1},function(Queue,qTick,elementConfig,queueElementId){var layerId='FightMessage-'+tick+'-'+action.Initiator+'-'+action.Target+'-'+action.Action+'-'+action.Damage;var layer=$(layerId);if(layer){var result=GameCore.Dom.updateLayerPositionByAddition(layerId,{'top':-1,'opacity':-0.025});if(result.opacity<=0||parseInt(result.fontSize)<=10){layer.remove();Queue.queue[queueElementId].config.endCheckFunction=function(){return true;};}}});};this.addDamageEffect=function(tick,target,damage){var self=this;if(this.setBlah!==true){this.EffectQueue.Add('DamageInit-'+tick+'-'+target+'-'+damage,{'endAfterCalls':1,'startAfter':tick*this.EffectQueueFactor},function(Queue,qTick,elementConfig){var div='<div id="'+'Damage-'+tick+'-'+target+'-'+damage+'" class="Damage '+target+'">-'+damage+'</div>';$(self.config.EffectsLayer).innerHTML+=div;var characterObj=self.config.Characters[target];if(characterObj===null){self.config.Characters[target]=Character;characterObj=Character;}
characterObj.decreaseHealth(damage);$('HealthBar'+self.config.CharacterLayer[target]+'Description').innerHTML=Math.ceil(characterObj.getHealthInPercent())+'%';$('HealthBar'+self.config.CharacterLayer[target]+'Percent').setStyle({'width':characterObj.getHealthInPercent()+'%'});delete characterObj;delete div;});this.EffectQueue.Add('Damage-'+tick+'-'+target+'-'+damage,{'startAfter':1+(tick*this.EffectQueueFactor),'tickStep':1},function(Queue,qTick,elementConfig,queueElementId){var layerId='Damage-'+tick+'-'+target+'-'+damage;var layer=$(layerId);if(layer){var result=GameCore.Dom.updateLayerPositionByAddition(layerId,{'left':-2,'top':-5,'opacity':-0.025,'fontSize':2});if(result.opacity<=0){layer.remove();Queue.queue[queueElementId].config.endCheckFunction=function(){return true;};}}});}};this.handleDamage=function(tick,actionData){if(actionData.Damage>0){this.addDamageEffect(tick,actionData.Target,actionData.Damage);}};this.addBackgroundScrollEffect=function(tick,duration,target){var horizontalBaseMovementValue=3;var self=this;var startTick=tick*this.BackgroundMovementQueueFactor;duration=duration*this.BackgroundMovementQueueFactor;switch(target){case'Right':break;};horizontalBaseMovementValue*=-1;this.BackgroundMovementQueue.Add(target+'-'+duration+'-'+tick+'-BackgroundImage-Tick '+startTick,{'endAfterCalls':duration,'startAfter':startTick,'Fight':this},function(Queue,tick,elementConfig){var speed=0.5;var base=(horizontalBaseMovementValue>0?horizontalBaseMovementValue:horizontalBaseMovementValue*-1);var backgroundMovementTick=elementConfig.config.__numberOfTicksExecuted;var backgroundMovementTickAmount=elementConfig.config.endAfterCalls;var additor=base/backgroundMovementTickAmount;var value=((backgroundMovementTick-1)*additor)-(base/2);var gauss=GameCore.Math.Gauss(base,value/speed,0.2);var horizontalChangeValue=Math.round(base-(gauss*base));if(horizontalBaseMovementValue<0){horizontalChangeValue*=-1*2.5;}
GameCore.Dom.updateLayerPositionByAddition(self.config.ForegroundLayer,{'left':-1});$(self.config.ForegroundLayer).setStyle({'width':(parseInt($(self.config.ForegroundLayer).style.left)*-1)+parseInt(self.config.ViewPortDimension.width)+'px'});if(self.config.BackgroundFrontLayer&&elementConfig.config.__numberOfTicksExecuted%2==0){GameCore.Dom.updateLayerPositionByAddition(self.config.BackgroundFrontLayer,{'backgroundPosition':{'left':horizontalChangeValue/2}});}
if(elementConfig.config.__numberOfTicksExecuted%2==0){GameCore.Dom.updateLayerPositionByAddition(self.config.BackgroundLayer,{'backgroundPosition':{'left':horizontalChangeValue/(self.config.BackgroundFrontLayer?4:2)}});}});};this.addActionAttack=function(startTick,actionData,nextAction,leftAttack){var self=this;var tick=startTick;var tickOverflow=GameCore.Rand(1,3);tickOverflow=2;if(this.config.Images[actionData.Initiator].IsNPC===true)leftAttack=false;tick+=1;this.addUpdateImageAction(tick,actionData.Initiator,(leftAttack===true?'AttackLeft':'Attack'),actionData,function(){var charMovePixel=0;if(leftAttack){charMovePixel=30;}else{charMovePixel=130;}
$('Character'+actionData.Target+'Container').setStyle({'zIndex':0});$('Character'+actionData.Initiator+'Container').setStyle({'zIndex':1});if(actionData.Initiator=='Left'){$('Character'+actionData.Initiator).setStyle({'left':charMovePixel+'px'});}else{$('Character'+actionData.Initiator).setStyle({'left':(charMovePixel*-1)+'px'});}});tick+=1;this.handleDamage(tick,actionData);this.addUpdateImageAction(tick,actionData.Target,'Hit',actionData);tick+=3;this.addUpdateImageAction(tick,actionData.Target,'Stand',actionData,function(){$('Character'+actionData.Initiator).setStyle({'left':'0px'});$('Character'+actionData.Initiator+'Container').setStyle({'zIndex':0});$('Character'+actionData.Target).setStyle({'left':'0px'});$('Character'+actionData.Target+'Container').setStyle({'zIndex':0});});this.addUpdateImageAction(tick,actionData.Initiator,'Stand',actionData);this.addBackgroundScrollEffect(startTick,(tick-startTick)+tickOverflow,actionData.Target);return tick-startTick+tickOverflow;};this.addActionHeavyAttack=function(startTick,actionData,nextAction){return this.addActionAttack(startTick,actionData,nextAction,true);};this.addActionCriticalAttack=function(startTick,actionData,nextAction){return this.addActionAttack(startTick,actionData,nextAction,true);};this.addActionNormalAttack=function(startTick,actionData,nextAction){return this.addActionAttack(startTick,actionData,nextAction);};this.addActionLightAttack=function(startTick,actionData,nextAction){return this.addActionAttack(startTick,actionData,nextAction);};this.addActionLuckyAttack=function(startTick,actionData,nextAction){return this.addActionAttack(startTick,actionData,nextAction);};this.addActionDefend=function(startTick,actionData,nextAction){var self=this;var tick=startTick;var tickOverflow=GameCore.Rand(1,3);tick+=2;this.addUpdateImageAction(tick,actionData.Initiator,'Attack',actionData,function(){var charMovePixel=70;$('Character'+actionData.Target+'Container').setStyle({'zIndex':0});$('Character'+actionData.Initiator+'Container').setStyle({'zIndex':1});if(actionData.Initiator=='Left'){$('Character'+actionData.Initiator).setStyle({'left':charMovePixel+'px'});}else{$('Character'+actionData.Initiator).setStyle({'left':(charMovePixel*-1)+'px'});}});tick+=1;if(this.config.Images[actionData.Target].IsNPC!=true){this.addUpdateImageAction(tick,actionData.Target,'Defend',actionData);}else{this.addUpdateImageAction(tick,actionData.Target,'Stand',actionData,function(){$('Character'+actionData.Target).setStyle({'left':'50px'});$('Character'+actionData.Target+'Container').setStyle({'zIndex':0});});}
tick+=5;this.addUpdateImageAction(tick,actionData.Target,'Stand',actionData,function(){$('Character'+actionData.Initiator).setStyle({'left':'0px'});$('Character'+actionData.Initiator+'Container').setStyle({'zIndex':0});$('Character'+actionData.Target).setStyle({'left':'0px'});$('Character'+actionData.Target+'Container').setStyle({'zIndex':0});});this.addUpdateImageAction(tick,actionData.Initiator,'Stand',actionData);this.addBackgroundScrollEffect(startTick,(tick-startTick)+tickOverflow,actionData.Target);return tick-startTick+tickOverflow;};this.addActionBlock=function(startTick,actionData,nextAction){return this.addActionDefend(startTick,actionData,nextAction);};this.addActionFailed=function(startTick,actionData,nextAction){return this.addActionBlock(startTick,actionData,nextAction);};this.updateImage=function(characterType,spriteType){$(this.config.CharacterLayer[characterType]).update(this.Characters[characterType].getSpriteHTMLTag('Char'+characterType,spriteType,(spriteType=='Looser'?'Gravestone':false)));};this.Init();};
function Game_Fight_StartScreen(config){this.config=config;this.EventQueue=new GameCore_Action_Queue({'Interval':(config.SingleEventQueue===true&&YAHOO.env.ua.ie==6?0.02:0.025)});this.Start=function(){var self=this;this.addFadeInMessageEvent(20,{'Text':this.config.VersusMessage,'TextLayerId':'VersusMessage','decreaseFontSizeValue':-8,'endFontSize':32,'StartPosition':{'top':'-500px','left':'-120px'},'onEnd':function(Queue,tick){self.addBlinkEvent(tick+20,{'LayerId':'VersusMessage','BlinkCount':2,'onEnd':function(Queue,tick){var div='<div ';div+='id="FightTextLayer" ';div+='class="TextEvent"';div+='>';div+=self.config.FightMessage;div+='</div>';$(self.config.EffectsLayer).innerHTML+=div;self.EventQueue.Add('FightEvent-'+tick,{'startAfter':20,'tickStep':1,'endAfterCalls':1},function(Queue,qTick,elementConfig,queueElementId){$('FightTextLayer').remove();self.config.onFinish(Queue,qTick,elementConfig,queueElementId);});}});}});this.EventQueue.Start();};this.addBlinkEvent=function(tick,Configuration){try{this.EventQueue.Add('BlinkEvent-'+Configuration.LayerId,{'startAfter':tick,'endAfterCalls':(Configuration.BlinkCount*2),'tickStep':20,'EventConfiguration':Configuration},function(Queue,qTick,elementConfig,queueElementId){$(elementConfig.config.EventConfiguration.LayerId).toggle();if(elementConfig.config.__numberOfTicksExecuted==(Configuration.BlinkCount*2)-1){$(elementConfig.config.EventConfiguration.LayerId).remove();if(elementConfig.config.EventConfiguration.onEnd){elementConfig.config.EventConfiguration.onEnd(Queue,qTick,elementConfig,queueElementId);}}});}catch(exception){}};this.addFadeInMessageEvent=function(tick,Configuration){var change={};change.opacity=0.075;switch(Configuration.decreaseFontSizeValue){case-3:change.left=4;change.top=10;break;case-6:change.left=8;change.top=22;break;case-8:change.left=12;change.top=36;break;default:change.left=1+(Configuration.decreaseFontSizeValue*-1)+Math.ceil((Configuration.decreaseFontSizeValue*-1)/6);change.top=(change.left*2)+(change.left*2/2);}
try{this.addMessageEvent(tick,{'MessageContent':{'Content':Configuration.Text,'LayerId':(Configuration.TextLayerId||null),'Style':{'opacity':0,'font-size':'120px','top':(Configuration.StartPosition&&Configuration.StartPosition.top?Configuration.StartPosition&&Configuration.StartPosition.top:'-200px'),'left':(Configuration.StartPosition&&Configuration.StartPosition.left?Configuration.StartPosition&&Configuration.StartPosition.left:'-100px')}},'Effect':{'StyleChangePerTick':{'opacity':change.opacity,'left':change.left,'top':change.top,'fontSize':Configuration.decreaseFontSizeValue},'checkEnd':function(tick,config,StyleAfterChange){if(StyleAfterChange.opacity>=1||parseInt(StyleAfterChange.fontSize)<=(Configuration.endFontSize||12)){return true;}
return false;}},'onEnd':Configuration.onEnd});}catch(e){}};this.addMessageEvent=function(startTick,config){var self=this;if(config.MessageContent.Content&&!config.MessageContent.LayerId)config.MessageContent.LayerId='MessageEvent-'+startTick;if(config.MessageContent.Content){this.EventQueue.Add('MessageEvent-AddText-'+config.MessageContent.LayerId,{'startAfter':startTick,'endAfterCalls':1,'tickStep':1,'MessageConfig':config},function(Queue,qTick,elementConfig,queueElementId){var div='<div ';div+='id="'+elementConfig.config.MessageConfig.MessageContent.LayerId+'" ';div+='class="'+(elementConfig.config.MessageConfig.MessageContent.ClassName||'TextEvent')+'"';if(elementConfig.config.MessageConfig.MessageContent.Style){div+=' style="';for(var styleKey in elementConfig.config.MessageConfig.MessageContent.Style){if(YAHOO.env.ua.ie>=6&&styleKey=='opacity'){div+='filter: alpha(opacity='+((elementConfig.config.MessageConfig.MessageContent.Style[styleKey]*100)+1)+');';}else{div+=styleKey+': '+elementConfig.config.MessageConfig.MessageContent.Style[styleKey]+';';}}
div+='"';}
div+='>';div+=elementConfig.config.MessageConfig.MessageContent.Content;div+='</div>';$(self.config.EffectsLayer).innerHTML+=div;});}
this.EventQueue.Add('MessageEvent-Effect-'+config.MessageContent.LayerId,{'startAfter':startTick+(config.EffectStartAfterTick||0),'tickStep':1,'MessageConfig':config},function(Queue,qTick,elementConfig,queueElementId){var layerId=elementConfig.config.MessageConfig.MessageContent.LayerId;var layer=$(layerId);var remove=true;if(layer){remove=false;var result=GameCore.Dom.updateLayerPositionByAddition(layerId,elementConfig.config.MessageConfig.Effect.StyleChangePerTick);if(elementConfig.config.MessageConfig.Effect.checkEnd&&elementConfig.config.MessageConfig.Effect.checkEnd(qTick,elementConfig.config,result)===true){remove=true;}else if(!elementConfig.config.MessageConfig.Effect.checkEnd){if(result.opacity<=0||result.opacity>=1){remove=true;}}}
if(remove===true){Queue.queue[queueElementId].config.endCheckFunction=function(){return true;};if(elementConfig.config.MessageConfig.onEnd)
elementConfig.config.MessageConfig.onEnd(Queue,qTick,elementConfig,queueElementId);}});};}
function Game_Alliance_DeclareWar(config){this.config=config;this.Declare=function(allianceId,name){new Ajax.Request(Router.link(this.config.AllianceDeclareWarPath.replace(/%ALLIANCE_ID%/,allianceId)),{'method':'get','onSuccess':function(transport){if(__handleAjaxResponse(transport)===true){var response=transport.responseJSON;if(response.status=='ok'){GameCore.UI.ModalDialog({'Title':gettext('DIALOG_MESSAGE_IGNORE_LIST_USER_TITLE'),'Message':GameCore.sprintf(gettext('DIALOG_MESSAGE_IGNORE_LIST_USER_ADDED_MESSAGE'),name).replace(/\\n/g,'<br />')});}else{GameCore.UI.ModalDialog({'Title':gettext('DIALOG_MESSAGE_IGNORE_LIST_USER_TITLE'),'Message':GameCore.sprintf(gettext(response.statusMessage),name).replace(/\\n/g,'<br />')});}}}});};}
function Game_Item_AuctionOffer(form,feeLayer,priceFeeMultiplicator,durationFeeMultiplicator){var self=this;this.form=form;this.priceFeeMultiplicator=priceFeeMultiplicator;this.durationFeeMultiplicator=durationFeeMultiplicator;this.feeLayer=feeLayer;this.currentItem=null;this.createDroppable=function(layerId,groups,config){var self=this;var itemLayer=$(layerId);var slot=new YAHOO.util.DDTarget(itemLayer,'Items',{'mapId':config.mapId,'handleFromContainerHook':false,'manipulateItemMap':false,'onValidDrop':function(fromElement,targetElement,element){var Item=self.fetchItem(element.el.id);self.currentItem=Item;self.form.AuctionOfferSubmitButton.style.display='block';self.form.itemPrice.value=Item.price_gold;self.form.item.value=Item.itemId;self.form.fromContainer.value=fromElement.id;self.updateForm(Item);element.el.onDragDropHook=function(el){self.form.item.value='';self.form.itemPrice.value='';self.form.fromContainer.value='';self.feeLayer.update(0);self.updateForm();el.onDragDropHook=null;};},'dropCallUrl':config.dropCallUrl,'additionalCheck':function(targetElement,fromElement,element){if($(targetElement.id).childNodes.length==1){return false;}
return true;},'multi':false,'type':'AuctionOffer'});for(var i=0;i<groups.length;i++){var group=groups[i];slot.addToGroup(group);}};this.fetchItem=function(layerId){for(var containerId in itemMap){for(var itemLayerId in itemMap[containerId].byItem){if(itemLayerId==layerId){var tmp=itemMap[containerId].byItem[layerId];tmp.containerId=containerId;return tmp;}}}
return null;};this.calculateFee=function(Item,price){var minPrice=Item.price_gold_sell;var maxPrice=Item.price_gold;if(Item.price_gold_sell==0){minPrice=Item.price_gold;maxPrice=minPrice*2;}
var PercentBase=((100/(maxPrice-minPrice))*price)-100;var feeMultiplicator=Math.max(this.priceFeeMultiplicator.Min,Math.min(this.priceFeeMultiplicator.Max,this.priceFeeMultiplicator.Max/100*PercentBase));var fee=price*feeMultiplicator;fee+=this.form.offerDuration.value*this.durationFeeMultiplicator;return Math.floor(fee);};this.updateForm=function(Item){if(this.form.item.value){var int=parseInt(this.form.itemPrice.value)*1;if(!isNaN(int)){if(typeof Item=='undefined')
Item=this.currentItem;this.form.itemPrice.value=int;feeLayer.update(this.calculateFee(Item,int));}}else{self.form.AuctionOfferSubmitButton.style.display='none';}};};
function Game_Achievement(config,data){this.config=config;this.data=data;this.show=function(achievementName,level){level=parseInt(level);if(level<1){level=1;}
if(this.config.isRanking===true){var global=data.global[achievementName];if(global){$(this.config.HoverContentLayerId).update(this.getContent(achievementName,data.characterStates[achievementName],level,global[level-1]));}else{$(this.config.HoverContentLayerId).update(this.getContent(achievementName,data.characterStates[achievementName],level,null));}}else{$(this.config.HoverContentLayerId).update(this.getContent(achievementName,data.characterStates[achievementName],level,data.global[achievementName][level-1]));}};this.magnify=function(achievementName,level){level=parseInt(level);if(level<1){level=1;}
var global=data.global[achievementName];if(global){$(this.config.PermanentContentLayerId).update(this.getContent(achievementName,data.characterStates[achievementName],level,global[level-1]));}};this.getContent=function(achievementName,achievementCharacterData,level,data){var content='<div class="achievementImage '+achievementName+'"></div>';var achievementName='<div class="textInfos"><span class="bold smallHeadline">'+gettext(achievementCharacterData.label)+'</span><br/>';content+=achievementName;if(this.config.isRanking===true){if(data){if(data.firstReached){content+=this.getRankingContent('LABEL_ACHIEVEMENT_RANKING_REACHED_FIRST',data.firstReached,'timestamp');}
if(data.lastReached){content+=this.getRankingContent('LABEL_ACHIEVEMENT_RANKING_REACHED_LAST',data.lastReached,'timestamp');}
if(data.fastestReached){content+=this.getRankingContent('LABEL_ACHIEVEMENT_RANKING_REACHED_FASTEST',data.fastestReached,'seconds');}}else{content+='<p class="Text">'+gettext('LABEL_ACHIEVEMENT_RANKING_NOT_REACHED')+'</p>';}}else{if(data){content+=this.getAchievementContent(gettext(achievementCharacterData.label),data);}else{content+='NO RANKING CONTENT => '+data;}}
content+='</div>';content+='<div class="Stars">';for(var i=1;i<=achievementCharacterData.max;i++){content+='<div class="Star '+(level>=i?'Active':'Inactive')+'"></div>';}
content+='</div>';return content;};this.getAchievementContent=function(achievementName,data){var content='';if(data.achievedSince){content+=GameCore.sprintf(gettext('LABEL_ACHIEVEMENT_VALUE_REACHED_SINCE'),GameCore.Date(gettext('DATE_FORMAT_YEAR_MONTH_DAY'),data.achievedSince),GameCore.Date('H:i:s',data.achievedSince));content+='<br />';}else{content+=gettext('LABEL_ACHIEVEMENT_VALUE_NOT_REACHED');content+='<br />';}
content+=GameCore.sprintf(gettext('LABEL_ACHIEVEMENT_VALUE_REQUIRED_THIS_LEVEL'),GameCore.lcfirst(achievementName),GameCore.NumberFormat(data.requiredValue,0));content+='<br />';content+=GameCore.sprintf(gettext('LABEL_ACHIEVEMENT_CURRENT_VALUE'),GameCore.lcfirst(achievementName),GameCore.NumberFormat(data.currentValue,0));return content;};this.getRankingContent=function(label,data,rankValueType){var self=this;var content='';var rankingValue=0;switch(rankValueType){case'timestamp':rankingValue=parseInt(GameCore.ServerTime.getCurrentTime())-parseInt(data.rankingValue);break;default:rankingValue=data.rankingValue;}
content+=GameCore.sprintf(gettext(label),Character.getFormattedAllianceTag(data)+' <a href="'+Router.link(this.config.UserProfilePath.replace('%CHARACTER_NAME%',data.username))+'">'+data.username+'</a>',GameCore.ServerTime.getTimeString(rankingValue,function(days,hours,minutes,seconds){return self.formatTime(days,hours,minutes,seconds);}));var cutafter=65;var TextWithoutAnchor=GameCore.sprintf(gettext(label),Character.getFormattedAllianceTag(data)+data.username,GameCore.ServerTime.getTimeString(rankingValue,function(days,hours,minutes,seconds){return self.formatTime(days,hours,minutes,seconds);}));if(TextWithoutAnchor.length>cutafter){var dif1=content.length-TextWithoutAnchor.length;content=content.substring(0,(dif1+cutafter))+'...';}
content='<span class="" onmouseout="Tooltip.Hide();" onmousemove="Tooltip.Show(event, \'text\', \''+TextWithoutAnchor+'\');">'+content+'</span>';content+='<br/>';return content;};this.formatTime=function(days,hours,minutes,seconds){var content='';if(parseInt(days)>0){content+=GameCore.sprintf(ngettext('LABEL_COUNTDOWN_DAYS_SINGULAR','LABEL_COUNTDOWN_DAYS_PLURAL',parseInt(days)),parseInt(days))+', ';}
if(parseInt(hours)>0||parseInt(days)>0){content+=GameCore.sprintf(ngettext('LABEL_COUNTDOWN_HOURS_SINGULAR','LABEL_COUNTDOWN_HOURS_PLURAL',parseInt(hours)),parseInt(hours))+', ';}
content+=GameCore.sprintf(ngettext('LABEL_COUNTDOWN_MINUTES_ONLY_SINGULAR','LABEL_COUNTDOWN_MINUTES_ONLY_PLURAL',parseInt(minutes)),parseInt(minutes));return content;};this.expand=function(tabElement){tabElement.internalCheckValue='check';tabElement.className=this.config.TabActiveClassName;var checkState=false
for(var i=0;i<tabElement.parentNode.childNodes.length;i++){try{var elem=tabElement.parentNode.childNodes[i];if(elem.internalCheckValue=='check'){checkState=true;}else if(elem&&elem.className&&elem.className.match(this.config.TabClassName)){elem.className=this.config.TabClassName;}
if(checkState===true&&elem&&elem.className&&elem.className.match(this.config.TabContentClassName)){checkState=false;elem.className=elem.className.replace(' '+this.config.InvisibleClassName,' '+this.config.VisibleClassName);}else if(checkState===false&&elem&&elem.className&&elem.className.match(this.config.TabContentClassName)){elem.className=elem.className.replace(' '+this.config.VisibleClassName,' '+this.config.InvisibleClassName);}}catch(e){console.log("execption: Achievement.js "+e);}}
tabElement.internalCheckValue=false;};};
function Game_Ranking(config){this.config=config;this.lastSelectedRow=null;this.lastSelectedUserId=null;this.lastSelectedAllianceId=null;this.SelectRow=function(row){if(row){if(this.lastSelectedRow){this.lastSelectedRow.className=this.lastSelectedRow.className.replace(' '+this.config.HighlightClass,'');}
row.className+=' '+this.config.HighlightClass;this.lastSelectedRow=row;}};this.UnselectRow=function(row){if(row){row.className=row.className.replace(' '+this.config.HighlightClass,'');this.lastSelectedRow=null;}};this.showUserData=function(userId,characterId,username,alliance,profileText,isOwn,row){if(userId!=this.lastSelectedUserId){this.SelectRow(row);var content='<div class="headline">'+Character.getFormattedAllianceTag(alliance)+' '+username+'</div>';content+='<div class="ProfileText">'+(profileText?GameCore.bbcode(GameCore.htmlentities(profileText.replace(/<br \/>/g,''))).replace(/\n/g,'<br />'):GameCore.sprintf(gettext('LABEL_NO_PROFILE_TEXT'),username))+'</div>';if(!isOwn===true){content+='<a href="'+Router.link(this.config.AttackLink.replace('%CHARACTER_ID%',characterId).replace('%USER_ID%',userId))+'">';}
content+='<div class="Signature"><img border="0" src="'+Router.link(this.config.SignatureLink.replace('%CHARACTER_ID%',characterId))+'"/></div>';if(!isOwn===true){content+='</a>';}
content+='<div class="Buttons">';if(!isOwn===true){if(this.config.DontShowAttackLink!==true){content+='<div class="LeftButton"><a class="submitButton" href="'+Router.link(this.config.AttackLink.replace('%CHARACTER_ID%',characterId).replace('%USER_ID%',userId))+'">'+gettext('LABEL_CHALLENGE')+'</a></div>';}
content+='<div class="RightButton"><a class="submitButton" href="'+Router.link(this.config.MessageWriteLink.replace('%USERNAME%',escape(username)))+'">'+gettext('LABEL_WRITE_MESSAGE')+'</a></div>';}else{content+='<div class="RightButton"><div class="submitButton" onclick="Goto(\''+Router.link(this.config.ProfileEditLink)+'\');">'+gettext('LABEL_CHANGE_PROFILE')+'</div></div>';}
content+='</div>';$(this.config.CharacterInfoLayerId).show();$(this.config.CharacterInfoLayerId).update(content);if(this.config.SearchLayerId)
$(this.config.SearchLayerId).hide();this.lastSelectedUserId=userId;}else if(this.config.SearchLayerId){this.UnselectRow(row);$(this.config.CharacterInfoLayerId).hide();$(this.config.SearchLayerId).show();this.lastSelectedUserId=null;}};this.showAllianceData=function(allianceId,name,alliance,description,isInAlliance,isOwn,row){if(allianceId!=this.lastSelectedAllianceId){var diplomacyState='noConnection';this.SelectRow(row);var content='<div class="headline">'+Character.getFormattedAllianceTag(alliance)+' '+name+'</div>';content+='<img src="'+GameCore.sprintf(this.config.AllianceLogoBasePath,alliance.allianceLogo)+'"/>';content+='<div class="ProfileText">';content+='<strong>'+gettext('LABEL_ALLIANCE_LEADERS')+':</strong> ';for(var key in alliance.leaders){content+='<a href="'+Router.link(this.config.AttackByNameLink.replace(/%CHARACTER_NAME%/,alliance.leaders[key]))+'">'+alliance.leaders[key]+'</a>, ';}
content=content.substr(0,content.length-2);if(alliance.enemies!==undefined){for(var i=0;i<alliance.enemies.length;i++){if(alliance.enemies[i]==this.config.ownAllianceName){diplomacyState='enemy';}}
content+='<br/><strong>'+gettext('LABEL_ALLIANCE_ENEMY')+':</strong> ';for(var key in alliance.enemies){if(alliance.enemies[key]==this.config.ownAllianceName){content+='<a href="'+Router.link(this.config.AllianceProfilePathByName.replace(/%ALLIANCE_NAME%/,alliance.enemies[key]))+'"><span class="ownEnemyColor">'+alliance.enemies[key]+'</span></a>, ';}
else{content+='<a href="'+Router.link(this.config.AllianceProfilePathByName.replace(/%ALLIANCE_NAME%/,alliance.enemies[key]))+'">'+alliance.enemies[key]+'</a>, ';}}
content=content.substr(0,content.length-2);}
content+='<br/><br/>';content+=GameCore.bbcode(GameCore.htmlentities(description.replace(/<br \/>/g,'')).replace(/\n/g,'<br />'))+'</div>';content+='<div class="Buttons">';content+='<div class="LeftButton">';if(isOwn===true){content+='<div class="submitButton" onclick="Goto(\''+Router.link(this.config.AllianceProfilePath.replace(/%ALLIANCE_ID%/,allianceId))+'\');">'+gettext('RANKING_YOUR_ALLIANCE')+'</div>';}
else{content+='<div class="submitButton" onclick="Goto(\''+Router.link(this.config.AllianceProfilePath.replace(/%ALLIANCE_ID%/,allianceId))+'\');">'+gettext('RANKING_ALLIANCE_PROFILE_BUTTON')+'</div>';}
content+='</div>';content+='<div class="RightButton">';if(isOwn!==true&&isInAlliance===true&&this.config.hasDiplomacyRight==='true'){if(diplomacyState=='enemy'){content+='<div class="submitButton" style="position:relative;" onclick="Goto(\''+Router.link(this.config.AllianceDiplomacyRemoveEnemyPath.replace(/%ALLIANCE_ID%/,allianceId))+'\');">'+gettext('LABEL_ALLIANCE_ENEMY_REMOVE')+'</div>';}else{content+='<div class="submitButton" style="position:relative;" onclick="Goto(\''+Router.link(this.config.AllianceDiplomacyAddEnemyPath.replace(/%ALLIANCE_ID%/,allianceId))+'\');">'+gettext('LABEL_ALLIANCE_ENEMY_ADD')+'</div>';}}
content+='</div>';content+='</div>';if(this.config.SearchLayerId)
$(this.config.SearchLayerId).hide();$(this.config.AllianceInfoLayerId).show();$(this.config.AllianceInfoLayerId).update(content);this.lastSelectedAllianceId=allianceId;}else if(this.config.SearchLayerId){this.UnselectRow(row);$(this.config.AllianceInfoLayerId).hide();$(this.config.SearchLayerId).show();this.lastSelectedAllianceId=null;}};};