function requireCss(A){document.write('<link rel="stylesheet" type="text/css" href="'+A+'"></link>')
}requireCss("themes/windows/ajaxbber_20080323_packed.css");var i18n_str={send:"Send",store:"Store",stored:"Stored",width:"Width",height:"Height",min_width:"Min height",min_height:"Min width",top:"Top",left:"Left",ok:"ok",yes:"yes",no:"no",me:"me",login:"Login",password:"Password",server:"Server",online:"Online",method:"Method",polling:"Polling",binding:"Binding",register:"Register",httpbase:"HTTP base",login_title:"Connection parameters",roster_title:"Contact list",status_active:"Active",status_away:"Away",status_dnd:"Dnd",status_xa:"Xa",status_invisible:"Invisible",status_offline:"Offline",ac_title:"Add a contact",ac_msg:"Authorisation request sent",ac_tb:"new contact",ag_title:"Add a group",ag_msg:"new group",connecting:"Connecting",authorisation_request:"Authorisation request",authorisation_removed:"removed your authorisation",authorisation_refused:"refused your autorisation",notification:"Notification",popup_chat_with:"Chat with",popup_contact_info:"Contact details",popup_move_into_groups:"Move into group(s)",popup_remove:"Remove",popup_rename:"Rename",popup_reauthorize:"Reauthorize",cd_nick:"Nickname",cd_given:"Given",cd_family:"Family",cd_email:"Email",configuration_title:"Configuration",configuration_basic_tab:"Basic",configuration_advanced_tab:"Advanced",configuration_store:"Store",configuration_save_in_cookie:"Save in a cookie",conf_msg_general:"General",conf_msg_icon_theme:"Icon theme",conf_msg_emoticon_theme:"Emoticon theme",conf_msg_window_theme:"Window theme",conf_msg_logon_status:"Defines the status on logon",conf_msg_logon_status_msg:"Defines the message status on logon",conf_msg_away_timeout:"Time before being 'away'",conf_msg_chat_window:"Chat window",conf_msg_cascading_offset:"Offset between 2 opened windows",conf_msg_cascading_nb:"Number of cascaded windows",conf_msg_roster_window:"Roster window",conf_msg_login_window:"Login window",conf_msg_default_group_name:"Default group",conf_msg_history:"History (if server supports it)",conf_msg_set_archiving:"Set archiving mode",conf_msg_show_msg_recent:"Shows messages more recent",conf_msg_max_msg:"Max historic messages to display",conf_msg_blinking_delay:"Delays for blinking on incoming messages",conf_msg_blink_delay_chat_title:"Delay for chat window title blink",conf_msg_blink_delay_doc_title:"Delay for document title blink",conf_msg_blink_doc_title:"Ajaxbber",conf_msg_blink_delay_roster_title:"Delay for roster blink",conf_msg_config_window:"Configuration window",conf_msg_ac_window:"Adding contact window",conf_msg_blink_roster_contact_start_color:"Starting notification color in roster",conf_msg_blink_roster_contact_end_color:"Ending notification color in roster",conf_msg_chat_blinking:"Chat window notification",conf_msg_blink_chat_margin_left:"Starting left margin for contact name",conf_msg_blink_chat_end_margin_left:"Ending left margin for contact name",conf_msg_blink_chat_start_color:"Starting color",conf_msg_blink_chat_end_color:"Ending color"};
if(typeof (I18nApp)!="undefined"){var I18n=new I18nApp();I18n.setAppConfig({path:"./lang/",defaultLang:"en",usedLang:typeof (LANG)!="undefined"?LANG:"en",availableLanguages:["en","fr","cs"],showError:false})
}var _=function(A){return i18n_str[A]};if(typeof (Document)!="undefined"&&typeof (Document.prototype)!="undefined"&&window.DOMParser){Document.prototype.loadXML=function(B){var D=(new DOMParser()).parseFromString(B,"text/xml");
while(this.hasChildNodes()){this.removeChild(this.lastChild)}for(var A=0;A<D.childNodes.length;
A++){this.appendChild(this.importNode(D.childNodes[A],true))}}}var MooTools={version:"1.11"};
function $defined(A){return(A!=undefined)}function $type(B){if(!$defined(B)){return false
}if(B.htmlElement){return"element"}var A=typeof B;if(A=="object"&&B.nodeName){switch(B.nodeType){case 1:return"element";
case 3:return(/\S/).test(B.nodeValue)?"textnode":"whitespace"}}if(A=="object"||A=="function"){switch(B.constructor){case Array:return"array";
case RegExp:return"regexp";case Class:return"class"}if(typeof B.length=="number"){if(B.item){return"collection"
}if(B.callee){return"arguments"}}}return A}function $merge(){var E={};for(var D=0;
D<arguments.length;D++){for(var A in arguments[D]){if(A=="toJSONString"){continue
}var B=arguments[D][A];var F=E[A];if(F&&$type(B)=="object"&&$type(F)=="object"){E[A]=$merge(F,B)
}else{E[A]=B}}}return E}var $extend=function(){var B=arguments;if(!B[1]){B=[this,B[0]]
}for(var A in B[1]){if(A!="toJSONString"){B[0][A]=B[1][A]}}return B[0]};var $native=function(){for(var B=0,A=arguments.length;
B<A;B++){arguments[B].extend=function(D){for(var E in D){if(E=="toJSONString"){continue
}if(!this.prototype[E]){this.prototype[E]=D[E]}if(!this[E]){this[E]=$native.generic(E)
}}}}};$native.generic=function(A){return function(B){return this.prototype[A].apply(B,Array.prototype.slice.call(arguments,1))
}};$native(Function,Array,String,Number);function $chk(A){return !!(A||A===0)}function $pick(B,A){return $defined(B)?B:A
}function $random(B,A){return Math.floor(Math.random()*(A-B+1)+B)}function $time(){return new Date().getTime()
}function $clear(A){clearTimeout(A);clearInterval(A);return null}var Abstract=function(A){A=A||{};
A.extend=$extend;return A};var Window=new Abstract(window);var Document=new Abstract(document);
document.head=document.getElementsByTagName("head")[0];window.xpath=!!(document.evaluate);
if(window.ActiveXObject){window.ie=window[window.XMLHttpRequest?"ie7":"ie6"]=true
}else{if(document.childNodes&&!document.all&&!navigator.taintEnabled){window.webkit=window[window.xpath?"webkit420":"webkit419"]=true
}else{if(document.getBoxObjectFor!=null){window.gecko=true}}}window.khtml=window.webkit;
Object.extend=$extend;if(typeof HTMLElement=="undefined"){var HTMLElement=function(){};
if(window.webkit){document.createElement("iframe")}HTMLElement.prototype=(window.webkit)?window["[[DOMElement.prototype]]"]:{}
}HTMLElement.prototype.htmlElement=function(){};if(window.ie6){try{document.execCommand("BackgroundImageCache",false,true)
}catch(e){}}var Class=function(B){var A=function(){return(arguments[0]!==null&&this.initialize&&$type(this.initialize)=="function")?this.initialize.apply(this,arguments):this
};$extend(A,this);A.prototype=B;A.constructor=Class;return A};Class.empty=function(){};
Class.prototype={extend:function(D){var E=new this(null);for(var A in D){if(A=="toJSONString"){continue
}var B=E[A];E[A]=Class.Merge(B,D[A])}return new Class(E)},implement:function(){for(var B=0,A=arguments.length;
B<A;B++){$extend(this.prototype,arguments[B])}}};Class.Merge=function(A,E){if(A&&A!=E){var B=$type(E);
if(B!=$type(A)){return E}switch(B){case"function":var D=function(){this.parent=arguments.callee.parent;
return E.apply(this,arguments)};D.parent=A;return D;case"object":return $merge(A,E)
}}return E};var Chain=new Class({chain:function(A){this.chains=this.chains||[];this.chains.push(A);
return this},callChain:function(){if(this.chains&&this.chains.length){this.chains.shift().delay(10,this)
}},clearChain:function(){this.chains=[]}});var Events=new Class({addEvent:function(B,A){if(A!=Class.empty){this.$events=this.$events||{};
this.$events[B]=this.$events[B]||[];this.$events[B].include(A)}return this},fireEvent:function(D,B,A){if(this.$events&&this.$events[D]){this.$events[D].each(function(E){E.create({bind:this,delay:A,"arguments":B})()
},this)}return this},removeEvent:function(B,A){if(this.$events&&this.$events[B]){this.$events[B].remove(A)
}return this}});var Options=new Class({setOptions:function(){this.options=$merge.apply(null,[this.options].extend(arguments));
if(this.addEvent){for(var A in this.options){if(A=="toJSONString"){continue}if($type(this.options[A]=="function")&&(/^on[A-Z]/).test(A)){this.addEvent(A,this.options[A])
}}}return this}});Array.extend({forEach:function(D,E){for(var B=0,A=this.length;B<A;
B++){D.call(E,this[B],B,this)}},filter:function(E,F){var D=[];for(var B=0,A=this.length;
B<A;B++){if(E.call(F,this[B],B,this)){D.push(this[B])}}return D},map:function(E,F){var D=[];
for(var B=0,A=this.length;B<A;B++){D[B]=E.call(F,this[B],B,this)}return D},every:function(D,E){for(var B=0,A=this.length;
B<A;B++){if(!D.call(E,this[B],B,this)){return false}}return true},some:function(D,E){for(var B=0,A=this.length;
B<A;B++){if(D.call(E,this[B],B,this)){return true}}return false},indexOf:function(D,E){var A=this.length;
for(var B=(E<0)?Math.max(0,A+E):E||0;B<A;B++){if(this[B]===D){return B}}return -1
},copy:function(E,B){E=E||0;if(E<0){E=this.length+E}B=B||(this.length-E);var A=[];
for(var D=0;D<B;D++){A[D]=this[E++]}return A},remove:function(D){var B=0;var A=this.length;
while(B<A){if(this[B]===D){this.splice(B,1);A--}else{B++}}return this},contains:function(A,B){return this.indexOf(A,B)!=-1
},associate:function(D){var E={},A=Math.min(this.length,D.length);for(var B=0;B<A;
B++){E[D[B]]=this[B]}return E},extend:function(D){for(var B=0,A=D.length;B<A;B++){this.push(D[B])
}return this},merge:function(D){for(var B=0,A=D.length;B<A;B++){this.include(D[B])
}return this},include:function(A){if(!this.contains(A)){this.push(A)}return this},getRandom:function(){return this[$random(0,this.length-1)]||null
},getLast:function(){return this[this.length-1]||null}});Array.prototype.each=Array.prototype.forEach;
Array.each=Array.forEach;function $A(A){return Array.copy(A)}function $each(D,B,E){if(D&&typeof D.length=="number"&&$type(D)!="object"){Array.forEach(D,B,E)
}else{for(var A in D){if(A!="toJSONString"){B.call(E||D,D[A],A)}}}}Array.prototype.test=Array.prototype.contains;
String.extend({test:function(A,B){return(($type(A)=="string")?new RegExp(A,B):A).test(this)
},toInt:function(){return parseInt(this,10)},toFloat:function(){return parseFloat(this)
},camelCase:function(){return this.replace(/-\D/g,function(A){return A.charAt(1).toUpperCase()
})},hyphenate:function(){return this.replace(/\w[A-Z]/g,function(A){return(A.charAt(0)+"-"+A.charAt(1).toLowerCase())
})},capitalize:function(){return this.replace(/\b[a-z]/g,function(A){return A.toUpperCase()
})},trim:function(){return this.replace(/^\s+|\s+$/g,"")},clean:function(){return this.replace(/\s{2,}/g," ").trim()
},rgbToHex:function(B){var A=this.match(/\d{1,3}/g);return(A)?A.rgbToHex(B):false
},hexToRgb:function(B){var A=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(A)?A.slice(1).hexToRgb(B):false
},contains:function(A,B){return(B)?(B+this+B).indexOf(B+A+B)>-1:this.indexOf(A)>-1
},escapeRegExp:function(){return this.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")}});
Array.extend({rgbToHex:function(E){if(this.length<3){return false}if(this.length==4&&this[3]==0&&!E){return"transparent"
}var B=[];for(var A=0;A<3;A++){var D=(this[A]-0).toString(16);B.push((D.length==1)?"0"+D:D)
}return E?B:"#"+B.join("")},hexToRgb:function(D){if(this.length!=3){return false}var A=[];
for(var B=0;B<3;B++){A.push(parseInt((this[B].length==1)?this[B]+this[B]:this[B],16))
}return D?A:"rgb("+A.join(",")+")"}});Function.extend({create:function(A){var B=this;
A=$merge({bind:B,event:false,"arguments":null,delay:false,periodical:false,attempt:false},A);
if($chk(A.arguments)&&$type(A.arguments)!="array"){A.arguments=[A.arguments]}return function(F){var D;
if(A.event){F=F||window.event;D=[(A.event===true)?F:new A.event(F)];if(A.arguments){D.extend(A.arguments)
}}else{D=A.arguments||arguments}var G=function(){return B.apply($pick(A.bind,B),D)
};if(A.delay){return setTimeout(G,A.delay)}if(A.periodical){return setInterval(G,A.periodical)
}if(A.attempt){try{return G()}catch(E){return false}}return G()}},pass:function(A,B){return this.create({"arguments":A,bind:B})
},attempt:function(A,B){return this.create({"arguments":A,bind:B,attempt:true})()
},bind:function(B,A){return this.create({bind:B,"arguments":A})},bindAsEventListener:function(B,A){return this.create({bind:B,event:true,"arguments":A})
},delay:function(B,D,A){return this.create({delay:B,bind:D,"arguments":A})()},periodical:function(A,D,B){return this.create({periodical:A,bind:D,"arguments":B})()
}});Number.extend({toInt:function(){return parseInt(this)},toFloat:function(){return parseFloat(this)
},limit:function(B,A){return Math.min(A,Math.max(B,this))},round:function(A){A=Math.pow(10,A||0);
return Math.round(this*A)/A},times:function(B){for(var A=0;A<this;A++){B(A)}}});var Element=new Class({initialize:function(E,D){if($type(E)=="string"){if(window.ie&&D&&(D.name||D.type)){var A=(D.name)?' name="'+D.name+'"':"";
var B=(D.type)?' type="'+D.type+'"':"";delete D.name;delete D.type;E="<"+E+A+B+">"
}E=document.createElement(E)}E=$(E);return(!D||!E)?E:E.set(D)}});var Elements=new Class({initialize:function(A){return(A)?$extend(A,this):this
}});Elements.extend=function(A){for(var B in A){if(B=="toJSONString"){continue}this.prototype[B]=A[B];
this[B]=$native.generic(B)}};function $(B){if(!B){return null}if(B.htmlElement){return Garbage.collect(B)
}if([window,document].contains(B)){return B}var A=$type(B);if(A=="string"){B=document.getElementById(B);
A=(B)?"element":false}if(A!="element"){return null}if(B.htmlElement){return Garbage.collect(B)
}if(["object","embed"].contains(B.tagName.toLowerCase())){return B}$extend(B,Element.prototype);
B.htmlElement=function(){};return Garbage.collect(B)}document.getElementsBySelector=document.getElementsByTagName;
function $$(){var B=[];for(var E=0,D=arguments.length;E<D;E++){var A=arguments[E];
switch($type(A)){case"element":B.push(A);case"boolean":break;case false:break;case"string":A=document.getElementsBySelector(A,true);
default:B.extend(A)}}return $$.unique(B)}$$.unique=function(H){var A=[];for(var E=0,B=H.length;
E<B;E++){if(H[E].$included){continue}var D=$(H[E]);if(D&&!D.$included){D.$included=true;
A.push(D)}}for(var G=0,F=A.length;G<F;G++){A[G].$included=null}return new Elements(A)
};Elements.Multi=function(A){return function(){var F=arguments;var D=[];var B=true;
for(var G=0,E=this.length,H;G<E;G++){H=this[G][A].apply(this[G],F);if($type(H)!="element"){B=false
}D.push(H)}return(B)?$$.unique(D):D}};Element.extend=function(B){for(var A in B){if(A=="toJSONString"){continue
}HTMLElement.prototype[A]=B[A];Element.prototype[A]=B[A];Element[A]=$native.generic(A);
var D=(Array.prototype[A])?A+"Elements":A;Elements.prototype[D]=Elements.Multi(A)
}};Element.extend({set:function(A){for(var D in A){if(D=="toJSONString"){continue
}var B=A[D];switch(D){case"styles":this.setStyles(B);break;case"events":if(this.addEvents){this.addEvents(B)
}break;case"properties":this.setProperties(B);break;default:this.setProperty(D,B)
}}return this},inject:function(D,A){D=$(D);switch(A){case"before":D.parentNode.insertBefore(this,D);
break;case"after":var B=D.getNext();if(!B){D.parentNode.appendChild(this)}else{D.parentNode.insertBefore(this,B)
}break;case"top":var E=D.firstChild;if(E){D.insertBefore(this,E);break}default:D.appendChild(this)
}return this},injectBefore:function(A){return this.inject(A,"before")},injectAfter:function(A){return this.inject(A,"after")
},injectInside:function(A){return this.inject(A,"bottom")},injectTop:function(A){return this.inject(A,"top")
},adopt:function(){var A=[];$each(arguments,function(B){A=A.concat(B)});$$(A).inject(this);
return this},remove:function(){return this.parentNode.removeChild(this)},clone:function(A){var D=$(this.cloneNode(A!==false));
if(!D.$events){return D}D.$events={};for(var B in this.$events){if(B!="toJSONString"){D.$events[B]={keys:$A(this.$events[B].keys),values:$A(this.$events[B].values)}
}}return D.removeEvents()},replaceWith:function(A){A=$(A);this.parentNode.replaceChild(A,this);
return A},appendText:function(A){this.appendChild(document.createTextNode(A));return this
},hasClass:function(A){return this.className.contains(A," ")},addClass:function(A){if(!this.hasClass(A)){this.className=(this.className+" "+A).clean()
}return this},removeClass:function(A){this.className=this.className.replace(new RegExp("(^|\\s)"+A+"(?:\\s|$)"),"$1").clean();
return this},toggleClass:function(A){return this.hasClass(A)?this.removeClass(A):this.addClass(A)
},setStyle:function(A,B){switch(A){case"opacity":return this.setOpacity(parseFloat(B));
case"float":A=(window.ie)?"styleFloat":"cssFloat"}A=A.camelCase();switch($type(B)){case"number":if(!["zIndex","zoom"].contains(A)){B+="px"
}break;case"array":B="rgb("+B.join(",")+")"}this.style[A]=B;return this},setStyles:function(A){switch($type(A)){case"object":Element.setMany(this,"setStyle",A);
break;case"string":this.style.cssText=A}return this},setOpacity:function(A){if(A==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"
}}else{if(this.style.visibility!="visible"){this.style.visibility="visible"}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1
}if(window.ie){this.style.filter=(A==1)?"":"alpha(opacity="+A*100+")"}this.style.opacity=this.$tmp.opacity=A;
return this},getStyle:function(A){A=A.camelCase();var D=this.style[A];if(!$chk(D)){if(A=="opacity"){return this.$tmp.opacity
}D=[];for(var B in Element.Styles){if(B=="toJSONString"){continue}if(A==B){Element.Styles[B].each(function(G){var F=this.getStyle(G);
D.push(parseInt(F)?F:"0px")},this);if(A=="border"){var E=D.every(function(F){return(F==D[0])
});return(E)?D[0]:false}return D.join(" ")}}if(A.contains("border")){if(Element.Styles.border.contains(A)){return["Width","Style","Color"].map(function(F){return this.getStyle(A+F)
},this).join(" ")}else{if(Element.borderShort.contains(A)){return["Top","Right","Bottom","Left"].map(function(F){return this.getStyle("border"+F+A.replace("border",""))
},this).join(" ")}}}if(document.defaultView){D=document.defaultView.getComputedStyle(this,null).getPropertyValue(A.hyphenate())
}else{if(this.currentStyle){D=this.currentStyle[A]}}}if(window.ie){D=Element.fixStyle(A,D,this)
}if(D&&A.test(/color/i)&&D.contains("rgb")){return D.split("rgb").splice(1,4).map(function(F){return F.rgbToHex()
}).join(" ")}return D},getStyles:function(){return Element.getMany(this,"getStyle",arguments)
},walk:function(A,D){A+="Sibling";var B=(D)?this[D]:this[A];while(B&&$type(B)!="element"){B=B[A]
}return $(B)},getPrevious:function(){return this.walk("previous")},getNext:function(){return this.walk("next")
},getFirst:function(){return this.walk("next","firstChild")},getLast:function(){return this.walk("previous","lastChild")
},getParent:function(){return $(this.parentNode)},getChildren:function(){return $$(this.childNodes)
},hasChild:function(A){return !!$A(this.getElementsByTagName("*")).contains(A)},getProperty:function(A){var D=Element.Properties[A];
if(D){return this[D]}var B=Element.PropertiesIFlag[A]||0;if(!window.ie||B){return this.getAttribute(A,B)
}var E=this.attributes[A];return(E)?E.nodeValue:null},removeProperty:function(A){var B=Element.Properties[A];
if(B){this[B]=""}else{this.removeAttribute(A)}return this},getProperties:function(){return Element.getMany(this,"getProperty",arguments)
},setProperty:function(A,D){var B=Element.Properties[A];if(B){this[B]=D}else{this.setAttribute(A,D)
}return this},setProperties:function(A){return Element.setMany(this,"setProperty",A)
},setHTML:function(){this.innerHTML=$A(arguments).join("");return this},setText:function(B){var A=this.getTag();
if(["style","script"].contains(A)){if(window.ie){if(A=="style"){this.styleSheet.cssText=B
}else{if(A=="script"){this.setProperty("text",B)}}return this}else{this.removeChild(this.firstChild);
return this.appendText(B)}}this[$defined(this.innerText)?"innerText":"textContent"]=B;
return this},getText:function(){var A=this.getTag();if(["style","script"].contains(A)){if(window.ie){if(A=="style"){return this.styleSheet.cssText
}else{if(A=="script"){return this.getProperty("text")}}}else{return this.innerHTML
}}return($pick(this.innerText,this.textContent))},getTag:function(){return this.tagName.toLowerCase()
},empty:function(){Garbage.trash(this.getElementsByTagName("*"));return this.setHTML("")
}});Element.fixStyle=function(A,F,B){if($chk(parseInt(F))){return F}if(["height","width"].contains(A)){var E=(A=="width")?["left","right"]:["top","bottom"];
var D=0;E.each(function(G){D+=B.getStyle("border-"+G+"-width").toInt()+B.getStyle("padding-"+G).toInt()
});return B["offset"+A.capitalize()]-D+"px"}else{if(A.test(/border(.+)Width|margin|padding/)){return"0px"
}}return F};Element.Styles={border:[],padding:[],margin:[]};["Top","Right","Bottom","Left"].each(function(B){for(var A in Element.Styles){if(A!="toJSONString"){Element.Styles[A].push(A+B)
}}});Element.borderShort=["borderWidth","borderStyle","borderColor"];Element.getMany=function(A,E,B){var D={};
$each(B,function(F){D[F]=A[E](F)});return D};Element.setMany=function(B,E,D){for(var A in D){if(A!="toJSONString"){B[E](A,D[A])
}}return B};Element.Properties=new Abstract({"class":"className","for":"htmlFor",colspan:"colSpan",rowspan:"rowSpan",accesskey:"accessKey",tabindex:"tabIndex",maxlength:"maxLength",readonly:"readOnly",frameborder:"frameBorder",value:"value",disabled:"disabled",checked:"checked",multiple:"multiple",selected:"selected"});
Element.PropertiesIFlag={href:2,src:2};Element.Methods={Listeners:{addListener:function(B,A){if(this.addEventListener){this.addEventListener(B,A,false)
}else{this.attachEvent("on"+B,A)}return this},removeListener:function(B,A){if(this.removeEventListener){this.removeEventListener(B,A,false)
}else{this.detachEvent("on"+B,A)}return this}}};window.extend(Element.Methods.Listeners);
document.extend(Element.Methods.Listeners);Element.extend(Element.Methods.Listeners);
var Garbage={elements:[],collect:function(A){if(!A.$tmp){Garbage.elements.push(A);
A.$tmp={opacity:1}}return A},trash:function(A){for(var D=0,B=A.length,E;D<B;D++){if(!(E=A[D])||!E.$tmp){continue
}if(E.$events){E.fireEvent("trash").removeEvents()}for(var F in E.$tmp){if(F!="toJSONString"){E.$tmp[F]=null
}}for(var G in Element.prototype){if(G!="toJSONString"){E[G]=null}}Garbage.elements[Garbage.elements.indexOf(E)]=null;
E.htmlElement=E.$tmp=E=null}Garbage.elements.remove(null)},empty:function(){Garbage.collect(window);
Garbage.collect(document);Garbage.trash(Garbage.elements)}};window.addListener("beforeunload",function(){window.addListener("unload",Garbage.empty);
if(window.ie){window.addListener("unload",CollectGarbage)}});var Event=new Class({initialize:function(D){if(D&&D.$extended){return D
}this.$extended=true;D=D||window.event;this.event=D;this.type=D.type;this.target=D.target||D.srcElement;
if(this.target.nodeType==3){this.target=this.target.parentNode}this.shift=D.shiftKey;
this.control=D.ctrlKey;this.alt=D.altKey;this.meta=D.metaKey;if(["DOMMouseScroll","mousewheel"].contains(this.type)){this.wheel=(D.wheelDelta)?D.wheelDelta/120:-(D.detail||0)/3
}else{if(this.type.contains("key")){this.code=D.which||D.keyCode;for(var B in Event.keys){if(B=="toJSONString"){continue
}if(Event.keys[B]==this.code){this.key=B;break}}if(this.type=="keydown"){var A=this.code-111;
if(A>0&&A<13){this.key="f"+A}}this.key=this.key||String.fromCharCode(this.code).toLowerCase()
}else{if(this.type.test(/(click|mouse|menu)/)){this.page={x:D.pageX||D.clientX+document.documentElement.scrollLeft,y:D.pageY||D.clientY+document.documentElement.scrollTop};
this.client={x:D.pageX?D.pageX-window.pageXOffset:D.clientX,y:D.pageY?D.pageY-window.pageYOffset:D.clientY};
this.rightClick=(D.which==3)||(D.button==2);switch(this.type){case"mouseover":this.relatedTarget=D.relatedTarget||D.fromElement;
break;case"mouseout":this.relatedTarget=D.relatedTarget||D.toElement}this.fixRelatedTarget()
}}}return this},stop:function(){return this.stopPropagation().preventDefault()},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation()
}else{this.event.cancelBubble=true}return this},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault()
}else{this.event.returnValue=false}return this}});Event.fix={relatedTarget:function(){if(this.relatedTarget&&this.relatedTarget.nodeType==3){this.relatedTarget=this.relatedTarget.parentNode
}},relatedTargetGecko:function(){try{Event.fix.relatedTarget.call(this)}catch(A){this.relatedTarget=this.target
}}};Event.prototype.fixRelatedTarget=(window.gecko)?Event.fix.relatedTargetGecko:Event.fix.relatedTarget;
Event.keys=new Abstract({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});
Element.Methods.Events={addEvent:function(E,D){this.$events=this.$events||{};this.$events[E]=this.$events[E]||{keys:[],values:[]};
if(this.$events[E].keys.contains(D)){return this}this.$events[E].keys.push(D);var B=E;
var A=Element.Events[E];if(A){if(A.add){A.add.call(this,D)}if(A.map){D=A.map}if(A.type){B=A.type
}}if(!this.addEventListener){D=D.create({bind:this,event:true})}this.$events[E].values.push(D);
return(Element.NativeEvents.contains(B))?this.addListener(B,D):this},removeEvent:function(E,D){if(!this.$events||!this.$events[E]){return this
}var G=this.$events[E].keys.indexOf(D);if(G==-1){return this}var B=this.$events[E].keys.splice(G,1)[0];
var F=this.$events[E].values.splice(G,1)[0];var A=Element.Events[E];if(A){if(A.remove){A.remove.call(this,D)
}if(A.type){E=A.type}}return(Element.NativeEvents.contains(E))?this.removeListener(E,F):this
},addEvents:function(A){return Element.setMany(this,"addEvent",A)},removeEvents:function(B){if(!this.$events){return this
}if(!B){for(var A in this.$events){if(A!="toJSONString"){this.removeEvents(A)}}this.$events=null
}else{if(this.$events[B]){this.$events[B].keys.each(function(D){this.removeEvent(B,D)
},this);this.$events[B]=null}}return this},fireEvent:function(D,B,A){if(this.$events&&this.$events[D]){this.$events[D].keys.each(function(E){E.create({bind:this,delay:A,"arguments":B})()
},this)}return this},cloneEvents:function(D,B){if(!D.$events){return this}if(!B){for(var A in D.$events){if(A!="toJSONString"){this.cloneEvents(D,A)
}}}else{if(D.$events[B]){D.$events[B].keys.each(function(E){this.addEvent(B,E)},this)
}}return this}};window.extend(Element.Methods.Events);document.extend(Element.Methods.Events);
Element.extend(Element.Methods.Events);Element.Events=new Abstract({mouseenter:{type:"mouseover",map:function(A){A=new Event(A);
if(A.relatedTarget!=this&&!this.hasChild(A.relatedTarget)){this.fireEvent("mouseenter",A)
}}},mouseleave:{type:"mouseout",map:function(A){A=new Event(A);if(A.relatedTarget!=this&&!this.hasChild(A.relatedTarget)){this.fireEvent("mouseleave",A)
}}},mousewheel:{type:(window.gecko)?"DOMMouseScroll":"mousewheel"}});Element.NativeEvents=["click","dblclick","mouseup","mousedown","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","keydown","keypress","keyup","load","unload","beforeunload","resize","move","focus","blur","change","submit","reset","select","error","abort","contextmenu","scroll"];
Function.extend({bindWithEvent:function(B,A){return this.create({bind:B,"arguments":A,event:Event})
}});Elements.extend({filterByTag:function(A){return new Elements(this.filter(function(B){return(Element.getTag(B)==A)
}))},filterByClass:function(B,D){var A=this.filter(function(E){return(E.className&&E.className.contains(B," "))
});return(D)?A:new Elements(A)},filterById:function(D,B){var A=this.filter(function(E){return(E.id==D)
});return(B)?A:new Elements(A)},filterByAttribute:function(B,D,E,F){var A=this.filter(function(G){var H=Element.getProperty(G,B);
if(!H){return false}if(!D){return true}switch(D){case"=":return(H==E);case"*=":return(H.contains(E));
case"^=":return(H.substr(0,E.length)==E);case"$=":return(H.substr(H.length-E.length)==E);
case"!=":return(H!=E);case"~=":return H.contains(E," ")}return false});return(F)?A:new Elements(A)
}});function $E(A,B){return($(B)||document).getElement(A)}function $ES(A,B){return($(B)||document).getElementsBySelector(A)
}$$.shared={regexp:/^(\w*|\*)(?:#([\w-]+)|\.([\w-]+))?(?:\[(\w+)(?:([!*^$]?=)["']?([^"'\]]*)["']?)?])?$/,xpath:{getParam:function(B,E,F,D){var A=[E.namespaceURI?"xhtml:":"",F[1]];
if(F[2]){A.push('[@id="',F[2],'"]')}if(F[3]){A.push('[contains(concat(" ", @class, " "), " ',F[3],' ")]')
}if(F[4]){if(F[5]&&F[6]){switch(F[5]){case"*=":A.push("[contains(@",F[4],', "',F[6],'")]');
break;case"^=":A.push("[starts-with(@",F[4],', "',F[6],'")]');break;case"$=":A.push("[substring(@",F[4],", string-length(@",F[4],") - ",F[6].length,' + 1) = "',F[6],'"]');
break;case"=":A.push("[@",F[4],'="',F[6],'"]');break;case"!=":A.push("[@",F[4],'!="',F[6],'"]')
}}else{A.push("[@",F[4],"]")}}B.push(A.join(""));return B},getItems:function(D,G,H){var A=[];
var B=document.evaluate(".//"+D.join("//"),G,$$.shared.resolver,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
for(var F=0,E=B.snapshotLength;F<E;F++){A.push(B.snapshotItem(F))}return(H)?A:new Elements(A.map($))
}},normal:{getParam:function(A,D,F,B){if(B==0){if(F[2]){var E=D.getElementById(F[2]);
if(!E||((F[1]!="*")&&(Element.getTag(E)!=F[1]))){return false}A=[E]}else{A=$A(D.getElementsByTagName(F[1]))
}}else{A=$$.shared.getElementsByTagName(A,F[1]);if(F[2]){A=Elements.filterById(A,F[2],true)
}}if(F[3]){A=Elements.filterByClass(A,F[3],true)}if(F[4]){A=Elements.filterByAttribute(A,F[4],F[5],F[6],true)
}return A},getItems:function(A,B,D){return(D)?A:$$.unique(A)}},resolver:function(A){return(A=="xhtml")?"http://www.w3.org/1999/xhtml":false
},getElementsByTagName:function(E,B){var F=[];for(var D=0,A=E.length;D<A;D++){F.extend(E[D].getElementsByTagName(B))
}return F}};$$.shared.method=(window.xpath)?"xpath":"normal";Element.Methods.Dom={getElements:function(A,I){var D=[];
A=A.trim().split(" ");for(var F=0,E=A.length;F<E;F++){var G=A[F];var H=G.match($$.shared.regexp);
if(!H){break}H[1]=H[1]||"*";var B=$$.shared[$$.shared.method].getParam(D,this,H,F);
if(!B){break}D=B}return $$.shared[$$.shared.method].getItems(D,this,I)},getElement:function(A){return $(this.getElements(A,true)[0]||false)
},getElementsBySelector:function(B,F){var A=[];B=B.split(",");for(var E=0,D=B.length;
E<D;E++){A=A.concat(this.getElements(B[E],true))}return(F)?A:$$.unique(A)}};Element.extend({getElementById:function(D){var B=document.getElementById(D);
if(!B){return false}for(var A=B.parentNode;A!=this;A=A.parentNode){if(!A){return false
}}return B},getElementsByClassName:function(A){return this.getElements("."+A)}});
document.extend(Element.Methods.Dom);Element.extend(Element.Methods.Dom);Element.extend({getValue:function(){switch(this.getTag()){case"select":var A=[];
$each(this.options,function(B){if(B.selected){A.push($pick(B.value,B.text))}});return(this.multiple)?A:A[0];
case"input":if(!(this.checked&&["checkbox","radio"].contains(this.type))&&!["hidden","text","password"].contains(this.type)){break
}case"textarea":return this.value}return false},getFormElements:function(){return $$(this.getElementsByTagName("input"),this.getElementsByTagName("select"),this.getElementsByTagName("textarea"))
},toQueryString:function(){var A=[];this.getFormElements().each(function(E){var D=E.name;
var F=E.getValue();if(F===false||!D||E.disabled){return }var B=function(G){A.push(D+"="+encodeURIComponent(G))
};if($type(F)=="array"){F.each(B)}else{B(F)}});return A.join("&")}});Element.extend({scrollTo:function(A,B){this.scrollLeft=A;
this.scrollTop=B},getSize:function(){return{scroll:{x:this.scrollLeft,y:this.scrollTop},size:{x:this.offsetWidth,y:this.offsetHeight},scrollSize:{x:this.scrollWidth,y:this.scrollHeight}}
},getPosition:function(B){B=B||[];var A=this,E=0,D=0;do{E+=A.offsetLeft||0;D+=A.offsetTop||0;
A=A.offsetParent}while(A);B.each(function(F){E-=F.scrollLeft||0;D-=F.scrollTop||0
});return{x:E,y:D}},getTop:function(A){return this.getPosition(A).y},getLeft:function(A){return this.getPosition(A).x
},getCoordinates:function(B){var A=this.getPosition(B);var D={width:this.offsetWidth,height:this.offsetHeight,left:A.x,top:A.y};
D.right=D.left+D.width;D.bottom=D.top+D.height;return D}});Element.Events.domready={add:function(B){if(window.loaded){B.call(this);
return }var A=function(){if(window.loaded){return }window.loaded=true;window.timer=$clear(window.timer);
this.fireEvent("domready")}.bind(this);if(document.readyState&&window.webkit){window.timer=function(){if(["loaded","complete"].contains(document.readyState)){A()
}}.periodical(50)}else{if(document.readyState&&window.ie){if(!$("ie_ready")){var D=(window.location.protocol=="https:")?"://0":"javascript:void(0)";
document.write('<script id="ie_ready" defer src="'+D+'"><\/script>');$("ie_ready").onreadystatechange=function(){if(this.readyState=="complete"){A()
}}}}else{window.addListener("load",A);document.addListener("DOMContentLoaded",A)}}}};
window.onDomReady=function(A){return this.addEvent("domready",A)};window.extend({getWidth:function(){if(this.webkit419){return this.innerWidth
}if(this.opera){return document.body.clientWidth}return document.documentElement.clientWidth
},getHeight:function(){if(this.webkit419){return this.innerHeight}if(this.opera){return document.body.clientHeight
}return document.documentElement.clientHeight},getScrollWidth:function(){if(this.ie){return Math.max(document.documentElement.offsetWidth,document.documentElement.scrollWidth)
}if(this.webkit){return document.body.scrollWidth}return document.documentElement.scrollWidth
},getScrollHeight:function(){if(this.ie){return Math.max(document.documentElement.offsetHeight,document.documentElement.scrollHeight)
}if(this.webkit){return document.body.scrollHeight}return document.documentElement.scrollHeight
},getScrollLeft:function(){return this.pageXOffset||document.documentElement.scrollLeft
},getScrollTop:function(){return this.pageYOffset||document.documentElement.scrollTop
},getSize:function(){return{size:{x:this.getWidth(),y:this.getHeight()},scrollSize:{x:this.getScrollWidth(),y:this.getScrollHeight()},scroll:{x:this.getScrollLeft(),y:this.getScrollTop()}}
},getPosition:function(){return{x:0,y:0}}});var Fx={};Fx.Base=new Class({options:{onStart:Class.empty,onComplete:Class.empty,onCancel:Class.empty,transition:function(A){return -(Math.cos(Math.PI*A)-1)/2
},duration:500,unit:"px",wait:true,fps:50},initialize:function(A){this.element=this.element||null;
this.setOptions(A);if(this.options.initialize){this.options.initialize.call(this)
}},step:function(){var A=$time();if(A<this.time+this.options.duration){this.delta=this.options.transition((A-this.time)/this.options.duration);
this.setNow();this.increase()}else{this.stop(true);this.set(this.to);this.fireEvent("onComplete",this.element,10);
this.callChain()}},set:function(A){this.now=A;this.increase();return this},setNow:function(){this.now=this.compute(this.from,this.to)
},compute:function(B,A){return(A-B)*this.delta+B},start:function(B,A){if(!this.options.wait){this.stop()
}else{if(this.timer){return this}}this.from=B;this.to=A;this.change=this.to-this.from;
this.time=$time();this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);
this.fireEvent("onStart",this.element);return this},stop:function(A){if(!this.timer){return this
}this.timer=$clear(this.timer);if(!A){this.fireEvent("onCancel",this.element)}return this
},custom:function(B,A){return this.start(B,A)},clearTimer:function(A){return this.stop(A)
}});Fx.Base.implement(new Chain,new Events,new Options);Fx.CSS={select:function(A,D){if(A.test(/color/i)){return this.Color
}var B=$type(D);if((B=="array")||(B=="string"&&D.contains(" "))){return this.Multi
}return this.Single},parse:function(E,A,D){if(!D.push){D=[D]}var G=D[0],F=D[1];if(!$chk(F)){F=G;
G=E.getStyle(A)}var B=this.select(A,F);return{from:B.parse(G),to:B.parse(F),css:B}
}};Fx.CSS.Single={parse:function(A){return parseFloat(A)},getNow:function(D,B,A){return A.compute(D,B)
},getValue:function(D,B,A){if(B=="px"&&A!="opacity"){D=Math.round(D)}return D+B}};
Fx.CSS.Multi={parse:function(A){return A.push?A:A.split(" ").map(function(B){return parseFloat(B)
})},getNow:function(F,E,D){var A=[];for(var B=0;B<F.length;B++){A[B]=D.compute(F[B],E[B])
}return A},getValue:function(D,B,A){if(B=="px"&&A!="opacity"){D=D.map(Math.round)
}return D.join(B+" ")+B}};Fx.CSS.Color={parse:function(A){return A.push?A:A.hexToRgb(true)
},getNow:function(F,E,D){var A=[];for(var B=0;B<F.length;B++){A[B]=Math.round(D.compute(F[B],E[B]))
}return A},getValue:function(A){return"rgb("+A.join(",")+")"}};Fx.Style=Fx.Base.extend({initialize:function(D,A,B){this.element=$(D);
this.property=A;this.parent(B)},hide:function(){return this.set(0)},setNow:function(){this.now=this.css.getNow(this.from,this.to,this)
},set:function(A){this.css=Fx.CSS.select(this.property,A);return this.parent(this.css.parse(A))
},start:function(D,B){if(this.timer&&this.options.wait){return this}var A=Fx.CSS.parse(this.element,this.property,[D,B]);
this.css=A.css;return this.parent(A.from,A.to)},increase:function(){this.element.setStyle(this.property,this.css.getValue(this.now,this.options.unit,this.property))
}});Element.extend({effect:function(A,B){return new Fx.Style(this,A,B)}});Fx.Styles=Fx.Base.extend({initialize:function(B,A){this.element=$(B);
this.parent(A)},setNow:function(){for(var A in this.from){if(A!="toJSONString"){this.now[A]=this.css[A].getNow(this.from[A],this.to[A],this)
}}},set:function(D){var A={};this.css={};for(var B in D){if(B=="toJSONString"){continue
}this.css[B]=Fx.CSS.select(B,D[B]);A[B]=this.css[B].parse(D[B])}return this.parent(A)
},start:function(D){if(this.timer&&this.options.wait){return this}this.now={};this.css={};
var F={},E={};for(var B in D){if(B=="toJSONString"){continue}var A=Fx.CSS.parse(this.element,B,D[B]);
F[B]=A.from;E[B]=A.to;this.css[B]=A.css}return this.parent(F,E)},increase:function(){for(var A in this.now){if(A!="toJSONString"){this.element.setStyle(A,this.css[A].getValue(this.now[A],this.options.unit,A))
}}}});Element.extend({effects:function(A){return new Fx.Styles(this,A)}});Fx.Elements=Fx.Base.extend({initialize:function(A,B){this.elements=$$(A);
this.parent(B)},setNow:function(){for(var D in this.from){if(D=="toJSONString"){continue
}var G=this.from[D],F=this.to[D],B=this.css[D],A=this.now[D]={};for(var E in G){if(E!="toJSONString"){A[E]=B[E].getNow(G[E],F[E],this)
}}}},set:function(H){var E={};this.css={};for(var D in H){if(D=="toJSONString"){continue
}var G=H[D],B=this.css[D]={},A=E[D]={};for(var F in G){if(F=="toJSONString"){continue
}B[F]=Fx.CSS.select(F,G[F]);A[F]=B[F].parse(G[F])}}return this.parent(E)},start:function(H){if(this.timer&&this.options.wait){return this
}this.now={};this.css={};var K={},J={};for(var G in H){if(G=="toJSONString"){continue
}var B=H[G],D=K[G]={},I=J[G]={},F=this.css[G]={};for(var E in B){if(E=="toJSONString"){continue
}var A=Fx.CSS.parse(this.elements[G],E,B[E]);D[E]=A.from;I[E]=A.to;F[E]=A.css}}return this.parent(K,J)
},increase:function(){for(var D in this.now){if(D=="toJSONString"){continue}var A=this.now[D],B=this.css[D];
for(var E in A){if(E!="toJSONString"){this.elements[D].setStyle(E,B[E].getValue(A[E],this.options.unit,E))
}}}}});Fx.Scroll=Fx.Base.extend({options:{overflown:[],offset:{x:0,y:0},wheelStops:true},initialize:function(A,B){this.now=[];
this.element=$(A);this.bound={stop:this.stop.bind(this,false)};this.parent(B);if(this.options.wheelStops){this.addEvent("onStart",function(){document.addEvent("mousewheel",this.bound.stop)
}.bind(this));this.addEvent("onComplete",function(){document.removeEvent("mousewheel",this.bound.stop)
}.bind(this))}},setNow:function(){for(var A=0;A<2;A++){this.now[A]=this.compute(this.from[A],this.to[A])
}},scrollTo:function(B,G){if(this.timer&&this.options.wait){return this}var E=this.element.getSize();
var D={x:B,y:G};for(var F in E.size){if(F=="toJSONString"){continue}var A=E.scrollSize[F]-E.size[F];
if($chk(D[F])){D[F]=($type(D[F])=="number")?D[F].limit(0,A):A}else{D[F]=E.scroll[F]
}D[F]+=this.options.offset[F]}return this.start([E.scroll.x,E.scroll.y],[D.x,D.y])
},toTop:function(){return this.scrollTo(false,0)},toBottom:function(){return this.scrollTo(false,"full")
},toLeft:function(){return this.scrollTo(0,false)},toRight:function(){return this.scrollTo("full",false)
},toElement:function(B){var A=this.element.getPosition(this.options.overflown);var D=$(B).getPosition(this.options.overflown);
return this.scrollTo(D.x-A.x,D.y-A.y)},increase:function(){this.element.scrollTo(this.now[0],this.now[1])
}});Fx.Slide=Fx.Base.extend({options:{mode:"vertical"},initialize:function(B,A){this.element=$(B);
this.wrapper=new Element("div",{styles:$extend(this.element.getStyles("margin"),{overflow:"hidden"})}).injectAfter(this.element).adopt(this.element);
this.element.setStyle("margin",0);this.setOptions(A);this.now=[];this.parent(this.options);
this.open=true;this.addEvent("onComplete",function(){this.open=(this.now[0]===0)});
if(window.webkit419){this.addEvent("onComplete",function(){if(this.open){this.element.remove().inject(this.wrapper)
}})}},setNow:function(){for(var A=0;A<2;A++){this.now[A]=this.compute(this.from[A],this.to[A])
}},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight
},horizontal:function(){this.margin="margin-left";this.layout="width";this.offset=this.element.offsetWidth
},slideIn:function(A){this[A||this.options.mode]();return this.start([this.element.getStyle(this.margin).toInt(),this.wrapper.getStyle(this.layout).toInt()],[0,this.offset])
},slideOut:function(A){this[A||this.options.mode]();return this.start([this.element.getStyle(this.margin).toInt(),this.wrapper.getStyle(this.layout).toInt()],[-this.offset,0])
},hide:function(A){this[A||this.options.mode]();this.open=false;return this.set([-this.offset,0])
},show:function(A){this[A||this.options.mode]();this.open=true;return this.set([0,this.offset])
},toggle:function(A){if(this.wrapper.offsetHeight==0||this.wrapper.offsetWidth==0){return this.slideIn(A)
}return this.slideOut(A)},increase:function(){this.element.setStyle(this.margin,this.now[0]+this.options.unit);
this.wrapper.setStyle(this.layout,this.now[1]+this.options.unit)}});Fx.Transition=function(B,A){A=A||[];
if($type(A)!="array"){A=[A]}return $extend(B,{easeIn:function(D){return B(D,A)},easeOut:function(D){return 1-B(1-D,A)
},easeInOut:function(D){return(D<=0.5)?B(2*D,A)/2:(2-B(2*(1-D),A))/2}})};Fx.Transitions=new Abstract({linear:function(A){return A
}});Fx.Transitions.extend=function(B){for(var A in B){if(A=="toJSONString"){continue
}Fx.Transitions[A]=new Fx.Transition(B[A]);Fx.Transitions.compat(A)}};Fx.Transitions.compat=function(A){["In","Out","InOut"].each(function(B){Fx.Transitions[A.toLowerCase()+B]=Fx.Transitions[A]["ease"+B]
})};Fx.Transitions.extend({Pow:function(B,A){return Math.pow(B,A[0]||6)},Expo:function(A){return Math.pow(2,8*(A-1))
},Circ:function(A){return 1-Math.sin(Math.acos(A))},Sine:function(A){return 1-Math.sin((1-A)*Math.PI/2)
},Back:function(B,A){A=A[0]||1.618;return Math.pow(B,2)*((A+1)*B-A)},Bounce:function(E){var D;
for(var B=0,A=1;1;B+=A,A/=2){if(E>=(7-4*B)/11){D=-Math.pow((11-6*B-11*E)/4,2)+A*A;
break}}return D},Elastic:function(B,A){return Math.pow(2,10*--B)*Math.cos(20*B*Math.PI*(A[0]||1)/3)
}});["Quad","Cubic","Quart","Quint"].each(function(B,A){Fx.Transitions[B]=new Fx.Transition(function(D){return Math.pow(D,[A+2])
});Fx.Transitions.compat(B)});var Drag={};Drag.Base=new Class({options:{handle:false,unit:"px",onStart:Class.empty,onBeforeStart:Class.empty,onComplete:Class.empty,onSnap:Class.empty,onDrag:Class.empty,limit:false,modifiers:{x:"left",y:"top"},grid:false,snap:6},initialize:function(B,A){this.setOptions(A);
this.element=$(B);this.handle=$(this.options.handle)||this.element;this.mouse={now:{},pos:{}};
this.value={start:{},now:{}};this.bound={start:this.start.bindWithEvent(this),check:this.check.bindWithEvent(this),drag:this.drag.bindWithEvent(this),stop:this.stop.bind(this)};
this.attach();if(this.options.initialize){this.options.initialize.call(this)}},attach:function(){this.handle.addEvent("mousedown",this.bound.start);
return this},detach:function(){this.handle.removeEvent("mousedown",this.bound.start);
return this},start:function(D){this.fireEvent("onBeforeStart",this.element);this.mouse.start=D.page;
var A=this.options.limit;this.limit={x:[],y:[]};for(var E in this.options.modifiers){if(E=="toJSONString"){continue
}if(!this.options.modifiers[E]){continue}this.value.now[E]=this.element.getStyle(this.options.modifiers[E]).toInt();
this.mouse.pos[E]=D.page[E]-this.value.now[E];if(A&&A[E]){for(var B=0;B<2;B++){if($chk(A[E][B])){this.limit[E][B]=($type(A[E][B])=="function")?A[E][B]():A[E][B]
}}}}if($type(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid}
}document.addListener("mousemove",this.bound.check);document.addListener("mouseup",this.bound.stop);
this.fireEvent("onStart",this.element);D.stop()},check:function(A){var B=Math.round(Math.sqrt(Math.pow(A.page.x-this.mouse.start.x,2)+Math.pow(A.page.y-this.mouse.start.y,2)));
if(B>this.options.snap){document.removeListener("mousemove",this.bound.check);document.addListener("mousemove",this.bound.drag);
this.drag(A);this.fireEvent("onSnap",this.element)}A.stop()},drag:function(A){this.out=false;
this.mouse.now=A.page;for(var B in this.options.modifiers){if(B=="toJSONString"){continue
}if(!this.options.modifiers[B]){continue}this.value.now[B]=this.mouse.now[B]-this.mouse.pos[B];
if(this.limit[B]){if($chk(this.limit[B][1])&&(this.value.now[B]>this.limit[B][1])){this.value.now[B]=this.limit[B][1];
this.out=true}else{if($chk(this.limit[B][0])&&(this.value.now[B]<this.limit[B][0])){this.value.now[B]=this.limit[B][0];
this.out=true}}}if(this.options.grid[B]){this.value.now[B]-=(this.value.now[B]%this.options.grid[B])
}this.element.setStyle(this.options.modifiers[B],this.value.now[B]+this.options.unit)
}this.fireEvent("onDrag",this.element);A.stop()},stop:function(){document.removeListener("mousemove",this.bound.check);
document.removeListener("mousemove",this.bound.drag);document.removeListener("mouseup",this.bound.stop);
this.fireEvent("onComplete",this.element)}});Drag.Base.implement(new Events,new Options);
Element.extend({makeResizable:function(A){return new Drag.Base(this,$merge({modifiers:{x:"width",y:"height"}},A))
}});Drag.Move=Drag.Base.extend({options:{droppables:[],container:false,overflown:[]},initialize:function(B,A){this.setOptions(A);
this.element=$(B);this.droppables=$$(this.options.droppables);this.container=$(this.options.container);
this.position={element:this.element.getStyle("position"),container:false};if(this.container){this.position.container=this.container.getStyle("position")
}if(!["relative","absolute","fixed"].contains(this.position.element)){this.position.element="absolute"
}var E=this.element.getStyle("top").toInt();var D=this.element.getStyle("left").toInt();
if(this.position.element=="absolute"&&!["relative","absolute","fixed"].contains(this.position.container)){E=$chk(E)?E:this.element.getTop(this.options.overflown);
D=$chk(D)?D:this.element.getLeft(this.options.overflown)}else{E=$chk(E)?E:0;D=$chk(D)?D:0
}this.element.setStyles({top:E,left:D,position:this.position.element});this.parent(this.element)
},start:function(D){this.overed=null;if(this.container){var A=this.container.getCoordinates();
var B=this.element.getCoordinates();if(this.position.element=="absolute"&&!["relative","absolute","fixed"].contains(this.position.container)){this.options.limit={x:[A.left,A.right-B.width],y:[A.top,A.bottom-B.height]}
}else{this.options.limit={y:[0,A.height-B.height],x:[0,A.width-B.width]}}}this.parent(D)
},drag:function(B){this.parent(B);var A=this.out?false:this.droppables.filter(this.checkAgainst,this).getLast();
if(this.overed!=A){if(this.overed){this.overed.fireEvent("leave",[this.element,this])
}this.overed=A?A.fireEvent("over",[this.element,this]):null}return this},checkAgainst:function(B){B=B.getCoordinates(this.options.overflown);
var A=this.mouse.now;return(A.x>B.left&&A.x<B.right&&A.y<B.bottom&&A.y>B.top)},stop:function(){if(this.overed&&!this.out){this.overed.fireEvent("drop",[this.element,this])
}else{this.element.fireEvent("emptydrop",this)}this.parent();return this}});Element.extend({makeDraggable:function(A){return new Drag.Move(this,A)
}});var XHR=new Class({options:{method:"post",async:true,onRequest:Class.empty,onSuccess:Class.empty,onFailure:Class.empty,urlEncoded:true,encoding:"utf-8",autoCancel:false,headers:{}},setTransport:function(){this.transport=(window.XMLHttpRequest)?new XMLHttpRequest():(window.ie?new ActiveXObject("Microsoft.XMLHTTP"):false);
return this},initialize:function(A){this.setTransport().setOptions(A);this.options.isSuccess=this.options.isSuccess||this.isSuccess;
this.headers={};if(this.options.urlEncoded&&this.options.method=="post"){var B=(this.options.encoding)?"; charset="+this.options.encoding:"";
this.setHeader("Content-type","application/x-www-form-urlencoded"+B)}if(this.options.initialize){this.options.initialize.call(this)
}},onStateChange:function(){if(this.transport.readyState!=4||!this.running){return 
}this.running=false;var A=0;try{A=this.transport.status}catch(B){}if(this.options.isSuccess.call(this,A)){this.onSuccess()
}else{this.onFailure()}this.transport.onreadystatechange=Class.empty},isSuccess:function(A){return((A>=200)&&(A<300))
},onSuccess:function(){this.response={text:this.transport.responseText,xml:this.transport.responseXML};
this.fireEvent("onSuccess",[this.response.text,this.response.xml]);this.callChain()
},onFailure:function(){this.fireEvent("onFailure",this.transport)},setHeader:function(A,B){this.headers[A]=B;
return this},send:function(A,D){if(this.options.autoCancel){this.cancel()}else{if(this.running){return this
}}this.running=true;if(D&&this.options.method=="get"){A=A+(A.contains("?")?"&":"?")+D;
D=null}this.transport.open(this.options.method.toUpperCase(),A,this.options.async);
this.transport.onreadystatechange=this.onStateChange.bind(this);if((this.options.method=="post")&&this.transport.overrideMimeType){this.setHeader("Connection","close")
}$extend(this.headers,this.options.headers);for(var B in this.headers){if(B!="toJSONString"){try{this.transport.setRequestHeader(B,this.headers[B])
}catch(E){}}}this.fireEvent("onRequest");this.transport.send($pick(D,null));return this
},cancel:function(){if(!this.running){return this}this.running=false;this.transport.abort();
this.transport.onreadystatechange=Class.empty;this.setTransport();this.fireEvent("onCancel");
return this}});XHR.implement(new Chain,new Events,new Options);var Ajax=XHR.extend({options:{data:null,update:null,onComplete:Class.empty,evalScripts:false,evalResponse:false},initialize:function(A,B){this.addEvent("onSuccess",this.onComplete);
this.setOptions(B);this.options.data=this.options.data||this.options.postBody;if(!["post","get"].contains(this.options.method)){this._method="_method="+this.options.method;
this.options.method="post"}this.parent();this.setHeader("X-Requested-With","XMLHttpRequest");
this.setHeader("Accept","text/javascript, text/html, application/xml, text/xml, */*");
this.url=A},onComplete:function(){if(this.options.update){$(this.options.update).empty().setHTML(this.response.text)
}if(this.options.evalScripts||this.options.evalResponse){this.evalScripts()}this.fireEvent("onComplete",[this.response.text,this.response.xml],20)
},request:function(A){A=A||this.options.data;switch($type(A)){case"element":A=$(A).toQueryString();
break;case"object":A=Object.toQueryString(A)}if(this._method){A=(A)?[this._method,A].join("&"):this._method
}return this.send(this.url,A)},evalScripts:function(){var D,B;if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){B=this.response.text
}else{B=[];var A=/<script[^>]*>([\s\S]*?)<\/script>/gi;while((D=A.exec(this.response.text))){B.push(D[1])
}B=B.join("\n")}if(B){(window.execScript)?window.execScript(B):window.setTimeout(B,0)
}},getHeader:function(A){try{return this.transport.getResponseHeader(A)}catch(B){}return null
}});Object.toQueryString=function(B){var D=[];for(var A in B){if(A!="toJSONString"){D.push(encodeURIComponent(A)+"="+encodeURIComponent(B[A]))
}}return D.join("&")};Element.extend({send:function(A){return new Ajax(this.getProperty("action"),$merge({data:this.toQueryString()},A,{method:"post"})).request()
}});var Cookie=new Abstract({options:{domain:false,path:false,duration:false,secure:false},set:function(D,E,B){B=$merge(this.options,B);
E=encodeURIComponent(E);if(B.domain){E+="; domain="+B.domain}if(B.path){E+="; path="+B.path
}if(B.duration){var A=new Date();A.setTime(A.getTime()+B.duration*24*60*60*1000);
E+="; expires="+A.toGMTString()}if(B.secure){E+="; secure"}document.cookie=D+"="+E;
return $extend(B,{key:D,value:E})},get:function(A){var B=document.cookie.match("(?:^|;)\\s*"+A.escapeRegExp()+"=([^;]*)");
return B?decodeURIComponent(B[1]):false},remove:function(A,B){if($type(A)=="object"){this.set(A.key,"",$merge(A,{duration:-1}))
}else{this.set(A,"",$merge(B,{duration:-1}))}}});var Json={toString:function(D){switch($type(D)){case"string":return'"'+D.replace(/(["\\])/g,"\\$1")+'"';
case"array":return"["+D.map(Json.toString).join(",")+"]";case"object":var B=[];for(var A in D){if(A!="toJSONString"){B.push(Json.toString(A)+":"+Json.toString(D[A]))
}}return"{"+B.join(",")+"}";case"number":if(isFinite(D)){break}case false:return"null"
}return String(D)},evaluate:function(str,secure){return(($type(str)!="string")||(secure&&!str.test(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/)))?null:eval("("+str+")")
}};Json.Remote=XHR.extend({initialize:function(A,B){this.url=A;this.addEvent("onSuccess",this.onComplete);
this.parent(B);this.setHeader("X-Request","JSON")},send:function(A){return this.parent(this.url,"json="+Json.toString(A))
},onComplete:function(){this.fireEvent("onComplete",[Json.evaluate(this.response.text,this.options.secure)])
}});var Asset=new Abstract({javascript:function(A,B){B=$merge({onload:Class.empty},B);
var D=new Element("script",{src:A}).addEvents({load:B.onload,readystatechange:function(){if(this.readyState=="complete"){this.fireEvent("load")
}}});delete B.onload;return D.setProperties(B).inject(document.head)},css:function(A,B){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:A},B)).inject(document.head)
},image:function(A,D){D=$merge({onload:Class.empty,onabort:Class.empty,onerror:Class.empty},D);
var E=new Image();E.src=A;var B=new Element("img",{src:A});["load","abort","error"].each(function(F){var G=D["on"+F];
delete D["on"+F];B.addEvent(F,function(){this.removeEvent(F,arguments.callee);G.call(this)
})});if(E.width&&E.height){B.fireEvent("load",B,1)}return B.setProperties(D)},images:function(D,B){B=$merge({onComplete:Class.empty,onProgress:Class.empty},B);
if(!D.push){D=[D]}var E=[];var A=0;D.each(function(F){var G=new Asset.image(F,{onload:function(){B.onProgress.call(this,A);
A++;if(A==D.length){B.onComplete()}}});E.push(G)});return new Elements(E)}});var Hash=new Class({length:0,initialize:function(A){this.obj=A||{};
this.setLength()},get:function(A){return(this.hasKey(A))?this.obj[A]:null},hasKey:function(A){return(A in this.obj)
},set:function(A,B){if(!this.hasKey(A)){this.length++}this.obj[A]=B;return this},setLength:function(){this.length=0;
for(var A in this.obj){if(A!="toJSONString"){this.length++}}return this},remove:function(A){if(this.hasKey(A)){delete this.obj[A];
this.length--}return this},each:function(A,B){$each(this.obj,A,B)},extend:function(A){$extend(this.obj,A);
return this.setLength()},merge:function(){this.obj=$merge.apply(null,[this.obj].extend(arguments));
return this.setLength()},empty:function(){this.obj={};this.length=0;return this},keys:function(){var B=[];
for(var A in this.obj){if(A!="toJSONString"){B.push(A)}}return B},values:function(){var B=[];
for(var A in this.obj){if(A!="toJSONString"){B.push(this.obj[A])}}return B}});function $H(A){return new Hash(A)
}Hash.Cookie=Hash.extend({initialize:function(A,B){this.name=A;this.options=$extend({autoSave:true},B||{});
this.load()},save:function(){if(this.length==0){Cookie.remove(this.name,this.options);
return true}var A=Json.toString(this.obj);if(A.length>4096){return false}Cookie.set(this.name,A,this.options);
return true},load:function(){this.obj=Json.evaluate(Cookie.get(this.name),true)||{};
this.setLength()}});Hash.Cookie.Methods={};["extend","set","merge","empty","remove"].each(function(A){Hash.Cookie.Methods[A]=function(){Hash.prototype[A].apply(this,arguments);
if(this.options.autoSave){this.save()}return this}});Hash.Cookie.implement(Hash.Cookie.Methods);
var Color=new Class({initialize:function(B,E){E=E||(B.push?"rgb":"hex");var D,A;switch(E){case"rgb":D=B;
A=D.rgbToHsb();break;case"hsb":D=B.hsbToRgb();A=B;break;default:D=B.hexToRgb(true);
A=D.rgbToHsb()}D.hsb=A;D.hex=D.rgbToHex();return $extend(D,Color.prototype)},mix:function(){var B=$A(arguments);
var D=($type(B[B.length-1])=="number")?B.pop():50;var A=this.copy();B.each(function(E){E=new Color(E);
for(var F=0;F<3;F++){A[F]=Math.round((A[F]/100*(100-D))+(E[F]/100*D))}});return new Color(A,"rgb")
},invert:function(){return new Color(this.map(function(A){return 255-A}))},setHue:function(A){return new Color([A,this.hsb[1],this.hsb[2]],"hsb")
},setSaturation:function(A){return new Color([this.hsb[0],A,this.hsb[2]],"hsb")},setBrightness:function(A){return new Color([this.hsb[0],this.hsb[1],A],"hsb")
}});function $RGB(D,B,A){return new Color([D,B,A],"rgb")}function $HSB(D,B,A){return new Color([D,B,A],"hsb")
}Array.extend({rgbToHsb:function(){var D=this[0],E=this[1],K=this[2];var H,B,J;var I=Math.max(D,E,K),G=Math.min(D,E,K);
var L=I-G;J=I/255;B=(I!=0)?L/I:0;if(B==0){H=0}else{var F=(I-D)/L;var A=(I-E)/L;var M=(I-K)/L;
if(D==I){H=M-A}else{if(E==I){H=2+F-M}else{H=4+A-F}}H/=6;if(H<0){H++}}return[Math.round(H*360),Math.round(B*100),Math.round(J*100)]
},hsbToRgb:function(){var D=Math.round(this[2]/100*255);if(this[1]==0){return[D,D,D]
}else{var A=this[0]%360;var F=A%60;var G=Math.round((this[2]*(100-this[1]))/10000*255);
var E=Math.round((this[2]*(6000-this[1]*F))/600000*255);var B=Math.round((this[2]*(6000-this[1]*(60-F)))/600000*255);
switch(Math.floor(A/60)){case 0:return[D,B,G];case 1:return[E,D,G];case 2:return[G,D,B];
case 3:return[G,E,D];case 4:return[B,G,D];case 5:return[D,G,E]}}return false}});var Scroller=new Class({options:{area:20,velocity:1,onChange:function(A,B){this.element.scrollTo(A,B)
}},initialize:function(A,B){this.setOptions(B);this.element=$(A);this.mousemover=([window,document].contains(A))?$(document.body):this.element
},start:function(){this.coord=this.getCoords.bindWithEvent(this);this.mousemover.addListener("mousemove",this.coord)
},stop:function(){this.mousemover.removeListener("mousemove",this.coord);this.timer=$clear(this.timer)
},getCoords:function(A){this.page=(this.element==window)?A.client:A.page;if(!this.timer){this.timer=this.scroll.periodical(50,this)
}},scroll:function(){var A=this.element.getSize();var E=this.element.getPosition();
var B={x:0,y:0};for(var D in this.page){if(D=="toJSONString"){continue}if(this.page[D]<(this.options.area+E[D])&&A.scroll[D]!=0){B[D]=(this.page[D]-this.options.area-E[D])*this.options.velocity
}else{if(this.page[D]+this.options.area>(A.size[D]+E[D])&&A.scroll[D]+A.size[D]!=A.scrollSize[D]){B[D]=(this.page[D]-A.size[D]+this.options.area-E[D])*this.options.velocity
}}}if(B.y||B.x){this.fireEvent("onChange",[A.scroll.x+B.x,A.scroll.y+B.y])}}});Scroller.implement(new Events,new Options);
var Slider=new Class({options:{onChange:Class.empty,onComplete:Class.empty,onTick:function(A){this.knob.setStyle(this.p,A)
},mode:"horizontal",steps:100,offset:0},initialize:function(E,A,D){this.element=$(E);
this.knob=$(A);this.setOptions(D);this.previousChange=-1;this.previousEnd=-1;this.step=-1;
this.element.addEvent("mousedown",this.clickedElement.bindWithEvent(this));var B,G;
switch(this.options.mode){case"horizontal":this.z="x";this.p="left";B={x:"left",y:false};
G="offsetWidth";break;case"vertical":this.z="y";this.p="top";B={x:false,y:"top"};
G="offsetHeight"}this.max=this.element[G]-this.knob[G]+(this.options.offset*2);this.half=this.knob[G]/2;
this.getPos=this.element["get"+this.p.capitalize()].bind(this.element);this.knob.setStyle("position","relative").setStyle(this.p,-this.options.offset);
var F={};F[this.z]=[-this.options.offset,this.max-this.options.offset];this.drag=new Drag.Base(this.knob,{limit:F,modifiers:B,snap:0,onStart:function(){this.draggedKnob()
}.bind(this),onDrag:function(){this.draggedKnob()}.bind(this),onComplete:function(){this.draggedKnob();
this.end()}.bind(this)});if(this.options.initialize){this.options.initialize.call(this)
}},set:function(A){this.step=A.limit(0,this.options.steps);this.checkStep();this.end();
this.fireEvent("onTick",this.toPosition(this.step));return this},clickedElement:function(B){var A=B.page[this.z]-this.getPos()-this.half;
A=A.limit(-this.options.offset,this.max-this.options.offset);this.step=this.toStep(A);
this.checkStep();this.end();this.fireEvent("onTick",A)},draggedKnob:function(){this.step=this.toStep(this.drag.value.now[this.z]);
this.checkStep()},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;
this.fireEvent("onChange",this.step)}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;
this.fireEvent("onComplete",this.step+"")}},toStep:function(A){return Math.round((A+this.options.offset)/this.max*this.options.steps)
},toPosition:function(A){return this.max*A/this.options.steps}});Slider.implement(new Events);
Slider.implement(new Options);var SmoothScroll=Fx.Scroll.extend({initialize:function(B){this.parent(window,B);
this.links=(this.options.links)?$$(this.options.links):$$(document.links);var A=window.location.href.match(/^[^#]*/)[0]+"#";
this.links.each(function(E){if(E.href.indexOf(A)!=0){return }var D=E.href.substr(A.length);
if(D&&$(D)){this.useLink(E,D)}},this);if(!window.webkit419){this.addEvent("onComplete",function(){window.location.hash=this.anchor
})}},useLink:function(B,A){B.addEvent("click",function(D){this.anchor=A;this.toElement(A);
D.stop()}.bindWithEvent(this))}});var Sortables=new Class({options:{handles:false,onStart:Class.empty,onComplete:Class.empty,ghost:true,snap:3,onDragStart:function(A,B){B.setStyle("opacity",0.7);
A.setStyle("opacity",0.7)},onDragComplete:function(A,B){A.setStyle("opacity",1);B.remove();
this.trash.remove()}},initialize:function(E,D){this.setOptions(D);this.list=$(E);
this.elements=this.list.getChildren();this.handles=(this.options.handles)?$$(this.options.handles):this.elements;
this.bound={start:[],moveGhost:this.moveGhost.bindWithEvent(this)};for(var B=0,A=this.handles.length;
B<A;B++){this.bound.start[B]=this.start.bindWithEvent(this,this.elements[B])}this.attach();
if(this.options.initialize){this.options.initialize.call(this)}this.bound.move=this.move.bindWithEvent(this);
this.bound.end=this.end.bind(this)},attach:function(){this.handles.each(function(A,B){A.addEvent("mousedown",this.bound.start[B])
},this)},detach:function(){this.handles.each(function(A,B){A.removeEvent("mousedown",this.bound.start[B])
},this)},start:function(D,B){this.active=B;this.coordinates=this.list.getCoordinates();
if(this.options.ghost){var A=B.getPosition();this.offset=D.page.y-A.y;this.trash=new Element("div").inject(document.body);
this.ghost=B.clone().inject(this.trash).setStyles({position:"absolute",left:A.x,top:D.page.y-this.offset});
document.addListener("mousemove",this.bound.moveGhost);this.fireEvent("onDragStart",[B,this.ghost])
}document.addListener("mousemove",this.bound.move);document.addListener("mouseup",this.bound.end);
this.fireEvent("onStart",B);D.stop()},moveGhost:function(A){var B=A.page.y-this.offset;
B=B.limit(this.coordinates.top,this.coordinates.bottom-this.ghost.offsetHeight);this.ghost.setStyle("top",B);
A.stop()},move:function(F){var B=F.page.y;this.previous=this.previous||B;var A=((this.previous-B)>0);
var E=this.active.getPrevious();var D=this.active.getNext();if(E&&A&&B<E.getCoordinates().bottom){this.active.injectBefore(E)
}if(D&&!A&&B>D.getCoordinates().top){this.active.injectAfter(D)}this.previous=B},serialize:function(A){return this.list.getChildren().map(A||function(B){return this.elements.indexOf(B)
},this)},end:function(){this.previous=null;document.removeListener("mousemove",this.bound.move);
document.removeListener("mouseup",this.bound.end);if(this.options.ghost){document.removeListener("mousemove",this.bound.moveGhost);
this.fireEvent("onDragComplete",[this.active,this.ghost])}this.fireEvent("onComplete",this.active)
}});Sortables.implement(new Events,new Options);var Tips=new Class({options:{onShow:function(A){A.setStyle("visibility","visible")
},onHide:function(A){A.setStyle("visibility","hidden")},maxTitleChars:30,showDelay:100,hideDelay:100,className:"tool",offsets:{x:16,y:16},fixed:false},initialize:function(A,B){this.setOptions(B);
this.toolTip=new Element("div",{"class":this.options.className+"-tip",styles:{position:"absolute",top:"0",left:"0",visibility:"hidden"}}).inject(document.body);
this.wrapper=new Element("div").inject(this.toolTip);$$(A).each(this.build,this);
if(this.options.initialize){this.options.initialize.call(this)}},build:function(B){B.$tmp.myTitle=(B.href&&B.getTag()=="a")?B.href.replace("http://",""):(B.rel||false);
if(B.title){var D=B.title.split("::");if(D.length>1){B.$tmp.myTitle=D[0].trim();B.$tmp.myText=D[1].trim()
}else{B.$tmp.myText=B.title}B.removeAttribute("title")}else{B.$tmp.myText=false}if(B.$tmp.myTitle&&B.$tmp.myTitle.length>this.options.maxTitleChars){B.$tmp.myTitle=B.$tmp.myTitle.substr(0,this.options.maxTitleChars-1)+"&hellip;"
}B.addEvent("mouseenter",function(E){this.start(B);if(!this.options.fixed){this.locate(E)
}else{this.position(B)}}.bind(this));if(!this.options.fixed){B.addEvent("mousemove",this.locate.bindWithEvent(this))
}var A=this.end.bind(this);B.addEvent("mouseleave",A);B.addEvent("trash",A)},start:function(A){this.wrapper.empty();
if(A.$tmp.myTitle){this.title=new Element("span").inject(new Element("div",{"class":this.options.className+"-title"}).inject(this.wrapper)).setHTML(A.$tmp.myTitle)
}if(A.$tmp.myText){this.text=new Element("span").inject(new Element("div",{"class":this.options.className+"-text"}).inject(this.wrapper)).setHTML(A.$tmp.myText)
}$clear(this.timer);this.timer=this.show.delay(this.options.showDelay,this)},end:function(A){$clear(this.timer);
this.timer=this.hide.delay(this.options.hideDelay,this)},position:function(A){var B=A.getPosition();
this.toolTip.setStyles({left:B.x+this.options.offsets.x,top:B.y+this.options.offsets.y})
},locate:function(A){var E={x:window.getWidth(),y:window.getHeight()};var D={x:window.getScrollLeft(),y:window.getScrollTop()};
var B={x:this.toolTip.offsetWidth,y:this.toolTip.offsetHeight};var H={x:"left",y:"top"};
for(var F in H){if(F=="toJSONString"){continue}var G=A.page[F]+this.options.offsets[F];
if((G+B[F]-D[F])>E[F]){G=A.page[F]-this.options.offsets[F]-B[F]}this.toolTip.setStyle(H[F],G)
}},show:function(){if(this.options.timeout){this.timer=this.hide.delay(this.options.timeout,this)
}this.fireEvent("onShow",[this.toolTip])},hide:function(){this.fireEvent("onHide",[this.toolTip])
}});Tips.implement(new Events,new Options);var Group=new Class({initialize:function(){this.instances=$A(arguments);
this.events={};this.checker={}},addEvent:function(B,A){this.checker[B]=this.checker[B]||{};
this.events[B]=this.events[B]||[];if(this.events[B].contains(A)){return false}else{this.events[B].push(A)
}this.instances.each(function(D,E){D.addEvent(B,this.check.bind(this,[B,D,E]))},this);
return this},check:function(D,A,B){this.checker[D][B]=true;var E=this.instances.every(function(G,F){return this.checker[D][F]||false
},this);if(!E){return }this.checker[D]={};this.events[D].each(function(F){F.call(this,this.instances,A)
},this)}});var Accordion=Fx.Elements.extend({options:{onActive:Class.empty,onBackground:Class.empty,display:0,show:false,height:true,width:false,opacity:true,fixedHeight:false,fixedWidth:false,wait:false,alwaysHide:false},initialize:function(){var F,D,A,G;
$each(arguments,function(H,J){switch($type(H)){case"object":F=H;break;case"element":G=$(H);
break;default:var I=$$(H);if(!D){D=I}else{A=I}}});this.togglers=D||[];this.elements=A||[];
this.container=$(G);this.setOptions(F);this.previous=-1;if(this.options.alwaysHide){this.options.wait=true
}if($chk(this.options.show)){this.options.display=false;this.previous=this.options.show
}if(this.options.start){this.options.display=false;this.options.show=false}this.effects={};
if(this.options.opacity){this.effects.opacity="fullOpacity"}if(this.options.width){this.effects.width=this.options.fixedWidth?"fullWidth":"offsetWidth"
}if(this.options.height){this.effects.height=this.options.fixedHeight?"fullHeight":"scrollHeight"
}for(var E=0,B=this.togglers.length;E<B;E++){this.addSection(this.togglers[E],this.elements[E])
}this.elements.each(function(I,H){if(this.options.show===H){this.fireEvent("onActive",[this.togglers[H],I])
}else{for(var J in this.effects){if(J!="toJSONString"){I.setStyle(J,0)}}}},this);
this.parent(this.elements);if($chk(this.options.display)){this.display(this.options.display)
}},addSection:function(D,E,H){D=$(D);E=$(E);var G=this.togglers.contains(D);var B=this.togglers.length;
this.togglers.include(D);this.elements.include(E);if(B&&(!G||H)){H=$pick(H,B-1);D.injectBefore(this.togglers[H]);
E.injectAfter(D)}else{if(this.container&&!G){D.inject(this.container);E.inject(this.container)
}}var A=this.togglers.indexOf(D);D.addEvent("click",this.display.bind(this,A));if(this.options.height){E.setStyles({"padding-top":0,"border-top":"none","padding-bottom":0,"border-bottom":"none"})
}if(this.options.width){E.setStyles({"padding-left":0,"border-left":"none","padding-right":0,"border-right":"none"})
}E.fullOpacity=1;if(this.options.fixedWidth){E.fullWidth=this.options.fixedWidth}if(this.options.fixedHeight){E.fullHeight=this.options.fixedHeight
}E.setStyle("overflow","hidden");if(!G){for(var F in this.effects){if(F!="toJSONString"){E.setStyle(F,0)
}}}return this},display:function(A){A=($type(A)=="element")?this.elements.indexOf(A):A;
if((this.timer&&this.options.wait)||(A===this.previous&&!this.options.alwaysHide)){return this
}this.previous=A;var B={};this.elements.each(function(F,E){B[E]={};var D=(E!=A)||(this.options.alwaysHide&&(F.offsetHeight>0));
this.fireEvent(D?"onBackground":"onActive",[this.togglers[E],F]);for(var G in this.effects){if(G!="toJSONString"){B[E][G]=D?0:F[this.effects[G]]
}}},this);return this.start(B)},showThisHideOpen:function(A){return this.display(A)
}});Fx.Accordion=Accordion;Fx.Overlay=new Class({options:{styles:{position:"absolute",top:0,left:0}},initialize:function(B,D,A){this.element=$(B);
this.setOptions(D);if([window,$(document.body)].contains(this.element)){this.padding=Fx.Overlay.windowPadding;
this.container=$(document.body);this.element=window}else{this.padding={x:0,y:0};this.container=this.element
}this.overlay=new Element($pick(A,"div"),{styles:{display:"none"}}).inject(this.container);
this.update()},show:function(){this.overlay.setStyle("display","block");return this
},update:function(A){this.overlay.set($merge(this.options,{styles:{width:this.element.getScrollWidth()-this.padding.x,height:this.element.getScrollHeight()-this.padding.y}},A));
return this},hide:function(){this.overlay.setStyle("display","none");return this},destroy:function(){this.overlay.remove(true);
return this}});Fx.Overlay.implement(new Options);Fx.Overlay.windowPadding=(window.ie6)?{x:21,y:4}:{x:0,y:0};
Element.$overlay=function(A,B){B=$pick(B,1);if(!this.fixOverlayElement){this.fixOverlayElement=new Element("iframe",{properties:{frameborder:"0",scrolling:"no",src:"javascript:void(0);"},styles:{position:this.getStyle("position"),border:"none",filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}}).injectBefore(this)
}if(A){return this.fixOverlayElement.setStyle("display","none")}var D=this.getStyle("z-index").toInt()||0;
if(D<B){this.setStyle("z-index",""+(D=B+1))}var E=this.getCoordinates();return this.fixOverlayElement.setStyles({display:"","z-index":""+(D-B),left:E.left+"px",top:E.top+"px",width:E.width+"px",height:E.height+"px"})
};Element.extend({fixOverlay:window.ie6?Element.$overlay:function(){return false},remove:function(A){if(this.fixOverlayElement){this.fixOverlayElement.remove();
if(A){Garbage.trash([this.fixOverlayElement])}}this.parentNode.removeChild(this);
if(A){Garbage.trash([this.empty()]);return false}return this}});Drag.Transition={linear:{step:function(D,A,B){return B*A-D
},inverse:function(D,A,B){return(D+A)/B}}};Drag.Multi=Drag.Base.extend({options:{handle:false,onStart:Class.empty,onBeforeStart:Class.empty,onComplete:Class.empty,onDrag:Class.empty,snap:6},elementOptions:{unit:"px",direction:1,limit:false,grid:false,bind:false,fn:Drag.Transition.linear},initialize:function(A){this.setOptions(A);
this.handle=$(this.options.handle);this.element=[];this.mouse={start:{},now:{}};this.modifiers={};
this.bound={start:this.start.bindWithEvent(this),check:this.check.bindWithEvent(this),drag:this.drag.bindWithEvent(this),stop:this.stop.bind(this)};
this.attach();if(this.options.initialize){this.options.initialize.call(this)}},add:function(E,D,H){E=$(E);
if(!$defined(H)){H={}}var F={};for(var G in D){if(G=="toJSONString"){continue}if($type(D[G])!="object"||!$defined(D[G].style)){continue
}if(!$defined(this.modifiers[G])){this.modifiers[G]=[]}var B=$merge(this.elementOptions,D[G],{modifier:G,element:E,bind:false,binded:false});
if(H[G]){B.bind=H[G];B.bind.binded=true}var A=B.style.slice(0,1);if(A=="-"||A=="+"){B.direction=(A+1).toInt();
B.style=B.style.slice(1)}this.modifiers[G].push(B);F[G]=B}if(!this.element.contains(E)){this.element.push(E)
}return F},remove:function(A){A=$(A);for(var B in this.modifiers){if(B!="toJSONString"){this.modifiers[B]=this.modifiers[B].filter(function(D){return A!=D.element
})}}this.element.remove(A);return this},detach:function(A){for(var B in A){if(B!="toJSONString"){if($type(A[B])=="object"&&!A[B].binded){this.modifiers[B].remove(A[B])
}}}return this},start:function(B){this.fireEvent("onBeforeStart",this.element);this.mouse.start=B.page;
for(var D in this.modifiers){if(D=="toJSONString"){continue}var A=this.mouse.start[D];
this.modifiers[D].each(function(G){G.now=G.element.getStyle(G.style).toInt();G.start=G.fn.step(G.now,A,G.direction,true);
G.$limit=[];var E=G.limit;if(E){for(var F=0;F<2;F++){if($chk(E[F])){G.$limit[F]=($type(E[F])=="function")?E[F](G):E[F]
}}}},this)}document.addListener("mousemove",this.bound.check);document.addListener("mouseup",this.bound.stop);
this.fireEvent("onStart",this.element);B.stop()},modifierUpdate:function(B){var D=B.modifier,A=this.mouse.now[D];
B.out=false;B.now=B.fn.step(B.start,B.bind?B.bind.inverse:A,B.direction);if(B.$limit&&$chk(B.$limit[1])&&(B.now>B.$limit[1])){B.now=B.$limit[1];
B.out=true}else{if(B.$limit&&$chk(B.$limit[0])&&(B.now<B.$limit[0])){B.now=B.$limit[0];
B.out=true}}if(B.grid){B.now-=((B.now+B.grid/2)%B.grid)-B.grid/2}if(B.binded){B.inverse=B.fn.inverse(B.start,B.now,B.direction)
}B.element.setStyle(B.style,B.now+B.unit)},drag:function(A){this.mouse.now=A.page;
for(var B in this.modifiers){if(B!="toJSONString"){this.modifiers[B].each(this.modifierUpdate,this)
}}this.fireEvent("onDrag",this.element);A.stop()}});Drag.Multi.$direction={east:{x:1},west:{x:-1},north:{y:-1},south:{y:1},nw:{x:-1,y:-1},ne:{x:1,y:-1},sw:{x:-1,y:1},se:{x:1,y:1}};
Drag.Resize=new Class({options:{zIndex:10000,moveLimit:false,resizeLimit:{x:[0],y:[0]},grid:false,modifiers:{x:"left",y:"top",width:"width",height:"height"},container:null,preserveRatio:false,ghost:false,snap:6,direction:Drag.Multi.$direction,limiter:{x:{"-1":["left","right"],"1":["right","left"]},y:{"-1":["top","bottom"],"1":["bottom","top"]}},moveLimiter:{x:["left","right"],y:["top","bottom"]},ghostClass:"ghost-sizer sizer-visible",classPrefix:"sizer sizer-",hoverClass:"sizer-visible",shadeBackground:"transparent url(s.gif)",onBuild:Class.empty,onBeforeStart:Class.empty,onStart:Class.empty,onSnap:Class.empty,onResize:Class.empty,onComplete:Class.empty},initialize:function(D,J){var P=this;
this.element=this.el=$(D);this.fx={};this.binds={};this.bound={};this.setOptions(J);
this.options.container=this.options.container===null?this.el.getParent():$(this.options.container);
if($type(this.options.direction)=="string"){if(T=="all"){this.options.direction=Drag.Multi.$direction
}else{var T=this.options.direction.split(/\s+/);this.options.direction={};T.each(function(R){this[R]=Drag.Multi.$direction[R]
},this.options.direction)}}var N=this.el.getCoordinates(),L=this.el.getStyle("position");
this.el.setStyles({width:N.width,height:N.height});if(this.options.container){if(!(["relative","fixed"].contains(L))){var O=this.options.container.getCoordinates();
this.el.setStyles({left:N.left-O.left,top:N.top-O.top})}this.options.moveLimit=$merge({x:[0],y:[0]},this.options.moveLimit)
}if(this.options.preserveRatio){var I=N.width/N.height;var G=P.options.resizeLimit;
var Q=function(a,Z,c,b,R){if(G&&G[a]&&G[Z]&&G[a][b]&&G[Z][b]){G[a][b]=Math[c](G[a][b],R*G[Z][b])
}};Q("x","y","max",0,I);Q("y","x","max",0,1/I);Q("x","y","min",1,I);Q("y","x","min",1,1/I);
this.aspectStep={x:{step:function(R,a,Z){return Z*a/I-R}},y:{step:function(R,a,Z){return Z*a*I-R
}}};this.options.direction=$merge(this.options.direction);["nw","ne","sw","se"].each(function(R){delete this[R]
},this.options.direction)}if(this.options.ghost){this.ghost=new Element("div",{"class":this.options.ghostClass,styles:{display:"none"}}).injectAfter(this.el);
for(var V in this.options.direction){if(V!="toJSONString"){this.ghost.adopt(new Element("div",{"class":this.options.classPrefix+V}))
}}}var E={snap:this.options.snap,onBeforeStart:function(){P.fireEvent("onBeforeStart",this);
P.started=true;this.shade=new Fx.Overlay(window,{styles:{position:L,cursor:this.options.handle.getStyle("cursor"),background:P.options.shadeBackground,"z-index":P.options.zIndex+1}}).show();
if(P.ghost){var R=P.el.getCoordinates();P.ghost.setStyles({display:"block","z-index":P.options.zIndex,left:P.el.getStyle("left"),top:P.el.getStyle("top"),width:R.width,height:R.height});
for(var Z in this.modifiers){if(Z=="toJSONString"){continue}}this.modifiers[Z].each(function(a){if(a.element===P.ghost){a.element.setStyle(a.style,P.el.getStyle(a.style))
}});if(P.options.hoverClass){P.el.removeClass(P.options.hoverClass)}}},onSnap:function(){P.fireEvent("onSnap",this)
},onStart:function(){P.fireEvent("onStart",this)},onDrag:function(){P.fireEvent("onResize",this)
},onComplete:function(){P.started=false;if(P.options.hoverClass){P.el.removeClass(P.options.hoverClass)
}this.shade.destroy();if(P.ghost){for(var R in this.modifiers){if(R=="toJSONString"){continue
}this.modifiers[R].each(function(Z){if(Z.element===P.ghost){P.el.setStyle(Z.style,Z.now+Z.unit)
}})}P.ghost.setStyle("display","none")}P.fireEvent("onComplete",this)}};var Y=function(Z,a,R){if(!P.options.container){return R
}if(!R){R=[0]}var b=function(c){return function(f){var i=P.options.container.getCoordinates(),d=f.element.getCoordinates();
var g=Z*(i[a[0]]-d[a[1]]);switch($type(c)){case"number":return Math.min(g,c);case"function":return Math.min(g,c(f));
default:return g}}};return[R[0],b(R[1])]};var F=function(Z,R,c){var a=P.options.container;
var b=function(i,f,j,d){if(!$type(f)){f=d}var g=$type(i);if(f===null){return g=="function"?i:function(){return i
}}return function(l){var n=a.getCoordinates(),k=l.element.getCoordinates();var m=k[Z[1]]-n[Z[0]]-f;
switch(g){case"number":return Math[j](m,i);case"function":return Math[j](m,i(l));
default:return m}}};if(!a){if(!R){R=false}a=P.el.getParent()}else{if(!R){R=[0]}}return[b(R[0],c[1],"max",null),b(R[1],c[0],"min",R[1])]
};var B=this.options,D=this.ghost?this.ghost:this.el;if($type(B.grid)=="number"){B.grid={x:B.grid,y:B.grid}
}for(var V in B.direction){if(V=="toJSONString"){continue}var W=B.direction[V];E.handle=new Element("div",{"class":B.classPrefix+V});
var U=this.fx[V]=new Drag.Multi(E);var A={x:Y(W.x,B.limiter.x[""+W.x],B.resizeLimit.x),y:Y(W.y,B.limiter.y[""+W.y],B.resizeLimit.y)};
var H={};for(var K in W){if(K=="toJSONString"){continue}if(W[K]<0){H[K]={limit:F(B.moveLimiter[K],B.moveLimit[K],B.resizeLimit[K]),style:B.modifiers[K],grid:B.grid.x}
}}var M={move:U.add(D,H)},S={opts:{},bind:{}};this.binds[V]=M;if($defined(W.x)){S.opts.x={limit:W.x<0?false:A.x,grid:W.x<0?false:B.grid.x,style:B.modifiers.width,direction:W.x};
if(W.x<0){S.bind.x=M.move.x}}if($defined(W.y)){S.opts.y={limit:W.y<0?false:A.y,grid:W.y<0?false:B.grid.y,style:B.modifiers.height,direction:W.y};
if(W.y<0){S.bind.y=M.move.y}}M.resize=U.add(D,S.opts,S.bind);if(B.preserveRatio){var X={x:{fn:this.aspectStep.x,style:($defined(W.x))?B.modifiers.height:null,direction:W.x},y:{fn:this.aspectStep.y,style:($defined(W.y))?B.modifiers.width:null,direction:W.y}};
M.aspect=U.add(D,X,M.resize)}this.fireEvent("onBuild",[V,M])}this.bound=(!this.options.hoverClass)?{}:{mouseenter:function(R){this.addClass(P.options.hoverClass)
},mouseleave:function(R){if(!P.started){this.removeClass(P.options.hoverClass)}}};
this.attach();if(this.options.initialize){this.options.initialize()}},add:function(A){for(var B in this.options.direction){if(B=="toJSONString"){continue
}A.call(this,B,this.binds[B])}},attach:function(){$each(this.bound,function(B,D){this.addEvent(D,B)
},this.el);for(var A in this.fx){if(A!="toJSONString"){this.element.adopt(this.fx[A].handle)
}}return this},detach:function(){$each(this.bound,function(B,D){this.removeEvent(D,B)
},this.el);for(var A in this.fx){if(A!="toJSONString"){this.fx[A].handle.remove()
}}return this},stop:function(){this.detach();var A=[this.ghost];for(var B in this.fx){if(B!="toJSONString"){A.push(this.fx[B].handle)
}}Garbage.trash(A);this.fx=this.bound=this.binds={}}});Drag.Resize.implement(new Events,new Options);
Element.extend({makeResizable:function(A){A=A||{};if(A.handle){return new Drag.Base(this,$merge({modifiers:{x:"width",y:"height"}},A))
}return new Drag.Resize(this,A)}});Drag.ResizeImage=new Class({initialize:function(B,A){this.image=$(B);
this.styles=this.image.getStyles("position","top","left","right","bottom","z-index","margin");
if(!["absolute","fixed","relative"].contains(this.styles.position)){this.styles.position="relative"
}this.wrapper=new Element("div",{styles:$merge(this.styles,{width:this.image.offsetWidth,height:this.image.offsetHeight})}).injectBefore(this.image).adopt(this.image.remove().setStyles({position:"absolute",top:"0",left:"0",margin:"0",width:"100%",height:"100%",zIndex:"0"}));
this.fx=new Drag.Resize(this.wrapper,$merge({preserveRatio:true},A))},stop:function(){this.image.setStyles($merge(this.styles,{width:this.wrapper.getStyle("width"),height:this.wrapper.getStyle("height")})).remove().injectBefore(this.wrapper);
this.fx=null;this.wrapper.remove(true)}});var Windoo=new Class({options:{type:"dom",url:false,title:"Windoo!",width:300,height:200,position:"center",top:0,left:0,resizable:true,draggable:true,positionStyle:"absolute",resizeLimit:{x:[0],y:[0]},padding:{top:0,right:0,bottom:0,left:0},ghost:{resize:false,move:false},snap:{resize:6,move:6},destroyOnClose:true,container:null,restrict:true,theme:"alphacube",shadow:true,modal:false,buttons:{menu:false,close:true,minimize:true,roll:false,maximize:true},"class":"",wm:false,effects:{show:{options:{duration:600},styles:{opacity:[0,1]}},close:{options:{duration:600},styles:{opacity:[1,0]}},hide:{options:{duration:600},styles:{opacity:[1,0]}}},onFocus:Class.empty,onBlur:Class.empty,onClose:Class.empty,onDestroy:Class.empty,onHide:Class.empty,onShow:Class.empty,onMaximize:Class.empty,onMinimize:Class.empty,onRestore:Class.empty,onBeforeDrag:Class.empty,onStartDrag:Class.empty,onDrag:Class.empty,onDragComplete:Class.empty,onBeforeResize:Class.empty,onStartResize:Class.empty,onResize:Class.empty,onResizeComplete:Class.empty},makeResizable:Class.empty,makeDraggable:Class.empty,initialize:function(D){var A=this;
this.fx={};this.bound={};this.padding={};this.panels=[];this.zIndex=0;this.visible=false;
this.options.id="windoo-"+(new Date().getTime());this.setOptions(D);var E=this.theme=$type(this.options.theme)=="string"?Windoo.Themes[this.options.theme]:this.options.theme;
this.options.container=$(this.options.container||document.body);for(var B in E.padding){if(B!="toJSONString"){this.padding[B]=E.padding[B]+this.options.padding[B]
}}["x","y"].each(function(G){var F=this.options.resizeLimit;if($type(F[G][0])=="number"){F[G][0]=Math.max(F[G][0],E.resizeLimit[G][0])
}},this);this.buildDOM().setSize(this.options.width,this.options.height).setTitle(this.options.title).fix();
if(this.options.position=="center"){this.positionAtCenter()}this.minimized=false;
if(this.options.draggable){this.makeDraggable()}if(this.options.resizable){this.makeResizable()
}this.wm=this.options.wm||Windoo.$wm;this.wm.register(this);if(this.options.initialize){this.options.initialize.call(this)
}},buildDOM:function(){var E=this.theme,A=E.classPrefix;this.el=new Element("div",{id:this.options.id,"class":E.className,styles:{position:this.options.positionStyle,overflow:"hidden",visibility:"hidden",top:this.options.top,left:this.options.left},events:{mousedown:this.focus.bind(this)}});
if(this.options["class"]){this.el.addClass(this.options["class"])}var G=function(K,L){return'<div class="'+K+"-left "+A+'-drag"><div class="'+K+'-right"><div class="'+L+'"></div></div></div>'
};var J=window.ie&&this.options.type!="iframe",H='<div class="'+A+'-frame">'+G("top","title")+G("bot","strut")+'</div><div class="'+A+'-body">'+(J?Windoo.ieTableCell:"")+"</div>";
this.el.setHTML(H).inject(this.options.container);if(window.ie){this.el.addClass(A+"-"+E.name+"-ie")
}var D=this.el.getFirst(),F=this.el.getLast(),B=D.getElement(".title"),I=new Element("div",{"class":"title-text"}).inject(B);
this.dom={frame:D,body:F,title:I,titleBody:B,strut:D.getElement(".strut").setHTML("&nbsp;"),content:J?F.getElement("td"):F};
if(this.options.type=="iframe"){this.dom.iframe=new Element("iframe",{frameborder:"0","class":A+"-body",styles:{width:"100%",height:"100%"}});
this.dom.body.setStyle("overflow","hidden");this.adopt(this.dom.iframe).setURL(this.options.url)
}return this.buildShadow().buildButtons()},buildButtons:function(){var E=this,F=this.options.buttons,B=this.theme.classPrefix;
var A=function(G,H){return function(I){new Event(I).stop();(H[G])()}};this.bound.noaction=function(G){new Event(G).stop()
};var D=function(J,I,K,H){E.bound[I]=H;if(J){var G=B+"-button "+B+"-"+I+(J=="disabled"?" "+B+"-"+I+"-disabled":"");
E.dom[I]=new Element("a",{"class":G,href:"#",title:K}).setHTML("x").inject(E.el);
E.dom[I].addEvent("click",J=="disabled"?E.bound.noaction:H)}};D(F.close,"close","Close",A("close",this));
D(F.maximize,"maximize","Maximize",A("maximize",this));if(F.maximize==true){this.dom.titleBody.addEvent("dblclick",this.maximize.bind(this))
}D(F.minimize,"minimize","Minimize",A(F.roll?"roll":"minimize",this));D(F.minimize,"restore","Restore",A("minimize",this));
D(F.menu,"menu","Menu",A("openmenu",this));return this},buildShadow:function(){var B=this.theme;
if(this.options.modal){this.modalOverlay=new Fx.Overlay(this.el.getParent(),{"class":this.classPrefix("modal-overlay")})
}if(!B.shadow||!this.options.shadow){return this}this.shadow=new Element("div",{styles:{position:this.options.positionStyle,display:"none"},"class":B.classPrefix+"-shadow-"+B.shadow}).injectAfter(this.el);
if(B.complexShadow){var A=function(D){var E=["l","r","m"].map(function(G){return new Element("div",{"class":G})
});var F=new Element("div",{"class":D});return F.adopt.apply(F,E)};this.shadow.adopt(A("top"),this.dom.shm=A("mid"),A("bot"))
}else{this.shadow.adopt(new Element("div",{"class":"c"}))}return this},setHTML:function(A){if(!this.dom.iframe){this.dom.content.empty().setHTML(A)
}return this},adopt:function(){this.dom.content.empty().adopt.apply(this.dom.content,arguments);
return this},wrap:function(F,E){var A={margin:"0",position:"static"};F=$(F);E=E||{};
var D=F.getSize().size,H=F.getPosition(),B=E.ignorePadding?0:1,G=this.padding;this.setSize(D.x+B*(G.right+G.left),D.y+B*(G.top+G.bottom));
if(E.resetWidth){A.width="auto"}if(E.position){this.setPosition(H.x-B*G.left,H.y-B*G.top)
}this.dom.content.empty().adopt(F.remove().setStyles(A));return this},empty:function(){if(this.dom.iframe){this.dom.iframe.src="about:blank"
}else{this.dom.content.empty()}return this},setURL:function(A){if(this.dom.iframe){this.dom.iframe.src=A||"about:blank"
}return this},getContent:function(){return this.dom.content},setTitle:function(A){this.dom.title.setHTML(A||"&nbsp;");
return this},effect:function(B,A,E){opts={onComplete:E};if(A){opts.duration=0}var D=this.options.effects[B];
new Fx.Styles(D.el||this.el,$merge(D.options,opts)).start(D.styles);if(this.shadow){new Fx.Styles(this.shadow,D.options).start(D.styles)
}return this},hide:function(A){if(!this.visible){return this}this.visible=false;return this.effect("hide",A,function(){this.el.setStyle("display","none");
if(this.modalOverlay){this.modalOverlay.hide()}this.fix(true).fireEvent("onHide")
}.bind(this))},show:function(A){if(this.visible){return this}this.visible=true;if(this.modalOverlay){this.modalOverlay.show()
}this.el.setStyle("display","");this.bringTop().fix();if(this.shadow){this.shadow.setStyle("visibility","hidden")
}return this.effect("show",A,function(){this.el.setStyle("visibility","visible");
this.fireEvent("onShow").fix()}.bind(this))},fix:function(A){this.el.fixOverlay(A||!this.visible);
return this.fixShadow(A)},fixShadow:function(A){if(this.shadow){this.shadow[(this.maximized?"add":"remove")+"Class"]("windoo-shadow-"+this.theme.name+"-maximized");
if(A||!this.visible){this.shadow.setStyle("display","none")}else{var D=this.el.getCoordinates(),B=this.theme.shadowDisplace;
this.shadow.setStyles({display:"",zIndex:this.zIndex-1,left:this.el.offsetLeft+B.left,top:this.el.offsetTop+B.top,width:D.width+B.width,height:D.height+B.height});
if(this.dom.shm){this.dom.shm.setStyle("height",D.height-B.delta)}}}return this},getState:function(){var B=this.el.getCoordinates(),D=this.options.container,A=D===$(document.body)?{top:0,left:0}:D.getCoordinates();
B.top-=A.top;B.right-=A.left;B.bottom-=A.top;B.left-=A.left;return{outer:B,inner:this.dom.content.getSize()}
},setSize:function(A,B){var D=this.padding;this.el.setStyles({width:A,height:B});
this.dom.strut.setStyle("height",Math.max(0,B-D.top));this.dom.body.setStyle("height",Math.max(0,B-D.top-D.bottom));
return this.fix().fireEvent("onResizeComplete",this.fx.resize)},positionAtCenter:function(F){F=$merge({x:0,y:0},F);
var E=this.options.container;if(E===document.body){E=window}var D=E.getSize(),B=this.el.getSize().size,A=function(G){return Math.max(0,F[G]+D.scroll[G]+(D.size[G]-B[G])/2)
};this.el.setStyles({left:A("x"),top:A("y")});return this.fix()},setPosition:function(A,B){this.el.setStyles({left:A,top:B});
return this.fix()},preventClose:function(A){this.$preventClose=$defined(A)?A:true;
return this},close:function(A){this.$preventClose=false;this.fireEvent("onBeforeClose");
if(this.$preventClose){return this}if(!this.visible){return this}this.visible=false;
return this.effect("close",A,function(){this.el.setStyle("display","none");if(this.modalOverlay){this.modalOverlay.hide()
}this.fix(true).fireEvent("onClose");if(this.options.destroyOnClose){this.destroy()
}}.bind(this))},destroy:function(){this.fireEvent("onDestroy");this.wm.unregister(this);
if(this.modalOverlay){this.modalOverlay.destroy()}if(this.shadow){this.shadow.remove(true)
}this.el.remove(true);for(var A in this){if(A!="toJSONString"){this[A]=null}}this.destroyed=true
},classPrefix:function(A){return[this.theme.classPrefix,this.theme.name,A+" "+this.theme.classPrefix,A].join("-")
},maximize:function(D){if(this.minimized){return this.minimize()}if(this.rolled){this.roll(true)
}var F=function(J,I){if(!I){return J}if(J<I[0]){return I[0]}if(I.length>1&&J>I[1]){return I[1]
}return J};var A=this.classPrefix("maximized");this.maximized=!this.maximized;this.minimized=false;
if(this.maximized){this.$restoreMaxi=this.getState();var G=this.options.container;
if(G===document.body){G=window}var E=G.getSize(),B=this.options.resizeLimit;if(B){for(var H in B){if(H!="toJSONString"){E.size[H]=F(E.size[H],B[H])
}}}this.el.addClass(A);this.setSize(E.size.x,E.size.y).setPosition(E.scroll.x,E.scroll.y).fireEvent("onMaximize")
}else{this.el.removeClass(A);this.restoreState(this.$restoreMaxi).fireEvent("onRestore","maximize")
}return this.fix()},minimize:function(B){var A=this.classPrefix("minimized");this.minimized=!this.minimized;
if(this.minimized){this.$restoreMini=this.getState();var E=this.options.container;
if(E===document.body){E=window}var D=E.getSize(),F=this.theme.padding.top+this.theme.padding.bottom;
this.el.addClass(A);this.setSize("auto",F).setPosition(D.scroll.x+10,D.scroll.y+D.size.y-F-10).fireEvent("onMinimize")
}else{this.el.removeClass(A);this.restoreState(this.$restoreMini).fireEvent("onRestore","minimize")
}return this.fix()},restoreState:function(A){A=A.outer;return this.setSize(A.width,A.height).setPosition(A.left,A.top)
},roll:function(B){var A=this.classPrefix("rolled");this.rolled=!this.rolled;if(this.rolled){this.$restoreRoll=this.getState().outer;
var E=this.theme.padding;this.setSize(this.$restoreRoll.width,E.top+E.bottom);this.el.addClass(A);
this.fireEvent("onRoll")}else{this.el.removeClass(A);var D=this.$restoreRoll;this.setSize(D.width,D.height).fireEvent("onRestore","roll")
}return this.fix()},openmenu:function(){this.fireEvent("onMenu");return this},setZIndex:function(A){this.zIndex=A;
this.el.setStyle("zIndex",A);if(this.el.fixOverlayElement){this.el.fixOverlayElement.setStyle("zIndex",A-1)
}if(this.shadow){this.shadow.setStyle("zIndex",A-1)}if(this.fx.resize){this.fx.resize.options.zIndex=A+1
}if(this.modalOverlay){this.modalOverlay.overlay.setStyle("zIndex",A-2)}return this
},focus:function(){this.el.removeClass(this.theme.classPrefix+"-blur");this.wm.focus(this);
return this},blur:function(){this.el.addClass(this.theme.classPrefix+"-blur");if(this.wm.blur(this)){this.fireEvent("onBlur")
}return this},bringTop:function(){return this.setZIndex(this.wm.maxZIndex())}});Windoo.implement(new Events,new Options);
Windoo.ieTableCell='<table style="position:absolute;top:0;left:0;border:none;border-collapse:collapse;padding:0;"><tr><td style="border:none;overflow:auto;position:relative;padding:0;"></td></tr></table>';
Windoo.Themes={cssFirefoxMac:".windoo-blur * {overflow: hidden !important;}",alphacube:{name:"alphacube",padding:{top:22,right:10,bottom:15,left:10},resizeLimit:{x:[275],y:[37]},className:"windoo windoo-alphacube",sizerClass:"sizer",classPrefix:"windoo",ghostClass:"windoo-ghost windoo-alphacube-ghost windoo-hover",hoverClass:"windoo-hover",shadow:"simple window-shadow-alphacube-simple",shadeBackground:"transparent url(windoo/s.gif)",shadowDisplace:{left:3,top:3,width:0,height:0}}};
if(window.gecko&&navigator.appVersion.indexOf("acintosh")>=0){window.addEvent("domready",function(){new Element("style",{type:"text/css",media:"all"}).inject(document.head).appendText(Windoo.Themes.cssFirefoxMac)
})}Windoo.Manager=new Class({focused:false,options:{zIndex:100,onRegister:Class.empty,onUnregister:Class.empty,onFocus:Class.empty,onBlur:Class.empty},initialize:function(A){this.hash=[];
this.setOptions(A)},maxZIndex:function(){var B=this.hash;if(!B.length){return this.options.zIndex
}var A=[];B.each(function(D){this.push(D.zIndex)},A);A.sort(function(E,D){return E-D
});return A.getLast()+3},register:function(A){A.setZIndex(this.maxZIndex());this.hash.push(A);
return this.fireEvent("onRegister",A)},unregister:function(A){this.hash.remove(A);
if(this.focused===A){this.focused=false}return this.fireEvent("onUnregister",A)},focus:function(B){var A=this.hash.indexOf(B);
if(A===this.focused){return this}if(this.focused){this.focused.blur()}this.focused=B;
B.bringTop(this.maxZIndex());return this.fireEvent("onFocus",B)},blur:function(A){if(this.focused===A){this.focused=false;
this.fireEvent("onBlur",A);return true}return false}});Windoo.Manager.implement(new Events,new Options);
Windoo.$wm=new Windoo.Manager();Windoo.implement({makeResizable:function(){var B=this,E=this.theme,D=this.options,A=D.container===$(document.body);
this.fx.resize=this.el.makeResizable({ghostClass:E.ghostClass,hoverClass:E.hoverClass,classPrefix:E.classPrefix+"-sizer "+E.classPrefix+"-",shadeBackground:E.shadeBackground,container:(D.restrict&&!A)?D.container:false,resizeLimit:D.resizeLimit,ghost:D.ghost.resize,snap:D.snap.resize,onBeforeStart:function(){B.fireEvent("onBeforeResize",this).focus()
},onStart:function(F){if(B.maximized){F.stop()}else{if(!this.ghost&&window.gecko){Element.$overlay.call(F.shade.overlay)
}B.fireEvent("onStartResize",this)}},onResize:function(){B.fireEvent("onResize",this)
},onComplete:function(){if(this.ghost){var F=B.getState().outer;B.setSize(F.width,F.height)
}else{B.fix().fireEvent("onResizeComplete",this)}},onBuild:function(F,H){if(!this.ghost){var I=this.fx[F],G={x:{limit:false},y:{limit:false}};
if(H.resize.y){["strut","body","shm"].each(function(J){if(this[J]){I.add(this[J],{y:{direction:H.resize.y.direction,style:"height"}},H.resize)
}},B.dom)}[B.shadow,B.el.fixOverlayElement].each(function(J){if(J){I.add(J,$merge(H.resize,G),H.resize);
if(H.move){I.add(J,$merge(H.move,G),H.move)}}},B)}}})},makeDraggable:function(){var B=this,E=this.fx.drag=[],A=this.options.container===$(document.body);
var F=function(){return 2-B.el.offsetWidth};var D={container:(this.options.restrict&&!A?this.options.container:null),limit:(A?{x:[F],y:[0]}:{}),snap:this.options.snap.move,onBeforeStart:function(){B.focus();
this.shade=new Fx.Overlay(window,{styles:{cursor:this.options.handle.getStyle("cursor"),background:B.theme.shadeBackground,zIndex:B.zIndex+3}}).show();
if(B.ghost){var G=B.el.getSize().size;this.element.setStyles({zIndex:B.zIndex+3,left:B.el.getStyle("left"),top:B.el.getStyle("top"),width:G.x,height:G.y})
}else{if(window.gecko){Element.$overlay.call(this.shade.overlay,false,2)}}B.fireEvent("onBeforeDrag",this)
},onStart:function(){if(B.maximized&&!B.minimized){this.stop()}else{B.fireEvent("onStartDrag",this)
}},onSnap:function(){if(B.ghost){this.element.setStyle("display","block")}},onDrag:function(){B.fix().fireEvent("onDrag",this)
},onComplete:function(){this.shade.destroy();if(B.ghost){for(var H in this.options.modifiers){if(H=="toJSONString"){continue
}var G=this.options.modifiers[H];B.el.setStyle(G,this.element.getStyle(G))}this.element.setStyle("display","none")
}B.fix().fireEvent("onDragComplete",this)}};if(this.options.ghost.move){this.ghost=new Element("div",{"class":this.theme.ghostClass,styles:{display:"none"}}).injectAfter(this.el)
}this.el.getElements("."+this.theme.classPrefix+"-drag").each(function(G){D.handle=G;
G.setStyle("cursor","move");E.push((this.ghost||this.el).makeDraggable(D))},this)
}});Windoo.Themes.aero={name:"aero",padding:{top:28,right:10,bottom:15,left:10},resizeLimit:{x:[175],y:[58]},className:"windoo windoo-aero",sizerClass:"sizer",classPrefix:"windoo",ghostClass:"windoo-ghost windoo-aero-ghost windoo-hover",hoverClass:"windoo-hover",shadow:"simple window-shadow-aero-simple",shadeBackground:"transparent url(windoo/s.gif)",shadowDisplace:{left:3,top:3,width:0,height:0}};
Windoo.Themes.aqua={name:"aqua",padding:{top:23,right:0,bottom:15,left:0},resizeLimit:{x:[275],y:[37]},className:"windoo windoo-aqua",sizerClass:"sizer",classPrefix:"windoo",ghostClass:"windoo-ghost windoo-aqua-ghost windoo-hover",hoverClass:"windoo-hover",shadeBackground:"transparent url(themes/windoo/s.gif)",shadow:"aqua",complexShadow:true,shadowDisplace:{left:-13,top:-8,width:26,height:31,delta:23}};
Windoo.Ajax=Ajax.extend({onComplete:function(){if(this.options.window){this.options.window.setHTML(this.response.text)
}this.parent()}});Windoo.implement({addPanel:function(E,A){A=$pick(A,"bottom");var I,H,G=this.el.getSize().size,D={position:"absolute"},B={element:$(E),position:A,fx:[]};
switch(A){case"top":case"bottom":I="x";H="y";break;case"left":case"right":I="y";H="x";
break;default:return this}var F=Windoo.panelOptions[I];D[A]=this.padding[A];D[F.deltaP]=this.padding[F.deltaP];
E=B.element.addClass(this.classPrefix("pane")).setStyles(D).inject(this.el);B.padding=E.getSize().size[H];
this.padding[A]+=B.padding;if(this.options.resizable&&!this.options.ghost.resize){this.fx.resize.add(function(J,L){if(L.resize[I]){var M=this.fx[J],K={};
K[I]=$merge(L.resize[I]);K[I].limit=null;B.fx.push({fx:M,bind:M.add(B.element,K,L.resize)})
}})}this.addEvent("onResizeComplete",function(){B.element.setStyle(F.style,this.el.getSize().size[I]-this.padding[F.deltaM]-this.padding[F.deltaP]-1)
});this.panels.push(B);return this.setSize(G.x,G.y)},removePanel:function(D){var B,F;
D=$(D);for(var E=0,A=this.panels.length;E<A;E++){B=this.panels[E];if(B.element===D){this.padding[B.position]-=B.padding;
B.element.remove();B.fx.each(function(G){G.fx.detach(G.bind)},this);this.panels.splice(E,1);
F=this.el.getSize().size;this.setSize(F.x,F.y);break}}return this}});Windoo.panelOptions={x:{style:"width",deltaP:"left",deltaM:"right"},y:{style:"height",deltaP:"top",deltaM:"bottom"}};
Windoo.Dialog=Windoo.extend({initialize:function(E,D){var A=this,B=this.dialog={dom:{},buttons:{},options:$merge(Windoo.Dialog.options,D),message:E};
this.parent($merge({onShow:function(){if(B.buttons.ok){B.buttons.ok.focus()}}},B.options.window));
B.bound=function(F){F=new Event(F);if(["enter","esc"].contains(F.key)){B.result=(F.key=="enter")?!B.cancelFocused:false;
A.close();F.stop()}};document.addEvent("keydown",B.bound);this.addEvent("onClose",function(){document.removeEvent("keydown",B.bound);
B.options[(B.result)?"onConfirm":"onCancel"].call(this)})},buildDialog:function(A,F){var B=this,D=this.dialog;
if("ok" in F){D.buttons.ok=new Element("input",$merge({events:{click:function(){D.result=true;
B.close()}}},D.options.buttons.ok))}if("cancel" in F){D.buttons.cancel=new Element("input",$merge({events:{click:function(){D.result=false;
B.close()}}},D.options.buttons.cancel)).addEvents({focus:function(){D.cancelFocused=true
},blur:function(){D.cancelFocused=false}})}D.dom.panel=new Element("div",$merge({"class":this.classPrefix(A+"-pane")},D.options.panel));
for(var E in F){if(E!="toJSONString"){if(F[E]){D.dom.panel.adopt(D.buttons[E])}}}D.dom.message=new Element("div",$merge({"class":this.classPrefix(A+"-message")},D.options.message));
return this.addPanel(D.dom.panel).adopt(D.dom.message.setHTML(D.message))}});Windoo.Dialog.options={window:{modal:true,resizable:false,buttons:{minimize:false,maximize:false}},buttons:{ok:{properties:{type:"button",value:"OK"}},cancel:{properties:{type:"button",value:"Cancel"}}},panel:null,message:null,onConfirm:Class.empty,onCancel:Class.empty};
Windoo.Alert=Windoo.Dialog.extend({initialize:function(B,A){this.parent(B,A);this.buildDialog("alert",{ok:true}).show()
}});Windoo.Confirm=Windoo.Dialog.extend({initialize:function(B,A){this.parent(B,A);
this.buildDialog("confirm",{ok:true,cancel:true}).show()}});function getScrollerWidth(D){if(!D&&window.scrollerwidth!=undefined){return window.scrollerwidth
}var F=null;var E=null;var A=0;var B=0;F=document.createElement("div");F.style.position="absolute";
F.style.top="-1000px";F.style.left="-1000px";F.style.width="100px";F.style.height="50px";
F.style.overflow="hidden";E=document.createElement("div");E.style.width="100%";E.style.height="200px";
F.appendChild(E);document.body.appendChild(F);A=E.offsetWidth;F.style.overflow="auto";
B=E.offsetWidth;document.body.removeChild(document.body.lastChild);return(window.scrollerwidth=(A-B))
}Element.extend({getMarginLeft:function(){return this.getStyle("marginLeft").toInt()
},getMarginRight:function(){return this.getStyle("marginRight").toInt()},getMarginTop:function(){return this.getStyle("marginTop").toInt()
},getMarginBottom:function(){return this.getStyle("marginBottom").toInt()},getMarginH:function(){return this.getMarginLeft()+this.getMarginRight()
},getMarginV:function(){return this.getMarginTop()+this.getMarginBottom()},getOuterLeft:function(A){return this.getStyle("borderLeftWidth").toInt()+this.getStyle("paddingLeft").toInt()+(A?this.getMarginLeft():0)
},getOuterRight:function(A){return this.getStyle("borderRightWidth").toInt()+this.getStyle("paddingRight").toInt()+(A?this.getMarginRight():0)
},getOuterTop:function(A){return this.getStyle("borderTopWidth").toInt()+this.getStyle("paddingTop").toInt()+(A?this.getMarginTop():0)
},getOuterBottom:function(A){return this.getStyle("borderBottomWidth").toInt()+this.getStyle("paddingBottom").toInt()+(A?this.getMarginBottom():0)
},getOuterH:function(A){return this.getOuterLeft(A)+this.getOuterRight(A)},getOuterV:function(A){return this.getOuterTop(A)+this.getOuterBottom(A)
},getWidth:function(A){return A?this.scrollWidth:this.offsetWidth},getHeight:function(A){return A?this.scrollHeight:this.offsetHeight
},getOuterWidth:function(A){return this.getWidth(A)+this.getMarginH()},getOuterHeight:function(A){return this.getHeight(A)+this.getMarginV()
},getInnerWidth:function(A){return this.getWidth(A)-this.getOuterH()},getInnerHeight:function(A){return this.getHeight(A)-this.getOuterV()
},setWidth:function(B,A){this.setInnerWidth(parseInt(B)-(window.ie?0:this.getOuterH(A)))
},setHeight:function(B,A){this.setInnerHeight(parseInt(B)-(window.ie?0:this.getOuterV(A)))
},setOuterWidth:function(A){this.setWidth(A,true)},setOuterHeight:function(A){this.setHeight(A,true)
},setInnerWidth:function(A){this.setStyle("width",parseInt(A)-(window.ie?this.getOuterH():0)+"px")
},setInnerHeight:function(A){this.setStyle("height",parseInt(A)-(window.ie?this.getOuterV():0)+"px")
}});var MPopupMenu=new Class({initialize:function(){this.lastmenu=0;this.menus=[];
this.items={};this.lastzindex=0;this.lastitemid=0;this.substack=[];this.elements=[];
this.amenushown=false},onBodyDown:function(A){if(!window.moopopupmenu.amenushown){return true
}A=new Event(A);if(!A.target.ismenu){window.moopopupmenu.hideAllMenus()}},onClick2:function(A){this.toggle(A)
},reg:function(A,B){this.elements.push(A);A.onclick=this.onClick2.bind(B)},hideAllMenus:function(){for(var A=0;
A<this.menus.length;++A){if(this.menus[A].isVisible){this.menus[A].hide()}}this.amenushown=false
},onMouseEnter:function(A){if(window.moopopupmenu){window.moopopupmenu.setClassNameOver(this)
}if(this.parentMenu.shownSub&&this.parentMenu.shownSub.parentItem!==this){this.parentMenu.shownSub.hide()
}if(this.subMenu){this.subMenu.show()}},setClassName:function(A){if(A.classNameOver){A.removeClass(A.classNameOver)
}A.addClass(A.classNameNormal);if(A.arrow){A.arrow.className="moopopupitem_arrow"
}},setClassNameOver:function(A){if(A.classNameOver){A.addClass(A.classNameOver);if(A.arrow){A.arrow.className="moopopupitem_arrow_over"
}}},onMouseLeave:function(A){if(!this.subMenu){window.moopopupmenu.setClassName(this)
}var A=new Event(A);if(this.hideOnMouseLeave&&(!A.relatedTarget.ismenu||typeof (A.relatedTarget.ismenu)=="undefined")){window.moopopupmenu.hideAllMenus()
}A.stop()},onClick:function(e){if(this.stuff.istitle||this.stuff.text=="-"||(this.subMenu&&!this.stuff.command)){return 
}if(this.stuff.hideOnClick){window.moopopupmenu.hideAllMenus()}if(this.stuff.toggleable&&!this.stuff.fn){if(this.hasClass("moopopupitem_toggled")){this.removeClass("moopopupitem_toggled")
}else{this.addClass("moopopupitem_toggled")}}if(this.stuff.command){eval(this.stuff.command)
}if(this.stuff.fn){var result=this.stuff.fn.create({bind:this,"arguments":this.stuff.args})();
if(this.stuff.toggleable&&result){if(this.hasClass("moopopupitem_toggled")){this.removeClass("moopopupitem_toggled")
}else{this.addClass("moopopupitem_toggled")}}}}});MPopupMenu.implement(new Events);
window.moopopupmenu=new MPopupMenu();var Item=new Class({initialize:function(B,A,E,D){this.menuObj=null;
this.items={};this.parentItem=B;this.isVisible=false;this.hideOnMouseLeave=D},a:function(A){return this.addItem(A?{path:A.p,text:A.t,command:A.c,istitle:A.is,icon:A.i,func:A.fn,args:A.args,hideOnClick:A.hideOnClick,toggleable:A.toggleable,toggled:A.toggled}:undefined)
},addItem:function(D){if(!D){return }var H=this.menuObj;var B=null;var I=null;if(typeof (D.hideOnClick)=="undefined"){D.hideOnClick=true
}if(typeof (D.toggleable)=="undefined"){D.toggleable=true}if(!D.path||D.path.length==0){D.path="/unnamed"+(++window.moopopupmenu.lastitemid)
}if(D.path&&D.path.length>1){var G=D.path.lastIndexOf("/");if(G<=0||this.parentItem!=undefined){I=D.path
}else{B=D.path.substr(0,G);var L=window.moopopupmenu.items[B];if(!L){return }if(!L.subMenu){L.subMenu=new mooPopupMenu(L);
L.subMenu.addEvent(RENAME,function(M){this.fireEvent(RENAME,M)}.bindAsEventListener(this));
L.subMenu.addEvent(IDENTICAL,function(M){this.fireEvent(IDENTICAL,M)}.bindAsEventListener(this));
var J=document.createElement("div");J.className="moopopupitem_arrow";L.arrow=J;L.insertBefore(J,L.firstChild)
}L.subMenu.addItem(D);return L}}var L=new Element("div");L.stuff=D;L.ismenu=true;
if(D.istitle){L.classNameNormal="moopopupitem_title"}else{if(D.text=="-"){L.classNameNormal="moopopupitem_separator"
}else{L.classNameNormal="moopopupitem "+D.path.htmlUsable();L.classNameOver="moopopupitem_over "+D.path.htmlUsable()
}}if(D.toggled){L.addClass("moopopupitem_toggled")}window.moopopupmenu.setClassName(L);
L.onmouseover=window.moopopupmenu.onMouseEnter;L.onmouseout=window.moopopupmenu.onMouseLeave;
L.hideOnMouseLeave=this.hideOnMouseLeave;L.onclick=window.moopopupmenu.onClick;if(D.text!="-"){var F=document.createElement("span");
F.className="moopopupitem_icon";F.ismenu=true;if(D.icon&&D.icon.length){if(D.icon.charAt(0)=="<"){F.innerHTML=D.icon
}else{var E=document.createElement("img");E.src=D.icon;F.appendChild(E);E.className="moopopupitem_icon";
E.ismenu=true}}L.appendChild(F);if(D.text){var A=new Element("span",{id:D.path.htmlUsable()+"_span"});
A.appendChild(document.createTextNode(D.text));L.span=A;L.appendChild(A);A.ismenu=true;
A.addEvent(RENAME,function(M){this.fireEvent(RENAME,M)}.bindAsEventListener(this));
A.addEvent(IDENTICAL,function(M){this.fireEvent(IDENTICAL,M)}.bindAsEventListener(this))
}}else{var K=document.createElement("div");K.className="moopopupitem_hr";K.ismenu=true;
L.appendChild(K)}L.parentMenu=this.menuObj;this.menuObj.appendChild(L);window.moopopupmenu.items[I]=L;
return L},rename:function(D,A){var B=$(D.htmlUsable()+"_span");if(B!=null){cambia(B,A)
}},moveItem:function(G,B){var E=0;while(E<window.moopopupmenu.lastmenu){var D=0;var F=window.moopopupmenu.menus[E].menuObj.getElementsByTagName("div");
while(D<F.length){if(typeof (F[D].stuff)!="undefined"&&F[D].stuff.path==G){break}D++
}if(D<F.length){break}E++}if(E<window.moopopupmenu.lastmenu){var A=B.htmlUsable();
F[D].classNameOver="moopopupitem_over "+A;F[D].classNameNormal="moopopupitem "+A;
F[D].className=F[D].classNameNormal;F[D].stuff.path=B;$(G.htmlUsable()+"_span").id=A+"_span"
}},remove:function(A){$$("."+A.htmlUsable()).each(function(B){B.remove()})},addCloseBox:function(){var A=new Element("a",{id:"moopopupitem_title_close",href:"#"});
A.addEvent("click",function(B){this.hide()}.bindAsEventListener(this));this.menuObj.insertBefore(A,this.menuObj.firstChild)
},show:function(A,H,P,I){var O=4;if(this.isVisible){return }this.menuObj.setStyles({left:0,top:0});
this.menuObj.setStyle("visibility","hidden");this.menuObj.setStyle("display","inline");
if(this.hideOnMouseLeave){this.menuObj.onmouseout=window.moopopupmenu.onMouseLeave
}if(window.moopopupmenu.lastzindex==0){window.moopopupmenu.lastzindex=this.menuObj.getStyle("zIndex")
}var K,J;var L;if(typeof (H)!="undefined"){L=H;this.menuObj.setStyle("width",L)}else{L=this.menuObj.getWidth()
}var F=this.menuObj.getHeight();var D=window.getScrollLeft(),N=window.getScrollTop();
if(!this.parentItem){window.moopopupmenu.hideAllMenus();K=A.page.x-D;J=A.page.y-N;
if(K+L>window.getWidth()){if(K<L){K=D}else{K=A.page.x-L}}else{K=A.page.x}if(J+F>window.getHeight()){if(J<F){K=N
}else{J=A.page.y-F}}else{J=A.page.y}}else{this.parentItem.parentMenu.shownSub=this;
var B=this.parentItem.parentMenu.getPosition();var M=this.parentItem.getPosition();
var E=this.parentItem.parentMenu.getWidth();var G=this.parentItem.getHeight();K=(B.x+E-O)-D;
J=M.y-N;if(K+L>window.getWidth()){if(B.x-L+O<D){K=D}else{K=B.x-L+O}}else{K=B.x+E-O
}if(J+F>window.getHeight()){if(M.y+G-F<N){J=N}else{J=M.y+G-F}}else{J=M.y}}if(typeof (P)!="undefined"){J=P
}if(typeof (I)!="undefined"){K=I}this.menuObj.setStyles({left:K,top:J});this.menuObj.setStyle("zIndex",++window.moopopupmenu.lastzindex);
this.menuObj.setStyle("visibility","visible");this.isVisible=true;window.moopopupmenu.amenushown=true;
if(A){A.stop()}},hide:function(){if(!this.isVisible){return }window.moopopupmenu.lastzindex=this.menuObj.getStyle("zIndex");
this.menuObj.setStyle("display","none");if(this.parentItem){window.moopopupmenu.setClassName(this.parentItem.parentMenu.shownSub.parentItem);
this.parentItem.parentMenu.shownSub=undefined}var A=this.menuObj.getChildren();for(var B in A){if(A[B].subMenu){A[B].subMenu.hide()
}}this.isVisible=false},toggle:function(E,B,D,A){if(this.isVisible){this.hide()}else{this.show(new Event(E),B,D,A)
}}});Item.implement(new Events);var mooPopupMenu=new Class({initialize:function(parent,items,addCloseBox,hideOnMouseLeave){window.moopopupmenu.menus[window.moopopupmenu.lastmenu]=new Item(parent,items,addCloseBox,hideOnMouseLeave);
window.moopopupmenu.menus[window.moopopupmenu.lastmenu].addEvent(RENAME,function(e){this.fireEvent(RENAME,e)
}.bindAsEventListener(this));window.moopopupmenu.menus[window.moopopupmenu.lastmenu].addEvent(IDENTICAL,function(e){this.fireEvent(IDENTICAL,e)
}.bindAsEventListener(this));var ret;if(window.moopopupmenu.lastmenu==0){document.body.onclick=window.moopopupmenu.onBodyDown
}with(window.moopopupmenu.menus[window.moopopupmenu.lastmenu]){menuObj=window.ie?new Element("div"):document.createElement("div");
menuObj.className="moopopupmenu";menuObj.ismenu=true;if(hideOnMouseLeave){menuObj.addEvent("mouseout",function(e){var e=new Event(e);
if(!e.relatedTarget.ismenu||typeof (e.relatedTarget.ismenu)=="undefined"){window.moopopupmenu.hideAllMenus()
}e.stop()})}menuObj.addEvent("blur",function(e){var e=new Event(e);if(!e.target.ismenu){window.moopopupmenu.hideAllMenus()
}e.stop()});document.body.appendChild(menuObj);ret=window.moopopupmenu.menus[window.moopopupmenu.lastmenu];
++window.moopopupmenu.lastmenu}if(items){var end=items.length-1;for(var c=0;c<end;
c++){ret.a(items[c])}}return ret}});mooPopupMenu.implement(new Events);window.moocombobox={lastcombo:0,combos:[],elements:[],lastzindex:0,lastitemid:0,acomboshown:false,onBodyDown:function(A){if(!window.moocombobox.acomboshown){return true
}A=new Event(A);if(!A.target.iscombo){window.moocombobox.hideAllCombos()}},onClick2:function(A){this.toggle(A)
},reg:function(A,B){this.elements.push(A);A.onclick=this.onClick2.bind(B)},hideAllCombos:function(){for(var A=0;
A<this.combos.length;++A){if(this.combos[A].isVisible){this.combos[A].hide()}}this.acomboshown=false
},setClassName:function(A){A.removeClass("moocombobox_optionover")},setClassNameOver:function(A){A.addClass("moocombobox_optionover")
},onMouseEnter:function(A){window.moocombobox.setClassNameOver(this)},onMouseLeave:function(A){window.moocombobox.setClassName(this)
},onClick:function(A){this.combo.selectIndex(this.index);window.moocombobox.hideAllCombos()
}};function mooComboBox(combo){if(combo.type=="select-multiple"){return mooListBox(combo)
}window.moocombobox.combos[window.moocombobox.lastcombo]={comboObj:null,dropdownObj:null,containerObj2:null,inputObj:null,isVisible:false,blur:function(){},focus:function(){},form:null,handleEvent:function(event){},length:0,name:null,options:[],selectedIndex:-1,type:null,disabled:false,value:null,addOptgroup:function(label){var e=window.ie?new Element("span"):document.createElement("span");
e.id="optgroup"+this.options.length;e.setText(label);e.label=label;e.className="moocombobox_optgroup";
e.combo=this;this.containerObj2.appendChild(e)},addItem:function(option){var e=window.ie?new Element("div"):document.createElement("div");
e.id="option"+this.options.length;e.index=this.options.length;e.innerHTML=(option.text);
e.value=option.value;e.text=option.text;e.className="moocombobox_option";if(option.issuboption){e.addClass("moocombobox_suboption")
}e.issuboption=option.issuboption;e.selected=false;e.onmouseover=window.moocombobox.onMouseEnter;
e.onmouseout=window.moocombobox.onMouseLeave;e.onclick=window.moocombobox.onClick;
e.combo=this;this.containerObj2.appendChild(e);this.options[this.options.length]=e
},selectIndex:function(index){if(index<0){index=-1}else{if(index>=this.options.length){index=-1
}}this.selectedIndex=index;var opt=this.options[index];this.inputObj.value=opt.text;
this.value=opt.value},setName:function(name){this.inputObj.name=name},setDisabled:function(disabled){this.hide();
this.inputObj.disabled=this.disabled=disabled},show:function(event){if(this.isVisible){return 
}this.dropdownObj.setStyle("visibility","hidden");this.dropdownObj.setStyle("display","inline");
if(window.moocombobox.lastzindex==0){window.moocombobox.lastzindex=this.comboObj.getStyle("zIndex")
}var pos=this.inputObj.getPosition();window.moocombobox.hideAllCombos();pos.y+=this.inputObj.getOuterHeight();
this.dropdownObj.setStyles({left:pos.x,top:pos.y});this.dropdownObj.setWidth(this.comboObj.getWidth());
var h=Math.min(250,this.containerObj2.getOuterHeight());this.containerObj2.setOuterHeight(h);
this.containerObj2.setOuterWidth(this.inputObj.getWidth());this.dropdownObj.setInnerHeight(h);
this.dropdownObj.setStyle("zIndex",++window.moocombobox.lastzindex);this.dropdownObj.setStyle("visibility","visible");
this.isVisible=true;window.moocombobox.acomboshown=true;if(event){event.stop()}},hide:function(){if(!this.isVisible){return 
}window.moocombobox.lastzindex=this.dropdownObj.getStyle("zIndex");this.dropdownObj.setStyle("display","none");
this.isVisible=false},toggle:function(event){if(this.isVisible){this.hide()}else{this.show(new Event(event))
}}};var ret;if(window.moocombobox.lastcombo==0){(window.ie?$(document.body):document.body).addEvent("click",window.moocombobox.onBodyDown)
}ret=window.moocombobox.combos[window.moocombobox.lastcombo];with(window.moocombobox.combos[window.moocombobox.lastcombo]){comboObj=window.ie?new Element("span"):document.createElement("span");
inputObj=window.ie?new Element("input"):document.createElement("input");inputObj.setProperties({type:"text",readonly:"readonly"});
inputObj.className="moocombobox";inputObj.setWidth(combo.getWidth());comboObj.appendChild(inputObj);
combo.parentNode.replaceChild(comboObj,combo);dropdownObj=window.ie?new Element("span"):document.createElement("span");
dropdownObj.setStyles({position:"absolute",visibility:"hidden",overflow:"hidden"});
containerObj2=window.ie?new Element("div"):document.createElement("div");containerObj2.className="moocombobox_dropdown";
dropdownObj.appendChild(containerObj2);dropdownObj.injectAfter(comboObj);comboObj.onclick=function(event){if(!this.disabled){this.toggle(event)
}}.bind(ret);form=combo.form;type=combo.type;for(var c=0;c<combo.childNodes.length;
++c){var nod=combo.childNodes[c];if(nod.nodeType!=1){continue}var tag=nod.tagName.toLowerCase();
if(tag=="option"){addItem(new Option(nod.text,nod.value))}else{if(tag=="optgroup"){addOptgroup(nod.label);
for(var c2=0;c2<nod.childNodes.length;++c2){var nod2=nod.childNodes[c2];if(nod2.nodeType!=1||nod2.tagName.toLowerCase()!="option"){continue
}var o=new Option(nod2.text,nod2.value);o.issuboption=true;addItem(o)}}}}selectIndex(combo.selectedIndex);
++window.moocombobox.lastcombo}return ret}var SimpleTabs=new Class({options:{show:0,entrySelector:".tab-entry",classWrapper:"tab-wrapper",classMenu:"tab-menu",classContainer:"tab-container",onShow:function(D,B,A){D.addClass("tab-selected");
B.setStyle("display","")},onHide:function(D,B,A){D.removeClass("tab-selected");B.setStyle("display","none")
},onRequest:function(D,B,A){B.addClass("tab-ajax-loading")},onComplete:function(D,B,A){B.removeClass("tab-ajax-loading")
},onFailure:function(D,B,A){B.removeClass("tab-ajax-loading")},getContent:null},initialize:function(B,A){this.setOptions(A);
this.element=$(B);this.selected=null;this.build()},build:function(){this.entries=[];
this.menu=new Element("ul",{"class":this.options.classMenu});this.wrapper=new Element("div",{"class":this.options.classWrapper});
this.element.getElements(this.options.entrySelector).each(function(A){var B=A.href||(this.options.getContent?this.options.getContent.call(this,A):A.getNext());
this.addTab(A.innerHTML,A.title||A.innerHTML,B)},this);this.element.empty().adopt(this.menu).adopt(this.wrapper);
if(this.entries.length){this.select(this.options.show)}},addTab:function(F,E,D){if($type(D)=="string"&&!$(D)){var A=D
}var B=$(D)||new Element("div");this.entries.push({container:B.setStyle("display","none").addClass(this.options.classContainer).inject(this.wrapper),toggle:new Element("li").adopt(new Element("a",{href:"#",title:E,events:{click:this.onClick.bindWithEvent(this,[this.entries.length])}}).setHTML(F)).inject(this.menu),url:A||null});
return this},onClick:function(A,B){A.stop();this.select(B)},select:function(A){if(this.selected===A||!this.entries[A]){return this
}var B=this.entries[A];var E=[B.toggle,B.container,A];if(this.selected!==null){var D=this.entries[this.selected];
if(this.ajax&&this.ajax.running){this.ajax.cancel()}E.concat([D.toggle,D.container,this.selected]);
this.fireEvent("onHide",[D.toggle,D.container,this.selected])}this.fireEvent("onShow",E);
if(B.url&&!B.loaded){this.ajax=new Ajax(B.url,$merge({onRequest:this.fireEvent.pass(["onRequest",E],this),onFailure:this.fireEvent.pass(["onFailure",E],this),onComplete:function(F){B.loaded=true;
B.container.empty().setHTML(F);this.fireEvent("onComplete",E)}.bind(this)},this.options.ajaxOptions)).request()
}this.selected=A;return this}});SimpleTabs.implement(new Events,new Options);var changing=false;
function fieldEnter(B,D,A,E){var F=new Event(A);if(F.code==13&&B.value!=""){elem=$(E);
noLight(elem);elem.innerHTML=B.value;elem.previousText=D;changing=false;elem.fireEvent(RENAME,elem);
return false}else{if(F.code==27){elem=$(E);noLight(elem);elem.setText(D);changing=false;
elem.fireEvent(IDENTICAL,elem);return false}}return true}function fieldBlur(A,D,B,E){alert(A.hasFocus());
if(A.value!=""){elem=$(D);elem.innerHTML=B;noLight(elem);changing=false;elem.fireEvent(IDENTICAL);
return false}}function cambia(E,B){if(!changing){width=widthEl(E.id);height=heightEl(E.id);
var D=E.getText();changing=true;if(width<100){width=150}E.innerHTML='<input id="'+E.id+'_field" value="'+D+'"/>';
var A=$(E.id+"_field");A.setAttribute("style",{width:width,height:height,maxlength:254});
if(typeof (B)!="undefined"){A.setAttribute("class",B)}A.setAttribute("type","text");
A.select();A.addEvent("blur",function(G){var G=new Event(G);G.stop()}.bindAsEventListener(A));
A.onclick=function(G){var G=new Event(G);G.stop()};A.addEvent("keyup",function(H){var H=new Event(H);
var G=fieldEnter(this,D,H,E.id);H.stop();return G}.bindAsEventListener(A));A.addEvent("focus",function(G){if(typeof (B)=="undefined"){highLight(this)
}else{this.addClass(B);this.highlightedClassName=B}}.bindAsEventListener(A))}var F=E.firstChild;
while(typeof (F)!="undefined"&&F!=null&&F.nodeName!="input"&&F.nodeName!="INPUT"&&F.nodeName!="textarea"&&F.nodeName!="TEXTAREA"){F=F.firstChild
}if(typeof (F)!="undefined"&&F!=null){F.focus()}}function widthEl(A){if(document.layers){w=document.layers[A].clip.width
}else{if(document.all&&!document.getElementById){w=document.all[A].offsetWidth}else{if(document.getElementById){w=$(A).offsetWidth
}}}return w}function heightEl(A){if(document.layers){h=document.layers[A].clip.height
}else{if(document.all&&!document.getElementById){h=document.all[A].offsetHeight}else{if(document.getElementById){h=$(A).offsetHeight
}}}return h}function highLight(A){A.parentNode.style.border="2px solid #D1FDCD";A.parentNode.style.padding="0";
A.style.border="1px solid #54CE43"}function noLight(A){if(typeof (A.highlightedClassName)!="undefined"){A.removeClass(A.highlightedClassName)
}else{A.style.border="0px"}}var JSJAC_HAVEKEYS=true;var JSJAC_NKEYS=16;var JSJAC_INACTIVITY=300;
var JSJAC_ERR_COUNT=10;var JSJAC_ALLOW_PLAIN=true;var JSJAC_CHECKQUEUEINTERVAL=1;
var JSJAC_CHECKINQUEUEINTERVAL=1;var JSJACHBC_BOSH_VERSION="1.6";var JSJACHBC_USE_BOSH_VER=true;
var JSJACHBC_MAX_HOLD=1;var JSJACHBC_MAX_WAIT=300;var JSJACHBC_MAXPAUSE=120;String.prototype.htmlEnc=function(){var A=this.replace(/&/g,"&amp;");
A=A.replace(/</g,"&lt;");A=A.replace(/>/g,"&gt;");A=A.replace(/\"/g,"&quot;");A=A.replace(/\n/g,"<br />");
return A};Date.jab2date=function(B){var A=new Date(Date.UTC(B.substr(0,4),B.substr(5,2)-1,B.substr(8,2),B.substr(11,2),B.substr(14,2),B.substr(17,2)));
if(B.substr(B.length-6,1)!="Z"){var D=new Date();D.setTime(0);D.setUTCHours(B.substr(B.length-5,2));
D.setUTCMinutes(B.substr(B.length-2,2));if(B.substr(B.length-6,1)=="+"){A.setTime(A.getTime()-D.getTime())
}else{if(B.substr(B.length-6,1)=="-"){A.setTime(A.getTime()+D.getTime())}}}return A
};Date.hrTime=function(A){return Date.jab2date(A).toLocaleString()};Date.prototype.jabberDate=function(){var A=function(D){if(D<10){return"0"+D
}return D};var B=this.getUTCFullYear()+"-";B+=A(this.getUTCMonth()+1)+"-";B+=A(this.getUTCDate())+"T";
B+=A(this.getUTCHours())+":";B+=A(this.getUTCMinutes())+":";B+=A(this.getUTCSeconds())+"Z";
return B};Number.max=function(D,E){return(D>E)?D:E};var hexcase=0;var b64pad="=";
var chrsz=8;function hex_sha1(A){return binb2hex(core_sha1(str2binb(A),A.length*chrsz))
}function b64_sha1(A){return binb2b64(core_sha1(str2binb(A),A.length*chrsz))}function str_sha1(A){return binb2str(core_sha1(str2binb(A),A.length*chrsz))
}function hex_hmac_sha1(A,B){return binb2hex(core_hmac_sha1(A,B))}function b64_hmac_sha1(A,B){return binb2b64(core_hmac_sha1(A,B))
}function str_hmac_sha1(A,B){return binb2str(core_hmac_sha1(A,B))}function sha1_vm_test(){return hex_sha1("abc")=="a9993e364706816aba3e25717850c26c9cd0d89d"
}function core_sha1(N,I){N[I>>5]|=128<<(24-I%32);N[((I+64>>9)<<4)+15]=I;var P=Array(80);
var O=1732584193;var M=-271733879;var L=-1732584194;var K=271733878;var J=-1009589776;
for(var F=0;F<N.length;F+=16){var H=O;var G=M;var E=L;var D=K;var A=J;for(var B=0;
B<80;B++){if(B<16){P[B]=N[F+B]}else{P[B]=rol(P[B-3]^P[B-8]^P[B-14]^P[B-16],1)}var Q=safe_add(safe_add(rol(O,5),sha1_ft(B,M,L,K)),safe_add(safe_add(J,P[B]),sha1_kt(B)));
J=K;K=L;L=rol(M,30);M=O;O=Q}O=safe_add(O,H);M=safe_add(M,G);L=safe_add(L,E);K=safe_add(K,D);
J=safe_add(J,A)}return Array(O,M,L,K,J)}function sha1_ft(B,A,E,D){if(B<20){return(A&E)|((~A)&D)
}if(B<40){return A^E^D}if(B<60){return(A&E)|(A&D)|(E&D)}return A^E^D}function sha1_kt(A){return(A<20)?1518500249:(A<40)?1859775393:(A<60)?-1894007588:-899497514
}function core_hmac_sha1(D,G){var F=str2binb(D);if(F.length>16){F=core_sha1(F,D.length*chrsz)
}var A=Array(16),E=Array(16);for(var B=0;B<16;B++){A[B]=F[B]^909522486;E[B]=F[B]^1549556828
}var H=core_sha1(A.concat(str2binb(G)),512+G.length*chrsz);return core_sha1(E.concat(H),512+160)
}function safe_add(A,E){var D=(A&65535)+(E&65535);var B=(A>>16)+(E>>16)+(D>>16);return(B<<16)|(D&65535)
}function rol(A,B){return(A<<B)|(A>>>(32-B))}function str2binb(E){var D=Array();var A=(1<<chrsz)-1;
for(var B=0;B<E.length*chrsz;B+=chrsz){D[B>>5]|=(E.charCodeAt(B/chrsz)&A)<<(32-chrsz-B%32)
}return D}function binb2str(D){var E="";var A=(1<<chrsz)-1;for(var B=0;B<D.length*32;
B+=chrsz){E+=String.fromCharCode((D[B>>5]>>>(32-chrsz-B%32))&A)}return E}function binb2hex(D){var B=hexcase?"0123456789ABCDEF":"0123456789abcdef";
var E="";for(var A=0;A<D.length*4;A++){E+=B.charAt((D[A>>2]>>((3-A%4)*8+4))&15)+B.charAt((D[A>>2]>>((3-A%4)*8))&15)
}return E}function binb2b64(E){var D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var G="";for(var B=0;B<E.length*4;B+=3){var F=(((E[B>>2]>>8*(3-B%4))&255)<<16)|(((E[B+1>>2]>>8*(3-(B+1)%4))&255)<<8)|((E[B+2>>2]>>8*(3-(B+2)%4))&255);
for(var A=0;A<4;A++){if(B*8+A*6>E.length*32){G+=b64pad}else{G+=D.charAt((F>>6*(3-A))&63)
}}}return G}function hex_md5(A){return binl2hex(core_md5(str2binl(A),A.length*chrsz))
}function b64_md5(A){return binl2b64(core_md5(str2binl(A),A.length*chrsz))}function str_md5(A){return binl2str(core_md5(str2binl(A),A.length*chrsz))
}function hex_hmac_md5(A,B){return binl2hex(core_hmac_md5(A,B))}function b64_hmac_md5(A,B){return binl2b64(core_hmac_md5(A,B))
}function str_hmac_md5(A,B){return binl2str(core_hmac_md5(A,B))}function md5_vm_test(){return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72"
}function core_md5(K,G){K[G>>5]|=128<<((G)%32);K[(((G+64)>>>9)<<4)+14]=G;var L=1732584193;
var J=-271733879;var I=-1732584194;var H=271733878;for(var D=0;D<K.length;D+=16){var F=L;
var E=J;var B=I;var A=H;L=md5_ff(L,J,I,H,K[D+0],7,-680876936);H=md5_ff(H,L,J,I,K[D+1],12,-389564586);
I=md5_ff(I,H,L,J,K[D+2],17,606105819);J=md5_ff(J,I,H,L,K[D+3],22,-1044525330);L=md5_ff(L,J,I,H,K[D+4],7,-176418897);
H=md5_ff(H,L,J,I,K[D+5],12,1200080426);I=md5_ff(I,H,L,J,K[D+6],17,-1473231341);J=md5_ff(J,I,H,L,K[D+7],22,-45705983);
L=md5_ff(L,J,I,H,K[D+8],7,1770035416);H=md5_ff(H,L,J,I,K[D+9],12,-1958414417);I=md5_ff(I,H,L,J,K[D+10],17,-42063);
J=md5_ff(J,I,H,L,K[D+11],22,-1990404162);L=md5_ff(L,J,I,H,K[D+12],7,1804603682);H=md5_ff(H,L,J,I,K[D+13],12,-40341101);
I=md5_ff(I,H,L,J,K[D+14],17,-1502002290);J=md5_ff(J,I,H,L,K[D+15],22,1236535329);
L=md5_gg(L,J,I,H,K[D+1],5,-165796510);H=md5_gg(H,L,J,I,K[D+6],9,-1069501632);I=md5_gg(I,H,L,J,K[D+11],14,643717713);
J=md5_gg(J,I,H,L,K[D+0],20,-373897302);L=md5_gg(L,J,I,H,K[D+5],5,-701558691);H=md5_gg(H,L,J,I,K[D+10],9,38016083);
I=md5_gg(I,H,L,J,K[D+15],14,-660478335);J=md5_gg(J,I,H,L,K[D+4],20,-405537848);L=md5_gg(L,J,I,H,K[D+9],5,568446438);
H=md5_gg(H,L,J,I,K[D+14],9,-1019803690);I=md5_gg(I,H,L,J,K[D+3],14,-187363961);J=md5_gg(J,I,H,L,K[D+8],20,1163531501);
L=md5_gg(L,J,I,H,K[D+13],5,-1444681467);H=md5_gg(H,L,J,I,K[D+2],9,-51403784);I=md5_gg(I,H,L,J,K[D+7],14,1735328473);
J=md5_gg(J,I,H,L,K[D+12],20,-1926607734);L=md5_hh(L,J,I,H,K[D+5],4,-378558);H=md5_hh(H,L,J,I,K[D+8],11,-2022574463);
I=md5_hh(I,H,L,J,K[D+11],16,1839030562);J=md5_hh(J,I,H,L,K[D+14],23,-35309556);L=md5_hh(L,J,I,H,K[D+1],4,-1530992060);
H=md5_hh(H,L,J,I,K[D+4],11,1272893353);I=md5_hh(I,H,L,J,K[D+7],16,-155497632);J=md5_hh(J,I,H,L,K[D+10],23,-1094730640);
L=md5_hh(L,J,I,H,K[D+13],4,681279174);H=md5_hh(H,L,J,I,K[D+0],11,-358537222);I=md5_hh(I,H,L,J,K[D+3],16,-722521979);
J=md5_hh(J,I,H,L,K[D+6],23,76029189);L=md5_hh(L,J,I,H,K[D+9],4,-640364487);H=md5_hh(H,L,J,I,K[D+12],11,-421815835);
I=md5_hh(I,H,L,J,K[D+15],16,530742520);J=md5_hh(J,I,H,L,K[D+2],23,-995338651);L=md5_ii(L,J,I,H,K[D+0],6,-198630844);
H=md5_ii(H,L,J,I,K[D+7],10,1126891415);I=md5_ii(I,H,L,J,K[D+14],15,-1416354905);J=md5_ii(J,I,H,L,K[D+5],21,-57434055);
L=md5_ii(L,J,I,H,K[D+12],6,1700485571);H=md5_ii(H,L,J,I,K[D+3],10,-1894986606);I=md5_ii(I,H,L,J,K[D+10],15,-1051523);
J=md5_ii(J,I,H,L,K[D+1],21,-2054922799);L=md5_ii(L,J,I,H,K[D+8],6,1873313359);H=md5_ii(H,L,J,I,K[D+15],10,-30611744);
I=md5_ii(I,H,L,J,K[D+6],15,-1560198380);J=md5_ii(J,I,H,L,K[D+13],21,1309151649);L=md5_ii(L,J,I,H,K[D+4],6,-145523070);
H=md5_ii(H,L,J,I,K[D+11],10,-1120210379);I=md5_ii(I,H,L,J,K[D+2],15,718787259);J=md5_ii(J,I,H,L,K[D+9],21,-343485551);
L=safe_add(L,F);J=safe_add(J,E);I=safe_add(I,B);H=safe_add(H,A)}return Array(L,J,I,H)
}function md5_cmn(G,D,B,A,F,E){return safe_add(bit_rol(safe_add(safe_add(D,G),safe_add(A,E)),F),B)
}function md5_ff(D,B,H,G,A,F,E){return md5_cmn((B&H)|((~B)&G),D,B,A,F,E)}function md5_gg(D,B,H,G,A,F,E){return md5_cmn((B&G)|(H&(~G)),D,B,A,F,E)
}function md5_hh(D,B,H,G,A,F,E){return md5_cmn(B^H^G,D,B,A,F,E)}function md5_ii(D,B,H,G,A,F,E){return md5_cmn(H^(B|(~G)),D,B,A,F,E)
}function core_hmac_md5(D,G){var F=str2binl(D);if(F.length>16){F=core_md5(F,D.length*chrsz)
}var A=Array(16),E=Array(16);for(var B=0;B<16;B++){A[B]=F[B]^909522486;E[B]=F[B]^1549556828
}var H=core_md5(A.concat(str2binl(G)),512+G.length*chrsz);return core_md5(E.concat(H),512+128)
}function safe_add(A,E){var D=(A&65535)+(E&65535);var B=(A>>16)+(E>>16)+(D>>16);return(B<<16)|(D&65535)
}function bit_rol(A,B){return(A<<B)|(A>>>(32-B))}function str2binl(E){var D=Array();
var A=(1<<chrsz)-1;for(var B=0;B<E.length*chrsz;B+=chrsz){D[B>>5]|=(E.charCodeAt(B/chrsz)&A)<<(B%32)
}return D}function binl2str(D){var E="";var A=(1<<chrsz)-1;for(var B=0;B<D.length*32;
B+=chrsz){E+=String.fromCharCode((D[B>>5]>>>(B%32))&A)}return E}function binl2hex(D){var B=hexcase?"0123456789ABCDEF":"0123456789abcdef";
var E="";for(var A=0;A<D.length*4;A++){E+=B.charAt((D[A>>2]>>((A%4)*8+4))&15)+B.charAt((D[A>>2]>>((A%4)*8))&15)
}return E}function binl2b64(E){var D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var G="";for(var B=0;B<E.length*4;B+=3){var F=(((E[B>>2]>>8*(B%4))&255)<<16)|(((E[B+1>>2]>>8*((B+1)%4))&255)<<8)|((E[B+2>>2]>>8*((B+2)%4))&255);
for(var A=0;A<4;A++){if(B*8+A*6>E.length*32){G+=b64pad}else{G+=D.charAt((F>>6*(3-A))&63)
}}}return G}function utf8t2d(A){A=A.replace(/\r\n/g,"\n");var B=new Array;var F=String.fromCharCode(237);
if(F.charCodeAt(0)<0){for(var E=0;E<A.length;E++){var D=A.charCodeAt(E);if(D>0){B[B.length]=D
}else{B[B.length]=(((256+D)>>6)|192);B[B.length]=(((256+D)&63)|128)}}}else{for(var E=0;
E<A.length;E++){var D=A.charCodeAt(E);if(D<128){B[B.length]=D}else{if((D>127)&&(D<2048)){B[B.length]=((D>>6)|192);
B[B.length]=((D&63)|128)}else{B[B.length]=((D>>12)|224);B[B.length]=(((D>>6)&63)|128);
B[B.length]=((D&63)|128)}}}}return B}function utf8d2t(D){var B=new Array;var A=0;
while(A<D.length){if(D[A]<128){B[B.length]=String.fromCharCode(D[A]);A++}else{if((D[A]>191)&&(D[A]<224)){B[B.length]=String.fromCharCode(((D[A]&31)<<6)|(D[A+1]&63));
A+=2}else{B[B.length]=String.fromCharCode(((D[A]&15)<<12)|((D[A+1]&63)<<6)|(D[A+2]&63));
A+=3}}}return B.join("")}function b64arrays(){var B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
b64=new Array();f64=new Array();for(var A=0;A<B.length;A++){b64[A]=B.charAt(A);f64[B.charAt(A)]=A
}}function b64d2t(F){var E=new Array;var D=0;var A=F.length;if((A%3)==1){F[F.length]=0;
F[F.length]=0}if((A%3)==2){F[F.length]=0}while(D<F.length){E[E.length]=b64[F[D]>>2];
E[E.length]=b64[((F[D]&3)<<4)|(F[D+1]>>4)];E[E.length]=b64[((F[D+1]&15)<<2)|(F[D+2]>>6)];
E[E.length]=b64[F[D+2]&63];if((D%57)==54){E[E.length]="\n"}D+=3}if((A%3)==1){E[E.length-1]=E[E.length-2]="="
}if((A%3)==2){E[E.length-1]="="}var B=E.join("");return B}function b64t2d(B){var D=new Array;
var A=0;B=B.replace(/\n|\r/g,"");B=B.replace(/=/g,"");while(A<B.length){D[D.length]=(f64[B.charAt(A)]<<2)|(f64[B.charAt(A+1)]>>4);
D[D.length]=(((f64[B.charAt(A+1)]&15)<<4)|(f64[B.charAt(A+2)]>>2));D[D.length]=(((f64[B.charAt(A+2)]&3)<<6)|(f64[B.charAt(A+3)]));
A+=4}if(B.length%4==2){D=D.slice(0,D.length-2)}if(B.length%4==3){D=D.slice(0,D.length-1)
}return D}if(typeof (atob)=="undefined"||typeof (btoa)=="undefined"){b64arrays()}if(typeof (atob)=="undefined"){atob=function(A){return utf8d2t(b64t2d(A))
}}if(typeof (btoa)=="undefined"){btoa=function(A){return b64d2t(utf8t2d(A))}}function cnonce(D){var E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
var A="";for(var B=0;B<D;B++){A+=E.charAt(Math.round(Math.random(new Date().getTime())*(E.length-1)))
}return A}function JSJaCJSON(){}JSJaCJSON.toString=function(D){var A={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},B={array:function(F){var H=["["],E,K,J,G=F.length,I;
for(J=0;J<G;J+=1){I=F[J];K=B[typeof I];if(K){I=K(I);if(typeof I=="string"){if(E){H[H.length]=","
}H[H.length]=I;E=true}}}H[H.length]="]";return H.join("")},"boolean":function(E){return String(E)
},"null":function(E){return"null"},number:function(E){return isFinite(E)?String(E):"null"
},object:function(F){if(F){if(F instanceof Array){return B.array(F)}var G=["{"],E,J,I,H;
for(I in F){if(F.hasOwnProperty(I)){H=F[I];J=B[typeof H];if(J){H=J(H);if(typeof H=="string"){if(E){G[G.length]=","
}G.push(B.string(I),":",H);E=true}}}}G[G.length]="}";return G.join("")}return"null"
},string:function(E){if(/["\\\x00-\x1f]/.test(E)){E=E.replace(/([\x00-\x1f\\"])/g,function(G,F){var H=A[F];
if(H){return H}H=F.charCodeAt();return"\\u00"+Math.floor(H/16).toString(16)+(H%16).toString(16)
})}return'"'+E+'"'}};switch(typeof (D)){case"object":return B.object(D);case"array":return B.array(D)
}};JSJaCJSON.parse=function(str){try{return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(str.replace(/"(\\.|[^"\\])*"/g,"")))&&eval("("+str+")")
}catch(e){return false}};function XmlHttp(){}XmlHttp.create=function(){try{if(window.XMLHttpRequest){var B=new XMLHttpRequest();
if(B.readyState==null){B.readyState=1;B.addEventListener("load",function(){B.readyState=4;
if(typeof B.onreadystatechange=="function"){B.onreadystatechange()}},false)}return B
}if(window.ActiveXObject){return new ActiveXObject(XmlHttp.getPrefix()+".XmlHttp")
}}catch(A){}throw new Error("Your browser does not support XmlHttp objects")};XmlHttp.getPrefix=function(){if(XmlHttp.prefix){return XmlHttp.prefix
}var A=["MSXML2","Microsoft","MSXML","MSXML3"];var E;for(var D=0;D<A.length;D++){try{E=new ActiveXObject(A[D]+".XmlHttp");
return XmlHttp.prefix=A[D]}catch(B){}}throw new Error("Could not find an installed XML parser")
};function XmlDocument(){}XmlDocument.create=function(B,E){B=B||"foo";E=E||"";try{var F;
if(document.implementation&&document.implementation.createDocument){F=document.implementation.createDocument(E,B,null);
if(F.readyState==null){F.readyState=1;F.addEventListener("load",function(){F.readyState=4;
if(typeof F.onreadystatechange=="function"){F.onreadystatechange()}},false)}}else{if(window.ActiveXObject){F=new ActiveXObject(XmlDocument.getPrefix()+".DomDocument")
}}if(!F.documentElement||F.documentElement.tagName!=B||(F.documentElement.namespaceURI&&F.documentElement.namespaceURI!=E)){try{if(E!=""){F.appendChild(F.createElement(B)).setAttribute("xmlns",E)
}else{F.appendChild(F.createElement(B))}}catch(A){F=document.implementation.createDocument(E,B,null);
if(F.documentElement==null){F.appendChild(F.createElement(B))}if(E!=""&&F.documentElement.getAttribute("xmlns")!=E){F.documentElement.setAttribute("xmlns",E)
}}}return F}catch(D){alert(D.name+": "+D.message)}throw new Error("Your browser does not support XmlDocument objects")
};XmlDocument.getPrefix=function(){if(XmlDocument.prefix){return XmlDocument.prefix
}var A=["MSXML2","Microsoft","MSXML","MSXML3"];var E;for(var D=0;D<A.length;D++){try{E=new ActiveXObject(A[D]+".DomDocument");
return XmlDocument.prefix=A[D]}catch(B){}}throw new Error("Could not find an installed XML parser")
};if(window.XMLSerializer&&window.Node&&Node.prototype&&Node.prototype.__defineGetter__){Node.prototype.__defineGetter__("xml",function(){return(new XMLSerializer()).serializeToString(this)
})}var JSJaCBuilder={buildNode:function(E,A){var B;if(arguments[2]){if(JSJaCBuilder._isStringOrNumber(arguments[2])||(arguments[2] instanceof Array)){B=E.createElement(A);
JSJaCBuilder._children(E,B,arguments[2])}else{if(arguments[2]["xmlns"]){try{B=E.createElementNS(arguments[2]["xmlns"],A)
}catch(D){B=E.createElement(A)}}else{B=E.createElement(A)}for(attr in arguments[2]){if(arguments[2].hasOwnProperty(attr)){if(attr=="xmlns"&&B.namespaceURI==attr){continue
}B.setAttribute(attr,arguments[2][attr])}}}}else{B=E.createElement(A)}if(arguments[3]){JSJaCBuilder._children(E,B,arguments[3])
}return B},_text:function(A,B){return A.createTextNode(B)},_children:function(G,A,D){if(typeof D=="object"){for(var B in D){if(D.hasOwnProperty(B)){var F=D[B];
if(typeof F=="object"){if(F instanceof Array){var E=JSJaCBuilder.buildNode(G,F[0],F[1],F[2]);
A.appendChild(E)}else{A.appendChild(F)}}else{if(JSJaCBuilder._isStringOrNumber(F)){A.appendChild(JSJaCBuilder._text(G,F))
}}}}}else{if(JSJaCBuilder._isStringOrNumber(D)){A.appendChild(JSJaCBuilder._text(G,D))
}}},_attributes:function(A){var B=[];for(attribute in A){if(A.hasOwnProperty(attribute)){B.push(attribute+'="'+A[attribute].toString().htmlEnc()+'"')
}}return B.join(" ")},_isStringOrNumber:function(A){return(typeof A=="string"||typeof A=="number")
}};if(typeof JSJaC=="undefined"){JSJaC={Version:"1.2"}}var NS_DISCO_ITEMS="http://jabber.org/protocol/disco#items";
var NS_DISCO_INFO="http://jabber.org/protocol/disco#info";var NS_VCARD="vcard-temp";
var NS_AUTH="jabber:iq:auth";var NS_AUTH_ERROR="jabber:iq:auth:error";var NS_REGISTER="jabber:iq:register";
var NS_SEARCH="jabber:iq:search";var NS_ROSTER="jabber:iq:roster";var NS_PRIVACY="jabber:iq:privacy";
var NS_PRIVATE="jabber:iq:private";var NS_VERSION="jabber:iq:version";var NS_TIME="jabber:iq:time";
var NS_LAST="jabber:iq:last";var NS_XDATA="jabber:x:data";var NS_IQDATA="jabber:iq:data";
var NS_DELAY="jabber:x:delay";var NS_EXPIRE="jabber:x:expire";var NS_EVENT="jabber:x:event";
var NS_XCONFERENCE="jabber:x:conference";var NS_STATS="http://jabber.org/protocol/stats";
var NS_MUC="http://jabber.org/protocol/muc";var NS_MUC_USER="http://jabber.org/protocol/muc#user";
var NS_MUC_ADMIN="http://jabber.org/protocol/muc#admin";var NS_MUC_OWNER="http://jabber.org/protocol/muc#owner";
var NS_PUBSUB="http://jabber.org/protocol/pubsub";var NS_PUBSUB_EVENT="http://jabber.org/protocol/pubsub#event";
var NS_PUBSUB_OWNER="http://jabber.org/protocol/pubsub#owner";var NS_PUBSUB_NMI="http://jabber.org/protocol/pubsub#node-meta-info";
var NS_COMMANDS="http://jabber.org/protocol/commands";var NS_STREAM="http://etherx.jabber.org/streams";
var NS_STANZAS="urn:ietf:params:xml:ns:xmpp-stanzas";var NS_STREAMS="urn:ietf:params:xml:ns:xmpp-streams";
var NS_TLS="urn:ietf:params:xml:ns:xmpp-tls";var NS_SASL="urn:ietf:params:xml:ns:xmpp-sasl";
var NS_SESSION="urn:ietf:params:xml:ns:xmpp-session";var NS_BIND="urn:ietf:params:xml:ns:xmpp-bind";
var NS_FEATURE_IQAUTH="http://jabber.org/features/iq-auth";var NS_FEATURE_IQREGISTER="http://jabber.org/features/iq-register";
var NS_FEATURE_COMPRESS="http://jabber.org/features/compress";var NS_COMPRESS="http://jabber.org/protocol/compress";
function STANZA_ERROR(D,B,A){if(window==this){return new STANZA_ERROR(D,B,A)}this.code=D;
this.type=B;this.cond=A}var ERR_BAD_REQUEST=STANZA_ERROR("400","modify","bad-request");
var ERR_CONFLICT=STANZA_ERROR("409","cancel","conflict");var ERR_FEATURE_NOT_IMPLEMENTED=STANZA_ERROR("501","cancel","feature-not-implemented");
var ERR_FORBIDDEN=STANZA_ERROR("403","auth","forbidden");var ERR_GONE=STANZA_ERROR("302","modify","gone");
var ERR_INTERNAL_SERVER_ERROR=STANZA_ERROR("500","wait","internal-server-error");
var ERR_ITEM_NOT_FOUND=STANZA_ERROR("404","cancel","item-not-found");var ERR_JID_MALFORMED=STANZA_ERROR("400","modify","jid-malformed");
var ERR_NOT_ACCEPTABLE=STANZA_ERROR("406","modify","not-acceptable");var ERR_NOT_ALLOWED=STANZA_ERROR("405","cancel","not-allowed");
var ERR_NOT_AUTHORIZED=STANZA_ERROR("401","auth","not-authorized");var ERR_PAYMENT_REQUIRED=STANZA_ERROR("402","auth","payment-required");
var ERR_RECIPIENT_UNAVAILABLE=STANZA_ERROR("404","wait","recipient-unavailable");
var ERR_REDIRECT=STANZA_ERROR("302","modify","redirect");var ERR_REGISTRATION_REQUIRED=STANZA_ERROR("407","auth","registration-required");
var ERR_REMOTE_SERVER_NOT_FOUND=STANZA_ERROR("404","cancel","remote-server-not-found");
var ERR_REMOTE_SERVER_TIMEOUT=STANZA_ERROR("504","wait","remote-server-timeout");
var ERR_RESOURCE_CONSTRAINT=STANZA_ERROR("500","wait","resource-constraint");var ERR_SERVICE_UNAVAILABLE=STANZA_ERROR("503","cancel","service-unavailable");
var ERR_SUBSCRIPTION_REQUIRED=STANZA_ERROR("407","auth","subscription-required");
var ERR_UNEXPECTED_REQUEST=STANZA_ERROR("400","wait","unexpected-request");function JSJaCConnection(A){oCon=this;
if(A&&A.oDbg&&A.oDbg.log){this.oDbg=A.oDbg}else{this.oDbg=new Object();this.oDbg.log=function(){}
}if(A&&A.httpbase){this._httpbase=A.httpbase}if(A&&A.allow_plain){this.allow_plain=A.allow_plain
}else{this.allow_plain=JSJAC_ALLOW_PLAIN}this._connected=false;this._events=new Array();
this._keys=null;this._ID=0;this._inQ=new Array();this._pQueue=new Array();this._regIDs=new Array();
this._req=new Array();this._status="intialized";this._errcnt=0;this._inactivity=JSJAC_INACTIVITY;
if(A&&A.timerval){this.setPollInterval(A.timerval)}}JSJaCConnection.prototype.connected=function(){return this._connected
};JSJaCConnection.prototype.getPollInterval=function(){return this._timerval};JSJaCConnection.prototype.registerHandler=function(event){event=event.toLowerCase();
var eArg={handler:arguments[arguments.length-1],childName:"*",childNS:"*",type:"*"};
if(arguments.length>2){eArg.childName=arguments[1]}if(arguments.length>3){eArg.childNS=arguments[2]
}if(arguments.length>4){eArg.type=arguments[3]}if(!this._events[event]){this._events[event]=new Array(eArg)
}else{this._events[event]=this._events[event].concat(eArg)}this._events[event]=this._events[event].sort(function(a,b){var aRank=0;
var bRank=0;with(a){if(type=="*"){aRank++}if(childNS=="*"){aRank++}if(childName=="*"){aRank++
}}with(b){if(type=="*"){bRank++}if(childNS=="*"){bRank++}if(childName=="*"){bRank++
}}if(aRank>bRank){return 1}if(aRank<bRank){return -1}return 0});this.oDbg.log("registered handler for event '"+event+"'",2)
};JSJaCConnection.prototype.registerIQGet=function(D,A,B){this.registerHandler("iq",D,A,"get",B)
};JSJaCConnection.prototype.registerIQSet=function(D,A,B){this.registerHandler("iq",D,A,"set",B)
};JSJaCConnection.prototype.resume=function(){try{this._setStatus("resuming");var D=unescape(JSJaCCookie.read("JSJaC_State").getValue());
this.oDbg.log("read cookie: "+D,2);var F=JSJaCJSON.parse(D);for(var B in F){if(F.hasOwnProperty(B)){this[B]=F[B]
}}if(this._keys){this._keys2=new JSJaCKeys();var A=this._keys2._getSuspendVars();
for(var B=0;B<A.length;B++){this._keys2[A[B]]=this._keys[A[B]]}this._keys=this._keys2
}try{JSJaCCookie.read("JSJaC_State").erase()}catch(E){}if(this._connected){this._handleEvent("onresume");
setTimeout("oCon._resume()",this.getPollInterval());this._interval=setInterval("oCon._checkQueue()",JSJAC_CHECKQUEUEINTERVAL);
this._inQto=setInterval("oCon._checkInQ();",JSJAC_CHECKINQUEUEINTERVAL)}return(this._connected===true)
}catch(E){if(E.message){this.oDbg.log("Resume failed: "+E.message,1)}else{this.oDbg.log("Resume failed: "+E,1)
}return false}};JSJaCConnection.prototype.send=function(E,B,A){if(!E||!E.pType){this.oDbg.log("no packet: "+E,1);
return false}if(!this.connected()){return false}if(B){if(!E.getID()){E.setID("JSJaCID_"+this._ID++)
}this._registerPID(E.getID(),B,A)}try{this._handleEvent(E.pType()+"_out",E);this._handleEvent("packet_out",E);
this._pQueue=this._pQueue.concat(E.xml())}catch(D){this.oDbg.log(D.toString(),1);
return false}return true};JSJaCConnection.prototype.sendIQ=function(G,E,A){if(!G||G.pType!="iq"){return false
}E=E||{};var D=E.error_handler||function(I){oCon.oDbg.log(G.xml(),1)};var F=E.result_handler||function(I){oCon.oDbg.log(I.xml(),2)
};var B=E.default_handler||function(I){oCon.oDbg.log(I.xml(),2)};var H=function(J,I){switch(J.getType()){case"error":D(J);
break;case"result":F(J,I);break;default:B(J,I)}};return this.send(G,H,A)};JSJaCConnection.prototype.setPollInterval=function(A){if(!A||isNaN(A)){this.oDbg.log("Invalid timerval: "+A,1);
throw"Invalid interval"}this._timerval=A;return this._timerval};JSJaCConnection.prototype.status=function(){return this._status
};JSJaCConnection.prototype.suspend=function(){clearTimeout(this._timeout);clearInterval(this._interval);
clearInterval(this._inQto);this._suspend();var I=("_connected,_keys,_ID,_inQ,_pQueue,_regIDs,_errcnt,_inactivity,domain,username,resource,jid,fulljid,_sid,_httpbase,_timerval,_is_polling").split(",");
I=I.concat(this._getSuspendVars());var J=new Object();for(var E=0;E<I.length;E++){if(!this[I[E]]){continue
}if(this[I[E]]._getSuspendVars){var F=this[I[E]]._getSuspendVars();var A=new Object();
for(var B=0;B<F.length;B++){A[F[B]]=this[I[E]][F[B]]}}else{var A=this[I[E]]}J[I[E]]=A
}var H=new JSJaCCookie("JSJaC_State",escape(JSJaCJSON.toString(J)),this._inactivity);
this.oDbg.log("writing cookie: "+unescape(H.value)+"\n(length:"+unescape(H.value).length+")",2);
H.write();try{var D=JSJaCCookie.read("JSJaC_State");if(H.value!=D.value){this.oDbg.log("Suspend failed writing cookie.\nRead: "+unescape(JSJaCCookie.read("JSJaC_State")),1);
H.erase()}this._connected=false;this._setStatus("suspending")}catch(G){this.oDbg.log("Failed reading cookie 'JSJaC_State': "+G.message)
}};JSJaCConnection.prototype._abort=function(){clearTimeout(this._timeout);clearInterval(this._inQto);
clearInterval(this._interval);this._connected=false;this._setStatus("aborted");this.oDbg.log("Disconnected.",1);
this._handleEvent("ondisconnect");this._handleEvent("onerror",JSJaCError("500","cancel","service-unavailable"))
};JSJaCConnection.prototype._checkInQ=function(){for(var A=0;A<this._inQ.length&&A<10;
A++){var B=this._inQ[0];this._inQ=this._inQ.slice(1,this._inQ.length);var D=JSJaCPacket.wrapNode(B);
if(!D){return }this._handleEvent("packet_in",D);if(D.pType&&!this._handlePID(D)){this._handleEvent(D.pType()+"_in",D);
this._handleEvent(D.pType(),D)}}};JSJaCConnection.prototype._checkQueue=function(){if(this._pQueue.length!=0){this._process()
}return true};JSJaCConnection.prototype._doAuth=function(){if(this.has_sasl&&this.authtype=="nonsasl"){this.oDbg.log("Warning: SASL present but not used",1)
}if(!this._doSASLAuth()&&!this._doLegacyAuth()){this.oDbg.log("Auth failed for authtype "+this.authtype,1);
this.disconnect();return false}return true};JSJaCConnection.prototype._doInBandReg=function(){if(this.authtype=="saslanon"||this.authtype=="anonymous"){return 
}var A=new JSJaCIQ();A.setType("set");A.setID("reg1");A.appendNode("query",{xmlns:"jabber:iq:register"},[["username",this.username],["password",this.pass]]);
this.send(A,this._doInBandRegDone)};JSJaCConnection.prototype._doInBandRegDone=function(A){if(A&&A.getType()=="error"){oCon.oDbg.log("registration failed for "+oCon.username,0);
oCon._handleEvent("onerror",A.getChild("error"));return }oCon.oDbg.log(oCon.username+" registered succesfully",0);
oCon._doAuth()};JSJaCConnection.prototype._doLegacyAuth=function(){if(this.authtype!="nonsasl"&&this.authtype!="anonymous"){return false
}var A=new JSJaCIQ();A.setIQ(oCon.server,"get","auth1");A.appendNode("query",{xmlns:"jabber:iq:auth"},[["username",oCon.username]]);
this.send(A,this._doLegacyAuth2);return true};JSJaCConnection.prototype._doLegacyAuth2=function(B){if(!B||B.getType()!="result"){if(B&&B.getType()=="error"){oCon._handleEvent("onerror",B.getChild("error"))
}oCon.disconnect();return }var A=(B.getChild("digest")!=null);var B=new JSJaCIQ();
B.setIQ(oCon.server,"set","auth2");query=B.appendNode("query",{xmlns:"jabber:iq:auth"},[["username",oCon.username],["resource",oCon.resource]]);
if(A){query.appendChild(B.buildNode("digest",hex_sha1(oCon.streamid+oCon.pass)))}else{if(oCon.allow_plain){query.appendChild(B.buildNode("password",oCon.pass))
}else{oCon.oDbg.log("no valid login mechanism found",1);oCon.disconnect();return false
}}oCon.send(B,oCon._doLegacyAuthDone)};JSJaCConnection.prototype._doLegacyAuthDone=function(A){if(A.getType()!="result"){if(A.getType()=="error"){oCon._handleEvent("onerror",A.getChild("error"))
}oCon.disconnect()}else{oCon._handleEvent("onconnect")}};JSJaCConnection.prototype._sendRaw=function(xml,cb,arg){var slot=this._getFreeSlot();
this._req[slot]=this._setupRequest(true);this._req[slot].r.onreadystatechange=function(){if(typeof (oCon)=="undefined"||!oCon||!oCon.connected()){return 
}if(oCon._req[slot].r.readyState==4){oCon.oDbg.log("async recv: "+oCon._req[slot].r.responseText,4);
if(typeof (cb)!="undefined"){eval("oCon."+cb+"(oCon._req[slot],"+arg+")")}}};if(typeof (this._req[slot].r.onerror)!="undefined"){this._req[slot].r.onerror=function(e){if(typeof (oCon)=="undefined"||!oCon||!oCon.connected()){return 
}oCon.oDbg.log("XmlHttpRequest error",1);return false}}var reqstr=this._getRequestString(xml);
this.oDbg.log("sending: "+reqstr,4);this._req[slot].r.send(reqstr);return true};JSJaCConnection.prototype._doSASLAuth=function(){if(this.authtype=="nonsasl"||this.authtype=="anonymous"){return false
}if(this.authtype=="saslanon"){if(this.mechs.ANONYMOUS){this.oDbg.log("SASL using mechanism 'ANONYMOUS'",2);
return this._sendRaw("<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='ANONYMOUS'/>","_doSASLAuthDone")
}this.oDbg.log("SASL ANONYMOUS requested but not supported",1)}else{if(this.mechs["DIGEST-MD5"]){this.oDbg.log("SASL using mechanism 'DIGEST-MD5'",2);
return this._sendRaw("<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='DIGEST-MD5'/>","_doSASLAuthDigestMd5S1")
}else{if(this.allow_plain&&this.mechs.PLAIN){this.oDbg.log("SASL using mechanism 'PLAIN'",2);
var A=this.username+"@"+this.domain+String.fromCharCode(0)+this.username+String.fromCharCode(0)+this.pass;
this.oDbg.log("authenticating with '"+A+"'",2);A=btoa(A);return this._sendRaw("<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>"+A+"</auth>","_doSASLAuthDone")
}}this.oDbg.log("No SASL mechanism applied",1);this.authtype="nonsasl"}return false
};JSJaCConnection.prototype._doSASLAuthDigestMd5S1=function(F){this.oDbg.log(F.r.responseText,2);
var G=oCon._parseResponse(F);if(!G||G.getElementsByTagName("challenge").length==0){this.oDbg.log("challenge missing",1);
oCon._handleEvent("onerror",JSJaCError("401","auth","not-authorized"));this.disconnect()
}else{var D=atob(G.getElementsByTagName("challenge").item(0).firstChild.nodeValue);
this.oDbg.log("got challenge: "+D,2);this._nonce=D.substring(D.indexOf("nonce=")+7);
this._nonce=this._nonce.substring(0,this._nonce.indexOf('"'));this.oDbg.log("nonce: "+this._nonce,2);
if(this._nonce==""||this._nonce.indexOf('"')!=-1){this.oDbg.log("nonce not valid, aborting",1);
this.disconnect();return }this._digest_uri="xmpp/";this._digest_uri+=this.domain;
this._cnonce=cnonce(14);this._nc="00000001";var B=str_md5(this.username+":"+this.domain+":"+this.pass)+":"+this._nonce+":"+this._cnonce;
var A="AUTHENTICATE:"+this._digest_uri;var E=hex_md5(hex_md5(B)+":"+this._nonce+":"+this._nc+":"+this._cnonce+":auth:"+hex_md5(A));
var H='username="'+this.username+'",realm="'+this.domain+'",nonce="'+this._nonce+'",cnonce="'+this._cnonce+'",nc="'+this._nc+'",qop=auth,digest-uri="'+this._digest_uri+'",response="'+E+'",charset=utf-8';
this.oDbg.log("response: "+H,2);this._sendRaw("<response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>"+binb2b64(str2binb(H))+"</response>","_doSASLAuthDigestMd5S2")
}};JSJaCConnection.prototype._doSASLAuthDigestMd5S2=function(F){this.oDbg.log(F.r.responseText,2);
var H=this._parseResponse(F);if(H.firstChild.nodeName=="failure"){if(H.firstChild.xml){this.oDbg.log("auth error: "+H.firstChild.xml,1)
}else{this.oDbg.log("auth error",1)}oCon._handleEvent("onerror",JSJaCError("401","auth","not-authorized"));
this.disconnect();return }var E=atob(H.firstChild.firstChild.nodeValue);this.oDbg.log("response: "+E,2);
var G=E.substring(E.indexOf("rspauth=")+8);this.oDbg.log("rspauth: "+G,2);var D=str_md5(this.username+":"+this.domain+":"+this.pass)+":"+this._nonce+":"+this._cnonce;
var B=":"+this._digest_uri;var A=hex_md5(hex_md5(D)+":"+this._nonce+":"+this._nc+":"+this._cnonce+":auth:"+hex_md5(B));
this.oDbg.log("rsptest: "+A,2);if(A!=G){this.oDbg.log("SASL Digest-MD5: server repsonse with wrong rspauth",1);
this.disconnect();return }if(H.firstChild.nodeName=="success"){this._reInitStream(this.domain,"_doStreamBind")
}else{this._sendRaw("<response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>","_doSASLAuthDone")
}};JSJaCConnection.prototype._doSASLAuthDone=function(A){var B=this._parseResponse(A);
if(B.firstChild.nodeName!="success"){this.oDbg.log("auth failed",1);this.disconnect()
}else{this._reInitStream(this.domain,"_doStreamBind")}};JSJaCConnection.prototype._doStreamBind=function(){var A=new JSJaCIQ();
A.setIQ(this.domain,"set","bind_1");A.appendNode("bind",{xmlns:"urn:ietf:params:xml:ns:xmpp-bind"},[["resource",this.resource]]);
this.oDbg.log(A.xml());this.send(A,this._doXMPPSess)};JSJaCConnection.prototype._doXMPPSess=function(A){if(A.getType()!="result"||A.getType()=="error"){oCon.disconnect();
if(A.getType()=="error"){oCon._handleEvent("onerror",A.getChild("error"))}return 
}oCon.fulljid=A.getChildVal("jid");oCon.jid=oCon.fulljid.substring(0,oCon.fulljid.lastIndexOf("/"));
A=new JSJaCIQ();A.setIQ(this.domain,"set","sess_1");A.appendNode("session",{xmlns:"urn:ietf:params:xml:ns:xmpp-session"},[]);
oCon.oDbg.log(A.xml());oCon.send(A,oCon._doXMPPSessDone)};JSJaCConnection.prototype._doXMPPSessDone=function(A){if(A.getType()!="result"||A.getType()=="error"){oCon.disconnect();
if(A.getType()=="error"){oCon._handleEvent("onerror",A.getChild("error"))}return 
}else{oCon._handleEvent("onconnect")}};JSJaCConnection.prototype._handleEvent=function(E,A){E=E.toLowerCase();
this.oDbg.log("incoming event '"+E+"'",3);if(!this._events[E]){return }this.oDbg.log("handling event '"+E+"'",2);
for(var D=0;D<this._events[E].length;D++){var B=this._events[E][D];if(B.handler){try{if(A){if(A.pType){if((!A.getNode().hasChildNodes()&&B.childName!="*")||(A.getNode().hasChildNodes()&&!A.getChild(B.childName,B.childNS))){continue
}if(B.type!="*"&&A.getType()!=B.type){continue}this.oDbg.log(B.childName+"/"+B.childNS+"/"+B.type+" => match for handler "+B.handler,3)
}if(B.handler(A)){break}}else{if(B.handler()){break}}}catch(F){this.oDbg.log(B.handler+"\n>>>"+F.name+": "+F.message,1)
}}}};JSJaCConnection.prototype._handlePID=function(E){if(!E.getID()){return false
}for(var B in this._regIDs){if(this._regIDs.hasOwnProperty(B)&&this._regIDs[B]&&B==E.getID()){var A=E.getID();
this.oDbg.log("handling "+A,3);try{if(this._regIDs[B].cb(E,this._regIDs[B].arg)===false){return false
}else{this._unregisterPID(A);return true}}catch(D){this.oDbg.log(D.name+": "+D.message);
this._unregisterPID(A);return true}}}return false};JSJaCConnection.prototype._handleResponse=function(D){var A=this._parseResponse(D);
if(!A){return }for(var B=0;B<A.childNodes.length;B++){this._inQ=this._inQ.concat(A.childNodes.item(B))
}};JSJaCConnection.prototype._parseStreamFeatures=function(F){if(!F){this.oDbg.log("nothing to parse ... aborting",1);
return false}this.mechs=new Object();var E=F.getElementsByTagName("mechanisms");this.has_sasl=false;
for(var B=0;B<E.length;B++){if(E.item(B).getAttribute("xmlns")=="urn:ietf:params:xml:ns:xmpp-sasl"){this.has_sasl=true;
var D=E.item(B).getElementsByTagName("mechanism");for(var A=0;A<D.length;A++){this.mechs[D.item(A).firstChild.nodeValue]=true
}break}}if(this.has_sasl){this.oDbg.log("SASL detected",2)}else{this.authtype="nonsasl";
this.oDbg.log("No support for SASL detected",2)}};JSJaCConnection.prototype._process=function(A){if(!this.connected()){this.oDbg.log("Connection lost ...",1);
if(this._interval){clearInterval(this._interval)}return }if(A){this.setPollInterval(A)
}if(this._timeout){clearTimeout(this._timeout)}var E=this._getFreeSlot();if(E<0){return 
}if(typeof (this._req[E])!="undefined"&&typeof (this._req[E].r)!="undefined"&&this._req[E].r.readyState!=4){this.oDbg.log("Slot "+E+" is not ready");
return }if(!this.isPolling()&&this._pQueue.length==0&&this._req[(E+1)%2]&&this._req[(E+1)%2].r.readyState!=4){this.oDbg.log("all slots busy, standby ...",2);
return }if(!this.isPolling()){this.oDbg.log("Found working slot at "+E,2)}this._req[E]=this._setupRequest(true);
this._req[E].r.onreadystatechange=function(){if(typeof (oCon)=="undefined"||!oCon||!oCon.connected()){return 
}if(oCon._req[E].r.readyState==4){oCon._setStatus("processing");oCon.oDbg.log("async recv: "+oCon._req[E].r.responseText,4);
oCon._handleResponse(oCon._req[E]);if(oCon._pQueue.length){oCon._timeout=setTimeout("oCon._process()",100)
}else{oCon.oDbg.log("scheduling next poll in "+oCon.getPollInterval()+" msec",4);
oCon._timeout=setTimeout("oCon._process()",oCon.getPollInterval())}}};try{this._req[E].r.onerror=function(){if(typeof (oCon)=="undefined"||!oCon||!oCon.connected()){return 
}oCon._errcnt++;oCon.oDbg.log("XmlHttpRequest error ("+oCon._errcnt+")",1);if(oCon._errcnt>JSJAC_ERR_COUNT){oCon._abort();
return false}oCon._setStatus("onerror_fallback");setTimeout("oCon._resume()",oCon.getPollInterval());
return false}}catch(D){}var B=this._getRequestString();if(typeof (this._rid)!="undefined"){this._req[E].rid=this._rid
}this.oDbg.log("sending: "+B,4);this._req[E].r.send(B)};JSJaCConnection.prototype._registerPID=function(D,B,A){if(!D||!B){return false
}this._regIDs[D]=new Object();this._regIDs[D].cb=B;if(A){this._regIDs[D].arg=A}this.oDbg.log("registered "+D,3);
return true};JSJaCConnection.prototype._sendEmpty=function JSJaCSendEmpty(){var B=this._getFreeSlot();
this._req[B]=this._setupRequest(true);this._req[B].r.onreadystatechange=function(){if(typeof (oCon)=="undefined"||!oCon){return 
}if(oCon._req[B].r.readyState==4){oCon.oDbg.log("async recv: "+oCon._req[B].r.responseText,4);
oCon._getStreamID(B)}};if(typeof (this._req[B].r.onerror)!="undefined"){this._req[B].r.onerror=function(D){if(typeof (oCon)=="undefined"||!oCon||!oCon.connected()){return 
}oCon.oDbg.log("XmlHttpRequest error",1);return false}}var A=this._getRequestString();
this.oDbg.log("sending: "+A,4);this._req[B].r.send(A)};JSJaCConnection.prototype._setStatus=function(A){if(!A||A==""){return 
}if(A!=this._status){this._status=A;this._handleEvent("onstatuschanged",A);this._handleEvent("status_changed",A)
}};JSJaCConnection.prototype._unregisterPID=function(A){if(!this._regIDs[A]){return false
}this._regIDs[A]=null;this.oDbg.log("unregistered "+A,3);return true};function JSJaCConsoleLogger(A){this.level=A||4;
this.start=function(){};this.log=function(D,E){E=E||0;if(E>this.level){return }if(typeof (console)=="undefined"){return 
}try{switch(E){case 0:console.warn(D);break;case 1:console.error(D);break;case 2:console.info(D);
break;case 4:console.debug(D);break;default:console.log(D);break}}catch(B){try{console.log(D)
}catch(B){}}};this.setLevel=function(B){this.level=B;return this};this.getLevel=function(){return this.level
}}function JSJaCCookie(A,D,B){if(window==this){return new JSJaCCookie(A,D,B)}this.name=A;
this.value=D;this.expires=B;this.write=function(){if(this.secs){var E=new Date();
E.setTime(E.getTime()+(this.secs*1000));var F="; expires="+E.toGMTString()}else{var F=""
}document.cookie=this.getName()+"="+this.getValue()+F+"; path=/"};this.erase=function(){var E=new JSJaCCookie(this.getName(),"",-1);
E.write()};this.getName=function(){return this.name};this.setName=function(E){this.name=E;
return this};this.getValue=function(){return this.value};this.setValue=function(E){this.value=E;
return this}}JSJaCCookie.read=function(B){var F=B+"=";var A=document.cookie.split(";");
for(var D=0;D<A.length;D++){var E=A[D];while(E.charAt(0)==" "){E=E.substring(1,E.length)
}if(E.indexOf(F)==0){return new JSJaCCookie(B,E.substring(F.length,E.length))}}throw new JSJaCCookieException("Cookie not found")
};JSJaCCookie.get=function(A){return JSJaCCookie.read(A).getValue()};JSJaCCookie.remove=function(A){JSJaCCookie.read(A).erase()
};function JSJaCCookieException(A){this.message=A;this.name="CookieException"}function JSJaCError(B,A,E){var D=XmlDocument.create("error","jsjac");
D.documentElement.setAttribute("code",B);D.documentElement.setAttribute("type",A);
D.documentElement.appendChild(D.createElement(E)).setAttribute("xmlns","urn:ietf:params:xml:ns:xmpp-stanzas");
return D.documentElement}var JSJACJID_FORBIDDEN=['"'," ","&","'","/",":","<",">","@"];
function JSJaCJID(A){this._node="";this._domain="";this._resource="";if(typeof (A)=="string"){if(A.indexOf("@")!=-1){this.setNode(A.substring(0,A.indexOf("@")));
A=A.substring(A.indexOf("@")+1)}if(A.indexOf("/")!=-1){this.setResource(A.substring(A.indexOf("/")+1));
A=A.substring(0,A.indexOf("/"))}this.setDomain(A)}else{this.setNode(A.node);this.setDomain(A.domain);
this.setResource(A.resource)}}JSJaCJID.prototype.getNode=function(){return this._node
};JSJaCJID.prototype.getDomain=function(){return this._domain};JSJaCJID.prototype.getResource=function(){return this._resource
};JSJaCJID.prototype.setNode=function(A){JSJaCJID._checkNodeName(A);this._node=A||"";
return this};JSJaCJID.prototype.setDomain=function(A){if(!A||A==""){throw new JSJaCJIDInvalidException("domain name missing")
}JSJaCJID._checkNodeName(A);this._domain=A;return this};JSJaCJID.prototype.setResource=function(A){this._resource=A||"";
return this};JSJaCJID.prototype.toString=function(){var A="";if(this.getNode()&&this.getNode()!=""){A=this.getNode()+"@"
}A+=this.getDomain();if(this.getResource()&&this.getResource()!=""){A+="/"+this.getResource()
}return A};JSJaCJID.prototype.removeResource=function(){return this.setResource()
};JSJaCJID.prototype.clone=function(){return new JSJaCJID(this.toString())};JSJaCJID.prototype.isEntity=function(A){if(typeof A=="string"){A=(new JSJaCJID(A))
}A.removeResource();return(this.clone().removeResource().toString()===A.toString())
};JSJaCJID._checkNodeName=function(A){if(!A||A==""){return }for(var B=0;B<JSJACJID_FORBIDDEN.length;
B++){if(A.indexOf(JSJACJID_FORBIDDEN[B])!=-1){throw new JSJaCJIDInvalidException("forbidden char in nodename: "+JSJACJID_FORBIDDEN[B])
}}};function JSJaCJIDInvalidException(A){this.message=A;this.name="JSJaCJIDInvalidException"
}function JSJaCKeys(E,D){var A=Math.random();this._k=new Array();this._k[0]=A.toString();
if(D){this.oDbg=D}else{this.oDbg={};this.oDbg.log=function(){}}if(E){for(var B=1;
B<JSJAC_NKEYS;B++){this._k[B]=E(this._k[B-1]);D.log(B+": "+this._k[B],4)}}this._indexAt=JSJAC_NKEYS-1;
this.getKey=function(){return this._k[this._indexAt--]};this.lastKey=function(){return(this._indexAt==0)
};this.size=function(){return this._k.length};this._getSuspendVars=function(){return("_k,_indexAt").split(",")
}}var JSJACPACKET_USE_XMLNS=true;function JSJaCPacket(A){this.name=A;if(typeof (JSJACPACKET_USE_XMLNS)!="undefined"&&JSJACPACKET_USE_XMLNS){this.doc=XmlDocument.create(A,"jabber:client")
}else{this.doc=XmlDocument.create(A,"")}}JSJaCPacket.prototype.pType=function(){return this.name
};JSJaCPacket.prototype.getDoc=function(){return this.doc};JSJaCPacket.prototype.getNode=function(){if(this.getDoc()&&this.getDoc().documentElement){return this.getDoc().documentElement
}else{return null}};JSJaCPacket.prototype.setTo=function(A){if(!A||A==""){this.getNode().removeAttribute("to")
}else{if(typeof (A)=="string"){this.getNode().setAttribute("to",A)}else{this.getNode().setAttribute("to",A.toString())
}}return this};JSJaCPacket.prototype.setFrom=function(A){if(!A||A==""){this.getNode().removeAttribute("from")
}else{if(typeof (A)=="string"){this.getNode().setAttribute("from",A)}else{this.getNode().setAttribute("from",A.toString())
}}return this};JSJaCPacket.prototype.setID=function(A){if(!A||A==""){this.getNode().removeAttribute("id")
}else{this.getNode().setAttribute("id",A)}return this};JSJaCPacket.prototype.setType=function(A){if(!A||A==""){this.getNode().removeAttribute("type")
}else{this.getNode().setAttribute("type",A)}return this};JSJaCPacket.prototype.setXMLLang=function(A){if(!A||A==""){this.getNode().removeAttribute("xml:lang")
}else{this.getNode().setAttribute("xml:lang",A)}return this};JSJaCPacket.prototype.getTo=function(){return this.getNode().getAttribute("to")
};JSJaCPacket.prototype.getFrom=function(){return this.getNode().getAttribute("from")
};JSJaCPacket.prototype.getToJID=function(){return new JSJaCJID(this.getTo())};JSJaCPacket.prototype.getFromJID=function(){return new JSJaCJID(this.getFrom())
};JSJaCPacket.prototype.getID=function(){return this.getNode().getAttribute("id")
};JSJaCPacket.prototype.getType=function(){return this.getNode().getAttribute("type")
};JSJaCPacket.prototype.getXMLLang=function(){return this.getNode().getAttribute("xml:lang")
};JSJaCPacket.prototype.getXMLNS=function(){return this.getNode().namespaceURI};JSJaCPacket.prototype.getChild=function(B,E){if(!this.getNode()){return null
}B=B||"*";E=E||"*";if(this.getNode().getElementsByTagNameNS){return this.getNode().getElementsByTagNameNS(E,B).item(0)
}var A=this.getNode().childNodes;for(var D=0;D<A.length;D++){if(A.item(D).nodeType!=1){continue
}if(B!="*"&&A.item(D).tagName!=B){continue}if(E!="*"&&A.item(D).namespaceURI!=E){continue
}return A.item(D)}return null};JSJaCPacket.prototype.getChildVal=function(A,B){var D=this.getChild(A,B);
if(D&&D.firstChild){return D.firstChild.nodeValue}else{return""}};JSJaCPacket.prototype.clone=function(){return JSJaCPacket.wrapNode(this.getNode())
};JSJaCPacket.prototype.isError=function(){return(this.getType()=="error")};JSJaCPacket.prototype.errorReply=function(A){var B=this.clone();
B.setTo(this.getFrom());B.setFrom();B.setType("error");B.appendNode("error",{code:A.code,type:A.type},[[A.cond]]);
return B};JSJaCPacket.prototype.xml=function(){if(this.getDoc().xml){return this.getDoc().xml
}var A=(new XMLSerializer()).serializeToString(this.getNode());if(typeof (A)!="undefined"){return A
}return(new XMLSerializer()).serializeToString(this.doc)};JSJaCPacket.prototype._getAttribute=function(A){return this.getNode().getAttribute(A)
};JSJaCPacket.prototype._replaceNode=function(A){for(var B=0;B<A.attributes.length;
B++){if(A.attributes.item(B).nodeName!="xmlns"){this.getNode().setAttribute(A.attributes.item(B).nodeName,A.attributes.item(B).nodeValue)
}}for(var B=0;B<A.childNodes.length;B++){if(this.getDoc().importNode){this.getNode().appendChild(this.getDoc().importNode(A.childNodes.item(B),true))
}else{this.getNode().appendChild(A.childNodes.item(B).cloneNode(true))}}};JSJaCPacket.prototype._setChildNode=function(F,B){var A=this.getChild(F);
var D=this.getDoc().createTextNode(B);if(A){try{A.replaceChild(D,A.firstChild)}catch(E){}}else{A=this.getNode().appendChild(this.getDoc().createElement(F));
A.appendChild(D)}return A};JSJaCPacket.prototype.buildNode=function(A){return JSJaCBuilder.buildNode(this.getDoc(),A,arguments[1],arguments[2])
};JSJaCPacket.prototype.appendNode=function(A){if(typeof A=="object"){return this.getNode().appendChild(A)
}else{return this.getNode().appendChild(this.buildNode(A,arguments[1],arguments[2]))
}};function JSJaCPresence(){this.base=JSJaCPacket;this.base("presence")}JSJaCPresence.prototype=new JSJaCPacket;
JSJaCPresence.prototype.setStatus=function(A){this._setChildNode("status",A);return this
};JSJaCPresence.prototype.setShow=function(A){this._setChildNode("show",A);return this
};JSJaCPresence.prototype.setPriority=function(A){this._setChildNode("priority",A);
return this};JSJaCPresence.prototype.setPresence=function(A,B,D){if(A){this.setShow(A)
}if(B){this.setStatus(B)}if(D){this.setPriority(D)}return this};JSJaCPresence.prototype.getStatus=function(){return this.getChildVal("status")
};JSJaCPresence.prototype.getShow=function(){return this.getChildVal("show")};JSJaCPresence.prototype.getPriority=function(){return this.getChildVal("priority")
};function JSJaCIQ(){this.base=JSJaCPacket;this.base("iq")}JSJaCIQ.prototype=new JSJaCPacket;
JSJaCIQ.prototype.setIQ=function(D,A,B){if(D){this.setTo(D)}if(A){this.setType(A)
}if(B){this.setID(B)}return this};JSJaCIQ.prototype.setQuery=function(D){var A;try{A=this.getDoc().createElementNS(D,"query")
}catch(B){A=this.getDoc().createElement("query")}if(A&&A.getAttribute("xmlns")!=D){A.setAttribute("xmlns",D)
}this.getNode().appendChild(A);return A};JSJaCIQ.prototype.getQuery=function(){return this.getNode().getElementsByTagName("query").item(0)
};JSJaCIQ.prototype.getQueryXMLNS=function(){if(this.getQuery()){return this.getQuery().namespaceURI
}else{return null}};JSJaCIQ.prototype.reply=function(E){var B=this.clone();B.setTo(this.getFrom());
B.setType("result");if(E){if(typeof E=="string"){B.getChild.appendChild(B.getDoc().loadXML(E))
}else{if(E.constructor==Array){var D=B.getChild();for(var A=0;A<E.length;A++){if(typeof E[A]=="string"){D.appendChild(B.getDoc().loadXML(E[A]))
}else{if(typeof E[A]=="object"){D.appendChild(E[A])}}}}else{if(typeof E=="object"){B.getChild().appendChild(E)
}}}}return B};function JSJaCMessage(){this.base=JSJaCPacket;this.base("message")}JSJaCMessage.prototype=new JSJaCPacket;
JSJaCMessage.prototype.setBody=function(A){this._setChildNode("body",A);return this
};JSJaCMessage.prototype.setSubject=function(A){this._setChildNode("subject",A);return this
};JSJaCMessage.prototype.setThread=function(A){this._setChildNode("thread",A);return this
};JSJaCMessage.prototype.getThread=function(){return this.getChildVal("thread")};
JSJaCMessage.prototype.getBody=function(){return this.getChildVal("body")};JSJaCMessage.prototype.getSubject=function(){return this.getChildVal("subject")
};JSJaCPacket.wrapNode=function(B){var A;switch(B.nodeName.toLowerCase()){case"presence":A=new JSJaCPresence();
break;case"message":A=new JSJaCMessage();break;case"iq":A=new JSJaCIQ();break;default:return null
}A._replaceNode(B);return A};function JSJaCHttpBindingConnection(A){this.base=JSJaCConnection;
this.base(A);this._hold=JSJACHBC_MAX_HOLD;this._inactivity=0;this._last_requests=new Object();
this._last_rid=0;this._min_polling=0;this._pause=0;this._wait=JSJACHBC_MAX_WAIT;this.connect=JSJaCHBCConnect;
this.disconnect=JSJaCHBCDisconnect;this.inherit=JSJaCHBCInherit;this.isPolling=function(){return(this._hold==0)
};this.setPollInterval=function(B){if(!B||isNaN(B)){this.oDbg.log("Invalid timerval: "+B,1);
return -1}if(!this.isPolling()){this._timerval=100}else{if(this._min_polling&&B<this._min_polling*1000){this._timerval=this._min_polling*1000
}else{if(this._inactivity&&B>this._inactivity*1000){this._timerval=this._inactivity*1000
}else{this._timerval=B}}}return this._timerval};this._getRequestString=JSJaCHBCGetRequestString;
this._getFreeSlot=function(){for(var B=0;B<this._hold+1;B++){if(typeof (this._req[B])=="undefined"||typeof (this._req[B].r)=="undefined"||this._req[B].r.readyState==4){return B
}}return -1};this._getHold=function(){return this._hold};this._getStreamID=JSJaCHBCGetStreamID;
this._getSuspendVars=function(){return("host,port,secure,_rid,_last_rid,_wait,_min_polling,_inactivity,_hold,_last_requests,_pause").split(",")
};this._handleInitialResponse=JSJaCHBCHandleInitialResponse;this._parseResponse=JSJaCHBCParseResponse;
this._reInitStream=JSJaCHBCReInitStream;this._resume=function(){if(this._pause==0&&this._rid>=this._last_rid){this._rid=this._last_rid-1
}this._process()};this._setHold=function(B){if(!B||isNaN(B)||B<0){B=0}else{if(B>JSJACHBC_MAX_HOLD){B=JSJACHBC_MAX_HOLD
}}this._hold=B;return this._hold};this._setupRequest=JSJaCHBCSetupRequest;this._suspend=function(){if(this._pause==0){return 
}var F=this._getFreeSlot();this._req[F]=this._setupRequest(false);var D="<body pause='"+this._pause+"' xmlns='http://jabber.org/protocol/httpbind' sid='"+this._sid+"' rid='"+this._rid+"'";
if(JSJAC_HAVEKEYS){D+=" key='"+this._keys.getKey()+"'";if(this._keys.lastKey()){this._keys=new JSJaCKeys(hex_sha1,this.oDbg);
D+=" newkey='"+this._keys.getKey()+"'"}}D+=">";while(this._pQueue.length){var B=this._pQueue[0];
D+=B;this._pQueue=this._pQueue.slice(1,this._pQueue.length)}D+="</body>";var E=setTimeout("oCon._req["+F+"].r.abort();",5000);
this.oDbg.log("Disconnecting: "+D,4);this._req[F].r.send(D);clearTimeout(E)}}JSJaCHttpBindingConnection.prototype=new JSJaCConnection();
function JSJaCHBCConnect(A){this._setStatus("connecting");this.domain=A.domain||"localhost";
this.username=A.username;this.resource=A.resource;this.pass=A.pass;this.register=A.register;
this.oDbg.log("httpbase: "+this._httpbase+"\domain:"+this.domain,2);this.host=A.host||this.domain;
this.port=A.port||5222;this.authhost=A.authhost||this.domain;this.authtype=A.authtype||"sasl";
if(A.secure){this.secure="true"}else{this.secure="false"}this.jid=this.username+"@"+this.domain;
this.fulljid=this.jid+"/"+this.resource;if(A.wait){this._wait=A.wait}if(A.xmllang&&A.xmllang!=""){this._xmllang=A.xmllang
}this._rid=Math.round(100000.5+(((900000.49999)-(100000.5))*Math.random()));var D=this._getFreeSlot();
this._req[D]=this._setupRequest(true);var B="<body hold='"+this._hold+"' xmlns='http://jabber.org/protocol/httpbind' to='"+this.authhost+"' wait='"+this._wait+"' rid='"+this._rid+"'";
if(A.host||A.port){B+=" route='xmpp:"+this.host+":"+this.port+"'"}if(A.secure){B+=" secure='"+this.secure+"'"
}if(JSJAC_HAVEKEYS){this._keys=new JSJaCKeys(hex_sha1,this.oDbg);key=this._keys.getKey();
B+=" newkey='"+key+"'"}if(this._xmllang){B+=" xml:lang='"+this._xmllang+"'"}if(JSJACHBC_USE_BOSH_VER){B+=" ver='"+JSJACHBC_BOSH_VERSION+"'";
B+=" xmpp:xmlns='urn:xmpp:xbosh'";B+=" xmpp:version='1.0'"}B+="/>";this.oDbg.log(B,4);
this._req[D].r.onreadystatechange=function(){if(typeof (oCon)=="undefined"||!oCon){return 
}if(oCon._req[D].r.readyState==4){oCon.oDbg.log("async recv: "+oCon._req[D].r.responseText,4);
oCon._handleInitialResponse(D)}};if(typeof (this._req[D].r.onerror)!="undefined"){this._req[D].r.onerror=function(E){if(typeof (oCon)=="undefined"||!oCon||!oCon.connected()){return 
}oCon.oDbg.log("XmlHttpRequest error",1);return false}}this._req[D].r.send(B)}function JSJaCHBCHandleInitialResponse(D){try{this.oDbg.log(this._req[D].r.getAllResponseHeaders(),4);
this.oDbg.log(this._req[D].r.responseText,4)}catch(B){this.oDbg.log("No response",4)
}if(this._req[D].r.status!=200||!this._req[D].r.responseXML){this.oDbg.log("initial response broken (status: "+this._req[D].r.status+")",1);
this._handleEvent("onerror",JSJaCError("503","cancel","service-unavailable"));return 
}var A=this._req[D].r.responseXML.documentElement;if(!A||A.tagName!="body"||A.namespaceURI!="http://jabber.org/protocol/httpbind"){this.oDbg.log("no body element or incorrect body in initial response",1);
this._handleEvent("onerror",JSJaCError("500","wait","internal-service-error"));return 
}if(A.getAttribute("type")=="terminate"){this.oDbg.log("invalid response:\n"+this._req[D].r.responseText,1);
clearTimeout(this._timeout);this._connected=false;this.oDbg.log("Disconnected.",1);
this._handleEvent("ondisconnect");this._handleEvent("onerror",JSJaCError("503","cancel","service-unavailable"));
return }this._sid=A.getAttribute("sid");this.oDbg.log("got sid: "+this._sid,2);if(A.getAttribute("polling")){this._min_polling=A.getAttribute("polling")
}if(A.getAttribute("inactivity")){this._inactivity=A.getAttribute("inactivity")}if(A.getAttribute("requests")){this._setHold(A.getAttribute("requests")-1)
}this.oDbg.log("set hold to "+this._getHold(),2);if(A.getAttribute("ver")){this._bosh_version=A.getAttribute("ver")
}if(A.getAttribute("maxpause")){this._pause=Number.max(A.getAttribute("maxpause"),JSJACHBC_MAXPAUSE)
}this.setPollInterval(this._timerval);this._connected=true;this._inQto=setInterval("oCon._checkInQ();",JSJAC_CHECKINQUEUEINTERVAL);
this._interval=setInterval("oCon._checkQueue()",JSJAC_CHECKQUEUEINTERVAL);this._getStreamID(D)
}function JSJaCHBCGetStreamID(B){this.oDbg.log(this._req[B].r.responseText,4);if(!this._req[B].r.responseXML||!this._req[B].r.responseXML.documentElement){this._handleEvent("onerror",JSJaCError("503","cancel","service-unavailable"));
return }var A=this._req[B].r.responseXML.documentElement;if(A.getAttribute("authid")){this.streamid=A.getAttribute("authid");
this.oDbg.log("got streamid: "+this.streamid,2)}else{this._timeout=setTimeout("oCon._sendEmpty()",this.getPollInterval());
return }this._timeout=setTimeout("oCon._process()",this.getPollInterval());this._parseStreamFeatures(A);
if(this.register){this._doInBandReg()}else{this._doAuth()}}function JSJaCHBCInherit(A){this.domain=A.domain||"localhost";
this.username=A.username;this.resource=A.resource;this._sid=A.sid;this._rid=A.rid;
this._min_polling=A.polling;this._inactivity=A.inactivity;this._setHold(A.requests-1);
this.setPollInterval(this._timerval);if(A.wait){this._wait=A.wait}this._connected=true;
this._handleEvent("onconnect");this._interval=setInterval("oCon._checkQueue()",JSJAC_CHECKQUEUEINTERVAL);
this._inQto=setInterval("oCon._checkInQ();",JSJAC_CHECKINQUEUEINTERVAL);this._timeout=setTimeout("oCon._process()",this.getPollInterval())
}function JSJaCHBCReInitStream(to,cb,arg){oCon._reinit=true;eval("oCon."+cb+"("+arg+")")
}function JSJaCHBCDisconnect(){this._setStatus("disconnecting");if(!this.connected()){return 
}this._connected=false;clearInterval(this._interval);clearInterval(this._inQto);if(this._timeout){clearTimeout(this._timeout)
}var F=this._getFreeSlot();this._req[F]=this._setupRequest(false);var D="<body type='terminate' xmlns='http://jabber.org/protocol/httpbind' sid='"+this._sid+"' rid='"+this._rid+"'";
if(JSJAC_HAVEKEYS){D+=" key='"+this._keys.getKey()+"'"}D+=">";while(this._pQueue.length){var A=this._pQueue[0];
D+=A;this._pQueue=this._pQueue.slice(1,this._pQueue.length)}D+="</body>";var E=setTimeout("oCon._req["+F+"].r.abort();",5000);
this.oDbg.log("Disconnecting: "+D,4);this._req[F].r.send(D);clearTimeout(E);try{JSJaCCookie.read("JSJaC_State").erase()
}catch(B){}oCon.oDbg.log("Disconnected: "+oCon._req[F].r.responseText,2);oCon._handleEvent("ondisconnect")
}function JSJaCHBCSetupRequest(A){var D=new Object();var B=XmlHttp.create();try{B.open("POST",this._httpbase,A);
B.setRequestHeader("Content-Type","text/xml; charset=utf-8")}catch(E){this.oDbg.log(E,1)
}D.r=B;this._rid++;D.rid=this._rid;return D}function JSJaCHBCGetRequestString(B){B=B||"";
var F="";if(this._rid<=this._last_rid&&typeof (this._last_requests[this._rid])!="undefined"){F=this._last_requests[this._rid].xml
}else{var A="";while(this._pQueue.length){var E=this._pQueue[0];A+=E;this._pQueue=this._pQueue.slice(1,this._pQueue.length)
}F="<body rid='"+this._rid+"' sid='"+this._sid+"' xmlns='http://jabber.org/protocol/httpbind' ";
if(JSJAC_HAVEKEYS){F+="key='"+this._keys.getKey()+"' ";if(this._keys.lastKey()){this._keys=new JSJaCKeys(hex_sha1,this.oDbg);
F+="newkey='"+this._keys.getKey()+"' "}}if(this._reinit){F+="xmpp:restart='true' ";
this._reinit=false}if(A!=""||B!=""){F+=">"+B+A+"</body>"}else{F+="/>"}this._last_requests[this._rid]=new Object();
this._last_requests[this._rid].xml=F;this._last_rid=this._rid;for(var D in this._last_requests){if(this._last_requests.hasOwnProperty(D)&&D<this._rid-this._hold){delete (this._last_requests[D])
}}}return F}function JSJaCHBCParseResponse(D){if(!this.connected()||!D){return null
}var B=D.r;try{if(B.status==404||B.status==403){this._abort();return null}if(B.status!=200||!B.responseXML){this._errcnt++;
var F="invalid response ("+B.status+"):\n"+B.getAllResponseHeaders()+"\n"+B.responseText;
if(!B.responseXML){F+="\nResponse failed to parse!"}this.oDbg.log(F,1);if(this._errcnt>JSJAC_ERR_COUNT){this._abort();
return null}this.oDbg.log("repeating ("+this._errcnt+")",1);this._setStatus("proto_error_fallback");
setTimeout("oCon._resume()",this.getPollInterval());return null}}catch(E){this.oDbg.log("XMLHttpRequest error: status not available",1);
this._errcnt++;if(this._errcnt>JSJAC_ERR_COUNT){this._abort()}else{this.oDbg.log("repeating ("+this._errcnt+")",1);
this._setStatus("proto_error_fallback");setTimeout("oCon._resume()",this.getPollInterval())
}return null}var A=B.responseXML.documentElement;if(!A||A.tagName!="body"||A.namespaceURI!="http://jabber.org/protocol/httpbind"){this.oDbg.log("invalid response:\n"+B.responseText,1);
clearTimeout(this._timeout);clearInterval(this._interval);clearInterval(this._inQto);
this._connected=false;this.oDbg.log("Disconnected.",1);this._handleEvent("ondisconnect");
this._setStatus("internal_server_error");this._handleEvent("onerror",JSJaCError("500","wait","internal-server-error"));
return null}if(typeof (D.rid)!="undefined"&&this._last_requests[D.rid]){if(this._last_requests[D.rid].handled){this.oDbg.log("already handled "+D.rid,2);
return null}else{this._last_requests[D.rid].handled=true}}if(A.getAttribute("type")=="terminate"){this.oDbg.log("session terminated:\n"+B.responseText,1);
clearTimeout(this._timeout);clearInterval(this._interval);clearInterval(this._inQto);
if(A.getAttribute("condition")=="remote-stream-error"){if(A.getElementsByTagName("conflict").length>0){this._setStatus("session-terminate-conflict")
}}this._handleEvent("onerror",JSJaCError("503","cancel",A.getAttribute("condition")));
this._connected=false;this.oDbg.log("Disconnected.",1);this._handleEvent("ondisconnect");
return null}this._errcnt=0;return B.responseXML.documentElement}function JSJaCHttpPollingConnection(A){this.base=JSJaCConnection;
this.base(A);JSJACPACKET_USE_XMLNS=false;this.connect=JSJaCHPCConnect;this.disconnect=JSJaCHPCDisconnect;
this.isPolling=function(){return true};this._getFreeSlot=function(){if(typeof (this._req[0])=="undefined"||typeof (this._req[0].r)=="undefined"||this._req[0].r.readyState==4){return 0
}else{return -1}};this._getRequestString=JSJaCHPCGetRequestString;this._getStreamID=JSJaCHPCGetStream;
this._getSuspendVars=function(){return new Array()};this._parseResponse=JSJaCHPCParseResponse;
this._reInitStream=JSJaCHPCReInitStream;this._resume=function(){this._process(this._timerval)
};this._setupRequest=JSJaCHPCSetupRequest;this._suspend=function(){}}JSJaCHttpPollingConnection.prototype=new JSJaCConnection();
function JSJaCHPCSetupRequest(A){var D=XmlHttp.create();try{D.open("POST",this._httpbase,A);
D.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}catch(E){this.oDbg.log(E,1)
}var B=new Object();B.r=D;return B}function JSJaCHPCGetRequestString(A){var B=this._sid;
if(JSJAC_HAVEKEYS){B+=";"+this._keys.getKey();if(this._keys.lastKey()){this._keys=new JSJaCKeys(b64_sha1,this.oDbg);
B+=";"+this._keys.getKey()}}B+=",";if(A){B+=A}while(this._pQueue.length){B+=this._pQueue[0];
this._pQueue=this._pQueue.slice(1,this._pQueue.length)}return B}function JSJaCHPCParseResponse(G){var F=G.r;
if(!this.connected()){return null}if(F.status!=200){this.oDbg.log("invalid response ("+F.status+"):"+F.responseText+"\n"+F.getAllResponseHeaders(),1);
this._setStatus("internal_server_error");clearTimeout(this._timeout);clearInterval(this._interval);
clearInterval(this._inQto);this._connected=false;this.oDbg.log("Disconnected.",1);
this._handleEvent("ondisconnect");this._handleEvent("onerror",JSJaCError("503","cancel","service-unavailable"));
return null}this.oDbg.log(F.getAllResponseHeaders(),4);var D=F.getResponseHeader("Set-Cookie");
D=D.split(";");var A;for(var E=0;E<D.length;E++){var B=D[E].split("=");if(B[0]=="ID"){A=B[1]
}}if(typeof (A)!="undefined"&&A.indexOf(":0")!=-1){switch(A.substring(0,A.indexOf(":0"))){case"0":this.oDbg.log("invalid response:"+F.responseText,1);
break;case"-1":this.oDbg.log("Internal Server Error",1);break;case"-2":this.oDbg.log("Bad Request",1);
break;case"-3":this.oDbg.log("Key Sequence Error",1);break}this._setStatus("internal_server_error");
clearTimeout(this._timeout);clearInterval(this._interval);clearInterval(this._inQto);
this._handleEvent("onerror",JSJaCError("500","wait","internal-server-error"));this._connected=false;
this.oDbg.log("Disconnected.",1);this._handleEvent("ondisconnect");return null}if(!F.responseText||F.responseText==""){return null
}try{var I=JSJaCHttpPollingConnection.parseTree("<body>"+F.responseText+"</body>");
if(!I||I.tagName=="parsererror"){this.oDbg.log("parsererror",1);I=JSJaCHttpPollingConnection.parseTree("<stream:stream xmlns:stream='http://etherx.jabber.org/streams'>"+F.responseText);
if(I&&I.tagName!="parsererror"){this.oDbg.log("stream closed",1);if(I.getElementsByTagName("conflict").length>0){this._setStatus("session-terminate-conflict")
}clearTimeout(this._timeout);clearInterval(this._interval);clearInterval(this._inQto);
this._handleEvent("onerror",JSJaCError("503","cancel","session-terminate"));this._connected=false;
this.oDbg.log("Disconnected.",1);this._handleEvent("ondisconnect")}else{this.oDbg.log("parsererror:"+I,1)
}return I}return I}catch(H){this.oDbg.log("parse error:"+H.message,1)}return null
}function JSJaCHPCConnect(D){this.domain=D.domain||"localhost";this.username=D.username;
this.resource=D.resource||"jsjac";this.pass=D.pass;this.register=D.register;this.authtype=D.authtype||"sasl";
this.jid=this.username+"@"+this.domain;this.fulljid=this.jid+this.resource;this.authhost=D.authhost||this.domain;
var F="0";if(JSJAC_HAVEKEYS){this._keys=new JSJaCKeys(b64_sha1,this.oDbg);key=this._keys.getKey();
F+=";"+key}var E=this.domain;if(this.authhost){E=this.authhost}F+=",<stream:stream to='"+E+"' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>";
this.oDbg.log(F,4);this._req[0]=this._setupRequest(false);this._req[0].r.send(F);
this.oDbg.log(this._req[0].r.getAllResponseHeaders(),4);var A=this._req[0].r.getResponseHeader("Set-Cookie");
A=A.split(";");for(var B=0;B<A.length;B++){aArg=A[B].split("=");if(aArg[0]=="ID"){this._sid=aArg[1]
}}this.oDbg.log("got sid: "+this._sid,2);oCon=this;this._interval=setInterval("oCon._checkQueue()",JSJAC_CHECKQUEUEINTERVAL);
this._inQto=setInterval("oCon._checkInQ();",JSJAC_CHECKINQUEUEINTERVAL);this._getStreamID()
}function JSJaCHPCGetStream(){if(!this._req[0].r.responseXML||this._req[0].r.responseText==""){oCon=this;
this._timeout=setTimeout("oCon._sendEmpty()",1000);return }this.oDbg.log(this._req[0].r.responseText,4);
if(this._req[0].r.responseText.match(/id=[\'\"]([^\'\"]+)[\'\"]/)){this.streamid=RegExp.$1
}this.oDbg.log("got streamid: "+this.streamid,2);var B;try{B=XmlDocument.create("doc");
B.loadXML(this._req[0].r.responseText+"</stream:stream>");this._parseStreamFeatures(B)
}catch(A){this.oDbg.log("loadXML: "+A.toString(),1)}if(this.register){this._doInBandReg()
}else{this._doAuth()}this._connected=true;this._process(this._timerval)}function JSJaCHPCReInitStream(D,B,A){oCon._sendRaw("<stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' to='"+D+"' version='1.0'>",B,A)
}function JSJaCHPCDisconnect(){if(!this.connected()){return }this._checkQueue();clearInterval(this._interval);
clearInterval(this._inQto);if(this._timeout){clearTimeout(this._timeout)}this._req[0]=this._setupRequest(false);
if(JSJAC_HAVEKEYS){this._req[0].r.send(this._sid+";"+this._keys.getKey()+",</stream:stream>")
}else{this._req[0].r.send(this._sid+",</stream:stream>")}try{JSJaCCookie.read("JSJaC_State").erase()
}catch(A){}this.oDbg.log("Disconnected: "+this._req[0].r.responseText,2);this._connected=false;
this._handleEvent("ondisconnect")}JSJaCHttpPollingConnection.parseTree=function(A){try{var B=XmlDocument.create("body","foo");
if(typeof (B.loadXML)!="undefined"){B.loadXML(A);return B.documentElement}else{if(window.DOMParser){return(new DOMParser()).parseFromString(A,"text/xml").documentElement
}}}catch(D){}return null};var JabberConnectionHandler=new Class({initialize:function(E,H,G,F,B,A){this.idIq=1;
this.jid=E;this.pwd=G;this.server=H;this.iqHandler=new Array();this.addHandledQuery=function(I){this.iqHandler.push(I)
}.bindAsEventListener(this);this.oArgs=new Object();this.oArgs.httpbase=A;this.oArgs.timerval=1000;
this.oArgs.domain=this.server;this.oArgs.username=this.jid;this.oArgs.resource="ajaxbber";
this.oArgs.pass=this.pwd;this.oArgs.register=B;var D;D=function(){};D.log=function(){};
if(typeof (D)!="undefined"){this.oArgs.oDbg=D}if(F==_("polling")){this.connection=new JSJaCHttpPollingConnection(this.oArgs)
}else{this.connection=new JSJaCHttpBindingConnection(this.oArgs)}this.connection.registerHandler("message",this.handleMessage.bindAsEventListener(this));
this.connection.registerHandler("onconnect",this.handleConnected.bindAsEventListener(this));
this.connection.registerHandler("presence",this.handlePresence.bindAsEventListener(this));
this.connection.registerHandler("iq",this.handleEvent.bindAsEventListener(this));
this.connection.registerHandler("onerror",this.handleError.bindAsEventListener(this));
this.connection.registerHandler("status_changed",this.handleStatusChange.bindAsEventListener(this));
this.connection.registerHandler("ondisconnect",this.handleDisconnect.bindAsEventListener(this));
this.connection.connect(this.oArgs)},reconnect:function(){this.connection.connect(this.oArgs)
},handleMessage:function(A){this.fireEvent(CONTACT_SEND_MSG,{contactName:A.getFrom().getJid(),msg:A.getBody()})
},handlePresence:function(E){var D=E.getFrom().getJid();var A=$pick(E.getType(),E.getShow());
var B=E.getStatus();if(A==""||A==null){A=SET_STATUS_ACTIVE}if(A=="unavailable"||A=="error"){this.fireEvent(CONTACT_LOGOFF,D)
}else{if(A=="unsubscribed"){this.fireEvent(CONTACT_REFUSED_AUTH,{contactName:D,status:A,msg:B})
}else{if(A=="unsubscribe"){this.fireEvent(CONTACT_REMOVED_AUTH,{contactName:D,status:A,msg:B})
}else{if(A=="subscribe"){this.fireEvent(CONTACT_ASKED_AUTH,{contactName:D,status:A,msg:B})
}else{if(D&&D!=""&&A!="subscribed"){this.fireEvent(CONTACT_CHANGES_STATUS,{contactName:D,status:A,msg:B})
}}}}}},handleConnected:function(){this.fireEvent(CONNECTED);this.queryGetContactList()
},handleDisconnect:function(){$("infosdeco").innerHTML+=getStrCurrentDate()+":disconnected<br/>";
this.fireEvent(DISCONNECTED)},handleError:function(A){alert("Error :"+("Code: "+A.getAttribute("code")+"\nType: "+A.getAttribute("type")+"\nCondition: "+A.firstChild.nodeName).htmlEnc())
},handleStatusChange:function(A){},handleEvent:function(A){this.iqHandler.each(function(B){if(B.idIq==A.getID()){B.fn(A);
this.iqHandler.remove(B)}}.bindAsEventListener(this))},queryGetContactList:function(){var A=new JSJaCIQ();
var B=this.idIq++;A.setType("get");A.setID(B);A.setQuery("jabber:iq:roster");this.connection.send(A);
this.addHandledQuery({idIq:B,fn:function(J){if(J.getQuery()&&J.getQuery().firstChild){var K=J.getQuery().getElementsByTagName("item");
for(var H=0;H<K.length;H++){var M=K.item(H);var E=M.getAttribute("jid");var D;var G=M.getAttribute("name");
if(G!=null&&G.trim().length>0){D=G}var I=M.getElementsByTagName("group");if(I.length>0){for(var F=0;
F<I.length;F++){var L=I.item(F).firstChild.nodeValue;this.fireEvent(ADD_CONTACT_GROUP,{jid:E.getJid(),groupName:L,displayableName:D})
}}else{this.fireEvent(ADD_CONTACT_GROUP,{jid:E.getJid(),displayableName:D})}this.queryVCard_XEP0153(E.getJid())
}}this.fireEvent(GROUP_CONTACTS_RECEIVED)}.bindAsEventListener(this)});return B},send:function(D,B){var A=new JSJaCMessage();
A.setTo(D);A.setBody(B);A.setType("chat");this.connection.send(A)},disconnect:function(){this.connection.disconnect()
},setStatus:function(B,D){var A=new JSJaCPresence();A.setStatus(D);A.setShow(B);this.connection.send(A)
},modifyContact:function(A){var G=new JSJaCIQ();G.setFrom(this.jid);G.setID(this.idIq++);
G.setType("set");var E=G.setQuery("jabber:iq:roster");var D=G.getDoc().createElement("item");
D.setAttribute("jid",A.contactName);D.setAttribute("subscription","both");if(typeof (A.displayableName)!="undefined"){D.setAttribute("name",A.displayableName)
}E.appendChild(D);for(var B=0;B<A.groups.length;B++){var F=G.getDoc().createElement("group");
F.appendChild(G.getDoc().createTextNode(A.groups[B]));D.appendChild(F)}this.connection.send(G)
},removeContact:function(A){var E=new JSJaCIQ();E.setFrom(this.jid);E.setID(this.idIq++);
E.setType("set");var D=E.setQuery("jabber:iq:roster");var B=E.getDoc().createElement("item");
B.setAttribute("jid",A.contactName);B.setAttribute("subscription","remove");D.appendChild(B);
this.connection.send(E)},authorize:function(B){var A=new JSJaCPresence();A.setType("subscribed");
A.setTo(B);this.connection.send(A)},queryAddContact:function(H,G){var E=new JSJaCIQ();
E.setFrom(this.jid);var F=this.idIq++;E.setID(F);E.setType("set");var D=E.setQuery("jabber:iq:roster");
var B=E.getDoc().createElement("item");B.setAttribute("jid",H);D.appendChild(B);this.connection.send(E);
var A=new JSJaCPresence();A.setType("subscribe");A.setTo(H);A.setFrom(this.jid);if(typeof (G)!="undefined"){A.setStatus(G)
}this.connection.send(A);return F},queryVCard_XEP0153:function(E){var B=new JSJaCIQ();
var D=this.idIq++;B.setID(D);B.setType("get");B.setFrom(this.jid);B.setTo(E);var A=B.getDoc().createElement("vCard");
A.setAttribute("xmlns","vcard-temp");B.getNode().appendChild(A);this.connection.send(B);
this.addHandledQuery({idIq:D,fn:function(K){var M=null;var L=K.getNode().getAttribute("from");
var I=K.getNode().getElementsByTagName("vCard");if(I.length>0){var J=I[0].getElementsByTagName("PHOTO");
if(J.length>0){var F=I[0].getElementsByTagName("BINVAL");var H=I[0].getElementsByTagName("TYPE");
var M="data:"+H[0].firstChild.nodeValue+";base64,";for(var G=0;G<F[0].childNodes.length;
G++){M+=F[0].childNodes[G].nodeValue}this.fireEvent(PHOTO_RECEIVED,{contactName:L.getJid(),src:M})
}}}.bindAsEventListener(this)});return D},queryAvatar_XEP008:function(B){iq=new JSJaCIQ();
var A=this.idIq++;iq.setID(A);iq.setType("get");iq.setTo(B);iq.setQuery("jabber:iq:avatar");
this.connection.send(iq);this.addHandledQuery({idIq:A,fn:function(D){alert("queryAvatarXEP008:"+D.getDoc().xml)
}.bindAsEventListener(this)});return A}});JabberConnectionHandler.implement(new Events);
var BASIC="1";var ADVANCED="2";var ConnectionHandler;var ConfigWindow=new Class({initialize:function(){this.windoo=null;
this.CONFIG_ARRAY_STEP=5;this.INDEX_LEVEL=0;this.INDEX_NAME=1;this.INDEX_DEFAULT=2;
this.INDEX_TYPE=3;this.INDEX_LABEL=4;this.divWin=new Element("div",{id:"config_win"});
this.config=new Array();this.CDefaultValue=function(B){var A=0;var D;while(A<this.config.length&&this.config[A+this.INDEX_NAME]!=B){A+=this.CONFIG_ARRAY_STEP
}if(A<this.config.length){D=this.config[A+this.INDEX_DEFAULT]}return D},this.CType=function(B){var A=0;
var D;while(A<this.config.length&&this.config[A+this.INDEX_NAME]!=B){A+=this.CONFIG_ARRAY_STEP
}if(A<this.config.length){D=this.config[A+this.INDEX_TYPE]}return D},this.getConfigTab=function(B){var A=new Element("div");
var J=new Element("table");A.appendChild(J);for(var G=0;G<this.config.length;G+=this.CONFIG_ARRAY_STEP){if(this.config[G+this.INDEX_LEVEL]==B){if(this.config[G+this.INDEX_NAME]==""){var H=new Element("tr").appendChild(new Element("td",{colspan:"2"}).adopt(new Element("br"),new Element("span",{"class":"config_section"}).appendText(this.config[G+this.INDEX_LABEL]),new Element("hr")));
J.appendChild(H)}else{var H=new Element("tr").adopt(new Element("td").appendText(this.config[G+this.INDEX_LABEL]));
var E=new Element("td");var I=new Element("input",{id:"txt_"+this.config[G+this.INDEX_NAME].htmlUsable()});
I.addEvent("keydown",function(M){this.btn.removeAttribute("disabled")}.bindAsEventListener(this));
I.addEvent("change",function(M){this.btn.removeAttribute("disabled")}.bindAsEventListener(this));
if(this.config[G+this.INDEX_TYPE]=="int"||this.config[G+this.INDEX_TYPE]=="string"){I.setAttribute("type","text");
I.setAttribute("value",this.config[G+this.INDEX_DEFAULT]);E.appendChild(I)}else{if(this.config[G+this.INDEX_TYPE]=="boolean"){I.setAttribute("type","checkbox");
I.setAttribute("value",this.config[G+this.INDEX_DEFAULT]);E.appendChild(I)}else{var K=new Element("select",{id:"txt_"+this.config[G+this.INDEX_NAME].htmlUsable()});
K.addEvent("change",function(M){this.btn.removeAttribute("disabled")}.bindAsEventListener(this));
var L=this.config[G+this.INDEX_TYPE].split(new RegExp("[,;]+","g"));for(var F=0;F<L.length;
F++){var D=new Element("option",{value:L[F]});if(L[F]==this.config[G+this.INDEX_DEFAULT]){D.setAttribute("selected","")
}D.appendText(L[F]);K.appendChild(D)}E.appendChild(K)}}H.appendChild(E);J.appendChild(H)
}}}return A}},addConstant:function(F,B,D,E,A){this.config.push(F);this.config.push(B);
this.config.push(D);this.config.push(E);this.config.push(A)},addTitle:function(B,A){this.addConstant(B,"","","",A)
},show:function(){if(this.windoo==null){var B=new Element("div");var H=new Element("div",{id:"config_tabs"}).adopt(new Element("h4").appendText(_("configuration_basic_tab")),this.getConfigTab(BASIC),new Element("h4").appendText(_("configuration_advanced_tab")),this.getConfigTab(ADVANCED));
B.appendChild(H);this.chkCookie=new Element("input",{type:"checkbox"});var D=new Element("span").appendText(_("configuration_save_in_cookie"));
this.btn=new Element("button").appendText(_("configuration_store"));this.btn.addEvent("click",function(I){this.fireEvent(USER_IS_ACTIVE,"ConfigWindow");
this.storeValues()}.bindAsEventListener(this));this.btn.setAttribute("disabled","disabled");
this.divWin.adopt(B,D,this.chkCookie,new Element("br"),this.btn);this.divWin.inject(document.body);
var A=new Element("div",{styles:{"padding-top":10,"text-align":"right"}});var G=$("config_win"),F=G.getParent();
G.remove();this.windoo=new Windoo({width:C("CONFIG_WIN_WIDTH"),height:C("CONFIG_WIN_HEIGHT"),top:C("CONFIG_WIN_TOP"),left:C("CONFIG_WIN_LEFT"),title:_("configuration_title"),container:F,resizeLimit:{x:[270],y:[200]},theme:Windoo.Themes.aero,position:false,destroyOnClose:false}).addPanel(A).adopt(G).show();
var E=new SimpleTabs($("config_tabs"),{entrySelector:"h4"})}this.windoo.show();this.windoo.bringTop()
},storeValues:function(){var B=new Array();for(var A=0;A<this.config.length;A+=this.CONFIG_ARRAY_STEP){if(this.config[A+this.INDEX_NAME]!=""){if(this.config[A+this.INDEX_TYPE]=="boolean"){this.config[A+this.INDEX_DEFAULT]=$("txt_"+this.config[A+this.INDEX_NAME].htmlUsable()).value
}else{this.config[A+this.INDEX_DEFAULT]=$("txt_"+this.config[A+this.INDEX_NAME].htmlUsable()).value
}B.push(this.config[A+this.INDEX_DEFAULT])}}if(this.chkCookie.getValue()&&typeof (this.user.jid)!="undefined"){var D=new Hash.Cookie(this.user.jid,{duration:604800});
D.extend({conf:B})}this.btn.setAttribute("disabled","disabled")},storeValue:function(A,B){},restoreValues:function(){var E=new Hash.Cookie(this.user.jid,{duration:604800});
var D=E.get("conf");if(D!=null&&typeof (D)!="undefined"){var A=0;for(var B=0;B<this.config.length;
B+=this.CONFIG_ARRAY_STEP){if(this.config[B+this.INDEX_NAME]!=""){this.config[B+this.INDEX_DEFAULT]=D[A];
A++}}}},setOffline:function(A){if(typeof (A)=="undefined"||A){ConnectionHandler=OfflineConnectionHandler
}else{ConnectionHandler=JabberConnectionHandler}},getValue:function(B){var A=this.CDefaultValue(B);
var D=this.CType(B);if(D=="boolean"){if(A=="true"){varConf=true}else{varConf=false
}}else{if(D=="int"){varConf=parseInt(A)}else{varConf=A}}return varConf}});ConfigWindow.implement(new Events);
function getStrCurrentDate(A){if(!A){A=new Date()}return"["+A.getHours().fPad(1)+":"+A.getMinutes().fPad(2)+":"+A.getSeconds().fPad(2)+"]"
}function random(A){return Math.round(Math.random()*A)%A}function forwardEvent(D,A,E,B){D.addEvent(A,function(F){if(typeof (B)=="undefined"){this.fireEvent(A,F)
}else{this.fireEvent(B,F)}}.bindAsEventListener(E))}Number.extend({fPad:function(A){var D=this.toString();
for(var B=D.length;B<A;B++){D="0"+D}return D}});String.extend({htmlUsable:function(){if(this.length>0){return this.replace(/@/g,"_").replace(/\./g,"_").replace(/\s/g,"_").replace(/\//g,"_").replace(/%/g,"_")
}return this},htmlEnc:function(){var A=this;A.replace(/&/g,"&amp;");A=A.replace(/</g,"&lt;");
A=A.replace(/>/g,"&gt;");A=A.replace(/\"/g,"&quot;");A=A.replace(/(\s|^)(https?:\/\/\S+)/gi,'$1<a href="$2" target="_blank">$2</a>');
A=A.replace(/(\s|^)(\w+\@\S+\.\S+)/g,'$1<a href="mailto:$2">$2</a>');A=A.replace(/\n/g,"<br/>");
return A},trim:function(){return this.replace(/^\s+/g,"").replace(/\s+$/g,"")},jidDisplayable:function(){var A=this;
if(A.length>0&&A.lastIndexOf("/")>-1){A=A.substring(0,this.lastIndexOf("/"))}if(A.lastIndexOf("@")>-1){A=A.substring(0,A.lastIndexOf("@"))
}return A},getJid:function(){var A=this;if(A.length>0&&A.lastIndexOf("/")>-1){A=A.substring(0,this.lastIndexOf("/"))
}return A},guessIM:function(){var A="";if(this.indexOf("hotmail")>=0){A="msn"}else{if(this.indexOf("icq")>=0){A="icq"
}else{if(this.indexOf("/Talk")>=0||this.indexOf("@gmail")>=0){A="gtalk"}else{A="jabber"
}}}return A},escaped:function(){return this.replace("\\","\\\\","g").replace('"','\\"',"g")
}});var config=new ConfigWindow();function C(A){return config.getValue(A)}function AC(F,B,D,E,A){config.addConstant(F,B,D,E,A)
}function AT(B,A){config.addTitle(B,A)}AT(BASIC,_("conf_msg_general"));AC(BASIC,"ICON_THEME","default","default,monochrome,blue",_("conf_msg_icon_theme"));
AC(BASIC,"EMOTICON_THEME","jwchat","jwchat",_("conf_msg_emoticon_theme"));AC(BASIC,"WINDOW_THEME","Windoo.Themes.aero","Windoo.Themes.aero,Windoo.Themes.aqua",_("conf_msg_window_theme"));
AC(BASIC,"INITIAL_STATUS","dnd","active,away,dnd,xa,invisible",_("conf_msg_logon_status"));
AC(BASIC,"INITIAL_STATUS_MSG",_("online"),"string",_("conf_msg_logon_status_msg"));
AC(BASIC,"SEC_BEFORE_IDLE","30","int",_("conf_msg_away_timeout"));AT(BASIC,_("conf_msg_chat_window"));
AC(BASIC,"CHAT_WIN_WIDTH","400","int",_("width"));AC(BASIC,"CHAT_WIN_HEIGHT","300","int",_("height"));
AC(BASIC,"CHAT_MIN_WIN_WIDTH","200","int",_("min_width"));AC(BASIC,"CHAT_MIN_WIN_HEIGHT","200","int",_("min_height"));
AC(BASIC,"CHAT_WIN_TOP","70","int",_("top"));AC(BASIC,"CHAT_WIN_LEFT","100","int",_("left"));
AC(BASIC,"CHAT_WIN_OFFSET","23","int",_("conf_msg_cascading_offset"));AC(BASIC,"CHAT_NB_CASCADING","20","int",_("conf_msg_cascading_nb"));
AT(BASIC,_("conf_msg_roster_window"));AC(BASIC,"ROSTER_WIN_WIDTH","300","int",_("width"));
AC(BASIC,"ROSTER_WIN_HEIGHT","500","int",_("height"));AC(BASIC,"ROSTER_MIN_WIN_WIDTH","200","int",_("min_width"));
AC(BASIC,"ROSTER_MIN_WIN_HEIGHT","300","int",_("min_height"));AC(BASIC,"ROSTER_WIN_TOP","50","int",_("top"));
AC(BASIC,"ROSTER_WIN_LEFT","550","int",_("left"));AC(BASIC,"DEFAULT_GROUP_NAME","default","string",_("conf_msg_default_group_name"));
AT(BASIC,_("conf_msg_login_window"));AC(BASIC,"LOGIN_WIN_HEIGHT","250","int",_("height"));
AC(BASIC,"LOGIN_WIN_WIDTH","350","int",_("width"));AT(ADVANCED,_("conf_msg_blinking_delay"));
AC(ADVANCED,"BLINK_DELAY_DOCUMENT_TITLE","2500","int",_("conf_msg_blink_delay_doc_title"));
AC(ADVANCED,"BLINK_DEFAULT_DOCUMENT_TITLE","Ajaxbber","string",_("conf_msg_blink_doc_title"));
AC(ADVANCED,"BLINK_ROSTER_CONTACT","1000","int",_("conf_msg_blink_delay_roster_title"));
AC(ADVANCED,"BLINK_ROSTER_CONTACT_START_COLOR","#6684a0","string",_("conf_msg_blink_roster_contact_start_color"));
AC(ADVANCED,"BLINK_ROSTER_CONTACT_END_COLOR","#d58a8a","string",_("conf_msg_blink_roster_contact_end_color"));
AT(ADVANCED,_("conf_msg_chat_blinking"));AC(ADVANCED,"BLINK_CHAT_WINDOW_TITLE","800","int",_("conf_msg_blink_delay_chat_title"));
AC(ADVANCED,"BLINK_CHAT_START_MARGIN_LEFT","0","int",_("conf_msg_blink_chat_margin_left"));
AC(ADVANCED,"BLINK_CHAT_START_COLOR","#6684a0","string",_("conf_msg_blink_chat_start_color"));
AC(ADVANCED,"BLINK_CHAT_END_MARGIN_LEFT","90","string",_("conf_msg_blink_chat_end_margin_left"));
AC(ADVANCED,"BLINK_CHAT_END_COLOR","#ff0000","string",_("conf_msg_blink_chat_end_color"));
AT(ADVANCED,_("conf_msg_config_window"));AC(ADVANCED,"CONFIG_WIN_WIDTH","500","int",_("width"));
AC(ADVANCED,"CONFIG_WIN_HEIGHT","500","int",_("height"));AC(ADVANCED,"CONFIG_WIN_TOP","150","int",_("top"));
AC(ADVANCED,"CONFIG_WIN_LEFT","300","int",_("left"));var CHAT_WITH="chat_with";var CONTACT_INFO="contact_info";
var TOGGLE_CONTACT_INTO_GROUP="toggle_contact_into_group";var MODIFY_CONTACT="modify_contact";
var REQUEST_ADD_CONTACT="add_contact";var MOVE="move";var REMOVE="remove";var RENAME="rename";
var IDENTICAL="identical";var REAUTHORIZE="reauthorize";var SET_STATUS="set_status";
var SET_STATUS_ACTIVE="active";var SET_STATUS_AWAY="away";var SET_STATUS_DND="dnd";
var SET_STATUS_XA="xa";var SET_STATUS_INVISIBLE="invisible";var SET_STATUS_OFFLINE="offline";
var SEND_MESSAGE="send_msg";var DISCONNECTED="disconnected";var CONNECTING="connecting";
var CONNECTED="connected";var USER_IS_ACTIVE="user_is_active";var STARTING_BLINKING="starting_blinking";
var STOP_BLINKING="stop_blinking";var ACCEPT_AUTHORISATION="accept_authorisation";
var REFUSE_AUTHORISATION="refuse_authorisation";var GROUP_CONTACTS_RECEIVED="gc_received";
var ADD_CONTACT_GROUP="add_contact_group";var PHOTO_RECEIVED="photo_received";var CONTACT_LOGOFF="contact_logoff";
var CONTACT_CHANGES_STATUS="contact_changes_status";var CONTACT_ASKED_AUTH="contact_asked_auth";
var CONTACT_SEND_MSG="contact_send_msg";var CONTACT_REFUSED_AUTH="contact_refused_auth";
var CONTACT_REMOVED_AUTH="contact_removed_auth";var ChatWindow=new Class({initialize:function(F,E,B,D,A){if(typeof (F)!="undefined"&&typeof (E)!="undefined"&&typeof (B)!="undefined"){this.id=F;
this.contactName=E;this.icon=B;if(typeof (D)!="undefined"){this.contactDisplayName=D.replace("/","\\/","g")
}else{this.contactDisplayName=E.jidDisplayable()}this.windoo=null;this.config=A;if(typeof (this.config.getNewChatWinPosition)=="undefined"){A.curX=C("CHAT_WIN_LEFT");
A.curY=C("CHAT_WIN_TOP");A.getNewChatWinPosition=function(){var G={x:this.curX,y:this.curY};
this.curX+=C("CHAT_WIN_OFFSET");this.curY+=C("CHAT_WIN_OFFSET");if(this.curX>C("CHAT_WIN_LEFT")+C("CHAT_WIN_OFFSET")*C("CHAT_NB_CASCADING")){this.curX=C("CHAT_WIN_LEFT");
this.curY=C("CHAT_WIN_TOP")}return G}.bindAsEventListener(A)}}},createWindow:function(){this.divWin=new Element("div",{id:"chat_win"+this.id});
this.sendButton=new Element("input",{type:"button",value:"Send"});this.textArea=new Element("textarea",{id:"chat_win_ta"+this.id,name:"send",styles:{width:"100%"}});
this.divText=new Element("div",{id:"chat_win_text_"+this.id});this.sendButton.addEvent("click",function(e){this.send.bindAsEventListener(this);
this.fireEvent(USER_IS_ACTIVE,"ChatWindow")}.bindAsEventListener(this));this.textArea.addEvent("click",function(e){this.stopBlinking();
this.fireEvent(USER_IS_ACTIVE,"ChatWindow")}.bindAsEventListener(this));this.textArea.onkeydown=function(event){var event=new Event(event);
if(!event.shift&&event.code==13){this.send()}this.stopBlinking();this.fireEvent(USER_IS_ACTIVE,"ChatWindow")
}.bindAsEventListener(this);this.textArea.onkeyup=function(event){var event=new Event(event);
if(!event.shift&&event.code==13){this.textArea.value="";return false}this.fireEvent(USER_IS_ACTIVE,"ChatWindow")
}.bindAsEventListener(this);var panel=new Element("div",{styles:{"padding-top":10,"text-align":"right"}}).adopt(this.textArea,this.sendButton);
this.divWin.adopt(this.divText);this.divWin.inject(document.body);var win=$("chat_win"+this.id),container=win.getParent();
win.remove();this.divTitle=new Element("div").adopt(new Element("img",{"class":"wc_img_title",src:"themes/icons/"+C("ICON_THEME")+"/"+this.icon+".png"}),new Element("img",{"class":"wc_img_status_title cw_ct_st_"+this.contactName.htmlUsable(),id:"wc_img_status_"+this.contactName.htmlUsable(),styles:{display:"none"}}),new Element("span",{id:"wc_title_"+this.contactName.htmlUsable(),"class":"wc_"+this.contactName.htmlUsable()}).appendText(this.contactDisplayName));
var pos=this.config.getNewChatWinPosition();this.windoo=new Windoo({left:pos.x,top:pos.y,title:this.divTitle.innerHTML,container:container,width:C("CHAT_WIN_WIDTH"),height:C("CHAT_WIN_HEIGHT"),resizeLimit:{x:[C("CHAT_MIN_WIN_WIDTH")],y:[C("CHAT_MIN_WIN_HEIGHT")]},theme:eval(C("WINDOW_THEME")),position:false,destroyOnClose:false}).addPanel(panel).adopt(win);
var ts=$("wc_title_"+this.contactName.htmlUsable());this.effect=ts.effects({duration:C("BLINK_CHAT_WINDOW_TITLE")});
this.fx=function(){this.effect.start({"margin-left":C("BLINK_CHAT_START_MARGIN_LEFT")}).chain(function(){if(this.blinking){this.effect.start({color:C("BLINK_CHAT_START_COLOR")})
}else{this._noBlinking()}}.bindAsEventListener(this)).chain(function(){if(this.blinking){this.effect.start({"margin-left":C("BLINK_CHAT_END_MARGIN_LEFT")})
}else{this._noBlinking()}}.bindAsEventListener(this)).chain(function(){if(this.blinking){this.effect.start({color:C("BLINK_CHAT_END_COLOR")})
}else{this._noBlinking()}}.bindAsEventListener(this))}.bindAsEventListener(this);
this.periodical=null;this.blinking=false},startBlinking:function(){var A=$("wc_title_"+this.contactName.htmlUsable());
this.fireEvent(STARTING_BLINKING,{el:A,type:"wct"})},stopBlinking:function(){var A=$("wc_title_"+this.contactName.htmlUsable());
this.fireEvent(STOP_BLINKING,{el:A,type:"wct"})},_noBlinking:function(){$clear(this.periodical);
var A=$("wc_title_"+this.contactName.htmlUsable());A.setStyle("color","");A.setStyle("margin-left","")
},send:function(){var E=this.textArea.getValue();if(E!=""){var D=new Element("span",{"class":"msg_sent"}).appendText(getStrCurrentDate()+" <"+_("me")+"> :");
var A=new Element("span").appendText(E);var B=new Element("br");this.divText.appendChild(D);
this.divText.appendChild(A);this.divText.appendChild(B);this.divText.getParent().getParent().scrollTo(0,this.divText.getParent().getParent().scrollHeight);
this.textArea.value="";this.fireEvent(SEND_MESSAGE,{contactName:this.contactName,msg:E.htmlEnc()})
}},receives:function(E){if(typeof (E)!=undefined&&E!=null&&E.length>0){var D=new Element("span",{"class":"msg_received wc_"+this.contactName.htmlUsable()}).appendText(getStrCurrentDate()+" <"+this.contactDisplayName+"> ");
var A=new Element("span").appendText(E.htmlEnc());var B=new Element("br");this.divText.appendChild(D);
this.divText.appendChild(A);this.divText.appendChild(B);this.divText.getParent().getParent().scrollTo(0,this.divText.getParent().getParent().scrollHeight)
}},receivesNotification:function(B){if(typeof (B)!=undefined&&B!=""){var A=new Element("span",{"class":"notification_title"});
A.appendText(_("notification"));var D=new Element("div",{"class":"notification_received "});
D.adopt(A,new Element("span").appendText(" : "+this.contactName),new Element("br"),new Element("span").appendText(getStrCurrentDate()+" "+B.htmlEnc()));
this.divText.appendChild(D);this.divText.getParent().getParent().scrollTo(0,this.divText.getParent().getParent().scrollHeight)
}},receivesAuthorisationRequest:function(E){var B=new Element("span",{"class":"authorisationrequest_title"}).appendText(_("authorisation_request"));
var A=new Element("a",{href:"#","class":"authorisationrequest_link"}).appendText(_("yes"));
var D=new Element("a",{href:"#","class":"authorisationrequest_link"}).appendText(_("no"));
var F=new Element("div",{"class":"authorisationrequest_received"}).adopt(B,new Element("span").appendText(" : "+this.contactName),new Element("br"),new Element("span").appendText((typeof (E)!=undefined&&E==null&&E.length>0)?getStrCurrentDate()+" "+E.htmlEnc():""),new Element("br"),A,D);
A.addEvent("click",function(){this.fireEvent(ACCEPT_AUTHORISATION,this.contactName);
A.remove();D.remove()}.bindAsEventListener(this));D.addEvent("click",function(){this.fireEvent(REFUSE_AUTHORISATION,this.contactName);
A.remove();D.remove()}.bindAsEventListener(this));this.divText.appendChild(F);this.divText.getParent().getParent().scrollTo(0,this.divText.getParent().getParent().scrollHeight)
},renameContact:function(A){$$(".wc_"+this.contactName.htmlUsable()).each(function(B){B.setText(B.getText().replace(this.contactDisplayName,A))
}.bindAsEventListener(this));this.contactDisplayName=A},show:function(){if(this.windoo==null||typeof (this.windoo)=="undefined"){this.createWindow()
}this.windoo.show();this.windoo.bringTop()},setStatus:function(A){if(typeof (A)!="undefined"){$$(".cw_ct_st_"+this.contactName.htmlUsable()).each(function(B){if(A!=SET_STATUS_ACTIVE){B.setStyle("display","block");
B.setAttribute("src","themes/icons/"+C("ICON_THEME")+"/"+A+".png")}else{B.setStyle("display","none")
}}.bindAsEventListener(this))}}});ChatWindow.implement(new Events);var RosterWindow=new Class({initialize:function(G,D){if(typeof (G)!="undefined"){this.title=G;
this.contacts=new Array();this.groups=new Array();this.currentStatus=C("INITIAL_STATUS");
this.currentStatusMsg=C("INITIAL_STATUS_MSG");this.config=D;this.divWin=new Element("div",{id:"roster_win"});
this.timer=null;this.blinkingContacts=new Array();this.doctitleperiodical=null;this.notifManager=new NotificationManager();
this.getContact=function(L){var J=null;var K=this.contacts.filter(function(M){return M.contactName.indexOf(L)>-1
});if(K.length>0){J=K[0]}return J};var A=new Element("div",{"class":"roster_panel_status roster_top_panel roster_pane_ac"});
this.spanAddContact=new Element("span",{id:"roster_divaddcontact_id","class":"roster_span_add_contact"}).appendText(_("ac_title"));
this.spanAddContact.addEvent("click",function(J){$clear(this.timer);this.spanAddContact.setText(_("ac_tb"));
cambia(this.spanAddContact,"roster_span_highlighted");this.fireEvent(USER_IS_ACTIVE,"RosterWindow")
}.bindAsEventListener(this));this.effect=this.spanAddContact.effects({duration:C("BLINK_CHAT_WINDOW_TITLE")});
this.fx=function(){this.effect.start({"font-size":"0"}).chain(function(){this.spanAddContact.innerHTML=_("ac_msg");
this.spanAddContact.setStyle("font-size","");var K=this.spanAddContact.getStyle("color");
this.spanAddContact.setStyle("color","green");var J=function(){this.spanAddContact.setText(_("ac_title"));
this.spanAddContact.setStyle("color",K)}.bindAsEventListener(this);this.timer=J.delay(5000)
}.bindAsEventListener(this))};this.spanAddContact.addEvent(RENAME,function(J){this.fireEvent(REQUEST_ADD_CONTACT,J.getText());
this.fx()}.bindAsEventListener(this));this.spanAddContact.addEvent(IDENTICAL,function(J){this.spanAddContact.setText(_("ac_title"))
}.bindAsEventListener(this));A.appendChild(this.spanAddContact);var E=new Element("div",{"class":"roster_panel_btn_status roster_panel_top_btn_status"});
var B=new Element("img",{src:"themes/icons/"+C("ICON_THEME")+"/configure.png","class":"roster_button_img"});
B.addEvent("click",function(J){this.config.show();this.fireEvent(USER_IS_ACTIVE,"RosterWindow")
}.bindAsEventListener(this));E.appendChild(B);this.imgSt=new Element("img",{src:"themes/icons/"+C("ICON_THEME")+"/jabber.png","class":"roster_button_img"});
var F=new Element("div",{"class":"roster_panel_btn_status roster_panel_bottom_btn_status"}).adopt(this.imgSt);
this.spanSt=new Element("span",{id:"roster_id_status","class":"roster_text_status"}).appendText(C("INITIAL_STATUS_MSG"));
var I=new Element("div",{"class":"roster_panel_status roster_bottom_panel"}).adopt(this.spanSt);
var H=new Element("div",{"class":"roster_main_panel",styles:{"margin-left":"-1px"}}).adopt(E,A);
this.imgSt.addEvent("click",function(J){var J=new Event(J);this.statusMenu.show(J,H.getWidth()-1,F.getTop()+F.getHeight()-1,F.getLeft());
J.stop();this.fireEvent(USER_IS_ACTIVE,"RosterWindow")}.bindAsEventListener(this));
this.panel=new Element("div",{"class":"roster_main_panel"}).adopt(F,I);this.statusMenu=new MPopup(undefined,true);
this.statusMenu.addChoice(_("status_active"),"active.png",function(){this.setStatus(SET_STATUS_ACTIVE)
}.bindAsEventListener(this));this.statusMenu.addChoice(_("status_away"),"away.png",function(){this.setStatus(SET_STATUS_AWAY)
}.bindAsEventListener(this));this.statusMenu.addChoice(_("status_dnd"),"dnd.png",function(){this.setStatus(SET_STATUS_DND)
}.bindAsEventListener(this));this.statusMenu.addChoice(_("status_xa"),"xa.png",function(){this.setStatus(SET_STATUS_XA)
}.bindAsEventListener(this));this.statusMenu.addChoice(_("status_invisible"),"invisible.png",function(){this.setStatus(SET_STATUS_INVISIBLE)
}.bindAsEventListener(this));this.statusMenu.addChoice(_("status_offline"),"offline.png",function(){this.setStatus(SET_STATUS_OFFLINE)
}.bindAsEventListener(this));this.spanSt.addEvent(RENAME,function(J){this.currentStatusMsg=J.getText();
this.fireEvent(SET_STATUS,{show:this.currentStatus,status:J.getText()})}.bindAsEventListener(this));
I.addEvent("click",function(J){cambia(this.spanSt,"roster_span_highlighted");this.fireEvent(USER_IS_ACTIVE,"RosterWindow")
}.bindAsEventListener(this));this.spanSt.addEvent("click",function(J){cambia(this.spanSt,"roster_span_highlighted");
this.fireEvent(USER_IS_ACTIVE,"RosterWindow")}.bindAsEventListener(this));this.windoo=new Windoo({left:C("ROSTER_WIN_LEFT"),top:C("ROSTER_WIN_TOP"),height:C("ROSTER_WIN_HEIGHT"),width:C("ROSTER_WIN_WIDTH"),resizeLimit:{x:[C("ROSTER_MIN_WIN_WIDTH")],y:[C("ROSTER_MIN_WIN_HEIGHT")]},title:this.title,container:document.body,theme:Windoo.Themes.aero,position:false}).addPanel(this.panel,"bottom").adopt(H,this.divWin);
this.fxGroup=new Array();this.idxBlinking=0;this.blinkingDocument=function(){if(this.blinkingContacts.length>0&&this.idxBlinking<this.blinkingContacts.length){var J=this.blinkingContacts[this.idxBlinking];
document.title=J.displayableName+" : "+J.msg.substring(0,20);this.idxBlinking++}else{this.idxBlinking=0;
document.title=C("BLINK_DEFAULT_DOCUMENT_TITLE")}}.bindAsEventListener(this)}},setStatus:function(B,A){this.currentStatus=B;
if(typeof (A)!="undefined"&&A!=null){this.currentStatusMsg=A}this.imgSt.setAttribute("src","themes/icons/"+C("ICON_THEME")+"/"+B+".png");
this.fireEvent(SET_STATUS,{show:B,status:this.currentStatusMsg})},show:function(){this.windoo.show();
this.windoo.bringTop()},addGroup:function(E){if(this.groups.indexOf(E)==-1){this.groups.push(E)
}this.contacts.each(function(F){F.addGroupInSubMenu(E)});if($("roster_group_"+E.htmlUsable())==null||typeof ($("roster_group_"+E.htmlUsable()))=="undefined"){var B=new Element("td",{id:"roster_group_"+E.htmlUsable(),"class":"roster_contact_group"});
B.appendText(E);var D=new Element("td",{"class":"roster_contact_arrow"});D.appendChild(new Element("img",{id:"roster_img_group_"+E.htmlUsable(),src:"themes/icons/"+C("ICON_THEME")+"/arrow_bottom.png","class":"roster_img_arrow"}));
var A=new Element("table",{"class":"roster_table_group",style:{width:"100%"}}).adopt(new Element("tr",{id:"roster_contact_group_"+E.htmlUsable()}).adopt(D,B));
this.divWin.appendChild(A);B.addEvent("click",function(G){var F=$("roster_img_group_"+E.htmlUsable());
if(F.getAttribute("src")=="themes/icons/"+C("ICON_THEME")+"/arrow_bottom.png"){F.setAttribute("src","themes/icons/"+C("ICON_THEME")+"/arrow_right.png")
}else{F.setAttribute("src","themes/icons/"+C("ICON_THEME")+"/arrow_bottom.png")}$$(".roster_cg_"+E.htmlUsable()).each(function(H){if(H.getStyle("display")!="none"){H.setStyle("display","none")
}else{H.setStyle("display","")}this.fireEvent(USER_IS_ACTIVE,"RosterWindow")})})}},setRosterState:function(A){if(A==CONNECTING){var B=$("div_"+CONNECTING+"_id");
if(typeof (B)=="undefined"||B==null){B=new Element("div",{id:"div_"+CONNECTING+"_id"});
this.divWin.appendChild(B);B.appendText(_("connecting"))}}else{var B=$("div_"+CONNECTING+"_id");
B.remove()}},removeGroup:function(B){if($("roster_group_"+B.htmlUsable())!=null){$("roster_group_"+B.htmlUsable()).getParent().getParent().remove();
this.groups.remove(B);var A=false;if(B!=C("DEFAULT_GROUP_NAME")){this.contacts.each(function(D){if(D.isInGroup(B)){A=true
}});if(!A){this.contacts.each(function(D){D.removeGroupInSubMenu(B)})}}}},addContact:function(D,A,B){return this.addContactInGroup(D,A,C("DEFAULT_GROUP_NAME"),B)
},addContactInGroup:function(F,B,D,E){if(typeof (D)=="undefined"||D==null){D=C("DEFAULT_GROUP_NAME")
}var A=this.getContact(F);if(A==null){A=new Contact(F,B,this.groups,E,this.config);
this.contacts.push(A);A.addEvent("contact_created",function(H,G){$("roster_contact_group_"+H.htmlUsable()).getParent().appendChild(G)
});A.addEvent(TOGGLE_CONTACT_INTO_GROUP,function(G){var H=this.getContact(F);if(H.isInGroup(G)){this.addContactInGroup(F,B,G,E);
H.createContact(G);H.setStatus(H.status,H.statusMsg);$("roster_group_"+G.htmlUsable()).setStyle("display","block")
}else{this.removeContactFromGroup(F,G)}this.fireEvent(MODIFY_CONTACT,A)}.bindAsEventListener(this));
A.addEvent(STOP_BLINKING,function(G){this.blinkingContacts.each(function(H){if(H!=null){if(A.contactName.indexOf(H.contactName)>-1){this.blinkingContacts.remove(H);
if(this.blinkingContacts.length==0){$clear(this.doctitleperiodical);this.doctitleperiodical=null;
document.title=C("BLINK_DEFAULT_DOCUMENT_TITLE")}}}}.bindAsEventListener(this));if(G.type=="wct"){this.notifManager.stopWCT(G.el)
}else{this.notifManager.stopRC(G.el)}}.bindAsEventListener(this));forwardEvent(A,USER_IS_ACTIVE,this);
forwardEvent(A,SEND_MESSAGE,this);forwardEvent(A,ACCEPT_AUTHORISATION,this);forwardEvent(A,REFUSE_AUTHORISATION,this);
forwardEvent(A,RENAME,this,MODIFY_CONTACT);A.addEvent(STARTING_BLINKING,function(G){if(G.type=="wct"){this.notifManager.startWCT(G.el)
}else{this.notifManager.startRC(G.el)}}.bindAsEventListener(this));A.addEvent(REMOVE,function(G){this.removeContact(G);
this.fireEvent(REMOVE,G)}.bindAsEventListener(this))}if($("roster_group_"+D.htmlUsable())==null){this.addGroup(D)
}A.addToGroup(D);return A},removeContactFromGroup:function(D,B){var A=$("roster_cg_"+B.htmlUsable()+"_"+D.htmlUsable());
if(typeof (A)!="undefined"&&A!=null){A.remove();if($("roster_group_"+B.htmlUsable()).childNodes.length==0){this.removeGroup(B)
}}},removeContact:function(B){var A=this.getContact(B);if(A!=null){A.groups.each(function(D){this.removeContactFromGroup(B,D)
}.bindAsEventListener(this))}},contactLogOff:function(A){this.contactChangesStatus(A,SET_STATUS_OFFLINE);
$$(".roster_cg_"+A.htmlUsable()).each(function(B){B.setStyle("display","none")})},receivesContactMessage:function(D,E){if(typeof (E)!="undefined"&&E.length>0){var A=this.getContact(D);
if(A!=null){A.openChat();A.chatBox.receives(E);A.startBlinking();A.chatBox.startBlinking();
var B=false;this.blinkingContacts.each(function(F){if(F.contactName.indexOf(D)>-1){F.msg=E;
B=true}});if(!B){this.blinkingContacts.push({contactName:D,displayableName:A.displayableName,msg:E});
if(this.doctitleperiodical==null){this.doctitleperiodical=this.blinkingDocument.periodical(C("BLINK_DELAY_DOCUMENT_TITLE"))
}}}else{alert("unknown contact ("+D+") sent a message ("+E+") ?")}}},contactChangesStatus:function(D,A,B){this.contacts.each(function(E){if(E.contactName.indexOf(D)>-1){E.setStatus(A,B);
E.groups.each(function(F){if(A!=SET_STATUS_OFFLINE){}}.bindAsEventListener(this))
}})},contactAskAuth:function(D,B){var A=this.getContact(D);if(A==null){A=this.addContact(D,D.guessIM())
}A.openChat();A.chatBox.receivesAuthorisationRequest(B)},setContactPhoto:function(D,B){var A;
this.contacts.each(function(E){if(E.contactName.indexOf(D)>-1){E.setPhoto(B)}}.bindAsEventListener(this))
},contactNotification:function(D,B){var A=this.getContact(D);if(A!=null){A.openChat();
A.chatBox.receivesNotification(A.displayableName+" "+B)}}});RosterWindow.implement(new Events);
var LoginWindow=new Class({initialize:function(offline){var login=new Element("input",{type:"text",id:"login_login","class":"login_input"});
var password=new Element("input",{type:"password",id:"login_password","class":"login_input"});
var server=new Element("input",{type:"text",id:"login_server","class":"login_input"});
var method=new Element("select",{type:"select",id:"login_method","class":"login_input"}).adopt(new Element("option").appendText(_("polling")),new Element("option").appendText(_("binding")));
var register=new Element("input",{type:"checkbox",id:"login_register","class":"login_register"});
var httpbase=new Element("input",{type:"text",id:"login_httpbase","class":"login_input"});
var isOffline=false;if(typeof (offline)!="undefined"){isOffline=offline}var inputs=[login,password,server,httpbase];
var connect=function(){var ok=true;for(var i=0;i<inputs.length;i++){if(inputs[i].getValue().length==0){ok=false;
inputs[i].addClass("login_input_empty")}else{inputs[i].removeClass("login_input_empty")
}}if(ok){this.windoo.hide();var ajxb=new Ajaxbber(login.getValue(),password.getValue(),server.getValue(),method.getValue(),register.getValue(),httpbase.getValue(),config,isOffline);
window.onunload=function(){ajxb.disconnect()}}}.bindAsEventListener(this);for(var i=0;
i<inputs.length;i++){inputs[i].onkeydown=function(event){var event=new Event(event);
if(event.code==13){connect()}}}var btn=new Element("button").appendText(_("ok"));
btn.addEvent("click",function(e){connect()}.bindAsEventListener(this));var table=new Element("table",{"class":"login_table"});
table.adopt(new Element("tr",{"class":"login_tr"}).adopt(new Element("td").adopt(new Element("span").appendText(_("login"))),new Element("td").adopt(login)),new Element("tr",{"class":"login_tr"}).adopt(new Element("td").adopt(new Element("span").appendText(_("password"))),new Element("td").adopt(password)),new Element("tr",{"class":"login_tr"}).adopt(new Element("td").adopt(new Element("span").appendText(_("server"))),new Element("td").adopt(server)),new Element("tr",{"class":"login_tr"}).adopt(new Element("td").adopt(new Element("span").appendText(_("method"))),new Element("td").adopt(method)),new Element("tr",{"class":"login_tr"}).adopt(new Element("td"),new Element("td").adopt(register,new Element("span").appendText(_("register")))),new Element("tr",{"class":"login_tr"}).adopt(new Element("td").adopt(new Element("span").appendText(_("httpbase"))),new Element("td").adopt(httpbase)),new Element("tr",{"class":"login_tr"}).adopt(new Element("td"),new Element("td",{"class":"login_td_btn"}).adopt(btn)));
var win=new Element("div",{"class":"login_div"});win.appendChild(table);this.windoo=new Windoo({title:_("login_title"),container:win.getParent(),width:C("LOGIN_WIN_WIDTH"),height:C("LOGIN_WIN_HEIGHT"),theme:eval(C("WINDOW_THEME")),position:false,destroyOnClose:true}).adopt(win);
this.windoo.positionAtCenter();this.windoo.show();this.windoo.bringTop()}});var Contact=new Class({initialize:function(F,B,A,E,D){this.status=null;
this.statusMsg=null;this.allgroups=A;this.isMenuShowable=true;this.config=D;this.periodical=null;
this.blinking=false;if(typeof (F)!="undefined"&&typeof (B)!="undefined"){this.chatBox=null;
this.contactName=F;this.groups=new Array();this.im=B;if(typeof (E)!="undefined"){this.displayableName=E
}else{this.displayableName=F.jidDisplayable()}this.divs=new Array();this.effects=new Array();
this.status=undefined;this.fx=function(){this.effects.each(function(G){G.start(C("BLINK_ROSTER_CONTACT_START_COLOR")).chain(function(){if(this.blinking){G.start(C("BLINK_ROSTER_CONTACT_END_COLOR"))
}else{this._noBlinking()}}.bindAsEventListener(this))}.bindAsEventListener(this))
}.bindAsEventListener(this)}},addToGroup:function(A){if(this.groups.indexOf(A)==-1){this.groups.push(A)
}},removeFromGroup:function(A){this.groups.remove(A)},initFromString:function(str){var ct;
eval(str);return ct},createContact:function(H){var G=new Element("tr",{id:"roster_cg_"+H.htmlUsable()+"_"+this.contactName.htmlUsable(),"class":"roster_contact_divs roster_cg_"+this.contactName.htmlUsable()+" roster_cg_"+H.htmlUsable()});
var F=new Element("img",{"class":"roster_contact_im_img",src:"themes/icons/"+C("ICON_THEME")+"/"+this.im+".png"});
var A=new Element("div",{"class":"roster_div_contact_status"}).adopt(new Element("img",{"class":"roster_contact_status ct_st_"+this.contactName.htmlUsable(),src:"themes/images/empty.png"}));
var D=new Element("div",{"class":"roster_contact_div_im_img"}).adopt(F);var E=new Element("a",{id:"a_contact_"+H.htmlUsable()+"_"+this.contactName.htmlUsable(),"class":"roster_contact_button "+this.contactName.htmlUsable(),href:"#"});
E.addEvent("click",function(J){this.stopBlinking();if(this.chatBox!=null&&typeof (this.chatBox)!="undefined"){this.chatBox.stopBlinking()
}if(!this.menu.isBeingShown()&&this.isMenuShowable){var J=new Event(J);this.menu.show(J);
J.stop()}else{this.menu.hide()}this.fireEvent(USER_IS_ACTIVE,"Contact")}.bindAsEventListener(this));
G.addEvent("mouseover",function(J){if(!this.menu.isBeingShown()){}}.bindAsEventListener(this));
var B=new Element("span",{id:"roster_span_"+H.htmlUsable()+"_"+this.contactName.htmlUsable(),"class":"roster_contact_span roster_span_"+this.contactName.htmlUsable()}).appendText(this.displayableName);
B.addEvent(RENAME,function(J){this.displayableName=J.getText();if(this.chatBox!=null){this.chatBox.renameContact(this.displayableName)
}$$(".roster_span_"+this.contactName.htmlUsable()).each(function(K){K.innerHTML=this.displayableName
}.bindAsEventListener(this));this.fireEvent(RENAME,this);this.isMenuShowable=true
}.bindAsEventListener(this));B.addEvent(IDENTICAL,function(){this.isMenuShowable=true
}.bindAsEventListener(this));E.adopt(B);G.adopt(new Element("td",{colspan:"2"}).adopt(A,D,new Element("table").adopt(new Element("tr").adopt(new Element("td",{"class":"roster_contact_cn_td"}).adopt(E)),new Element("tr").adopt(new Element("td",{"class":"roster_contact_st_td"}).adopt(new Element("span",{"class":"roster_contact_div_st roster_div_st_msg_"+this.contactName.htmlUsable()}))))));
var I="contact_menu_"+H.htmlUsable()+"_"+this.contactName.htmlUsable();if(typeof (this.menu)=="undefined"){this.menu=new MPopup(this.contactName);
this.menu.addEvent(RENAME,function(J){this.menu.remove("/"+this.contactName.htmlUsable()+"_groups/"+J.previousText.htmlUsable());
this.addGroupInSubMenu(J.getText().htmlUsable())}.bindAsEventListener(this));this.menu.addEvent(IDENTICAL,function(J){this.menu.remove("/"+this.contactName.htmlUsable()+"_groups/"+J.getText().htmlUsable())
}.bindAsEventListener(this));this.menu.addChoice(_("popup_chat_with"),"talk.png",function(){this.openChat();
this.fireEvent(CHAT_WITH)}.bindAsEventListener(this));this.menu.addChoice(_("popup_contact_info"),"details.png",function(){this.fireEvent(CONTACT_INFO,this.contactName)
}.bindAsEventListener(this));this.menu.addSubMenu(_("popup_move_into_groups"),"move.png","/"+this.contactName.htmlUsable()+"_groups");
this.menu.addItemInSubMenu(_("ag_title"),function(){this.addGroupInSubMenu(_("ag_msg"));
this.menu.rename("/"+this.contactName.htmlUsable()+"_groups/"+_("ag_msg").htmlUsable())
}.bindAsEventListener(this),"/"+this.contactName.htmlUsable()+"_groups/title");this.addGroupInSubMenu("-");
this.addGroupInSubMenu(C("DEFAULT_GROUP_NAME"));this.allgroups.each(function(J){this.addGroupInSubMenu(J)
}.bindAsEventListener(this));this.menu.addChoice(_("popup_remove"),"remove.png",function(){this.fireEvent(REMOVE,this.contactName)
}.bindAsEventListener(this));this.menu.addChoice(_("popup_rename"),"rename.png",function(){cambia(B);
this.isMenuShowable=false}.bindAsEventListener(this));this.menu.addChoice(_("popup_reauthorize"),"reauth.png",function(){this.fireEvent(REAUTHORIZE,this.contactName)
}.bindAsEventListener(this))}this.effects.push(G);this.fireEvent("contact_created",[H,G]);
this.divs.push(G)},addGroupInSubMenu:function(A){if(typeof (this.menu)!="undefined"){this.menu.addToggleableInSubMenu(A,function(){var B=false;
if(this.groups.indexOf(A)==-1){this.groups.push(A);this.fireEvent(TOGGLE_CONTACT_INTO_GROUP,A);
B=true}else{if(this.groups.length>1){this.groups.remove(A);this.fireEvent(TOGGLE_CONTACT_INTO_GROUP,A);
B=true}}return B}.bindAsEventListener(this),"/"+this.contactName.htmlUsable()+"_groups/"+A.htmlUsable(),this.groups.contains(A))
}},removeGroupInSubMenu:function(A){if(typeof (this.menu)!="undefined"){this.menu.remove("/"+this.contactName.htmlUsable()+"_groups/"+A)
}},isInGroup:function(A){return(this.groups.indexOf(A)>-1)},setChatBox:function(A){this.chatBox=A;
this.chatBox.addEvent(STOP_BLINKING,function(B){this.fireEvent(STOP_BLINKING,B);this.stopBlinking()
}.bindAsEventListener(this))},startBlinking:function(){this.effects.each(function(A){this.fireEvent(STARTING_BLINKING,{el:A,type:"rc"})
}.bindAsEventListener(this))},stopBlinking:function(){this.effects.each(function(A){this.fireEvent(STOP_BLINKING,{el:A,type:"rc"})
}.bindAsEventListener(this))},_noBlinking:function(){$clear(this.periodical);this.divs.each(function(A){if(typeof (A)!="undefined"){A.setStyle("background-color","")
}})},openChat:function(){if(this.chatBox==null){this.chatBox=new ChatWindow("id"+this.contactName.htmlUsable(),this.contactName,this.im,this.displayableName,this.config);
this.chatBox.addEvent(STOP_BLINKING,function(A){this.stopBlinking();this.fireEvent(STOP_BLINKING,A)
}.bindAsEventListener(this));forwardEvent(this.chatBox,SEND_MESSAGE,this);forwardEvent(this.chatBox,ACCEPT_AUTHORISATION,this);
forwardEvent(this.chatBox,REFUSE_AUTHORISATION,this);forwardEvent(this.chatBox,USER_IS_ACTIVE,this);
forwardEvent(this.chatBox,STARTING_BLINKING,this)}this.chatBox.show();this.chatBox.setStatus(this.status)
},showMenu:function(D,B,A){this.menu.show(D,B,A)},setStatus:function(A,B){if(A!=SET_STATUS_OFFLINE){if(this.status==SET_STATUS_OFFLINE){$$(".roster_cg_"+this.contactName.htmlUsable()).each(function(D){D.setStyle("display","block")
})}else{if(typeof (this.status)=="undefined"){this.groups.each(function(D){this.createContact(D)
}.bindAsEventListener(this))}}if(typeof (A)=="undefined"){alert(this.contactName+":status undefined")
}$$(".ct_st_"+this.contactName.htmlUsable()).each(function(D){if(A!=SET_STATUS_ACTIVE&&A!=SET_STATUS_OFFLINE){D.setAttribute("src","themes/icons/"+C("ICON_THEME")+"/"+A+".png");
D.setAttribute("alt",A)}else{D.setAttribute("src","themes/images/empty.png");D.setAttribute("alt","")
}}.bindAsEventListener(this));if(typeof (B)!="undefined"){this.statusMsg=B;$$(".roster_div_st_msg_"+this.contactName.htmlUsable()).each(function(D){D.innerHTML=B
}.bindAsEventListener(this))}}this.status=A},setPhoto:function(A){$$(".roster_avatar_"+this.contactName.htmlUsable()).each(function(D){var F=D.getElementsByTagName("img");
for(var B=0;B<F.length;B++){F[B].remove()}var E=new Element("img",{"class":"roster_contact_im_img",src:A});
D.appendChild(E)}.bindAsEventListener(this))}});Contact.implement(new Events);var MPopup=new Class({initialize:function(B,A){this.mpmenu=new mooPopupMenu(undefined,undefined,undefined,A);
if(typeof (B)!="undefined"){this.mpmenu.addItem({path:"/item1",text:B,istitle:true});
this.mpmenu.addItem({path:"/item2",text:"-"})}this.mpmenu.addEvent(RENAME,function(D){this.fireEvent(RENAME,D)
}.bindAsEventListener(this));this.mpmenu.addEvent(IDENTICAL,function(D){this.fireEvent(IDENTICAL,D)
}.bindAsEventListener(this));this.itemCount=2;this.itemInSubMenuCount=0;this.subMenus=new Array()
},addChoice:function(D,A,E,B){var F=this.mpmenu.addItem({path:"/item"+(++this.itemCount),icon:"themes/icons/"+C("ICON_THEME")+"/"+A,text:D,fn:E})
},addSubMenu:function(B,A,E){this.itemInSubMenuCount=0;var D=this.mpmenu.a({p:(typeof (E)!="undefined"?E:"/item"+(++this.itemCount)),t:B,i:'<img class="moopopupitem_icon" src="themes/icons/'+C("ICON_THEME")+"/"+A+'"/>'})
},addItemInSubMenu:function(A,B,E){var D=this.mpmenu.addItem({path:(typeof (E)!="undefined"?E:"/item"+(this.itemCount)+"/i"+(++this.itemInSubMenuCount)),text:A,fn:B,hideOnClick:false})
},addToggleableInSubMenu:function(A,B,F,E){var D=null;if(!this.subMenus.contains(F)){D=this.mpmenu.addItem({path:(typeof (F)!="undefined"?F:"/item"+(this.itemCount)+"/i"+(++this.itemInSubMenuCount)),text:A,fn:B,hideOnClick:false,toggleable:true,toggled:(typeof (E)!="undefined"?E:false)});
this.subMenus.push(F)}return D},rename:function(A){this.mpmenu.rename(A,"popup_span_highlighted")
},remove:function(A){this.mpmenu.remove(A);this.subMenus.remove(A)},moveItem:function(B,A){this.mpmenu.moveItem(B,A);
this.subMenus.remove(B);this.subMenus.push(A)},show:function(E,A,D,B){this.mpmenu.toggle(E,A,D,B)
},isBeingShown:function(){return this.mpmenu.isVisible},hide:function(){this.mpmenu.hide()
}});MPopup.implement(new Events);var PopupMenu=new Class({initialize:function(B,A){this.id=B;
this.idGroup=A.htmlUsable();this.divToggle=new Element("div",{id:"popup_menu_toggle_"+this.idGroup,styles:{position:"absolute",width:"100%"}});
this.divToggle.appendText("");this.divMenu=new Element("div",{id:this.id,"class":"popup_menu "+this.idGroup});
this.divMenu.setStyle("display","none");this.divToggle.inject(document.body);this.divToggle.appendChild(this.divMenu)
},addChoice:function(E,A,G,D){var B=new Element("img",{"class":"popup_img",src:"themes/icons/"+C("ICON_THEME")+"/"+A});
var F=new Element("a",{"class":"popup_choice_menu",href:"#"});var H=new Element("div",{"class":"popup_div_status"});
F.appendChild(B);F.appendText(E);F.addEvent("mouseenter",function(I){this.setStyle("background-color","#CCFF9D")
}.bindAsEventListener(F));F.addEvent("mouseleave",function(I){this.setStyle("background-color","")
});H.appendChild(F);this.divMenu.appendChild(H);F.addEvent("click",function(){this.setStyle("display","none");
G.create({bind:this,"arguments":D})();this.fireEvent(USER_IS_ACTIVE,"PopupMenu")}.bindAsEventListener(this.divMenu))
},show:function(D){var B=D.page.x;var A=D.page.y;this.divToggle.setStyle("left",B);
this.divToggle.setStyle("top",A);if(typeof (width)!="undefined"){this.divMenu.setStyle("width",width)
}this.divMenu.setStyle("display","block");$$("."+this.idGroup).each(function(E){if(E.id!=this.id){E.setStyle("display","none")
}}.bindAsEventListener(this.divMenu))},isBeingShown:function(){return(this.divMenu.getStyle("display")=="block")
},hide:function(){this.divMenu.setStyle("display","none")}});var Ajaxbber=new Class({initialize:function(A,I,E,J,K,H,F,G){this.config=F;
this.config.user={jid:A,pwd:I,server:E};this.config.restoreValues();this.config.setOffline(G);
this.roster=new RosterWindow(_("roster_title"),F);this.roster.setRosterState(CONNECTING);
this.jid=A;this.pwd=I;this.server=E;this.jUtil=new ConnectionHandler(this.jid,this.server,this.pwd,J,K,H);
this.contactGroupsReceived=false;this.pendingStatus=new Array();this.pendingOfflineMessages=new Array();
this.oldShowCurrentStatus=null;var D=function(){this.oldShowCurrentStatus=this.currentStatus.show;
this.roster.setStatus(SET_STATUS_AWAY,this.currentStatus.status)}.bindAsEventListener(this);
this.idleDelay=D.delay(C("SEC_BEFORE_IDLE")*1000);var B=function(){$clear(this.idleDelay);
this.idleDelay=D.delay(C("SEC_BEFORE_IDLE")*1000);if(typeof (this.currentStatus)!="undefined"){this.roster.setStatus(this.currentStatus.show,this.currentStatus.status)
}}.bindAsEventListener(this);this.roster.addEvent(SEND_MESSAGE,function(L){this.jUtil.send(L.contactName,L.msg)
}.bindAsEventListener(this));this.roster.addEvent(SET_STATUS,function(L){if(this.oldShowCurrentStatus==null){this.currentStatus={show:L.show,status:L.status}
}else{this.currentStatus={show:this.oldShowCurrentStatus,status:L.status};this.oldShowCurrentStatus=null
}this.jUtil.setStatus(L.show,L.status)}.bindAsEventListener(this));this.roster.addEvent(MODIFY_CONTACT,function(L){this.jUtil.modifyContact(L)
}.bindAsEventListener(this));this.roster.addEvent(REQUEST_ADD_CONTACT,function(L){this.jUtil.queryAddContact(L)
}.bindAsEventListener(this));this.config.addEvent(USER_IS_ACTIVE,function(L){B()}.bindAsEventListener(this));
this.roster.addEvent(USER_IS_ACTIVE,function(L){B()}.bindAsEventListener(this));this.roster.addEvent(ACCEPT_AUTHORISATION,function(L){this.jUtil.authorize(L)
}.bindAsEventListener(this));this.roster.addEvent(REMOVE,function(L){this.jUtil.removeContact(L)
}.bindAsEventListener(this));this.jUtil.addEvent(ADD_CONTACT_GROUP,function(L){if(typeof (L.groupName)!="undefined"){this.roster.addContactInGroup(L.jid,L.jid.guessIM(),L.groupName,L.displayableName)
}else{this.roster.addContact(L.jid,L.jid.guessIM(),L.displayableName)}}.bindAsEventListener(this));
this.jUtil.addEvent(CONTACT_CHANGES_STATUS,function(M){if(this.contactGroupsReceived){this.roster.contactChangesStatus(M.contactName,M.status,M.msg)
}else{var L=this.pendingStatus.filter(function(N){return N.contactName.indexOf(M.contactName)>-1
});L.each(function(N){this.pendingStatus.remove(N)}.bindAsEventListener(this));this.pendingStatus.push({contactName:M.contactName,status:M.status,msg:M.msg})
}}.bindAsEventListener(this));this.jUtil.addEvent(CONNECTED,function(){this.roster.setStatus(C("INITIAL_STATUS"),C("INITIAL_STATUS_MSG"))
}.bindAsEventListener(this));this.jUtil.addEvent(CONTACT_LOGOFF,function(L){this.roster.contactLogOff(L)
}.bindAsEventListener(this));this.jUtil.addEvent(CONTACT_REMOVED_AUTH,function(L){this.roster.contactNotification(L.contactName,_("authorisation_removed")+(typeof (L.msg)!="undefined"&&L.msg.length>0?" : "+L.msg:""))
}.bindAsEventListener(this));this.jUtil.addEvent(CONTACT_REFUSED_AUTH,function(L){this.roster.contactNotification(L.contactName,_("authorisation_refused")+(typeof (L.msg)!="undefined"&&L.msg.length>0?" : "+L.msg:""))
}.bindAsEventListener(this));this.jUtil.addEvent(CONTACT_ASKED_AUTH,function(L){this.roster.contactAskAuth(L.contactName,(typeof (L.msg)!="undefined"&&L.msg.length>0?" : "+L.msg:""))
}.bindAsEventListener(this));this.jUtil.addEvent(CONTACT_SEND_MSG,function(L){if(this.contactGroupsReceived){this.roster.receivesContactMessage(L.contactName,L.msg)
}else{this.pendingOfflineMessages.push(L)}}.bindAsEventListener(this));this.jUtil.addEvent(GROUP_CONTACTS_RECEIVED,function(){if(!this.contactGroupsReceived){this.pendingStatus.each(function(L){if(L!=null){this.roster.contactChangesStatus(L.contactName,L.status,L.msg);
this.pendingStatus.remove(L)}}.bindAsEventListener(this));this.pendingOfflineMessages.each(function(L){this.roster.receivesContactMessage(L.contactName,L.msg)
}.bindAsEventListener(this));this.contactGroupsReceived=true}this.roster.setRosterState(CONNECTED)
}.bindAsEventListener(this));this.jUtil.addEvent(PHOTO_RECEIVED,function(L){this.roster.setContactPhoto(L.contactName,L.src)
}.bindAsEventListener(this));this.jUtil.addEvent(DISCONNECTED,function(){this.jUtil.reconnect()
}.bindAsEventListener(this));this.roster.show()},disconnect:function(){this.jUtil.disconnect()
}});var NotificationManager=new Class({initialize:function(){this.wct=new Array();
this.cont=new Array();this.notifyInChatTitle=function(){$$(".wct_start_blinking").each(function(A){A.setStyle("color",C("BLINK_CHAT_START_COLOR"));
A.removeClass("wct_start_blinking");if(!A.hasClass("wct_is_blinking")){A.addClass("wct_is_blinking")
}});$$(".wct_is_blinking").each(function(A){if(A.getStyle("color")==C("BLINK_CHAT_START_COLOR")){A.setStyle("color",C("BLINK_CHAT_END_COLOR"))
}else{A.setStyle("color",C("BLINK_CHAT_START_COLOR"))}});$$(".wct_stop_blinking").each(function(A){A.setStyle("margin-left","");
A.setStyle("color","")})};this.notifyInRoster=function(){$$(".cont_start_blinking").each(function(A){A.setStyle("background-color",C("BLINK_ROSTER_CONTACT_START_COLOR"));
A.removeClass("cont_start_blinking");if(!A.hasClass("cont_is_blinking")){A.addClass("cont_is_blinking")
}});$$(".cont_is_blinking").each(function(A){if(A.getStyle("background-color")==C("BLINK_ROSTER_CONTACT_START_COLOR")){A.setStyle("background-color",C("BLINK_ROSTER_CONTACT_END_COLOR"))
}else{A.setStyle("background-color",C("BLINK_ROSTER_CONTACT_START_COLOR"))}});$$(".cont_stop_blinking").each(function(A){A.setStyle("background-color","")
})};this.notifWCT=function(){this.wct.each(function(A){if(A.blinkingState=="starting"){A.setStyle("color",C("BLINK_CHAT_START_COLOR"));
A.blinkingState="blinking"}else{if(A.blinkingState=="blinking"){if(A.getStyle("color")==C("BLINK_CHAT_START_COLOR")){A.setStyle("color",C("BLINK_CHAT_END_COLOR"))
}else{A.setStyle("color",C("BLINK_CHAT_START_COLOR"))}}else{if(A.blinkingState=="stopping"){A.blinkingState="";
A.setStyle("color","");this.wct.remove(A)}}}}.bindAsEventListener(this))}.bindAsEventListener(this);
this.notifWCT.periodical(C("BLINK_CHAT_WINDOW_TITLE"));this.notifRC=function(){this.cont.each(function(A){if(A.blinkingState=="starting"){A.setStyle("background-color",C("BLINK_ROSTER_CONTACT_START_COLOR"));
A.blinkingState="blinking"}else{if(A.blinkingState=="blinking"){if(A.getStyle("background-color")==C("BLINK_ROSTER_CONTACT_START_COLOR")){A.setStyle("background-color",C("BLINK_ROSTER_CONTACT_END_COLOR"))
}else{A.setStyle("background-color",C("BLINK_ROSTER_CONTACT_START_COLOR"))}}else{if(A.blinkingState=="stopping"){A.blinkingState="";
A.setStyle("background-color","");this.cont.remove(A)}}}}.bindAsEventListener(this))
}.bindAsEventListener(this);this.notifRC.periodical(C("BLINK_ROSTER_CONTACT"))},startWCT:function(A){if(this.wct.indexOf(A)==-1){A.blinkingState="starting";
this.wct.push(A)}},stopWCT:function(A){A.blinkingState="stopping"},startRC:function(A){if(this.cont.indexOf(A)==-1){A.blinkingState="starting";
this.cont.push(A)}},stopRC:function(A){A.blinkingState="stopping"}});