var MooTools={version:"1.2.4",build:"0d9113241a90b9cd5643b926795852a2026710d4"};
var Native=function(h){h=h||{};
var a=h.name;
var j=h.legacy;
var f=h.protect;
var b=h.implement;
var i=h.generics;
var e=h.initialize;
var g=h.afterImplement||function(){};
var d=e||j;
i=i!==false;
d.constructor=Native;
d.$family={name:"native"};
if(j&&e){d.prototype=j.prototype;
}d.prototype.constructor=d;
if(a){var c=a.toLowerCase();
d.prototype.$family={name:c};
Native.typize(d,c);
}var k=function(o,l,n,m){if(!f||m||!o.prototype[l]){o.prototype[l]=n;
}if(i){Native.genericize(o,l,f);
}g.call(o,l,n);
return o;
};
d.alias=function(n,l,p){if(typeof n=="string"){var o=this.prototype[n];
if((n=o)){return k(this,l,n,p);
}}for(var m in n){this.alias(m,n[m],l);
}return this;
};
d.implement=function(m,l,o){if(typeof m=="string"){return k(this,m,l,o);
}for(var n in m){k(this,n,m[n],l);
}return this;
};
if(b){d.implement(b);
}return d;
};
Native.genericize=function(c,a,b){if((!b||!c[a])&&typeof c.prototype[a]=="function"){c[a]=function(){var d=Array.prototype.slice.call(arguments);
return c.prototype[a].apply(d.shift(),d);
};
}};
Native.implement=function(a,c){for(var d=0,b=a.length;
d<b;
d++){a[d].implement(c);
}};
Native.typize=function(b,a){if(!b.type){b.type=function(c){return($type(c)===a);
};
}};
(function(){var a={Array:Array,Date:Date,Function:Function,Number:Number,RegExp:RegExp,String:String};
for(var h in a){new Native({name:h,initialize:a[h],protect:true});
}var d={"boolean":Boolean,"native":Native,object:Object};
for(var c in d){Native.typize(d[c],c);
}var f={Array:["concat","indexOf","join","lastIndexOf","pop","push","reverse","shift","slice","sort","splice","toString","unshift","valueOf"],String:["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","valueOf"]};
for(var e in f){for(var b=f[e].length;
b--;
){Native.genericize(a[e],f[e][b],true);
}}})();
var Hash=new Native({name:"Hash",initialize:function(b){if($type(b)=="hash"){b=$unlink(b.getClean());
}for(var a in b){this[a]=b[a];
}return this;
}});
Hash.implement({forEach:function(b,c){for(var a in this){if(this.hasOwnProperty(a)){b.call(c,this[a],a,this);
}}},getClean:function(){var b={};
for(var a in this){if(this.hasOwnProperty(a)){b[a]=this[a];
}}return b;
},getLength:function(){var a=0;
for(var b in this){if(this.hasOwnProperty(b)){a++;
}}return a;
}});
Hash.alias("forEach","each");
Array.implement({forEach:function(c,d){for(var b=0,a=this.length;
b<a;
b++){c.call(d,this[b],b,this);
}}});
Array.alias("forEach","each");
function $A(b){if(b.item){var a=b.length,c=new Array(a);
while(a--){c[a]=b[a];
}return c;
}return Array.prototype.slice.call(b);
}function $arguments(a){return function(){return arguments[a];
};
}function $chk(a){return !!(a||a===0);
}function $clear(a){clearTimeout(a);
clearInterval(a);
return null;
}function $defined(a){return(a!=undefined);
}function $each(c,b,d){var a=$type(c);
((a=="arguments"||a=="collection"||a=="array")?Array:Hash).each(c,b,d);
}function $empty(){}function $extend(b,c){for(var a in (c||{})){b[a]=c[a];
}return b;
}function $H(a){return new Hash(a);
}function $lambda(a){return($type(a)=="function")?a:function(){return a;
};
}function $merge(){var a=Array.slice(arguments);
a.unshift({});
return $mixin.apply(null,a);
}function $mixin(e){for(var d=1,a=arguments.length;
d<a;
d++){var c=arguments[d];
if($type(c)!="object"){continue;
}for(var b in c){var g=c[b],f=e[b];
e[b]=(f&&$type(g)=="object"&&$type(f)=="object")?$mixin(f,g):$unlink(g);
}}return e;
}function $pick(){for(var b=0,a=arguments.length;
b<a;
b++){if(arguments[b]!=undefined){return arguments[b];
}}return null;
}function $random(b,a){return Math.floor(Math.random()*(a-b+1)+b);
}function $splat(b){var a=$type(b);
return(a)?((a!="array"&&a!="arguments")?[b]:b):[];
}var $time=Date.now||function(){return +new Date;
};
function $try(){for(var b=0,a=arguments.length;
b<a;
b++){try{return arguments[b]();
}catch(c){}}return null;
}function $type(a){if(a==undefined){return false;
}if(a.$family){return(a.$family.name=="number"&&!isFinite(a))?false:a.$family.name;
}if(a.nodeName){switch(a.nodeType){case 1:return"element";
case 3:return(/\S/).test(a.nodeValue)?"textnode":"whitespace";
}}else{if(typeof a.length=="number"){if(a.callee){return"arguments";
}else{if(a.item){return"collection";
}}}}return typeof a;
}function $unlink(c){var d;
switch($type(c)){case"object":d={};
for(var e in c){d[e]=$unlink(c[e]);
}break;
case"hash":d=new Hash(c);
break;
case"array":d=[];
for(var b=0,a=c.length;
b<a;
b++){d[b]=$unlink(c[b]);
}break;
default:return c;
}return d;
}var Browser=$merge({Engine:{name:"unknown",version:0},Platform:{name:(window.orientation!=undefined)?"ipod":(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase()},Features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.querySelector)},Plugins:{},Engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getElementsByClassName)?950:925));
},trident:function(){return(!window.ActiveXObject)?false:((window.XMLHttpRequest)?((document.querySelectorAll)?6:5):4);
},webkit:function(){return(navigator.taintEnabled)?false:((Browser.Features.xpath)?((Browser.Features.query)?525:420):419);
},gecko:function(){return(!document.getBoxObjectFor&&window.mozInnerScreenX==null)?false:((document.getElementsByClassName)?19:18);
}}},Browser||{});
Browser.Platform[Browser.Platform.name]=true;
Browser.detect=function(){for(var b in this.Engines){var a=this.Engines[b]();
if(a){this.Engine={name:b,version:a};
this.Engine[b]=this.Engine[b+a]=true;
break;
}}return{name:b,version:a};
};
Browser.detect();
Browser.Request=function(){return $try(function(){return new XMLHttpRequest();
},function(){return new ActiveXObject("MSXML2.XMLHTTP");
},function(){return new ActiveXObject("Microsoft.XMLHTTP");
});
};
Browser.Features.xhr=!!(Browser.Request());
Browser.Plugins.Flash=(function(){var a=($try(function(){return navigator.plugins["Shockwave Flash"].description;
},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version");
})||"0 r0").match(/\d+/g);
return{version:parseInt(a[0]||0+"."+a[1],10)||0,build:parseInt(a[2],10)||0};
})();
function $exec(b){if(!b){return b;
}if(window.execScript){window.execScript(b);
}else{var a=document.createElement("script");
a.setAttribute("type","text/javascript");
a[(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerText":"text"]=b;
document.head.appendChild(a);
document.head.removeChild(a);
}return b;
}Native.UID=1;
var $uid=(Browser.Engine.trident)?function(a){return(a.uid||(a.uid=[Native.UID++]))[0];
}:function(a){return a.uid||(a.uid=Native.UID++);
};
var Window=new Native({name:"Window",legacy:(Browser.Engine.trident)?null:window.Window,initialize:function(a){$uid(a);
if(!a.Element){a.Element=$empty;
if(Browser.Engine.webkit){a.document.createElement("iframe");
}a.Element.prototype=(Browser.Engine.webkit)?window["[[DOMElement.prototype]]"]:{};
}a.document.window=a;
return $extend(a,Window.Prototype);
},afterImplement:function(a,b){window[a]=Window.Prototype[a]=b;
}});
Window.Prototype={$family:{name:"window"}};
new Window(window);
var Document=new Native({name:"Document",legacy:(Browser.Engine.trident)?null:window.Document,initialize:function(a){$uid(a);
a.head=a.getElementsByTagName("head")[0];
a.html=a.getElementsByTagName("html")[0];
if(Browser.Engine.trident&&Browser.Engine.version<=4){$try(function(){a.execCommand("BackgroundImageCache",false,true);
});
}if(Browser.Engine.trident){a.window.attachEvent("onunload",function(){a.window.detachEvent("onunload",arguments.callee);
a.head=a.html=a.window=null;
});
}return $extend(a,Document.Prototype);
},afterImplement:function(a,b){document[a]=Document.Prototype[a]=b;
}});
Document.Prototype={$family:{name:"document"}};
new Document(document);
Array.implement({every:function(c,d){for(var b=0,a=this.length;
b<a;
b++){if(!c.call(d,this[b],b,this)){return false;
}}return true;
},filter:function(d,e){var c=[];
for(var b=0,a=this.length;
b<a;
b++){if(d.call(e,this[b],b,this)){c.push(this[b]);
}}return c;
},clean:function(){return this.filter($defined);
},indexOf:function(c,d){var a=this.length;
for(var b=(d<0)?Math.max(0,a+d):d||0;
b<a;
b++){if(this[b]===c){return b;
}}return -1;
},map:function(d,e){var c=[];
for(var b=0,a=this.length;
b<a;
b++){c[b]=d.call(e,this[b],b,this);
}return c;
},some:function(c,d){for(var b=0,a=this.length;
b<a;
b++){if(c.call(d,this[b],b,this)){return true;
}}return false;
},associate:function(c){var d={},a=Math.min(this.length,c.length);
for(var b=0;
b<a;
b++){d[c[b]]=this[b];
}return d;
},link:function(d){var e={};
for(var c=0,a=this.length;
c<a;
c++){for(var b in d){if(d[b](this[c])){e[b]=this[c];
delete d[b];
break;
}}}return e;
},contains:function(a,b){return this.indexOf(a,b)!=-1;
},extend:function(c){for(var b=0,a=c.length;
b<a;
b++){this.push(c[b]);
}return this;
},getLast:function(){return(this.length)?this[this.length-1]:null;
},getRandom:function(){return(this.length)?this[$random(0,this.length-1)]:null;
},include:function(a){if(!this.contains(a)){this.push(a);
}return this;
},combine:function(c){for(var b=0,a=c.length;
b<a;
b++){this.include(c[b]);
}return this;
},erase:function(b){for(var a=this.length;
a--;
a){if(this[a]===b){this.splice(a,1);
}}return this;
},empty:function(){this.length=0;
return this;
},flatten:function(){var d=[];
for(var b=0,a=this.length;
b<a;
b++){var c=$type(this[b]);
if(!c){continue;
}d=d.concat((c=="array"||c=="collection"||c=="arguments")?Array.flatten(this[b]):this[b]);
}return d;
},hexToRgb:function(b){if(this.length!=3){return null;
}var a=this.map(function(c){if(c.length==1){c+=c;
}return c.toInt(16);
});
return(b)?a:"rgb("+a+")";
},rgbToHex:function(d){if(this.length<3){return null;
}if(this.length==4&&this[3]==0&&!d){return"transparent";
}var b=[];
for(var a=0;
a<3;
a++){var c=(this[a]-0).toString(16);
b.push((c.length==1)?"0"+c:c);
}return(d)?b:"#"+b.join("");
}});
Function.implement({extend:function(b){for(var a in b){this[a]=b[a];
}return this;
},create:function(b){var a=this;
b=b||{};
return function(d){var c=b.arguments;
c=(c!=undefined)?$splat(c):Array.slice(arguments,(b.event)?1:0);
if(b.event){c=[d||window.event].extend(c);
}var e=function(){return a.apply(b.bind||null,c);
};
if(b.delay){return setTimeout(e,b.delay);
}if(b.periodical){return setInterval(e,b.periodical);
}if(b.attempt){return $try(e);
}return e();
};
},run:function(a,b){return this.apply(b,$splat(a));
},pass:function(a,b){return this.create({bind:b,arguments:a});
},bind:function(b,a){return this.create({bind:b,arguments:a});
},bindWithEvent:function(b,a){return this.create({bind:b,arguments:a,event:true});
},attempt:function(a,b){return this.create({bind:b,arguments:a,attempt:true})();
},delay:function(b,c,a){return this.create({bind:c,arguments:a,delay:b})();
},periodical:function(c,b,a){return this.create({bind:b,arguments:a,periodical:c})();
}});
Number.implement({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,c){for(var a=0;
a<this;
a++){b.call(c,a,this);
}},toFloat:function(){return parseFloat(this);
},toInt:function(a){return parseInt(this,a||10);
}});
Number.alias("times","each");
(function(b){var a={};
b.each(function(c){if(!Number[c]){a[c]=function(){return Math[c].apply(null,[this].concat($A(arguments)));
};
}});
Number.implement(a);
})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);
String.implement({test:function(a,b){return((typeof a=="string")?new RegExp(a,b):a).test(this);
},contains:function(a,b){return(b)?(b+this+b).indexOf(b+a+b)>-1:this.indexOf(a)>-1;
},trim:function(){return this.replace(/^\s+|\s+$/g,"");
},clean:function(){return this.replace(/\s+/g," ").trim();
},camelCase:function(){return this.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase();
});
},hyphenate:function(){return this.replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase());
});
},capitalize:function(){return this.replace(/\b[a-z]/g,function(a){return a.toUpperCase();
});
},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1");
},toInt:function(a){return parseInt(this,a||10);
},toFloat:function(){return parseFloat(this);
},hexToRgb:function(b){var a=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);
return(a)?a.slice(1).hexToRgb(b):null;
},rgbToHex:function(b){var a=this.match(/\d{1,3}/g);
return(a)?a.rgbToHex(b):null;
},stripScripts:function(b){var a="";
var c=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(){a+=arguments[1]+"\n";
return"";
});
if(b===true){$exec(a);
}else{if($type(b)=="function"){b(a,c);
}}return c;
},substitute:function(b,a){return this.replace(a||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1);
}return(b[c]!=undefined)?b[c]:"";
});
}});
Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(b){for(var a in this){if(this.hasOwnProperty(a)&&this[a]===b){return a;
}}return null;
},hasValue:function(a){return(Hash.keyOf(this,a)!==null);
},extend:function(a){Hash.each(a||{},function(c,b){Hash.set(this,b,c);
},this);
return this;
},combine:function(a){Hash.each(a||{},function(c,b){Hash.include(this,b,c);
},this);
return this;
},erase:function(a){if(this.hasOwnProperty(a)){delete this[a];
}return this;
},get:function(a){return(this.hasOwnProperty(a))?this[a]:null;
},set:function(a,b){if(!this[a]||this.hasOwnProperty(a)){this[a]=b;
}return this;
},empty:function(){Hash.each(this,function(b,a){delete this[a];
},this);
return this;
},include:function(a,b){if(this[a]==undefined){this[a]=b;
}return this;
},map:function(b,c){var a=new Hash;
Hash.each(this,function(e,d){a.set(d,b.call(c,e,d,this));
},this);
return a;
},filter:function(b,c){var a=new Hash;
Hash.each(this,function(e,d){if(b.call(c,e,d,this)){a.set(d,e);
}},this);
return a;
},every:function(b,c){for(var a in this){if(this.hasOwnProperty(a)&&!b.call(c,this[a],a)){return false;
}}return true;
},some:function(b,c){for(var a in this){if(this.hasOwnProperty(a)&&b.call(c,this[a],a)){return true;
}}return false;
},getKeys:function(){var a=[];
Hash.each(this,function(c,b){a.push(b);
});
return a;
},getValues:function(){var a=[];
Hash.each(this,function(b){a.push(b);
});
return a;
},toQueryString:function(a){var b=[];
Hash.each(this,function(f,d){if(a){d=a+"["+d+"]";
}var e;
switch($type(f)){case"object":e=Hash.toQueryString(f,d);
break;
case"array":var c={};
f.each(function(h,g){c[g]=h;
});
e=Hash.toQueryString(c,d);
break;
default:e=d+"="+encodeURIComponent(f);
}if(f!=undefined){b.push(e);
}});
return b.join("&");
}});
Hash.alias({keyOf:"indexOf",hasValue:"contains"});
var Event=new Native({name:"Event",initialize:function(a,g){g=g||window;
var k=g.document;
a=a||g.event;
if(a.$extended){return a;
}this.$extended=true;
var j=a.type;
var c=a.target||a.srcElement;
while(c&&c.nodeType==3){c=c.parentNode;
}if(j.test(/key/)){var b=a.which||a.keyCode;
var m=Event.Keys.keyOf(b);
if(j=="keydown"){var e=b-111;
if(e>0&&e<13){m="f"+e;
}}m=m||String.fromCharCode(b).toLowerCase();
}else{if(j.match(/(click|mouse|menu)/i)){k=(!k.compatMode||k.compatMode=="CSS1Compat")?k.html:k.body;
var i={x:a.pageX||a.clientX+k.scrollLeft,y:a.pageY||a.clientY+k.scrollTop};
var f={x:(a.pageX)?a.pageX-g.pageXOffset:a.clientX,y:(a.pageY)?a.pageY-g.pageYOffset:a.clientY};
if(j.match(/DOMMouseScroll|mousewheel/)){var h=(a.wheelDelta)?a.wheelDelta/120:-(a.detail||0)/3;
}var d=(a.which==3)||(a.button==2);
var l=null;
if(j.match(/over|out/)){switch(j){case"mouseover":l=a.relatedTarget||a.fromElement;
break;
case"mouseout":l=a.relatedTarget||a.toElement;
}if(!(function(){while(l&&l.nodeType==3){l=l.parentNode;
}return true;
}).create({attempt:Browser.Engine.gecko})()){l=false;
}}}}return $extend(this,{event:a,type:j,page:i,client:f,rightClick:d,wheel:h,relatedTarget:l,target:c,code:b,key:m,shift:a.shiftKey,control:a.ctrlKey,alt:a.altKey,meta:a.metaKey});
}});
Event.Keys=new Hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});
Event.implement({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;
}});
function Class(b){if(b instanceof Function){b={initialize:b};
}var a=function(){Object.reset(this);
if(a._prototyping){return this;
}this._current=$empty;
var c=(this.initialize)?this.initialize.apply(this,arguments):this;
delete this._current;
delete this.caller;
return c;
}.extend(this);
a.implement(b);
a.constructor=Class;
a.prototype.constructor=a;
return a;
}Function.prototype.protect=function(){this._protected=true;
return this;
};
Object.reset=function(c,b){if(b==null){for(var e in c){Object.reset(c,e);
}return c;
}delete c[b];
switch($type(c[b])){case"object":var d=function(){};
d.prototype=c[b];
var a=new d;
c[b]=Object.reset(a);
break;
case"array":c[b]=$unlink(c[b]);
break;
}return c;
};
new Native({name:"Class",initialize:Class}).extend({instantiate:function(b){b._prototyping=true;
var a=new b;
delete b._prototyping;
return a;
},wrap:function(a,b,c){if(c._origin){c=c._origin;
}return function(){if(c._protected&&this._current==null){throw new Error('The method "'+b+'" cannot be called.');
}var d=this.caller,f=this._current;
this.caller=f;
this._current=arguments.callee;
var e=c.apply(this,arguments);
this._current=f;
this.caller=d;
return e;
}.extend({_owner:a,_origin:c,_name:b});
}});
Class.implement({implement:function(b,d){if($type(b)=="object"){for(var e in b){this.implement(e,b[e]);
}return this;
}var f=Class.Mutators[b];
if(f){d=f.call(this,d);
if(d==null){return this;
}}var c=this.prototype;
switch($type(d)){case"function":if(d._hidden){return this;
}c[b]=Class.wrap(this,b,d);
break;
case"object":var a=c[b];
if($type(a)=="object"){$mixin(a,d);
}else{c[b]=$unlink(d);
}break;
case"array":c[b]=$unlink(d);
break;
default:c[b]=d;
}return this;
}});
Class.Mutators={Extends:function(a){this.parent=a;
this.prototype=Class.instantiate(a);
this.implement("parent",function(){var c=this.caller._name,b=this.caller._owner.parent.prototype[c];
if(!b){throw new Error('The method "'+c+'" has no parent.');
}return b.apply(this,arguments);
}.protect());
},Implements:function(a){$splat(a).each(function(b){if(b instanceof Function){b=Class.instantiate(b);
}this.implement(b);
},this);
}};
var Chain=new Class({$chain:[],chain:function(){this.$chain.extend(Array.flatten(arguments));
return this;
},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false;
},clearChain:function(){this.$chain.empty();
return this;
}});
var Events=new Class({$events:{},addEvent:function(c,b,a){c=Events.removeOn(c);
if(b!=$empty){this.$events[c]=this.$events[c]||[];
this.$events[c].include(b);
if(a){b.internal=true;
}}return this;
},addEvents:function(a){for(var b in a){this.addEvent(b,a[b]);
}return this;
},fireEvent:function(c,b,a){c=Events.removeOn(c);
if(!this.$events||!this.$events[c]){return this;
}this.$events[c].each(function(d){d.create({bind:this,delay:a,"arguments":b})();
},this);
return this;
},removeEvent:function(b,a){b=Events.removeOn(b);
if(!this.$events[b]){return this;
}if(!a.internal){this.$events[b].erase(a);
}return this;
},removeEvents:function(a){var d;
if($type(a)=="object"){for(d in a){this.removeEvent(d,a[d]);
}return this;
}if(a){a=Events.removeOn(a);
}for(d in this.$events){if(a&&a!=d){continue;
}var c=this.$events[d];
for(var b=c.length;
b--;
b){this.removeEvent(d,c[b]);
}}return this;
}});
Events.removeOn=function(a){return a.replace(/^on([A-Z])/,function(b,c){return c.toLowerCase();
});
};
var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments));
if(!this.addEvent){return this;
}for(var a in this.options){if($type(this.options[a])!="function"||!(/^on[A-Z]/).test(a)){continue;
}this.addEvent(a,this.options[a]);
delete this.options[a];
}return this;
}});
var Element=new Native({name:"Element",legacy:window.Element,initialize:function(a,b){var c=Element.Constructors.get(a);
if(c){return c(b);
}if(typeof a=="string"){return document.newElement(a,b);
}return document.id(a).set(b);
},afterImplement:function(a,b){Element.Prototype[a]=b;
if(Array[a]){return;
}Elements.implement(a,function(){var d=[],c=true;
for(var f=0,e=this.length;
f<e;
f++){var g=this[f][a].apply(this[f],arguments);
d.push(g);
if(c){c=($type(g)=="element");
}}return(c)?new Elements(d):d;
});
}});
Element.Prototype={$family:{name:"element"}};
Element.Constructors=new Hash;
var IFrame=new Native({name:"IFrame",generics:false,initialize:function(){var e=Array.link(arguments,{properties:Object.type,iframe:$defined});
var c=e.properties||{};
var b=document.id(e.iframe);
var f=c.onload||$empty;
delete c.onload;
c.id=c.name=$pick(c.id,c.name,b?(b.id||b.name):"IFrame_"+$time());
b=new Element(b||"iframe",c);
var a=function(){var g=$try(function(){return b.contentWindow.location.host;
});
if(!g||g==window.location.host){var h=new Window(b.contentWindow);
new Document(b.contentWindow.document);
$extend(h.Element.prototype,Element.Prototype);
}f.call(b.contentWindow,b.contentWindow.document);
};
var d=$try(function(){return b.contentWindow;
});
((d&&d.document.body)||window.frames[c.id])?a():b.addListener("load",a);
return b;
}});
var Elements=new Native({initialize:function(a,e){e=$extend({ddup:true,cash:true},e);
a=a||[];
if(e.ddup||e.cash){var g={},c=[];
for(var d=0,b=a.length;
d<b;
d++){var f=document.id(a[d],!e.cash);
if(e.ddup){if(g[f.uid]){continue;
}g[f.uid]=true;
}if(f){c.push(f);
}}a=c;
}return(e.cash)?$extend(a,this):a;
}});
Elements.implement({filter:function(a,b){if(!a){return this;
}return new Elements(Array.filter(this,(typeof a=="string")?function(c){return c.match(a);
}:a,b));
}});
Document.implement({newElement:function(a,b){if(Browser.Engine.trident&&b){["name","type","checked"].each(function(c){if(!b[c]){return;
}a+=" "+c+'="'+b[c]+'"';
if(c!="checked"){delete b[c];
}});
a="<"+a+">";
}return document.id(this.createElement(a)).set(b);
},newTextNode:function(a){return this.createTextNode(a);
},getDocument:function(){return this;
},getWindow:function(){return this.window;
},id:(function(){var a={string:function(d,c,b){d=b.getElementById(d);
return(d)?a.element(d,c):null;
},element:function(b,e){$uid(b);
if(!e&&!b.$family&&!(/^object|embed$/i).test(b.tagName)){var c=Element.Prototype;
for(var d in c){b[d]=c[d];
}}return b;
},object:function(c,d,b){if(c.toElement){return a.element(c.toElement(b),d);
}return null;
}};
a.textnode=a.whitespace=a.window=a.document=$arguments(0);
return function(c,e,d){if(c&&c.$family&&c.uid){return c;
}var b=$type(c);
return(a[b])?a[b](c,e,d||document):null;
};
})()});
if(window.$==null){Window.implement({$:function(a,b){return document.id(a,b,this.document);
}});
}Window.implement({$$:function(b){if(arguments.length==1&&typeof b=="string"){return this.document.getElements(b);
}var a=[];
var d=Array.flatten(arguments);
for(var e=0,c=d.length;
e<c;
e++){var f=d[e];
switch($type(f)){case"element":a.push(f);
break;
case"string":a.extend(this.document.getElements(f,true));
}}return new Elements(a);
},getDocument:function(){return this.document;
},getWindow:function(){return this;
}});
Native.implement([Element,Document],{getElement:function(a,b){return document.id(this.getElements(a,true)[0]||null,b);
},getElements:function(b,d){b=b.split(",");
var a=[];
var c=(b.length>1);
b.each(function(e){var f=this.getElementsByTagName(e.trim());
(c)?a.extend(f):a=f;
},this);
return new Elements(a,{ddup:c,cash:!d});
}});
(function(){var g={},b={};
var i={input:"checked",option:"selected",textarea:(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerHTML":"value"};
var c=function(l){return(b[l]||(b[l]={}));
};
var h=function(m,n){if(!m){return;
}var l=m.uid;
if(Browser.Engine.trident){if(m.clearAttributes){var q=n&&m.cloneNode(false);
m.clearAttributes();
if(q){m.mergeAttributes(q);
}}else{if(m.removeEvents){m.removeEvents();
}}if((/object/i).test(m.tagName)){for(var o in m){if(typeof m[o]=="function"){m[o]=$empty;
}}Element.dispose(m);
}}if(!l){return;
}g[l]=b[l]=null;
};
var d=function(){Hash.each(g,h);
if(Browser.Engine.trident){$A(document.getElementsByTagName("object")).each(h);
}if(window.CollectGarbage){CollectGarbage();
}g=b=null;
};
var k=function(o,m,s,n,q,r){var p=o[s||m];
var l=[];
while(p){if(p.nodeType==1&&(!n||Element.match(p,n))){if(!q){return document.id(p,r);
}l.push(p);
}p=p[m];
}return(q)?new Elements(l,{ddup:false,cash:!r}):null;
};
var e={html:"innerHTML","class":"className","for":"htmlFor",defaultValue:"defaultValue",text:(Browser.Engine.trident||(Browser.Engine.webkit&&Browser.Engine.version<420))?"innerText":"textContent"};
var a=["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"];
var j=["value","type","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"];
a=a.associate(a);
Hash.extend(e,a);
Hash.extend(e,j.associate(j.map(String.toLowerCase)));
var f={before:function(m,l){if(l.parentNode){l.parentNode.insertBefore(m,l);
}},after:function(m,l){if(!l.parentNode){return;
}var n=l.nextSibling;
(n)?l.parentNode.insertBefore(m,n):l.parentNode.appendChild(m);
},bottom:function(m,l){l.appendChild(m);
},top:function(m,l){var n=l.firstChild;
(n)?l.insertBefore(m,n):l.appendChild(m);
}};
f.inside=f.bottom;
Hash.each(f,function(l,m){m=m.capitalize();
Element.implement("inject"+m,function(n){l(this,document.id(n,true));
return this;
});
Element.implement("grab"+m,function(n){l(document.id(n,true),this);
return this;
});
});
Element.implement({set:function(o,m){switch($type(o)){case"object":for(var n in o){this.set(n,o[n]);
}break;
case"string":var l=Element.Properties.get(o);
(l&&l.set)?l.set.apply(this,Array.slice(arguments,1)):this.setProperty(o,m);
}return this;
},get:function(m){var l=Element.Properties.get(m);
return(l&&l.get)?l.get.apply(this,Array.slice(arguments,1)):this.getProperty(m);
},erase:function(m){var l=Element.Properties.get(m);
(l&&l.erase)?l.erase.apply(this):this.removeProperty(m);
return this;
},setProperty:function(m,n){var l=e[m];
if(n==undefined){return this.removeProperty(m);
}if(l&&a[m]){n=!!n;
}(l)?this[l]=n:this.setAttribute(m,""+n);
return this;
},setProperties:function(l){for(var m in l){this.setProperty(m,l[m]);
}return this;
},getProperty:function(m){var l=e[m];
var n=(l)?this[l]:this.getAttribute(m,2);
return(a[m])?!!n:(l)?n:n||null;
},getProperties:function(){var l=$A(arguments);
return l.map(this.getProperty,this).associate(l);
},removeProperty:function(m){var l=e[m];
(l)?this[l]=(l&&a[m])?false:"":this.removeAttribute(m);
return this;
},removeProperties:function(){Array.each(arguments,this.removeProperty,this);
return this;
},hasClass:function(l){return this.className.contains(l," ");
},addClass:function(l){if(!this.hasClass(l)){this.className=(this.className+" "+l).clean();
}return this;
},removeClass:function(l){this.className=this.className.replace(new RegExp("(^|\\s)"+l+"(?:\\s|$)"),"$1");
return this;
},toggleClass:function(l){return this.hasClass(l)?this.removeClass(l):this.addClass(l);
},adopt:function(){Array.flatten(arguments).each(function(l){l=document.id(l,true);
if(l){this.appendChild(l);
}},this);
return this;
},appendText:function(m,l){return this.grab(this.getDocument().newTextNode(m),l);
},grab:function(m,l){f[l||"bottom"](document.id(m,true),this);
return this;
},inject:function(m,l){f[l||"bottom"](this,document.id(m,true));
return this;
},replaces:function(l){l=document.id(l,true);
l.parentNode.replaceChild(this,l);
return this;
},wraps:function(m,l){m=document.id(m,true);
return this.replaces(m).grab(m,l);
},getPrevious:function(l,m){return k(this,"previousSibling",null,l,false,m);
},getAllPrevious:function(l,m){return k(this,"previousSibling",null,l,true,m);
},getNext:function(l,m){return k(this,"nextSibling",null,l,false,m);
},getAllNext:function(l,m){return k(this,"nextSibling",null,l,true,m);
},getFirst:function(l,m){return k(this,"nextSibling","firstChild",l,false,m);
},getLast:function(l,m){return k(this,"previousSibling","lastChild",l,false,m);
},getParent:function(l,m){return k(this,"parentNode",null,l,false,m);
},getParents:function(l,m){return k(this,"parentNode",null,l,true,m);
},getSiblings:function(l,m){return this.getParent().getChildren(l,m).erase(this);
},getChildren:function(l,m){return k(this,"nextSibling","firstChild",l,true,m);
},getWindow:function(){return this.ownerDocument.window;
},getDocument:function(){return this.ownerDocument;
},getElementById:function(o,n){var m=this.ownerDocument.getElementById(o);
if(!m){return null;
}for(var l=m.parentNode;
l!=this;
l=l.parentNode){if(!l){return null;
}}return document.id(m,n);
},getSelected:function(){return new Elements($A(this.options).filter(function(l){return l.selected;
}));
},getComputedStyle:function(l){if(this.currentStyle){return this.currentStyle[l.camelCase()];
}var m=this.getDocument().defaultView.getComputedStyle(this,null);
return(m)?m.getPropertyValue([l.hyphenate()]):null;
},toQueryString:function(){var l=[];
this.getElements("input, select, textarea",true).each(function(m){if(!m.name||m.disabled||m.type=="submit"||m.type=="reset"||m.type=="file"){return;
}var n=(m.tagName.toLowerCase()=="select")?Element.getSelected(m).map(function(o){return o.value;
}):((m.type=="radio"||m.type=="checkbox")&&!m.checked)?null:m.value;
$splat(n).each(function(o){if(typeof o!="undefined"){l.push(m.name+"="+encodeURIComponent(o));
}});
});
return l.join("&");
},clone:function(l,o){l=l!==false;
var r=this.cloneNode(l);
var n=function(v,u){if(!o){v.removeAttribute("id");
}if(Browser.Engine.trident){v.clearAttributes();
v.mergeAttributes(u);
v.removeAttribute("uid");
if(v.options){var w=v.options,s=u.options;
for(var t=w.length;
t--;
){w[t].selected=s[t].selected;
}}}var x=i[u.tagName.toLowerCase()];
if(x&&u[x]){v[x]=u[x];
}};
if(l){var p=r.getElementsByTagName("*"),q=this.getElementsByTagName("*");
for(var m=p.length;
m--;
){n(p[m],q[m]);
}}n(r,this);
return document.id(r);
},destroy:function(){Element.empty(this);
Element.dispose(this);
h(this,true);
return null;
},empty:function(){$A(this.childNodes).each(function(l){Element.destroy(l);
});
return this;
},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this;
},hasChild:function(l){l=document.id(l,true);
if(!l){return false;
}if(Browser.Engine.webkit&&Browser.Engine.version<420){return $A(this.getElementsByTagName(l.tagName)).contains(l);
}return(this.contains)?(this!=l&&this.contains(l)):!!(this.compareDocumentPosition(l)&16);
},match:function(l){return(!l||(l==this)||(Element.get(this,"tag")==l));
}});
Native.implement([Element,Window,Document],{addListener:function(o,n){if(o=="unload"){var l=n,m=this;
n=function(){m.removeListener("unload",n);
l();
};
}else{g[this.uid]=this;
}if(this.addEventListener){this.addEventListener(o,n,false);
}else{this.attachEvent("on"+o,n);
}return this;
},removeListener:function(m,l){if(this.removeEventListener){this.removeEventListener(m,l,false);
}else{this.detachEvent("on"+m,l);
}return this;
},retrieve:function(l,m){var n=c(this.uid),o=n[l];
if(m!=undefined&&o==undefined){o=n[l]=m;
}return $pick(o);
},store:function(l,m){var n=c(this.uid);
n[l]=m;
return this;
},eliminate:function(l){var m=c(this.uid);
delete m[l];
return this;
}});
window.addListener("unload",d);
})();
Element.Properties=new Hash;
Element.Properties.style={set:function(a){this.style.cssText=a;
},get:function(){return this.style.cssText;
},erase:function(){this.style.cssText="";
}};
Element.Properties.tag={get:function(){return this.tagName.toLowerCase();
}};
Element.Properties.html=(function(){var c=document.createElement("div");
var b={table:[1,"<table>","</table>"],select:[1,"<select>","</select>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"]};
b.thead=b.tfoot=b.tbody;
var a={set:function(){var e=Array.flatten(arguments).join("");
var f=Browser.Engine.trident&&b[this.get("tag")];
if(f){var g=c;
g.innerHTML=f[1]+e+f[2];
for(var d=f[0];
d--;
){g=g.firstChild;
}this.empty().adopt(g.childNodes);
}else{this.innerHTML=e;
}}};
a.erase=a.set;
return a;
})();
if(Browser.Engine.webkit&&Browser.Engine.version<420){Element.Properties.text={get:function(){if(this.innerText){return this.innerText;
}var a=this.ownerDocument.newElement("div",{html:this.innerHTML}).inject(this.ownerDocument.body);
var b=a.innerText;
a.destroy();
return b;
}};
}Element.Properties.events={set:function(a){this.addEvents(a);
}};
Native.implement([Element,Window,Document],{addEvent:function(f,g){var h=this.retrieve("events",{});
h[f]=h[f]||{keys:[],values:[]};
if(h[f].keys.contains(g)){return this;
}h[f].keys.push(g);
var a=f,e=Element.Events.get(f),c=g,i=this;
if(e){if(e.onAdd){e.onAdd.call(this,g);
}if(e.condition){c=function(j){if(e.condition.call(this,j)){return g.call(this,j);
}return true;
};
}a=e.base||a;
}var d=function(){return g.call(i);
};
var b=Element.NativeEvents[a];
if(b){if(b==2){d=function(j){j=new Event(j,i.getWindow());
if(c.call(i,j)===false){j.stop();
}};
}this.addListener(a,d);
}h[f].values.push(d);
return this;
},removeEvent:function(d,c){var b=this.retrieve("events");
if(!b||!b[d]){return this;
}var f=b[d].keys.indexOf(c);
if(f==-1){return this;
}b[d].keys.splice(f,1);
var e=b[d].values.splice(f,1)[0];
var a=Element.Events.get(d);
if(a){if(a.onRemove){a.onRemove.call(this,c);
}d=a.base||d;
}return(Element.NativeEvents[d])?this.removeListener(d,e):this;
},addEvents:function(a){for(var b in a){this.addEvent(b,a[b]);
}return this;
},removeEvents:function(a){var c;
if($type(a)=="object"){for(c in a){this.removeEvent(c,a[c]);
}return this;
}var b=this.retrieve("events");
if(!b){return this;
}if(!a){for(c in b){this.removeEvents(c);
}this.eliminate("events");
}else{if(b[a]){while(b[a].keys[0]){this.removeEvent(a,b[a].keys[0]);
}b[a]=null;
}}return this;
},fireEvent:function(d,c,b){var a=this.retrieve("events");
if(!a||!a[d]){return this;
}a[d].keys.each(function(e){e.create({bind:this,delay:b,"arguments":c})();
},this);
return this;
},cloneEvents:function(d,c){d=document.id(d);
var b=d.retrieve("events");
if(!b){return this;
}if(!c){for(var a in b){this.cloneEvents(d,a);
}}else{if(b[c]){b[c].keys.each(function(e){this.addEvent(c,e);
},this);
}}return this;
}});
Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};
(function(){var a=function(b){var c=b.relatedTarget;
if(c==undefined){return true;
}if(c===false){return false;
}return($type(this)!="document"&&c!=this&&c.prefix!="xul"&&!this.hasChild(c));
};
Element.Events=new Hash({mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}});
})();
Element.Properties.styles={set:function(a){this.setStyles(a);
}};
Element.Properties.opacity={set:function(a,b){if(!b){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(Browser.Engine.trident){this.style.filter=(a==1)?"":"alpha(opacity="+a*100+")";
}this.style.opacity=a;
this.store("opacity",a);
},get:function(){return this.retrieve("opacity",1);
}};
Element.implement({setOpacity:function(a){return this.set("opacity",a,true);
},getOpacity:function(){return this.get("opacity");
},setStyle:function(a,b){switch(a){case"opacity":return this.set("opacity",parseFloat(b));
case"float":a=(Browser.Engine.trident)?"styleFloat":"cssFloat";
}a=a.camelCase();
if($type(b)!="string"){var c=(Element.Styles.get(a)||"@").split(" ");
b=$splat(b).map(function(e,d){if(!c[d]){return"";
}return($type(e)=="number")?c[d].replace("@",Math.round(e)):e;
}).join(" ");
}else{if(b==String(Number(b))){b=Math.round(b);
}}this.style[a]=b;
return this;
},getStyle:function(a){switch(a){case"opacity":return this.get("opacity");
case"float":a=(Browser.Engine.trident)?"styleFloat":"cssFloat";
}a=a.camelCase();
var g=this.style[a];
if(!$chk(g)){g=[];
for(var f in Element.ShortStyles){if(a!=f){continue;
}for(var e in Element.ShortStyles[f]){g.push(this.getStyle(e));
}return g.join(" ");
}g=this.getComputedStyle(a);
}if(g){g=String(g);
var b=g.match(/rgba?\([\d\s,]+\)/);
if(b){g=g.replace(b[0],b[0].rgbToHex());
}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(g,10)))){if(a.test(/^(height|width)$/)){var d=(a=="width")?["left","right"]:["top","bottom"],c=0;
d.each(function(h){c+=this.getStyle("border-"+h+"-width").toInt()+this.getStyle("padding-"+h).toInt();
},this);
return this["offset"+a.capitalize()]-c+"px";
}if((Browser.Engine.presto)&&String(g).test("px")){return g;
}if(a.test(/(border(.+)Width|margin|padding)/)){return"0px";
}}return g;
},setStyles:function(a){for(var b in a){this.setStyle(b,a[b]);
}return this;
},getStyles:function(){var a={};
Array.flatten(arguments).each(function(b){a[b]=this.getStyle(b);
},this);
return a;
}});
Element.Styles=new Hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"});
Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};
["Top","Right","Bottom","Left"].each(function(g){var f=Element.ShortStyles;
var b=Element.Styles;
["margin","padding"].each(function(h){var i=h+g;
f[h][i]=b[i]="@px";
});
var e="border"+g;
f.border[e]=b[e]="@px @ rgb(@, @, @)";
var d=e+"Width",a=e+"Style",c=e+"Color";
f[e]={};
f.borderWidth[d]=f[e][d]=b[d]="@px";
f.borderStyle[a]=f[e][a]=b[a]="@";
f.borderColor[c]=f[e][c]=b[c]="rgb(@, @, @)";
});
(function(){Element.implement({scrollTo:function(h,i){if(e(this)){this.getWindow().scrollTo(h,i);
}else{this.scrollLeft=h;
this.scrollTop=i;
}return this;
},getSize:function(){if(e(this)){return this.getWindow().getSize();
}return{x:this.offsetWidth,y:this.offsetHeight};
},getScrollSize:function(){if(e(this)){return this.getWindow().getScrollSize();
}return{x:this.scrollWidth,y:this.scrollHeight};
},getScroll:function(){if(e(this)){return this.getWindow().getScroll();
}return{x:this.scrollLeft,y:this.scrollTop};
},getScrolls:function(){var i=this,h={x:0,y:0};
while(i&&!e(i)){h.x+=i.scrollLeft;
h.y+=i.scrollTop;
i=i.parentNode;
}return h;
},getOffsetParent:function(){var h=this;
if(e(h)){return null;
}if(!Browser.Engine.trident){return h.offsetParent;
}while((h=h.parentNode)&&!e(h)){if(c(h,"position")!="static"){return h;
}}return null;
},getOffsets:function(){if(this.getBoundingClientRect){var k=this.getBoundingClientRect(),n=document.id(this.getDocument().documentElement),o=n.getScroll(),l=this.getScrolls(),j=this.getScroll(),h=(c(this,"position")=="fixed");
return{x:k.left.toInt()+l.x-j.x+((h)?0:o.x)-n.clientLeft,y:k.top.toInt()+l.y-j.y+((h)?0:o.y)-n.clientTop};
}var i=this,m={x:0,y:0};
if(e(this)){return m;
}while(i&&!e(i)){m.x+=i.offsetLeft;
m.y+=i.offsetTop;
if(Browser.Engine.gecko){if(!f(i)){m.x+=a(i);
m.y+=g(i);
}var p=i.parentNode;
if(p&&c(p,"overflow")!="visible"){m.x+=a(p);
m.y+=g(p);
}}else{if(i!=this&&Browser.Engine.webkit){m.x+=a(i);
m.y+=g(i);
}}i=i.offsetParent;
}if(Browser.Engine.gecko&&!f(this)){m.x-=a(this);
m.y-=g(this);
}return m;
},getPosition:function(i){if(e(this)){return{x:0,y:0};
}var l=this.getOffsets(),k=this.getScrolls();
var h={x:l.x-k.x,y:l.y-k.y};
var j=(i&&(i=document.id(i)))?i.getPosition():{x:0,y:0};
return{x:h.x-j.x,y:h.y-j.y};
},getCoordinates:function(i){if(e(this)){return this.getWindow().getCoordinates();
}var h=this.getPosition(i),j=this.getSize();
var k={left:h.x,top:h.y,width:j.x,height:j.y};
k.right=k.left+k.width;
k.bottom=k.top+k.height;
return k;
},computePosition:function(h){return{left:h.x-b(this,"margin-left"),top:h.y-b(this,"margin-top")};
},setPosition:function(h){return this.setStyles(this.computePosition(h));
}});
Native.implement([Document,Window],{getSize:function(){if(Browser.Engine.presto||Browser.Engine.webkit){var i=this.getWindow();
return{x:i.innerWidth,y:i.innerHeight};
}var h=d(this);
return{x:h.clientWidth,y:h.clientHeight};
},getScroll:function(){var i=this.getWindow(),h=d(this);
return{x:i.pageXOffset||h.scrollLeft,y:i.pageYOffset||h.scrollTop};
},getScrollSize:function(){var i=d(this),h=this.getSize();
return{x:Math.max(i.scrollWidth,h.x),y:Math.max(i.scrollHeight,h.y)};
},getPosition:function(){return{x:0,y:0};
},getCoordinates:function(){var h=this.getSize();
return{top:0,left:0,bottom:h.y,right:h.x,height:h.y,width:h.x};
}});
var c=Element.getComputedStyle;
function b(h,i){return c(h,i).toInt()||0;
}function f(h){return c(h,"-moz-box-sizing")=="border-box";
}function g(h){return b(h,"border-top-width");
}function a(h){return b(h,"border-left-width");
}function e(h){return(/^(?:body|html)$/i).test(h.tagName);
}function d(h){var i=h.getDocument();
return(!i.compatMode||i.compatMode=="CSS1Compat")?i.html:i.body;
}})();
Element.alias("setPosition","position");
Native.implement([Window,Document,Element],{getHeight:function(){return this.getSize().y;
},getWidth:function(){return this.getSize().x;
},getScrollTop:function(){return this.getScroll().y;
},getScrollLeft:function(){return this.getScroll().x;
},getScrollHeight:function(){return this.getScrollSize().y;
},getScrollWidth:function(){return this.getScrollSize().x;
},getTop:function(){return this.getPosition().y;
},getLeft:function(){return this.getPosition().x;
}});
Native.implement([Document,Element],{getElements:function(h,g){h=h.split(",");
var d,f={};
for(var e=0,c=h.length;
e<c;
e++){var b=h[e],a=Selectors.Utils.search(this,b,f);
if(e!=0&&a.item){a=$A(a);
}d=(e==0)?a:(d.item)?$A(d).concat(a):d.concat(a);
}return new Elements(d,{ddup:(h.length>1),cash:!g});
}});
Element.implement({match:function(b){if(!b||(b==this)){return true;
}var c=Selectors.Utils.parseTagAndID(b);
var a=c[0],e=c[1];
if(!Selectors.Filters.byID(this,e)||!Selectors.Filters.byTag(this,a)){return false;
}var d=Selectors.Utils.parseSelector(b);
return(d)?Selectors.Utils.filter(this,d,{}):true;
}});
var Selectors={Cache:{nth:{},parsed:{}}};
Selectors.RegExps={id:(/#([\w-]+)/),tag:(/^(\w+|\*)/),quick:(/^(\w+|\*)$/),splitter:(/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),combined:(/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)(["']?)([^\4]*?)\4)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)};
Selectors.Utils={chk:function(b,c){if(!c){return true;
}var a=$uid(b);
if(!c[a]){return c[a]=true;
}return false;
},parseNthArgument:function(e){if(Selectors.Cache.nth[e]){return Selectors.Cache.nth[e];
}var g=e.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);
if(!g){return false;
}var h=parseInt(g[1],10);
var d=(h||h===0)?h:1;
var f=g[2]||false;
var c=parseInt(g[3],10)||0;
if(d!=0){c--;
while(c<1){c+=d;
}while(c>=d){c-=d;
}}else{d=c;
f="index";
}switch(f){case"n":g={a:d,b:c,special:"n"};
break;
case"odd":g={a:2,b:0,special:"n"};
break;
case"even":g={a:2,b:1,special:"n"};
break;
case"first":g={a:0,special:"index"};
break;
case"last":g={special:"last-child"};
break;
case"only":g={special:"only-child"};
break;
default:g={a:(d-1),special:"index"};
}return Selectors.Cache.nth[e]=g;
},parseSelector:function(e){if(Selectors.Cache.parsed[e]){return Selectors.Cache.parsed[e];
}var c,a={classes:[],pseudos:[],attributes:[]};
while((c=Selectors.RegExps.combined.exec(e))){var i=c[1],g=c[2],f=c[3],b=c[5],d=c[6],j=c[7];
if(i){a.classes.push(i);
}else{if(d){var h=Selectors.Pseudo.get(d);
if(h){a.pseudos.push({parser:h,argument:j});
}else{a.attributes.push({name:d,operator:"=",value:j});
}}else{if(g){a.attributes.push({name:g,operator:f,value:b});
}}}}if(!a.classes.length){delete a.classes;
}if(!a.attributes.length){delete a.attributes;
}if(!a.pseudos.length){delete a.pseudos;
}if(!a.classes&&!a.attributes&&!a.pseudos){a=null;
}return Selectors.Cache.parsed[e]=a;
},parseTagAndID:function(b){var a=b.match(Selectors.RegExps.tag);
var c=b.match(Selectors.RegExps.id);
return[(a)?a[1]:"*",(c)?c[1]:false];
},filter:function(f,e,d){var c;
if(e.classes){for(c=e.classes.length;
c--;
c){var g=e.classes[c];
if(!Selectors.Filters.byClass(f,g)){return false;
}}}if(e.attributes){for(c=e.attributes.length;
c--;
c){var b=e.attributes[c];
if(!Selectors.Filters.byAttribute(f,b.name,b.operator,b.value)){return false;
}}}if(e.pseudos){for(c=e.pseudos.length;
c--;
c){var a=e.pseudos[c];
if(!Selectors.Filters.byPseudo(f,a.parser,a.argument,d)){return false;
}}}return true;
},getByTagAndID:function(b,a,d){if(d){var c=(b.getElementById)?b.getElementById(d,true):Element.getElementById(b,d,true);
return(c&&Selectors.Filters.byTag(c,a))?[c]:[];
}else{return b.getElementsByTagName(a);
}},search:function(o,A,s){var b=[];
var d=A.trim().replace(Selectors.RegExps.splitter,function(k,j,i){b.push(j);
return":)"+i;
}).split(":)");
var h,c,z;
for(var y=0,u=d.length;
y<u;
y++){var x=d[y];
if(y==0&&Selectors.RegExps.quick.test(x)){h=o.getElementsByTagName(x);
continue;
}var f=b[y-1];
var q=Selectors.Utils.parseTagAndID(x);
var B=q[0],p=q[1];
if(y==0){h=Selectors.Utils.getByTagAndID(o,B,p);
}else{var e={},g=[];
for(var w=0,v=h.length;
w<v;
w++){g=Selectors.Getters[f](g,h[w],B,p,e);
}h=g;
}var a=Selectors.Utils.parseSelector(x);
if(a){c=[];
for(var t=0,r=h.length;
t<r;
t++){z=h[t];
if(Selectors.Utils.filter(z,a,s)){c.push(z);
}}h=c;
}}return h;
}};
Selectors.Getters={" ":function(j,g,h,a,e){var d=Selectors.Utils.getByTagAndID(g,h,a);
for(var c=0,b=d.length;
c<b;
c++){var f=d[c];
if(Selectors.Utils.chk(f,e)){j.push(f);
}}return j;
},">":function(j,g,h,a,f){var c=Selectors.Utils.getByTagAndID(g,h,a);
for(var e=0,d=c.length;
e<d;
e++){var b=c[e];
if(b.parentNode==g&&Selectors.Utils.chk(b,f)){j.push(b);
}}return j;
},"+":function(c,b,a,e,d){while((b=b.nextSibling)){if(b.nodeType==1){if(Selectors.Utils.chk(b,d)&&Selectors.Filters.byTag(b,a)&&Selectors.Filters.byID(b,e)){c.push(b);
}break;
}}return c;
},"~":function(c,b,a,e,d){while((b=b.nextSibling)){if(b.nodeType==1){if(!Selectors.Utils.chk(b,d)){break;
}if(Selectors.Filters.byTag(b,a)&&Selectors.Filters.byID(b,e)){c.push(b);
}}}return c;
}};
Selectors.Filters={byTag:function(b,a){return(a=="*"||(b.tagName&&b.tagName.toLowerCase()==a));
},byID:function(a,b){return(!b||(a.id&&a.id==b));
},byClass:function(b,a){return(b.className&&b.className.contains&&b.className.contains(a," "));
},byPseudo:function(b,d,a,c){return d.call(b,a,c);
},byAttribute:function(a,b,c,e){var d=Element.prototype.getProperty.call(a,b);
if(!d){return(c=="!=");
}if(!c||e==undefined){return true;
}switch(c){case"=":return(d==e);
case"*=":return(d.contains(e));
case"^=":return(d.substr(0,e.length)==e);
case"$=":return(d.substr(d.length-e.length)==e);
case"!=":return(d!=e);
case"~=":return d.contains(e," ");
case"|=":return d.contains(e,"-");
}return false;
}};
Selectors.Pseudo=new Hash({checked:function(){return this.checked;
},empty:function(){return !(this.innerText||this.textContent||"").length;
},not:function(a){return !Element.match(this,a);
},contains:function(a){return(this.innerText||this.textContent||"").contains(a);
},"first-child":function(){return Selectors.Pseudo.index.call(this,0);
},"last-child":function(){var a=this;
while((a=a.nextSibling)){if(a.nodeType==1){return false;
}}return true;
},"only-child":function(){var b=this;
while((b=b.previousSibling)){if(b.nodeType==1){return false;
}}var a=this;
while((a=a.nextSibling)){if(a.nodeType==1){return false;
}}return true;
},"nth-child":function(b,e){b=(b==undefined)?"n":b;
var f=Selectors.Utils.parseNthArgument(b);
if(f.special!="n"){return Selectors.Pseudo[f.special].call(this,f.a,e);
}var g=0;
e.positions=e.positions||{};
var d=$uid(this);
if(!e.positions[d]){var c=this;
while((c=c.previousSibling)){if(c.nodeType!=1){continue;
}g++;
var a=e.positions[$uid(c)];
if(a!=undefined){g=a+g;
break;
}}e.positions[d]=g;
}return(e.positions[d]%f.a==f.b);
},index:function(b){var a=this,c=0;
while((a=a.previousSibling)){if(a.nodeType==1&&++c>b){return false;
}}return(c==b);
},even:function(a,b){return Selectors.Pseudo["nth-child"].call(this,"2n+1",b);
},odd:function(a,b){return Selectors.Pseudo["nth-child"].call(this,"2n",b);
},selected:function(){return this.selected;
},enabled:function(){return(this.disabled===false);
}});
Element.Events.domready={onAdd:function(a){if(Browser.loaded){a.call(this);
}}};
(function(){var b=function(){if(Browser.loaded){return;
}Browser.loaded=true;
window.fireEvent("domready");
document.fireEvent("domready");
};
window.addEvent("load",b);
if(Browser.Engine.trident){var a=document.createElement("div");
(function(){($try(function(){a.doScroll();
return document.id(a).inject(document.body).set("html","temp").dispose();
}))?b():arguments.callee.delay(50);
})();
}else{if(Browser.Engine.webkit&&Browser.Engine.version<525){(function(){(["loaded","complete"].contains(document.readyState))?b():arguments.callee.delay(50);
})();
}else{document.addEvent("DOMContentLoaded",b);
}}})();
var JSON=new Hash(this.JSON&&{stringify:JSON.stringify,parse:JSON.parse}).extend({$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:function(a){return JSON.$specialChars[a]||"\\u00"+Math.floor(a.charCodeAt()/16).toString(16)+(a.charCodeAt()%16).toString(16);
},encode:function(b){switch($type(b)){case"string":return'"'+b.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';
case"array":return"["+String(b.map(JSON.encode).clean())+"]";
case"object":case"hash":var a=[];
Hash.each(b,function(e,d){var c=JSON.encode(e);
if(c){a.push(JSON.encode(d)+":"+c);
}});
return"{"+a+"}";
case"number":case"boolean":return String(b);
case false:return"null";
}return null;
},decode:function(string,secure){if($type(string)!="string"||!string.length){return null;
}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null;
}return eval("("+string+")");
}});
Native.implement([Hash,Array,String,Number],{toJSON:function(){return JSON.encode(this);
}});
var Cookie=new Class({Implements:Options,options:{path:false,domain:false,duration:false,secure:false,document:document},initialize:function(b,a){this.key=b;
this.setOptions(a);
},write:function(b){b=encodeURIComponent(b);
if(this.options.domain){b+="; domain="+this.options.domain;
}if(this.options.path){b+="; path="+this.options.path;
}if(this.options.duration){var a=new Date();
a.setTime(a.getTime()+this.options.duration*24*60*60*1000);
b+="; expires="+a.toGMTString();
}if(this.options.secure){b+="; secure";
}this.options.document.cookie=this.key+"="+b;
return this;
},read:function(){var a=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)");
return(a)?decodeURIComponent(a[1]):null;
},dispose:function(){new Cookie(this.key,$merge(this.options,{duration:-1})).write("");
return this;
}});
Cookie.write=function(b,c,a){return new Cookie(b,a).write(c);
};
Cookie.read=function(a){return new Cookie(a).read();
};
Cookie.dispose=function(b,a){return new Cookie(b,a).dispose();
};
var Swiff=new Class({Implements:[Options],options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"transparent",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object;
},initialize:function(m,i){this.instance="Swiff_"+$time();
this.setOptions(i);
i=this.options;
var b=this.id=i.id||this.instance;
var g=document.id(i.container);
Swiff.CallBacks[this.instance]={};
var e=i.params,h=i.vars,d=i.callBacks;
var a=$extend({height:i.height,width:i.width},i.properties);
var l=this;
for(var f in d){Swiff.CallBacks[this.instance][f]=(function(n){return function(){return n.apply(l.object,arguments);
};
})(d[f]);
h[f]="Swiff.CallBacks."+this.instance+"."+f;
}e.flashVars=Hash.toQueryString(h);
if(Browser.Engine.trident){a.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
e.movie=m;
}else{a.type="application/x-shockwave-flash";
a.data=m;
}var k='<object id="'+b+'"';
for(var j in a){k+=" "+j+'="'+a[j]+'"';
}k+=">";
for(var c in e){if(e[c]){k+='<param name="'+c+'" value="'+e[c]+'" />';
}}k+="</object>";
this.object=((g)?g.empty():new Element("div")).set("html",k).firstChild;
},replaces:function(a){a=document.id(a,true);
a.parentNode.replaceChild(this.toElement(),a);
return this;
},inject:function(a){document.id(a,true).appendChild(this.toElement());
return this;
},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].extend(arguments));
}});
Swiff.CallBacks={};
Swiff.remote=function(obj,fn){var rs=obj.CallFunction('<invoke name="'+fn+'" returntype="javascript">'+__flash__argumentsToXML(arguments,2)+"</invoke>");
return eval(rs);
};
var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore"},initialize:function(a){this.subject=this.subject||this;
this.setOptions(a);
this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();
var b=this.options.wait;
if(b===false){this.options.link="cancel";
}},getTransition:function(){return function(a){return -(Math.cos(Math.PI*a)-1)/2;
};
},step:function(){var a=$time();
if(a<this.time+this.options.duration){var b=this.transition((a-this.time)/this.options.duration);
this.set(this.compute(this.from,this.to,b));
}else{this.set(this.compute(this.from,this.to,1));
this.complete();
}},set:function(a){return a;
},compute:function(c,b,a){return Fx.compute(c,b,a);
},check:function(){if(!this.timer){return true;
}switch(this.options.link){case"cancel":this.cancel();
return true;
case"chain":this.chain(this.caller.bind(this,arguments));
return false;
}return false;
},start:function(b,a){if(!this.check(b,a)){return this;
}this.from=b;
this.to=a;
this.time=0;
this.transition=this.getTransition();
this.startTimer();
this.onStart();
return this;
},complete:function(){if(this.stopTimer()){this.onComplete();
}return this;
},cancel:function(){if(this.stopTimer()){this.onCancel();
}return this;
},onStart:function(){this.fireEvent("start",this.subject);
},onComplete:function(){this.fireEvent("complete",this.subject);
if(!this.callChain()){this.fireEvent("chainComplete",this.subject);
}},onCancel:function(){this.fireEvent("cancel",this.subject).clearChain();
},pause:function(){this.stopTimer();
return this;
},resume:function(){this.startTimer();
return this;
},stopTimer:function(){if(!this.timer){return false;
}this.time=$time()-this.time;
this.timer=$clear(this.timer);
return true;
},startTimer:function(){if(this.timer){return false;
}this.time=$time()-this.time;
this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);
return true;
}});
Fx.compute=function(c,b,a){return(b-c)*a+c;
};
Fx.Durations={"short":250,normal:500,"long":1000};
Fx.CSS=new Class({Extends:Fx,prepare:function(b,a,e){e=$splat(e);
var c=e[1];
if(!$chk(c)){e[1]=e[0];
e[0]=b.getStyle(a);
}var d=e.map(this.parse);
return{from:d[0],to:d[1]};
},parse:function(a){a=$lambda(a)();
a=(typeof a=="string")?a.split(" "):$splat(a);
return a.map(function(c){c=String(c);
var b=false;
Fx.CSS.Parsers.each(function(f,d){if(b){return;
}var e=f.parse(c);
if($chk(e)){b={value:e,parser:f};
}});
b=b||{value:c,parser:Fx.CSS.Parsers.String};
return b;
});
},compute:function(d,c,b){var a=[];
(Math.min(d.length,c.length)).times(function(e){a.push({value:d[e].parser.compute(d[e].value,c[e].value,b),parser:d[e].parser});
});
a.$family={name:"fx:css:value"};
return a;
},serve:function(c,b){if($type(c)!="fx:css:value"){c=this.parse(c);
}var a=[];
c.each(function(d){a=a.concat(d.parser.serve(d.value,b));
});
return a;
},render:function(b,a,d,c){b.setStyle(a,this.serve(d,c));
},search:function(a){if(Fx.CSS.Cache[a]){return Fx.CSS.Cache[a];
}var b={};
Array.each(document.styleSheets,function(e,d){var c=e.href;
if(c&&c.contains("://")&&!c.contains(document.domain)){return;
}var f=e.rules||e.cssRules;
Array.each(f,function(j,h){if(!j.style){return;
}var g=(j.selectorText)?j.selectorText.replace(/^\w+/,function(i){return i.toLowerCase();
}):null;
if(!g||!g.test("^"+a+"$")){return;
}Element.Styles.each(function(k,i){if(!j.style[i]||Element.ShortStyles[i]){return;
}k=String(j.style[i]);
b[i]=(k.test(/^rgb/))?k.rgbToHex():k;
});
});
});
return Fx.CSS.Cache[a]=b;
}});
Fx.CSS.Cache={};
Fx.CSS.Parsers=new Hash({Color:{parse:function(a){if(a.match(/^#[0-9a-f]{3,6}$/i)){return a.hexToRgb(true);
}return((a=a.match(/(\d+),\s*(\d+),\s*(\d+)/)))?[a[1],a[2],a[3]]:false;
},compute:function(c,b,a){return c.map(function(e,d){return Math.round(Fx.compute(c[d],b[d],a));
});
},serve:function(a){return a.map(Number);
}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(b,a){return(a)?b+a:b;
}},String:{parse:$lambda(false),compute:$arguments(1),serve:$arguments(0)}});
Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(a,b){this.element=this.subject=document.id(a);
this.parent(b);
},set:function(a,b){if(arguments.length==1){b=a;
a=this.property||this.options.property;
}this.render(this.element,a,b,this.options.unit);
return this;
},start:function(a,e,d){if(!this.check(a,e,d)){return this;
}var b=Array.flatten(arguments);
this.property=this.options.property||b.shift();
var c=this.prepare(this.element,this.property,b);
return this.parent(c.from,c.to);
}});
Element.Properties.tween={set:function(b){var a=this.retrieve("tween");
if(a){a.cancel();
}return this.eliminate("tween").store("tween:options",$extend({link:"cancel"},b));
},get:function(a){if(a||!this.retrieve("tween")){if(a||!this.retrieve("tween:options")){this.set("tween",a);
}this.store("tween",new Fx.Tween(this,this.retrieve("tween:options")));
}return this.retrieve("tween");
}};
Element.implement({tween:function(a,c,b){this.get("tween").start(arguments);
return this;
},fade:function(b){var e=this.get("tween"),d="opacity",c;
b=$pick(b,"toggle");
switch(b){case"in":e.start(d,1);
break;
case"out":e.start(d,0);
break;
case"show":e.set(d,1);
break;
case"hide":e.set(d,0);
break;
case"toggle":var a=this.retrieve("fade:flag",this.get("opacity")==1);
e.start(d,(a)?0:1);
this.store("fade:flag",!a);
c=true;
break;
default:e.start(d,arguments);
}if(!c){this.eliminate("fade:flag");
}return this;
},highlight:function(c,a){if(!a){a=this.retrieve("highlight:original",this.getStyle("background-color"));
a=(a=="transparent")?"#fff":a;
}var b=this.get("tween");
b.start("background-color",c||"#ffff88",a).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original"));
b.callChain();
}.bind(this));
return this;
}});
Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(a,b){this.element=this.subject=document.id(a);
this.parent(b);
},set:function(a){if(typeof a=="string"){a=this.search(a);
}for(var b in a){this.render(this.element,b,a[b],this.options.unit);
}return this;
},compute:function(e,d,c){var a={};
for(var b in e){a[b]=this.parent(e[b],d[b],c);
}return a;
},start:function(a){if(!this.check(a)){return this;
}if(typeof a=="string"){a=this.search(a);
}var e={},d={};
for(var c in a){var b=this.prepare(this.element,c,a[c]);
e[c]=b.from;
d[c]=b.to;
}return this.parent(e,d);
}});
Element.Properties.morph={set:function(a){var b=this.retrieve("morph");
if(b){b.cancel();
}return this.eliminate("morph").store("morph:options",$extend({link:"cancel"},a));
},get:function(a){if(a||!this.retrieve("morph")){if(a||!this.retrieve("morph:options")){this.set("morph",a);
}this.store("morph",new Fx.Morph(this,this.retrieve("morph:options")));
}return this.retrieve("morph");
}};
Element.implement({morph:function(a){this.get("morph").start(a);
return this;
}});
Fx.implement({getTransition:function(){var a=this.options.transition||Fx.Transitions.Sine.easeInOut;
if(typeof a=="string"){var b=a.split(":");
a=Fx.Transitions;
a=a[b[0]]||a[b[0].capitalize()];
if(b[1]){a=a["ease"+b[1].capitalize()+(b[2]?b[2].capitalize():"")];
}}return a;
}});
Fx.Transition=function(b,a){a=$splat(a);
return $extend(b,{easeIn:function(c){return b(c,a);
},easeOut:function(c){return 1-b(1-c,a);
},easeInOut:function(c){return(c<=0.5)?b(2*c,a)/2:(2-b(2*(1-c),a))/2;
}});
};
Fx.Transitions=new Hash({linear:$arguments(0)});
Fx.Transitions.extend=function(b){for(var a in b){Fx.Transitions[a]=new Fx.Transition(b[a]);
}};
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(f){var e;
for(var d=0,c=1;
1;
d+=c,c/=2){if(f>=(7-4*d)/11){e=c*c-Math.pow((11-6*d-11*f)/4,2);
break;
}}return e;
},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(c){return Math.pow(c,[a+2]);
});
});
var Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,noCache:false},initialize:function(a){this.xhr=new Browser.Request();
this.setOptions(a);
this.options.isSuccess=this.options.isSuccess||this.isSuccess;
this.headers=new Hash(this.options.headers);
},onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return;
}this.running=false;
this.status=0;
$try(function(){this.status=this.xhr.status;
}.bind(this));
this.xhr.onreadystatechange=$empty;
if(this.options.isSuccess.call(this,this.status)){this.response={text:this.xhr.responseText,xml:this.xhr.responseXML};
this.success(this.response.text,this.response.xml);
}else{this.response={text:null,xml:null};
this.failure();
}},isSuccess:function(){return((this.status>=200)&&(this.status<300));
},processScripts:function(a){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return $exec(a);
}return a.stripScripts(this.options.evalScripts);
},success:function(b,a){this.onSuccess(this.processScripts(b),a);
},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain();
},failure:function(){this.onFailure();
},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);
},setHeader:function(a,b){this.headers.set(a,b);
return this;
},getHeader:function(a){return $try(function(){return this.xhr.getResponseHeader(a);
}.bind(this));
},check:function(){if(!this.running){return true;
}switch(this.options.link){case"cancel":this.cancel();
return true;
case"chain":this.chain(this.caller.bind(this,arguments));
return false;
}return false;
},send:function(j){if(!this.check(j)){return this;
}this.running=true;
var h=$type(j);
if(h=="string"||h=="element"){j={data:j};
}var c=this.options;
j=$extend({data:c.data,url:c.url,method:c.method},j);
var f=j.data,a=String(j.url),i=j.method.toLowerCase();
switch($type(f)){case"element":f=document.id(f).toQueryString();
break;
case"object":case"hash":f=Hash.toQueryString(f);
}if(this.options.format){var k="format="+this.options.format;
f=(f)?k+"&"+f:k;
}if(this.options.emulation&&!["get","post"].contains(i)){var g="_method="+i;
f=(f)?g+"&"+f:g;
i="post";
}if(this.options.urlEncoded&&i=="post"){var b=(this.options.encoding)?"; charset="+this.options.encoding:"";
this.headers.set("Content-type","application/x-www-form-urlencoded"+b);
}if(this.options.noCache){var e="noCache="+new Date().getTime();
f=(f)?e+"&"+f:e;
}var d=a.lastIndexOf("/");
if(d>-1&&(d=a.indexOf("#"))>-1){a=a.substr(0,d);
}if(f&&i=="get"){a=a+(a.contains("?")?"&":"?")+f;
f=null;
}this.xhr.open(i.toUpperCase(),a,this.options.async);
this.xhr.onreadystatechange=this.onStateChange.bind(this);
this.headers.each(function(m,l){try{this.xhr.setRequestHeader(l,m);
}catch(n){this.fireEvent("exception",[l,m]);
}},this);
this.fireEvent("request");
this.xhr.send(f);
if(!this.options.async){this.onStateChange();
}return this;
},cancel:function(){if(!this.running){return this;
}this.running=false;
this.xhr.abort();
this.xhr.onreadystatechange=$empty;
this.xhr=new Browser.Request();
this.fireEvent("cancel");
return this;
}});
(function(){var a={};
["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(b){a[b]=function(){var c=Array.link(arguments,{url:String.type,data:$defined});
return this.send($extend(c,{method:b}));
};
});
Request.implement(a);
})();
Element.Properties.send={set:function(a){var b=this.retrieve("send");
if(b){b.cancel();
}return this.eliminate("send").store("send:options",$extend({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")},a));
},get:function(a){if(a||!this.retrieve("send")){if(a||!this.retrieve("send:options")){this.set("send",a);
}this.store("send",new Request(this.retrieve("send:options")));
}return this.retrieve("send");
}};
Element.implement({send:function(b){var a=this.get("send");
a.send({data:this,url:b||a.options.url});
return this;
}});
Request=new Class({Extends:Request,timedOut:false,options:{timeout:false},send:function(b){var a=(this.options.timeout||(b?b.timeout:null));
if(a){this.timeoutTimer=window.setTimeout(this.callTimeout.bindWithEvent(this),a);
this.addEvent("onComplete",this.removeTimer);
}return this.parent(b);
},callTimeout:function(){this.timedOut=true;
if(!this.running){return this;
}this.running=false;
this.xhr.abort();
this.xhr.onreadystatechange=$empty;
this.xhr=new Browser.Request();
this.onFailure();
this.fireEvent("onTimeout");
},removeTimer:function(){window.clearTimeout(this.timeoutTimer);
},success:function(b,a){if(this.timedOut){return;
}this.parent(b,a);
},failure:function(){if(this.timedOut){return;
}this.parent();
}});
Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false},processHTML:function(c){var a=c.match(/<body[^>]*>([\s\S]*?)<\/body>/i);
c=(a)?a[1]:c;
var b=new Element("div");
return $try(function(){var d="<root>"+c+"</root>",g;
if(Browser.Engine.trident){g=new ActiveXObject("Microsoft.XMLDOM");
g.async=false;
g.loadXML(d);
}else{g=new DOMParser().parseFromString(d,"text/xml");
}d=g.getElementsByTagName("root")[0];
if(!d){return null;
}for(var f=0,e=d.childNodes.length;
f<e;
f++){var h=Element.clone(d.childNodes[f],true,true);
if(h){b.grab(h);
}}return b;
})||b.set("html",c);
},success:function(d){var b=this.options,c=this.response;
c.html=d.stripScripts(function(e){c.javascript=e;
});
var a=this.processHTML(c.html);
c.tree=a.childNodes;
c.elements=a.getElements("*");
if(b.filter){c.tree=c.elements.filter(b.filter);
}if(b.update){document.id(b.update).empty().set("html",c.html);
}else{if(b.append){document.id(b.append).adopt(a.getChildren());
}}if(b.evalScripts){$exec(c.javascript);
}this.onSuccess(c.tree,c.elements,c.html,c.javascript);
}});
Element.Properties.load={set:function(a){var b=this.retrieve("load");
if(b){b.cancel();
}return this.eliminate("load").store("load:options",$extend({data:this,link:"cancel",update:this,method:"get"},a));
},get:function(a){if(a||!this.retrieve("load")){if(a||!this.retrieve("load:options")){this.set("load",a);
}this.store("load",new Request.HTML(this.retrieve("load:options")));
}return this.retrieve("load");
}};
Element.implement({load:function(){this.get("load").send(Array.link(arguments,{data:Object.type,url:String.type}));
return this;
}});
Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(a){this.parent(a);
this.headers.extend({Accept:"application/json","X-Request":"JSON"});
},success:function(a){this.response.json=JSON.decode(a,this.options.secure);
this.onSuccess(this.response.json,a);
}});
Swiff.Uploader=new Class({Extends:Swiff,Implements:Events,options:{path:"Swiff.Uploader.swf",target:null,zIndex:9999,height:30,width:100,callBacks:null,params:{wMode:"opaque",menu:"false",allowScriptAccess:"always"},typeFilter:null,multiple:true,queued:true,verbose:false,url:null,method:null,data:null,mergeData:true,fieldName:null,fileSizeMin:1,fileSizeMax:null,allowDuplicates:false,buttonImage:null,fileListMax:0,fileListSizeMax:0,instantStart:false,appendCookieData:false,fileClass:null},initialize:function(a){this.addEvent("load",this.initializeSwiff,true).addEvent("select",this.processFiles,true).addEvent("complete",this.update,true);
this.setOptions(a);
if(this.options.callBacks){Hash.each(this.options.callBacks,function(e,d){this.addEvent(d,e);
},this);
}this.options.callBacks={fireCallback:this.fireCallback.bind(this)};
var c=this.options.path;
if(!c.contains("?")){c+="?noCache="+$time();
}this.options.container=this.box=new Element("span",{"class":"swiff-uploader-box"}).inject($(this.options.container)||document.body);
this.target=$(this.options.target);
if(this.target){var b=window.getScroll();
this.box.setStyles({position:"absolute",visibility:"visible",zIndex:this.options.zIndex,overflow:"hidden",height:1,width:1,top:b.y,left:b.x});
this.parent(c,{params:{wMode:"transparent"},height:"100%",width:"100%"});
this.target.addEvent("mouseenter",this.reposition.bind(this,[]));
this.addEvents({buttonEnter:this.targetRelay.bind(this,["mouseenter"]),buttonLeave:this.targetRelay.bind(this,["mouseleave"]),buttonDown:this.targetRelay.bind(this,["mousedown"]),buttonDisable:this.targetRelay.bind(this,["disable"])});
this.reposition();
window.addEvent("resize",this.reposition.bind(this,[]));
}else{this.parent(c);
}this.inject(this.box);
this.fileListSize=0;
this.fileList=[];
this.size=this.uploading=this.bytesLoaded=this.percentLoaded=0;
if(Browser.Plugins.Flash.version<9){this.fireEvent("fail",["flash"]);
}else{this.verifyLoad.delay(500,this);
}},verifyLoad:function(){if(this.loaded){return;
}if(!this.object.parentNode){this.fireEvent("fail",["disabled"]);
}else{if(this.object.style.display=="none"){this.fireEvent("fail",["hidden"]);
}else{if(!this.object.offsetWidth){this.fireEvent("fail",["empty"]);
}}}},fireCallback:function(b,a){if(b.substr(0,4)=="file"){if(a.length>1){this.update(a[1]);
}var e=a[0];
var c=this.findFile(e.id);
if(c){var d=b.replace(/^file([A-Z])/,function(g,f){return f.toLowerCase();
});
c.update(e).fireEvent(d,[e],10);
}this.fireEvent(b,c||e,10);
}else{this.fireEvent(b,a,10);
}},update:function(a){$extend(this,a);
this.fireEvent("queue",[this],10);
return this;
},findFile:function(b){for(var a=0;
a<this.fileList.length;
a++){if(this.fileList[a].id==b){return this.fileList[a];
}}return null;
},initializeSwiff:function(){this.remote("initialize",{width:this.options.width,height:this.options.height,typeFilter:this.options.typeFilter,multiple:this.options.multiple,queued:this.options.queued,url:this.options.url,method:this.options.method,data:this.options.data,mergeData:this.options.mergeData,fieldName:this.options.fieldName,verbose:this.options.verbose,fileSizeMin:this.options.fileSizeMin,fileSizeMax:this.options.fileSizeMax,allowDuplicates:this.options.allowDuplicates,buttonImage:this.options.buttonImage});
this.loaded=true;
this.appendCookieData();
},targetRelay:function(a){if(this.target){this.target.fireEvent(a);
}},reposition:function(a){this.box.setStyles(a||(this.target&&this.target.offsetHeight)?this.target.getCoordinates(this.box.getOffsetParent()):{top:window.getScrollTop(),left:0,width:40,height:40});
},setOptions:function(a){if(a){if(a.url){a.url=Swiff.Uploader.qualifyPath(a.url);
}if(a.buttonImage){a.buttonImage=Swiff.Uploader.qualifyPath(a.buttonImage);
}this.parent(a);
if(this.loaded){this.remote("setOptions",a);
}}return this;
},setEnabled:function(a){this.remote("setEnabled",a);
},start:function(){this.remote("start");
},stop:function(){this.remote("stop");
},remove:function(){this.remote("remove");
},fileStart:function(a){this.remote("fileStart",a.id);
},fileStop:function(a){this.remote("fileStop",a.id);
},fileRemove:function(a){this.remote("fileRemove",a.id);
},fileRequeue:function(a){this.remote("fileRequeue",a.id);
},appendCookieData:function(){var b=this.options.appendCookieData;
if(!b){return;
}var c={};
document.cookie.split(/;\s*/).each(function(d){d=d.split("=");
if(d.length==2){c[decodeURIComponent(d[0])]=decodeURIComponent(d[1]);
}});
var a=this.options.data||{};
if($type(b)=="string"){a[b]=c;
}else{$extend(a,c);
}this.setOptions({data:a});
},processFiles:function(e,b,a){var d=this.options.fileClass||Swiff.Uploader.File;
var c=[],f=[];
if(e){e.each(function(h){var g=new d(this,h);
if(!g.validate()){g.remove.delay(10,g);
c.push(g);
}else{this.fileListSize+=h.size;
this.fileList.push(g);
f.push(g);
g.render();
}},this);
this.fireEvent("selectSuccess",[f],10);
}if(b||c.length){c.extend((b)?b.map(function(g){return new d(this,g);
},this):[]).each(function(g){g.invalidate().render();
});
this.fireEvent("selectFail",[c],10);
}this.update(a);
if(this.options.instantStart&&f.length){this.start();
}}});
$extend(Swiff.Uploader,{STATUS_QUEUED:0,STATUS_RUNNING:1,STATUS_ERROR:2,STATUS_COMPLETE:3,STATUS_STOPPED:4,log:function(){if(window.console&&console.info){console.info.apply(console,arguments);
}},unitLabels:{b:[{min:1,unit:"B"},{min:1024,unit:"kB"},{min:1048576,unit:"MB"},{min:1073741824,unit:"GB"}],s:[{min:1,unit:"s"},{min:60,unit:"m"},{min:3600,unit:"h"},{min:86400,unit:"d"}]},formatUnit:function(a,h,b){var c=Swiff.Uploader.unitLabels[(h=="bps")?"b":h];
var f=(h=="bps")?"/s":"";
var e,d=c.length,j;
if(a<1){return"0 "+c[0].unit+f;
}if(h=="s"){var g=[];
for(e=d-1;
e>=0;
e--){j=Math.floor(a/c[e].min);
if(j){g.push(j+" "+c[e].unit);
a-=j*c[e].min;
if(!a){break;
}}}return(b===false)?g:g.join(b||", ");
}for(e=d-1;
e>=0;
e--){j=c[e].min;
if(a>=j){break;
}}return(a/j).toFixed(1)+" "+c[e].unit+f;
}});
Swiff.Uploader.qualifyPath=(function(){var a;
return function(b){(a||(a=new Element("a"))).href=b;
return a.href;
};
})();
Swiff.Uploader.File=new Class({Implements:Events,initialize:function(b,a){this.base=b;
this.update(a);
this.addEvent("remove",this.onRemove,true);
},update:function(a){return $extend(this,a);
},validate:function(){var a=this.base.options;
if(a.fileListMax&&this.base.fileList.length>=a.fileListMax){this.validationError="fileListMax";
return false;
}if(a.fileListSizeMax&&(this.base.fileListSize+this.size)>a.fileListSizeMax){this.validationError="fileListSizeMax";
return false;
}return true;
},invalidate:function(){this.invalid=true;
this.base.fireEvent("fileInvalid",this,10);
return this.fireEvent("invalid",this,10);
},render:function(){return this;
},setOptions:function(a){if(a){if(a.url){a.url=Swiff.Uploader.qualifyPath(a.url);
}this.base.remote("fileSetOptions",this.id,a);
this.options=$merge(this.options,a);
}return this;
},start:function(){this.base.fileStart(this);
return this;
},stop:function(){this.base.fileStop(this);
return this;
},remove:function(){this.base.fileRemove(this);
return this;
},requeue:function(){this.base.fileRequeue(this);
},onRemove:function(){this.base.fileListSize-=this.size;
this.base.fileList.erase(this);
}});
MooTools.More={version:"1.2.4.2",build:"bd5a93c0913cce25917c48cbdacde568e15e02ef"};
(function(){var d={language:"en-US",languages:{"en-US":{}},cascades:["en-US"]};
var c;
MooTools.lang=new Events();
$extend(MooTools.lang,{setLanguage:function(a){if(!d.languages[a]){return this;
}d.language=a;
this.load();
this.fireEvent("langChange",a);
return this;
},load:function(){var a=this.cascade(this.getCurrentLanguage());
c={};
$each(a,function(b,f){c[f]=this.lambda(b);
},this);
},getCurrentLanguage:function(){return d.language;
},addLanguage:function(a){d.languages[a]=d.languages[a]||{};
return this;
},cascade:function(a){var f=(d.languages[a]||{}).cascades||[];
f.combine(d.cascades);
f.erase(a).push(a);
var b=f.map(function(e){return d.languages[e];
},this);
return $merge.apply(this,b);
},lambda:function(a){(a||{}).get=function(b,f){return $lambda(a[b]).apply(this,$splat(f));
};
return a;
},get:function(a,b,f){if(c&&c[a]){return(b?c[a].get(b,f):c[a]);
}},set:function(b,a,f){this.addLanguage(b);
langData=d.languages[b];
if(!langData[a]){langData[a]={};
}$extend(langData[a],f);
if(b==this.getCurrentLanguage()){this.load();
this.fireEvent("langChange",b);
}return this;
},list:function(){return Hash.getKeys(d.languages);
}});
})();
(function(){var f=this;
var d=function(){if(f.console&&console.log){try{console.log.apply(console,arguments);
}catch(a){console.log(Array.slice(arguments));
}}else{Log.logged.push(arguments);
}return this;
};
var e=function(){this.logged.push(arguments);
return this;
};
this.Log=new Class({logged:[],log:e,resetLog:function(){this.logged.empty();
return this;
},enableLog:function(){this.log=d;
this.logged.each(function(a){this.log.apply(this,a);
},this);
return this.resetLog();
},disableLog:function(){this.log=e;
return this;
}});
Log.extend(new Log).enableLog();
Log.logger=function(){return this.log.apply(this,arguments);
};
})();
Array.implement({min:function(){return Math.min.apply(null,this);
},max:function(){return Math.max.apply(null,this);
},average:function(){return this.length?this.sum()/this.length:0;
},sum:function(){var d=0,c=this.length;
if(c){do{d+=this[--c];
}while(c);
}return d;
},unique:function(){return[].combine(this);
}});
(function(){var v=this.Date;
if(!v.now){v.now=$time;
}v.Methods={ms:"Milliseconds",year:"FullYear",min:"Minutes",mo:"Month",sec:"Seconds",hr:"Hours"};
["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds","Time","TimezoneOffset","Week","Timezone","GMTOffset","DayOfYear","LastMonth","LastDayOfMonth","UTCDate","UTCDay","UTCFullYear","AMPM","Ordinal","UTCHours","UTCMilliseconds","UTCMinutes","UTCMonth","UTCSeconds"].each(function(a){v.Methods[a.toLowerCase()]=a;
});
var A=function(a,b){return new Array(b-String(a).length+1).join("0")+a;
};
v.implement({set:function(a,c){switch($type(a)){case"object":for(var b in a){this.set(b,a[b]);
}break;
case"string":a=a.toLowerCase();
var d=v.Methods;
if(d[a]){this["set"+d[a]](c);
}}return this;
},get:function(a){a=a.toLowerCase();
var b=v.Methods;
if(b[a]){return this["get"+b[a]]();
}return null;
},clone:function(){return new v(this.get("time"));
},increment:function(c,a){c=c||"day";
a=$pick(a,1);
switch(c){case"year":return this.increment("month",a*12);
case"month":var b=this.get("date");
this.set("date",1).set("mo",this.get("mo")+a);
return this.set("date",b.min(this.get("lastdayofmonth")));
case"week":return this.increment("day",a*7);
case"day":return this.set("date",this.get("date")+a);
}if(!v.units[c]){throw new Error(c+" is not a supported interval");
}return this.set("time",this.get("time")+a*v.units[c]());
},decrement:function(b,a){return this.increment(b,-1*$pick(a,1));
},isLeapYear:function(){return v.isLeapYear(this.get("year"));
},clearTime:function(){return this.set({hr:0,min:0,sec:0,ms:0});
},diff:function(a,b){if($type(a)=="string"){a=v.parse(a);
}return((a-this)/v.units[b||"day"](3,3)).toInt();
},getLastDayOfMonth:function(){return v.daysInMonth(this.get("mo"),this.get("year"));
},getDayOfYear:function(){return(v.UTC(this.get("year"),this.get("mo"),this.get("date")+1)-v.UTC(this.get("year"),0,1))/v.units.day();
},getWeek:function(){return(this.get("dayofyear")/7).ceil();
},getOrdinal:function(a){return v.getMsg("ordinal",a||this.get("date"));
},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3");
},getGMTOffset:function(){var a=this.get("timezoneOffset");
return((a>0)?"-":"+")+A((a.abs()/60).floor(),2)+A(a%60,2);
},setAMPM:function(b){b=b.toUpperCase();
var a=this.get("hr");
if(a>11&&b=="AM"){return this.decrement("hour",12);
}else{if(a<12&&b=="PM"){return this.increment("hour",12);
}}return this;
},getAMPM:function(){return(this.get("hr")<12)?"AM":"PM";
},parse:function(a){this.set("time",v.parse(a));
return this;
},isValid:function(a){return !!(a||this).valueOf();
},format:function(b){if(!this.isValid()){return"invalid date";
}b=b||"%x %X";
b=t[b.toLowerCase()]||b;
var a=this;
return b.replace(/%([a-z%])/gi,function(c,d){switch(d){case"a":return v.getMsg("days")[a.get("day")].substr(0,3);
case"A":return v.getMsg("days")[a.get("day")];
case"b":return v.getMsg("months")[a.get("month")].substr(0,3);
case"B":return v.getMsg("months")[a.get("month")];
case"c":return a.toString();
case"d":return A(a.get("date"),2);
case"H":return A(a.get("hr"),2);
case"I":return((a.get("hr")%12)||12);
case"j":return A(a.get("dayofyear"),3);
case"m":return A((a.get("mo")+1),2);
case"M":return A(a.get("min"),2);
case"o":return a.get("ordinal");
case"p":return v.getMsg(a.get("ampm"));
case"S":return A(a.get("seconds"),2);
case"U":return A(a.get("week"),2);
case"w":return a.get("day");
case"x":return a.format(v.getMsg("shortDate"));
case"X":return a.format(v.getMsg("shortTime"));
case"y":return a.get("year").toString().substr(2);
case"Y":return a.get("year");
case"T":return a.get("GMTOffset");
case"Z":return a.get("Timezone");
}return d;
});
},toISOString:function(){return this.format("iso8601");
}});
v.alias("toISOString","toJSON");
v.alias("diff","compare");
v.alias("format","strftime");
var t={db:"%Y-%m-%d %H:%M:%S",compact:"%Y%m%dT%H%M%S",iso8601:"%Y-%m-%dT%H:%M:%S%T",rfc822:"%a, %d %b %Y %H:%M:%S %Z","short":"%d %b %H:%M","long":"%B %d, %Y %H:%M"};
var x=[];
var z=v.parse;
var q=function(c,a,d){var e=-1;
var b=v.getMsg(c+"s");
switch($type(a)){case"object":e=b[a.get(c)];
break;
case"number":e=b[month-1];
if(!e){throw new Error("Invalid "+c+" index: "+index);
}break;
case"string":var f=b.filter(function(g){return this.test(g);
},new RegExp("^"+a,"i"));
if(!f.length){throw new Error("Invalid "+c+" string");
}if(f.length>1){throw new Error("Ambiguous "+c);
}e=f[0];
}return(d)?b.indexOf(e):e;
};
v.extend({getMsg:function(a,b){return MooTools.lang.get("Date",a,b);
},units:{ms:$lambda(1),second:$lambda(1000),minute:$lambda(60000),hour:$lambda(3600000),day:$lambda(86400000),week:$lambda(608400000),month:function(b,c){var a=new v;
return v.daysInMonth($pick(b,a.get("mo")),$pick(c,a.get("year")))*86400000;
},year:function(a){a=a||new v().get("year");
return v.isLeapYear(a)?31622400000:31536000000;
}},daysInMonth:function(a,b){return[31,v.isLeapYear(b)?29:28,31,30,31,30,31,31,30,31,30,31][a];
},isLeapYear:function(a){return((a%4===0)&&(a%100!==0))||(a%400===0);
},parse:function(a){var b=$type(a);
if(b=="number"){return new v(a);
}if(b!="string"){return a;
}a=a.clean();
if(!a.length){return null;
}var c;
x.some(function(d){var e=d.re.exec(a);
return(e)?(c=d.handler(e)):false;
});
return c||new v(z(a));
},parseDay:function(b,a){return q("day",b,a);
},parseMonth:function(a,b){return q("month",a,b);
},parseUTC:function(b){var c=new v(b);
var a=v.UTC(c.get("year"),c.get("mo"),c.get("date"),c.get("hr"),c.get("min"),c.get("sec"));
return new v(a);
},orderIndex:function(a){return v.getMsg("dateOrder").indexOf(a)+1;
},defineFormat:function(b,a){t[b]=a;
},defineFormats:function(b){for(var a in b){v.defineFormat(a,b[a]);
}},parsePatterns:x,defineParser:function(a){x.push((a.re&&a.handler)?a:s(a));
},defineParsers:function(){Array.flatten(arguments).each(v.defineParser);
},define2DigitYearStart:function(a){w=a%100;
r=a-w;
}});
var r=1900;
var w=70;
var u=function(a){return new RegExp("(?:"+v.getMsg(a).map(function(b){return b.substr(0,3);
}).join("|")+")[a-z]*");
};
var D=function(a){switch(a){case"x":return((v.orderIndex("month")==1)?"%m[.-/]%d":"%d[.-/]%m")+"([.-/]%y)?";
case"X":return"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%T?";
}return null;
};
var p={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\d/,s:/\d+/,o:/[a-z]*/,p:/[ap]\.?m\.?/,y:/\d{2}|\d{4}/,Y:/\d{4}/,T:/Z|[+-]\d{2}(?::?\d{2})?/};
p.m=p.I;
p.S=p.M;
var B;
var C=function(a){B=a;
p.a=p.A=u("days");
p.b=p.B=u("months");
x.each(function(b,c){if(b.format){x[c]=s(b.format);
}});
};
var s=function(a){if(!B){return{format:a};
}var c=[];
var b=(a.source||a).replace(/%([a-z])/gi,function(d,e){return D(e)||d;
}).replace(/\((?!\?)/g,"(?:").replace(/ (?!\?|\*)/g,",? ").replace(/%([a-z%])/gi,function(e,f){var d=p[f];
if(!d){return f;
}c.push(f);
return"("+d.source+")";
}).replace(/\[a-z\]/gi,"[a-z\\u00c0-\\uffff]");
return{format:a,re:new RegExp("^"+b+"$","i"),handler:function(d){d=d.slice(1).associate(c);
var f=new v().clearTime();
if("d" in d){y.call(f,"d",1);
}if("m" in d){y.call(f,"m",1);
}for(var e in d){y.call(f,e,d[e]);
}return f;
}};
};
var y=function(c,b){if(!b){return this;
}switch(c){case"a":case"A":return this.set("day",v.parseDay(b,true));
case"b":case"B":return this.set("mo",v.parseMonth(b,true));
case"d":return this.set("date",b);
case"H":case"I":return this.set("hr",b);
case"m":return this.set("mo",b-1);
case"M":return this.set("min",b);
case"p":return this.set("ampm",b.replace(/\./g,""));
case"S":return this.set("sec",b);
case"s":return this.set("ms",("0."+b)*1000);
case"w":return this.set("day",b);
case"Y":return this.set("year",b);
case"y":b=+b;
if(b<100){b+=r+(b<w?100:0);
}return this.set("year",b);
case"T":if(b=="Z"){b="+00";
}var a=b.match(/([+-])(\d{2}):?(\d{2})?/);
a=(a[1]+"1")*(a[2]*60+(+a[3]||0))+this.getTimezoneOffset();
return this.set("time",this-a*60000);
}return this;
};
v.defineParsers("%Y([-./]%m([-./]%d((T| )%X)?)?)?","%Y%m%d(T%H(%M%S?)?)?","%x( %X)?","%d%o( %b( %Y)?)?( %X)?","%b( %d%o)?( %Y)?( %X)?","%Y %b( %d%o( %X)?)?","%o %b %d %X %T %Y");
MooTools.lang.addEvent("langChange",function(a){if(MooTools.lang.get("Date")){C(a);
}}).fireEvent("langChange",MooTools.lang.getCurrentLanguage());
})();
Date.implement({timeDiffInWords:function(b){return Date.distanceOfTimeInWords(this,b||new Date);
},timeDiff:function(j,h){if(j==null){j=new Date;
}var k=((j-this)/1000).toInt();
if(!k){return"0s";
}var i={s:60,m:60,h:24,d:365,y:0};
var l,m=[];
for(var n in i){if(!k){break;
}if((l=i[n])){m.unshift((k%l)+n);
k=(k/l).toInt();
}else{m.unshift(k+n);
}}return m.join(h||":");
}});
Date.alias("timeDiffInWords","timeAgoInWords");
Date.extend({distanceOfTimeInWords:function(c,d){return Date.getTimePhrase(((d-c)/1000).toInt());
},getTimePhrase:function(i){var k=(i<0)?"Until":"Ago";
if(i<0){i*=-1;
}var g={minute:60,hour:60,day:24,week:7,month:52/12,year:12,eon:Infinity};
var j="lessThanMinute";
for(var l in g){var h=g[l];
if(i<1.5*h){if(i>0.75*h){j=l;
}break;
}i/=h;
j=l+"s";
}return Date.getMsg(j+k).substitute({delta:i.round()});
}});
Date.defineParsers({re:/^(?:tod|tom|yes)/i,handler:function(d){var c=new Date().clearTime();
switch(d[0]){case"tom":return c.increment();
case"yes":return c.decrement();
default:return c;
}}},{re:/^(next|last) ([a-z]+)$/i,handler:function(i){var h=new Date().clearTime();
var d=h.getDay();
var j=Date.parseDay(i[2],true);
var g=j-d;
if(j<=d){g+=7;
}if(i[1]=="last"){g-=7;
}return h.set("date",h.getDate()+g);
}});
Hash.implement({getFromPath:function(d){var c=this.getClean();
d.replace(/\[([^\]]+)\]|\.([^.[]+)|[^[.]+/g,function(b){if(!c){return null;
}var a=arguments[2]||arguments[1]||arguments[0];
c=(a in c)?c[a]:null;
return b;
});
return c;
},cleanValues:function(b){b=b||$defined;
this.each(function(d,a){if(!b(d)){this.erase(a);
}},this);
return this;
},run:function(){var b=arguments;
this.each(function(d,a){if($type(d)=="function"){d.run(b);
}});
}});
(function(){var e=["??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??","??"];
var f=["A","a","A","a","A","a","A","a","Ae","ae","A","a","A","a","A","a","C","c","C","c","C","c","D","d","D","d","E","e","E","e","E","e","E","e","E","e","E","e","G","g","I","i","I","i","I","i","I","i","L","l","L","l","L","l","N","n","N","n","N","n","O","o","O","o","O","o","O","o","Oe","oe","O","o","o","R","r","R","r","S","s","S","s","S","s","T","t","T","t","T","t","U","u","U","u","U","u","Ue","ue","U","u","Y","y","Y","y","Z","z","Z","z","Z","z","TH","th","DH","dh","ss","OE","oe","AE","ae","u"];
var g={"[\xa0\u2002\u2003\u2009]":" ","\xb7":"*","[\u2018\u2019]":"'","[\u201c\u201d]":'"',"\u2026":"...","\u2013":"-","\u2014":"--","\uFFFD":"&raquo;"};
var h=function(c,b){c=c||"";
var a=b?"<"+c+"[^>]*>([\\s\\S]*?)</"+c+">":"</?"+c+"([^>]+)?>";
reg=new RegExp(a,"gi");
return reg;
};
String.implement({standardize:function(){var a=this;
e.each(function(b,c){a=a.replace(new RegExp(b,"g"),f[c]);
});
return a;
},repeat:function(a){return new Array(a+1).join(this);
},pad:function(c,a,d){if(this.length>=c){return this;
}var b=(a==null?" ":""+a).repeat(c-this.length).substr(0,c-this.length);
if(!d||d=="right"){return this+b;
}if(d=="left"){return b+this;
}return b.substr(0,(b.length/2).floor())+this+b.substr(0,(b.length/2).ceil());
},getTags:function(b,a){return this.match(h(b,a))||[];
},stripTags:function(b,a){return this.replace(h(b,a),"");
},tidy:function(){var a=this.toString();
$each(g,function(b,c){a=a.replace(new RegExp(c,"g"),b);
});
return a;
}});
})();
Element.implement({measure:function(l){var j=function(a){return !!(!a||a.offsetHeight||a.offsetWidth);
};
if(j(this)){return l.apply(this);
}var m=this.getParent(),k=[],h=[];
while(!j(m)&&m!=document.body){h.push(m.expose());
m=m.getParent();
}var n=this.expose();
var i=l.apply(this);
n();
h.each(function(a){a();
});
return i;
},expose:function(){if(this.getStyle("display")!="none"){return $empty;
}var b=this.style.cssText;
this.setStyles({display:"block",position:"absolute",visibility:"hidden"});
return function(){this.style.cssText=b;
}.bind(this);
},getDimensions:function(g){g=$merge({computeSize:false},g);
var h={};
var i=function(a,b){return(b.computeSize)?a.getComputedSize(b):a.getSize();
};
var e=this.getParent("body");
if(e&&this.getStyle("display")=="none"){h=this.measure(function(){return i(this,g);
});
}else{if(e){try{h=i(this,g);
}catch(j){}}else{h={x:0,y:0};
}}return $chk(h.x)?$extend(h,{width:h.x,height:h.y}):$extend(h,{x:h.width,y:h.height});
},getComputedSize:function(g){g=$merge({styles:["padding","border"],plains:{height:["top","bottom"],width:["left","right"]},mode:"both"},g);
var j={width:0,height:0};
switch(g.mode){case"vertical":delete j.width;
delete g.plains.width;
break;
case"horizontal":delete j.height;
delete g.plains.height;
break;
}var f=[];
$each(g.plains,function(a,b){a.each(function(c){g.styles.each(function(d){f.push((d=="border")?d+"-"+c+"-width":d+"-"+c);
});
});
});
var h={};
f.each(function(a){h[a]=this.getComputedStyle(a);
},this);
var i=[];
$each(g.plains,function(b,c){var a=c.capitalize();
j["total"+a]=j["computed"+a]=0;
b.each(function(d){j["computed"+d.capitalize()]=0;
f.each(function(e,l){if(e.test(d)){h[e]=h[e].toInt()||0;
j["total"+a]=j["total"+a]+h[e];
j["computed"+d.capitalize()]=j["computed"+d.capitalize()]+h[e];
}if(e.test(d)&&c!=e&&(e.test("border")||e.test("padding"))&&!i.contains(e)){i.push(e);
j["computed"+a]=j["computed"+a]-h[e];
}});
});
});
["Width","Height"].each(function(a){var b=a.toLowerCase();
if(!$chk(j[b])){return;
}j[b]=j[b]+this["offset"+a]+j["computed"+a];
j["total"+a]=j[b]+j["total"+a];
delete j["computed"+a];
},this);
return $extend(h,j);
}});
(function(){var b=Element.prototype.position;
Element.implement({position:function(F){if(F&&($defined(F.x)||$defined(F.y))){return b?b.apply(this,arguments):this;
}$each(F||{},function(c,d){if(!$defined(c)){delete F[d];
}});
F=$merge({relativeTo:document.body,position:{x:"center",y:"center"},edge:false,offset:{x:0,y:0},returnPos:false,relFixedPosition:false,ignoreMargins:false,ignoreScroll:false,allowNegative:false},F);
var u={x:0,y:0},H=false;
var K=this.measure(function(){return document.id(this.getOffsetParent());
});
if(K&&K!=this.getDocument().body){u=K.measure(function(){return this.getPosition();
});
H=K!=document.id(F.relativeTo);
F.offset.x=F.offset.x-u.x;
F.offset.y=F.offset.y-u.y;
}var a=function(d){if($type(d)!="string"){return d;
}d=d.toLowerCase();
var c={};
if(d.test("left")){c.x="left";
}else{if(d.test("right")){c.x="right";
}else{c.x="center";
}}if(d.test("upper")||d.test("top")){c.y="top";
}else{if(d.test("bottom")){c.y="bottom";
}else{c.y="center";
}}return c;
};
F.edge=a(F.edge);
F.position=a(F.position);
if(!F.edge){if(F.position.x=="center"&&F.position.y=="center"){F.edge={x:"center",y:"center"};
}else{F.edge={x:"left",y:"top"};
}}this.setStyle("position","absolute");
var G=document.id(F.relativeTo)||document.body,J=G==document.body?window.getScroll():G.getPosition(),z=J.y,E=J.x;
var I=G.getScrolls();
z+=I.y;
E+=I.x;
var y=this.getDimensions({computeSize:true,styles:["padding","border","margin"]});
var C={},x=F.offset.y,v=F.offset.x,B=window.getSize();
switch(F.position.x){case"left":C.x=E+v;
break;
case"right":C.x=E+v+G.offsetWidth;
break;
default:C.x=E+((G==document.body?B.x:G.offsetWidth)/2)+v;
break;
}switch(F.position.y){case"top":C.y=z+x;
break;
case"bottom":C.y=z+x+G.offsetHeight;
break;
default:C.y=z+((G==document.body?B.y:G.offsetHeight)/2)+x;
break;
}if(F.edge){var L={};
switch(F.edge.x){case"left":L.x=0;
break;
case"right":L.x=-y.x-y.computedRight-y.computedLeft;
break;
default:L.x=-(y.totalWidth/2);
break;
}switch(F.edge.y){case"top":L.y=0;
break;
case"bottom":L.y=-y.y-y.computedTop-y.computedBottom;
break;
default:L.y=-(y.totalHeight/2);
break;
}C.x+=L.x;
C.y+=L.y;
}C={left:((C.x>=0||H||F.allowNegative)?C.x:0).toInt(),top:((C.y>=0||H||F.allowNegative)?C.y:0).toInt()};
var D={left:"x",top:"y"};
["minimum","maximum"].each(function(c){["left","top"].each(function(e){var d=F[c]?F[c][D[e]]:null;
if(d!=null&&C[e]<d){C[e]=d;
}});
});
if(G.getStyle("position")=="fixed"||F.relFixedPosition){var A=window.getScroll();
C.top+=A.y;
C.left+=A.x;
}if(F.ignoreScroll){var w=G.getScroll();
C.top-=w.y;
C.left-=w.x;
}if(F.ignoreMargins){C.left+=(F.edge.x=="right"?y["margin-right"]:F.edge.x=="center"?-y["margin-left"]+((y["margin-right"]+y["margin-left"])/2):-y["margin-left"]);
C.top+=(F.edge.y=="bottom"?y["margin-bottom"]:F.edge.y=="center"?-y["margin-top"]+((y["margin-bottom"]+y["margin-top"])/2):-y["margin-top"]);
}C.left=Math.ceil(C.left);
C.top=Math.ceil(C.top);
if(F.returnPos){return C;
}else{this.setStyles(C);
}return this;
}});
})();
Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(c,d){this.elements=this.subject=$$(c);
this.parent(d);
},compute:function(l,k,i){var p={};
for(var o in l){var r=l[o],n=k[o],m=p[o]={};
for(var q in r){m[q]=this.parent(r[q],n[q],i);
}}return p;
},set:function(e){for(var h in e){var f=e[h];
for(var g in f){this.render(this.elements[h],g,f[g],this.options.unit);
}}return this;
},start:function(p){if(!this.check(p)){return this;
}var k={},i={};
for(var o in p){var m=p[o],r=k[o]={},l=i[o]={};
for(var q in m){var n=this.prepare(this.elements[o],q,m[q]);
r[q]=n.from;
l[q]=n.to;
}}return this.parent(k,i);
}});
Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(e,f){this.element=this.subject=document.id(e);
this.parent(f);
var g=this.cancel.bind(this,false);
if($type(this.element)!="element"){this.element=document.id(this.element.getDocument().body);
}var h=this.element;
if(this.options.wheelStops){this.addEvent("start",function(){h.addEvent("mousewheel",g);
},true);
this.addEvent("complete",function(){h.removeEvent("mousewheel",g);
},true);
}},set:function(){var b=Array.flatten(arguments);
if(Browser.Engine.gecko){b=[Math.round(b[0]),Math.round(b[1])];
}this.element.scrollTo(b[0],b[1]);
},compute:function(f,d,e){return[0,1].map(function(a){return Fx.compute(f[a],d[a],e);
});
},start:function(n,j){if(!this.check(n,j)){return this;
}var l=this.element.getScrollSize(),h=this.element.getScroll(),m={x:n,y:j};
for(var k in m){var i=l[k];
if($chk(m[k])){m[k]=($type(m[k])=="number")?m[k]:i;
}else{m[k]=h[k];
}m[k]+=this.options.offset[k];
}return this.parent([h.x,h.y],[m.x,m.y]);
},toTop:function(){return this.start(false,0);
},toLeft:function(){return this.start(0,false);
},toRight:function(){return this.start("right",false);
},toBottom:function(){return this.start(false,"bottom");
},toElement:function(c){var d=document.id(c).getPosition(this.element);
return this.start(d.x,d.y);
},scrollIntoView:function(p,n,o){n=n?$splat(n):["x","y"];
var k={};
p=document.id(p);
var m=p.getPosition(this.element);
var j=p.getSize();
var l=this.element.getScroll();
var r=this.element.getSize();
var q={x:m.x+j.x,y:m.y+j.y};
["x","y"].each(function(a){if(n.contains(a)){if(q[a]>l[a]+r[a]){k[a]=q[a]-r[a];
}if(m[a]<l[a]){k[a]=m[a];
}}if(k[a]==null){k[a]=l[a];
}if(o&&o[a]){k[a]=k[a]+o[a];
}},this);
if(k.x!=l.x||k.y!=l.y){this.start(k.x,k.y);
}return this;
},scrollToCenter:function(p,n,o){n=n?$splat(n):["x","y"];
p=$(p);
var k={},m=p.getPosition(this.element),j=p.getSize(),l=this.element.getScroll(),r=this.element.getSize(),q={x:m.x+j.x,y:m.y+j.y};
["x","y"].each(function(a){if(n.contains(a)){k[a]=m[a]-(r[a]-j[a])/2;
}if(k[a]==null){k[a]=l[a];
}if(o&&o[a]){k[a]=k[a]+o[a];
}},this);
if(k.x!=l.x||k.y!=l.y){this.start(k.x,k.y);
}return this;
}});
Fx.Slide=new Class({Extends:Fx,options:{mode:"vertical",hideOverflow:true},initialize:function(e,f){this.addEvent("complete",function(){this.open=(this.wrapper["offset"+this.layout.capitalize()]!=0);
if(this.open&&Browser.Engine.webkit419){this.element.dispose().inject(this.wrapper);
}},true);
this.element=this.subject=document.id(e);
this.parent(f);
var g=this.element.retrieve("wrapper");
var h=this.element.getStyles("margin","position","overflow");
if(this.options.hideOverflow){h=$extend(h,{overflow:"hidden"});
}this.wrapper=g||new Element("div",{styles:h}).wraps(this.element);
this.element.store("wrapper",this.wrapper).setStyle("margin",0);
this.now=[];
this.open=true;
},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;
},set:function(b){this.element.setStyle(this.margin,b[0]);
this.wrapper.setStyle(this.layout,b[1]);
return this;
},compute:function(f,d,e){return[0,1].map(function(a){return Fx.compute(f[a],d[a],e);
});
},start:function(h,l){if(!this.check(h,l)){return this;
}this[l||this.options.mode]();
var m=this.element.getStyle(this.margin).toInt();
var n=this.wrapper.getStyle(this.layout).toInt();
var i=[[m,n],[0,this.offset]];
var j=[[m,n],[-this.offset,0]];
var k;
switch(h){case"in":k=i;
break;
case"out":k=j;
break;
case"toggle":k=(n==0)?i:j;
}return this.parent(k[0],k[1]);
},slideIn:function(b){return this.start("in",b);
},slideOut:function(b){return this.start("out",b);
},hide:function(b){this[b||this.options.mode]();
this.open=false;
return this.set([-this.offset,0]);
},show:function(b){this[b||this.options.mode]();
this.open=true;
return this.set([0,this.offset]);
},toggle:function(b){return this.start("toggle",b);
}});
Element.Properties.slide={set:function(c){var d=this.retrieve("slide");
if(d){d.cancel();
}return this.eliminate("slide").store("slide:options",$extend({link:"cancel"},c));
},get:function(b){if(b||!this.retrieve("slide")){if(b||!this.retrieve("slide:options")){this.set("slide",b);
}this.store("slide",new Fx.Slide(this,this.retrieve("slide:options")));
}return this.retrieve("slide");
}};
Element.implement({slide:function(i,h){i=i||"toggle";
var f=this.get("slide"),g;
switch(i){case"hide":f.hide(h);
break;
case"show":f.show(h);
break;
case"toggle":var j=this.retrieve("slide:flag",f.open);
f[j?"slideOut":"slideIn"](h);
this.store("slide:flag",!j);
g=true;
break;
default:f.start(i,h);
}if(!g){this.eliminate("slide:flag");
}return this;
}});
Request.JSONP=new Class({Implements:[Chain,Events,Options,Log],options:{url:"",data:{},retries:0,timeout:0,link:"ignore",callbackKey:"callback",injectScript:document.head},initialize:function(b){this.setOptions(b);
if(this.options.log){this.enableLog();
}this.running=false;
this.requests=0;
this.triesRemaining=[];
},check:function(){if(!this.running){return true;
}switch(this.options.link){case"cancel":this.cancel();
return true;
case"chain":this.chain(this.caller.bind(this,arguments));
return false;
}return false;
},send:function(j){if(!$chk(arguments[1])&&!this.check(j)){return this;
}var h=$type(j),g=this.options,f=$chk(arguments[1])?arguments[1]:this.requests++;
if(h=="string"||h=="element"){j={data:j};
}j=$extend({data:g.data,url:g.url},j);
if(!$chk(this.triesRemaining[f])){this.triesRemaining[f]=this.options.retries;
}var i=this.triesRemaining[f];
(function(){var a=this.getScript(j);
this.log("JSONP retrieving script with url: "+a.get("src"));
this.fireEvent("request",a);
this.running=true;
(function(){if(i){this.triesRemaining[f]=i-1;
if(a){a.destroy();
this.send(j,f).fireEvent("retry",this.triesRemaining[f]);
}}else{if(a&&this.options.timeout){a.destroy();
this.cancel().fireEvent("failure");
}}}).delay(this.options.timeout,this);
}).delay(Browser.Engine.trident?50:0,this);
return this;
},cancel:function(){if(!this.running){return this;
}this.running=false;
this.fireEvent("cancel");
return this;
},getScript:function(j){var f=Request.JSONP.counter,i;
Request.JSONP.counter++;
switch($type(j.data)){case"element":i=document.id(j.data).toQueryString();
break;
case"object":case"hash":i=Hash.toQueryString(j.data);
}var h=j.url+(j.url.test("\\?")?"&":"?")+(j.callbackKey||this.options.callbackKey)+"=Request.JSONP.request_map.request_"+f+(i?"&"+i:"");
if(h.length>2083){this.log("JSONP "+h+" will fail in Internet Explorer, which enforces a 2083 bytes length limit on URIs");
}var g=new Element("script",{type:"text/javascript",src:h});
Request.JSONP.request_map["request_"+f]=function(a){this.success(a,g);
}.bind(this);
return g.inject(this.options.injectScript);
},success:function(c,d){if(d){d.destroy();
}this.running=false;
this.log("JSONP successfully retrieved: ",c);
this.fireEvent("complete",[c]).fireEvent("success",[c]).callChain();
}});
Request.JSONP.counter=0;
Request.JSONP.request_map={};
var Asset={javascript:function(k,m){m=$extend({onload:$empty,document:document,check:$lambda(true)},m);
var h=new Element("script",{src:k,type:"text/javascript"});
var l=m.onload.bind(h),i=m.check,j=m.document;
delete m.onload;
delete m.check;
delete m.document;
h.addEvents({load:l,readystatechange:function(){if(["loaded","complete"].contains(this.readyState)){l();
}}}).set(m);
if(Browser.Engine.webkit419){var n=(function(){if(!$try(i)){return;
}$clear(n);
l();
}).periodical(50);
}return h.inject(j.head);
},css:function(c,d){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:c},d)).inject(document.head);
},image:function(h,e){e=$merge({onload:$empty,onabort:$empty,onerror:$empty},e);
var g=new Image();
var f=document.id(g)||new Element("img");
["load","abort","error"].each(function(c){var b="on"+c;
var a=e[b];
delete e[b];
g[b]=function(){if(!g){return;
}if(!f.parentNode){f.width=g.width;
f.height=g.height;
}g=g.onload=g.onabort=g.onerror=null;
a.delay(1,f,f);
f.fireEvent(c,f,1);
};
});
g.src=f.src=h;
if(g&&g.complete){g.onload.delay(1);
}return f.set(e);
},images:function(g,h){h=$merge({onComplete:$empty,onProgress:$empty,onError:$empty,properties:{}},h);
g=$splat(g);
var f=[];
var e=0;
return new Elements(g.map(function(a){return Asset.image(a,$extend(h.properties,{onload:function(){h.onProgress.call(this,e,g.indexOf(a));
e++;
if(e==g.length){h.onComplete();
}},onerror:function(){h.onError.call(this,e,g.indexOf(a));
e++;
if(e==g.length){h.onComplete();
}}}));
}));
}};
Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:true},initialize:function(c,d){this.parent(c,d);
this.load();
},save:function(){var b=JSON.encode(this.hash);
if(!b||b.length>4096){return false;
}if(b=="{}"){this.dispose();
}else{this.write(b);
}return true;
},load:function(){this.hash=new Hash(JSON.decode(this.read(),true));
return this;
}});
Hash.each(Hash.prototype,function(c,d){if(typeof c=="function"){Hash.Cookie.implement(d,function(){var a=c.apply(this.hash,arguments);
if(this.options.autoSave){this.save();
}return a;
});
}});
var Scroller=new Class({Implements:[Events,Options],options:{area:20,velocity:1,onChange:function(d,c){this.element.scrollTo(d,c);
},fps:50},initialize:function(c,d){this.setOptions(d);
this.element=document.id(c);
this.listener=($type(this.element)!="element")?document.id(this.element.getDocument().body):this.element;
this.timer=null;
this.bound={attach:this.attach.bind(this),detach:this.detach.bind(this),getCoords:this.getCoords.bind(this)};
},start:function(){this.listener.addEvents({mouseover:this.bound.attach,mouseout:this.bound.detach});
},stop:function(){this.listener.removeEvents({mouseover:this.bound.attach,mouseout:this.bound.detach});
this.detach();
this.timer=$clear(this.timer);
},attach:function(){this.listener.addEvent("mousemove",this.bound.getCoords);
},detach:function(){this.listener.removeEvent("mousemove",this.bound.getCoords);
this.timer=$clear(this.timer);
},getCoords:function(b){this.page=(this.listener.get("tag")=="body")?b.client:b.page;
if(!this.timer){this.timer=this.scroll.periodical(Math.round(1000/this.options.fps),this);
}},scroll:function(){var g=this.element.getSize(),h=this.element.getScroll(),i=this.element.getOffsets(),l=this.element.getScrollSize(),j={x:0,y:0};
for(var k in this.page){if(this.page[k]<(this.options.area+i[k])&&h[k]!=0){j[k]=(this.page[k]-this.options.area-i[k])*this.options.velocity;
}else{if(this.page[k]+this.options.area>(g[k]+i[k])&&h[k]+g[k]!=l[k]){j[k]=(this.page[k]-g[k]+this.options.area-i[k])*this.options.velocity;
}}}if(j.y||j.x){this.fireEvent("change",[h.x+j.x,h.y+j.y]);
}}});
(function(){var b=function(d,a){return(d)?($type(d)=="function"?d(a):a.get(d)):"";
};
this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle("display","block");
},onHide:function(){this.tip.setStyle("display","none");
},title:"title",text:function(a){return a.get("rel")||a.get("href");
},showDelay:100,hideDelay:100,className:"tip-wrap",offset:{x:16,y:16},fixed:false},initialize:function(){var a=Array.link(arguments,{options:Object.type,elements:$defined});
this.setOptions(a.options);
document.id(this);
if(a.elements){this.attach(a.elements);
}},toElement:function(){if(this.tip){return this.tip;
}this.container=new Element("div",{"class":"tip"});
return this.tip=new Element("div",{"class":this.options.className,styles:{position:"absolute",top:0,left:0}}).adopt(new Element("div",{"class":"tip-top"}),this.container,new Element("div",{"class":"tip-bottom"})).inject(document.body);
},attach:function(a){$$(a).each(function(i){var g=b(this.options.title,i),h=b(this.options.text,i);
i.erase("title").store("tip:native",g).retrieve("tip:title",g);
i.retrieve("tip:text",h);
this.fireEvent("attach",[i]);
var j=["enter","leave"];
if(!this.options.fixed){j.push("move");
}j.each(function(c){var d=i.retrieve("tip:"+c);
if(!d){d=this["element"+c.capitalize()].bindWithEvent(this,i);
}i.store("tip:"+c,d).addEvent("mouse"+c,d);
},this);
},this);
return this;
},detach:function(a){$$(a).each(function(e){["enter","leave","move"].each(function(c){e.removeEvent("mouse"+c,e.retrieve("tip:"+c)).eliminate("tip:"+c);
});
this.fireEvent("detach",[e]);
if(this.options.title=="title"){var f=e.retrieve("tip:native");
if(f){e.set("title",f);
}}},this);
return this;
},elementEnter:function(d,a){this.container.empty();
["title","text"].each(function(c){var f=a.retrieve("tip:"+c);
if(f){this.fill(new Element("div",{"class":"tip-"+c}).inject(this.container),f);
}},this);
$clear(this.timer);
this.timer=this.show.delay(this.options.showDelay,this,a);
this.position((this.options.fixed)?{page:a.getPosition()}:d);
},elementLeave:function(d,a){$clear(this.timer);
this.timer=this.hide.delay(this.options.hideDelay,this,a);
this.fireForParent(d,a);
},fireForParent:function(d,a){if(!a){return;
}parentNode=a.getParent();
if(parentNode==document.body){return;
}if(parentNode.retrieve("tip:enter")){parentNode.fireEvent("mouseenter",d);
}else{this.fireForParent(parentNode,d);
}},elementMove:function(d,a){this.position(d);
},position:function(l){var n=window.getSize(),a=window.getScroll(),k={x:this.tip.offsetWidth,y:this.tip.offsetHeight},m={x:"left",y:"top"},j={};
for(var i in m){j[m[i]]=l.page[i]+this.options.offset[i];
if((j[m[i]]+k[i]-a[i])>n[i]){j[m[i]]=l.page[i]-this.options.offset[i]-k[i];
}}this.tip.setStyles(j);
},fill:function(a,d){if(typeof d=="string"){a.set("html",d);
}else{a.adopt(d);
}},show:function(a){this.fireEvent("show",[this.tip,a]);
},hide:function(a){this.fireEvent("hide",[this.tip,a]);
}});
})();
MooTools.lang.set("en-US","Date",{months:["January","February","March","April","May","June","July","August","September","October","November","December"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dateOrder:["month","date","year"],shortDate:"%m/%d/%Y",shortTime:"%I:%M%p",AM:"AM",PM:"PM",ordinal:function(b){return(b>3&&b<21)?"th":["th","st","nd","rd","th"][Math.min(b%10,4)];
},lessThanMinuteAgo:"less than a minute ago",minuteAgo:"about a minute ago",minutesAgo:"{delta} minutes ago",hourAgo:"about an hour ago",hoursAgo:"about {delta} hours ago",dayAgo:"1 day ago",daysAgo:"{delta} days ago",weekAgo:"1 week ago",weeksAgo:"{delta} weeks ago",monthAgo:"1 month ago",monthsAgo:"{delta} months ago",yearAgo:"1 year ago",yearsAgo:"{delta} years ago",lessThanMinuteUntil:"less than a minute from now",minuteUntil:"about a minute from now",minutesUntil:"{delta} minutes from now",hourUntil:"about an hour from now",hoursUntil:"about {delta} hours from now",dayUntil:"1 day from now",daysUntil:"{delta} days from now",weekUntil:"1 week from now",weeksUntil:"{delta} weeks from now",monthUntil:"1 month from now",monthsUntil:"{delta} months from now",yearUntil:"1 year from now",yearsUntil:"{delta} years from now"});
var FancyUpload2=new Class({Extends:Swiff.Uploader,options:{queued:1,limitSize:0,limitFiles:0,validateFile:$lambda(true)},initialize:function(b,c,a){this.status=$(b);
this.list=$(c);
if(!a.fileClass){a.fileClass=FancyUpload2.File;
}if(a.limitSize){a.fileSizeMax=a.limitSize;
}if(a.limitFiles){a.fileListMax=a.limitFiles;
}this.parent(a);
this.addEvents({load:this.render,select:this.onSelect,cancel:this.onCancel,start:this.onStart,queue:this.onQueue,complete:this.onComplete});
},render:function(){this.overallTitle=this.status.getElement(".overall-title");
this.currentTitle=this.status.getElement(".current-title");
this.currentText=this.status.getElement(".current-text");
var a=this.status.getElement(".overall-progress");
this.overallProgress=new Fx.ProgressBar(a,{text:new Element("span",{"class":"progress-text"}).inject(a,"after")});
a=this.status.getElement(".current-progress");
this.currentProgress=new Fx.ProgressBar(a,{text:new Element("span",{"class":"progress-text"}).inject(a,"after")});
a.addEvent("click",function(){this.currentProgress.start($random(0,100));
}.bind(this));
this.updateOverall();
},onSelect:function(){this.status.removeClass("status-browsing");
},onCancel:function(){this.status.removeClass("file-browsing");
},onStart:function(){this.status.addClass("file-uploading");
this.overallProgress.set(0);
},onQueue:function(){this.updateOverall();
},onComplete:function(){this.status.removeClass("file-uploading");
if(this.size){this.overallProgress.start(100);
}else{this.overallProgress.set(0);
this.currentProgress.set(0);
}},updateOverall:function(){this.overallTitle.set("html",MooTools.lang.get("FancyUpload","progressOverall").substitute({total:Swiff.Uploader.formatUnit(this.size,"b")}));
if(!this.size){this.currentTitle.set("html",MooTools.lang.get("FancyUpload","currentTitle"));
this.currentText.set("html","");
}},upload:function(){this.start();
},removeFile:function(){return this.remove();
}});
FancyUpload2.File=new Class({Extends:Swiff.Uploader.File,render:function(){if(this.invalid){if(this.validationError){var a=MooTools.lang.get("FancyUpload","validationErrors")[this.validationError]||this.validationError;
this.validationErrorMessage=a.substitute(this);
}this.remove();
return;
}this.addEvents({start:this.onStart,progress:this.onProgress,complete:this.onComplete,error:this.onError,remove:this.onRemove});
this.info=new Element("span",{"class":"file-info"});
this.element=new Element("li",{"class":"file"}).adopt(new Element("span",{"class":"file-size",html:Swiff.Uploader.formatUnit(this.size,"b")}),new Element("a",{"class":"file-remove",href:"#",html:MooTools.lang.get("FancyUpload","remove"),title:MooTools.lang.get("FancyUpload","removeTitle"),events:{click:function(){this.remove();
return false;
}.bind(this)}}),new Element("span",{"class":"file-name",html:MooTools.lang.get("FancyUpload","fileName").substitute(this)}),this.info).inject(this.base.list);
},validate:function(){return(this.parent()&&this.base.options.validateFile(this));
},onStart:function(){this.element.addClass("file-uploading");
this.base.currentProgress.cancel().set(0);
this.base.currentTitle.set("html",MooTools.lang.get("FancyUpload","currentFile").substitute(this));
},onProgress:function(){this.base.overallProgress.start(this.base.percentLoaded);
this.base.currentText.set("html",MooTools.lang.get("FancyUpload","currentProgress").substitute({rate:(this.progress.rate)?Swiff.Uploader.formatUnit(this.progress.rate,"bps"):"- B",bytesLoaded:Swiff.Uploader.formatUnit(this.progress.bytesLoaded,"b"),timeRemaining:(this.progress.timeRemaining)?Swiff.Uploader.formatUnit(this.progress.timeRemaining,"s"):"-"}));
this.base.currentProgress.start(this.progress.percentLoaded);
},onComplete:function(){this.element.removeClass("file-uploading");
this.base.currentText.set("html","Upload completed");
this.base.currentProgress.start(100);
if(this.response.error){this.fireEvent("error");
return;
}var a=this.response.text||"";
this.base.fireEvent("onFileSuccess",[this,a]);
},onError:function(){this.element.addClass("file-failed");
var a=MooTools.lang.get("FancyUpload","fileError").substitute(this);
var b=MooTools.lang.get("FancyUpload","errors")[this.response.error]||(this.response.error+" #"+this.response.code);
b=b.substitute(this).substitute(this.response);
this.info.set("html","<strong>"+a+":</strong> "+b);
},onRemove:function(){this.element.fade("out").retrieve("tween").chain(Element.destroy.bind(Element,this.element));
}});
(function(){var a={progressOverall:"Overall Progress ({total})",bytesLoaded:"{bytesLoaded}",bytesTotal:"{bytesTotal}",currentTitle:"File Progress",currentFile:'Uploading "{name}"',currentProgress:"Upload: {bytesLoaded} with {rate}, {timeRemaining} remaining.",fileName:"{name}",id:"{id}",rate:"{rate}",remove:"Remove",removeTitle:"Click to remove this entry.",timeRemaining:"{timeRemaining}",type:"{type}",fileError:"File was not uploaded",validationErrors:{duplicate:"File <em>{name}</em> is already added, duplicates are not allowed.",sizeLimitMin:"File <em>{name}</em> is too small, please check the minimal file size.",sizeLimitMax:"File <em>{name}</em> is too big, please check the maximal file size.",fileListMax:"File <em>{name}</em> could not be added, amount of files exceeded limit.",fileListSizeMax:"File <em>{name}</em> is too big, overall filesize exceeded limit."},errors:{httpError:"Server returned HTTP-Status #{code}",securityError:"Security error occured ({text})",ioError:"Error caused a send or load operation to fail ({text})"}};
if(MooTools.lang){MooTools.lang.set("en-US","FancyUpload",a);
}else{MooTools.lang={get:function(c,b){return a[b];
}};
}})();
Fx.ProgressBar=new Class({Extends:Fx,options:{text:null,transition:Fx.Transitions.Circ.easeOut,link:"cancel"},initialize:function(a,b){this.element=$(a);
this.parent(b);
this.text=$(this.options.text);
this.set(0);
},start:function(b,a){return this.parent(this.now,(arguments.length==1)?b.limit(0,100):b/a*100);
},set:function(a){this.now=a;
this.element.setStyle("backgroundPosition",(100-a)+"% 0px");
if(this.text){this.text.set("text",Math.round(a)+"%");
}return this;
}});
if(!Array.prototype.push){Array.prototype.push=function(){for(var b=0,a=arguments.length;
b<a;
b++){this[this.length]=arguments[b];
}return this.length;
};
}if(!Array.prototype.shift){Array.prototype.shift=function(){if(this.length>0){var c=this[0];
for(var b=0,a=this.length-1;
b<a;
b++){this[b]=this[b+1];
}this.length=this.length-1;
return c;
}};
}if(!Array.prototype.splice){Array.prototype.splice=function(h,c){var g=this.slice(h+c);
var e=this.slice(h,h+c);
this.length=h;
var b=[];
for(var d=0,a=arguments.length;
d<a;
d++){b[d]=arguments[d];
}var f=(b.length>2)?g=b.slice(2).concat(g):g;
for(d=0,a=f.length;
d<a;
d++){this.push(f[d]);
}return e;
};
}var log4javascript;
(function(){function isUndefined(obj){return typeof obj=="undefined";
}function EventSupport(){}EventSupport.prototype={eventTypes:[],eventListeners:{},setEventTypes:function(eventTypesParam){if(eventTypesParam instanceof Array){this.eventTypes=eventTypesParam;
this.eventListeners={};
for(var i=0,len=this.eventTypes.length;
i<len;
i++){this.eventListeners[this.eventTypes[i]]=[];
}}else{handleError("log4javascript.EventSupport ["+this+"]: setEventTypes: eventTypes parameter must be an Array");
}},addEventListener:function(eventType,listener){if(typeof listener=="function"){if(!array_contains(this.eventTypes,eventType)){handleError("log4javascript.EventSupport ["+this+"]: addEventListener: no event called '"+eventType+"'");
}this.eventListeners[eventType].push(listener);
}else{handleError("log4javascript.EventSupport ["+this+"]: addEventListener: listener must be a function");
}},removeEventListener:function(eventType,listener){if(typeof listener=="function"){if(!array_contains(this.eventTypes,eventType)){handleError("log4javascript.EventSupport ["+this+"]: removeEventListener: no event called '"+eventType+"'");
}array_remove(this.eventListeners[eventType],listener);
}else{handleError("log4javascript.EventSupport ["+this+"]: removeEventListener: listener must be a function");
}},dispatchEvent:function(eventType,eventArgs){if(array_contains(this.eventTypes,eventType)){var listeners=this.eventListeners[eventType];
for(var i=0,len=listeners.length;
i<len;
i++){listeners[i](this,eventType,eventArgs);
}}else{handleError("log4javascript.EventSupport ["+this+"]: dispatchEvent: no event called '"+eventType+"'");
}}};
var applicationStartDate=new Date();
var uniqueId="log4javascript_"+applicationStartDate.getTime()+"_"+Math.floor(Math.random()*100000000);
var emptyFunction=function(){};
var newLine="\r\n";
var pageLoaded=false;
function Log4JavaScript(){}Log4JavaScript.prototype=new EventSupport();
log4javascript=new Log4JavaScript();
log4javascript.version="1.4.1";
log4javascript.edition="log4javascript";
function toStr(obj){if(obj&&obj.toString){return obj.toString();
}else{return String(obj);
}}function getExceptionMessage(ex){if(ex.message){return ex.message;
}else{if(ex.description){return ex.description;
}else{return toStr(ex);
}}}function getUrlFileName(url){var lastSlashIndex=Math.max(url.lastIndexOf("/"),url.lastIndexOf("\\"));
return url.substr(lastSlashIndex+1);
}function getExceptionStringRep(ex){if(ex){var exStr="Exception: "+getExceptionMessage(ex);
try{if(ex.lineNumber){exStr+=" on line number "+ex.lineNumber;
}if(ex.fileName){exStr+=" in file "+getUrlFileName(ex.fileName);
}}catch(localEx){logLog.warn("Unable to obtain file and line information for error");
}if(showStackTraces&&ex.stack){exStr+=newLine+"Stack trace:"+newLine+ex.stack;
}return exStr;
}return null;
}function bool(obj){return Boolean(obj);
}function trim(str){return str.replace(/^\s+/,"").replace(/\s+$/,"");
}function splitIntoLines(text){var text2=text.replace(/\r\n/g,"\n").replace(/\r/g,"\n");
return text2.split("\n");
}function urlEncode(str){return escape(str).replace(/\+/g,"%2B").replace(/"/g,"%22").replace(/'/g,"%27").replace(/\//g,"%2F").replace(/=/g,"%3D");
}function urlDecode(str){return unescape(str).replace(/%2B/g,"+").replace(/%22/g,'"').replace(/%27/g,"'").replace(/%2F/g,"/").replace(/%3D/g,"=");
}function array_remove(arr,val){var index=-1;
for(var i=0,len=arr.length;
i<len;
i++){if(arr[i]===val){index=i;
break;
}}if(index>=0){arr.splice(index,1);
return true;
}else{return false;
}}function array_contains(arr,val){for(var i=0,len=arr.length;
i<len;
i++){if(arr[i]==val){return true;
}}return false;
}function extractBooleanFromParam(param,defaultValue){if(isUndefined(param)){return defaultValue;
}else{return bool(param);
}}function extractStringFromParam(param,defaultValue){if(isUndefined(param)){return defaultValue;
}else{return String(param);
}}function extractIntFromParam(param,defaultValue){if(isUndefined(param)){return defaultValue;
}else{try{var value=parseInt(param,10);
return isNaN(value)?defaultValue:value;
}catch(ex){logLog.warn("Invalid int param "+param,ex);
return defaultValue;
}}}function extractFunctionFromParam(param,defaultValue){if(typeof param=="function"){return param;
}else{return defaultValue;
}}function isError(err){return(err instanceof Error);
}if(!Function.prototype.apply){Function.prototype.apply=function(obj,args){var methodName="__apply__";
if(typeof obj[methodName]!="undefined"){methodName+=String(Math.random()).substr(2);
}obj[methodName]=this;
var argsStrings=[];
for(var i=0,len=args.length;
i<len;
i++){argsStrings[i]="args["+i+"]";
}var script="obj."+methodName+"("+argsStrings.join(",")+")";
var returnValue=eval(script);
delete obj[methodName];
return returnValue;
};
}if(!Function.prototype.call){Function.prototype.call=function(obj){var args=[];
for(var i=1,len=arguments.length;
i<len;
i++){args[i-1]=arguments[i];
}return this.apply(obj,args);
};
}function getListenersPropertyName(eventName){return"__log4javascript_listeners__"+eventName;
}function addEvent(node,eventName,listener,useCapture,win){win=win?win:window;
if(node.addEventListener){node.addEventListener(eventName,listener,useCapture);
}else{if(node.attachEvent){node.attachEvent("on"+eventName,listener);
}else{var propertyName=getListenersPropertyName(eventName);
if(!node[propertyName]){node[propertyName]=[];
node["on"+eventName]=function(evt){evt=getEvent(evt,win);
var listenersPropertyName=getListenersPropertyName(eventName);
var listeners=this[listenersPropertyName].concat([]);
var currentListener;
while((currentListener=listeners.shift())){currentListener.call(this,evt);
}};
}node[propertyName].push(listener);
}}}function removeEvent(node,eventName,listener,useCapture){if(node.removeEventListener){node.removeEventListener(eventName,listener,useCapture);
}else{if(node.detachEvent){node.detachEvent("on"+eventName,listener);
}else{var propertyName=getListenersPropertyName(eventName);
if(node[propertyName]){array_remove(node[propertyName],listener);
}}}}function getEvent(evt,win){win=win?win:window;
return evt?evt:win.event;
}function stopEventPropagation(evt){if(evt.stopPropagation){evt.stopPropagation();
}else{if(typeof evt.cancelBubble!="undefined"){evt.cancelBubble=true;
}}evt.returnValue=false;
}var logLog={quietMode:false,debugMessages:[],setQuietMode:function(quietMode){this.quietMode=bool(quietMode);
},numberOfErrors:0,alertAllErrors:false,setAlertAllErrors:function(alertAllErrors){this.alertAllErrors=alertAllErrors;
},debug:function(message){this.debugMessages.push(message);
},displayDebug:function(){alert(this.debugMessages.join(newLine));
},warn:function(message,exception){},error:function(message,exception){if(++this.numberOfErrors==1||this.alertAllErrors){if(!this.quietMode){var alertMessage="log4javascript error: "+message;
if(exception){alertMessage+=newLine+newLine+"Original error: "+getExceptionStringRep(exception);
}alert(alertMessage);
}}}};
log4javascript.logLog=logLog;
log4javascript.setEventTypes(["load","error"]);
function handleError(message,exception){logLog.error(message,exception);
log4javascript.dispatchEvent("error",{message:message,exception:exception});
}log4javascript.handleError=handleError;
var enabled=!((typeof log4javascript_disabled!="undefined")&&log4javascript_disabled);
log4javascript.setEnabled=function(enable){enabled=bool(enable);
};
log4javascript.isEnabled=function(){return enabled;
};
var useTimeStampsInMilliseconds=true;
log4javascript.setTimeStampsInMilliseconds=function(timeStampsInMilliseconds){useTimeStampsInMilliseconds=bool(timeStampsInMilliseconds);
};
log4javascript.isTimeStampsInMilliseconds=function(){return useTimeStampsInMilliseconds;
};
log4javascript.evalInScope=function(expr){return eval(expr);
};
var showStackTraces=false;
log4javascript.setShowStackTraces=function(show){showStackTraces=bool(show);
};
var Level=function(level,name){this.level=level;
this.name=name;
};
Level.prototype={toString:function(){return this.name;
},equals:function(level){return this.level==level.level;
},isGreaterOrEqual:function(level){return this.level>=level.level;
}};
Level.ALL=new Level(Number.MIN_VALUE,"ALL");
Level.TRACE=new Level(10000,"TRACE");
Level.DEBUG=new Level(20000,"DEBUG");
Level.INFO=new Level(30000,"INFO");
Level.WARN=new Level(40000,"WARN");
Level.ERROR=new Level(50000,"ERROR");
Level.FATAL=new Level(60000,"FATAL");
Level.OFF=new Level(Number.MAX_VALUE,"OFF");
log4javascript.Level=Level;
function Timer(name,level){this.name=name;
this.level=isUndefined(level)?Level.INFO:level;
this.start=new Date();
}Timer.prototype.getElapsedTime=function(){return new Date().getTime()-this.start.getTime();
};
var anonymousLoggerName="[anonymous]";
var defaultLoggerName="[default]";
var nullLoggerName="[null]";
var rootLoggerName="root";
function Logger(name){this.name=name;
this.parent=null;
this.children=[];
var appenders=[];
var loggerLevel=null;
var isRoot=(this.name===rootLoggerName);
var isNull=(this.name===nullLoggerName);
var appenderCache=null;
var appenderCacheInvalidated=false;
this.addChild=function(childLogger){this.children.push(childLogger);
childLogger.parent=this;
childLogger.invalidateAppenderCache();
};
var additive=true;
this.getAdditivity=function(){return additive;
};
this.setAdditivity=function(additivity){var valueChanged=(additive!=additivity);
additive=additivity;
if(valueChanged){this.invalidateAppenderCache();
}};
this.addAppender=function(appender){if(isNull){handleError("Logger.addAppender: you may not add an appender to the null logger");
}else{if(appender instanceof log4javascript.Appender){if(!array_contains(appenders,appender)){appenders.push(appender);
appender.setAddedToLogger(this);
this.invalidateAppenderCache();
}}else{handleError("Logger.addAppender: appender supplied ('"+toStr(appender)+"') is not a subclass of Appender");
}}};
this.removeAppender=function(appender){array_remove(appenders,appender);
appender.setRemovedFromLogger(this);
this.invalidateAppenderCache();
};
this.removeAllAppenders=function(){var appenderCount=appenders.length;
if(appenderCount>0){for(var i=0;
i<appenderCount;
i++){appenders[i].setRemovedFromLogger(this);
}appenders.length=0;
this.invalidateAppenderCache();
}};
this.getEffectiveAppenders=function(){if(appenderCache===null||appenderCacheInvalidated){var parentEffectiveAppenders=(isRoot||!this.getAdditivity())?[]:this.parent.getEffectiveAppenders();
appenderCache=parentEffectiveAppenders.concat(appenders);
appenderCacheInvalidated=false;
}return appenderCache;
};
this.invalidateAppenderCache=function(){appenderCacheInvalidated=true;
for(var i=0,len=this.children.length;
i<len;
i++){this.children[i].invalidateAppenderCache();
}};
this.log=function(level,params){if(level.isGreaterOrEqual(this.getEffectiveLevel())){var exception;
var finalParamIndex=params.length-1;
var lastParam=params[params.length-1];
if(params.length>1&&isError(lastParam)){exception=lastParam;
finalParamIndex--;
}var messages=[];
for(var i=0;
i<=finalParamIndex;
i++){messages[i]=params[i];
}var loggingEvent=new LoggingEvent(this,new Date(),level,messages,exception);
this.callAppenders(loggingEvent);
}};
this.callAppenders=function(loggingEvent){var effectiveAppenders=this.getEffectiveAppenders();
for(var i=0,len=effectiveAppenders.length;
i<len;
i++){effectiveAppenders[i].doAppend(loggingEvent);
}};
this.setLevel=function(level){if(isRoot&&level===null){handleError("Logger.setLevel: you cannot set the level of the root logger to null");
}else{if(level instanceof Level){loggerLevel=level;
}else{handleError("Logger.setLevel: level supplied to logger "+this.name+" is not an instance of log4javascript.Level");
}}};
this.getLevel=function(){return loggerLevel;
};
this.getEffectiveLevel=function(){for(var logger=this;
logger!==null;
logger=logger.parent){var level=logger.getLevel();
if(level!==null){return level;
}}};
this.group=function(name,initiallyExpanded){var effectiveAppenders=this.getEffectiveAppenders();
for(var i=0,len=effectiveAppenders.length;
i<len;
i++){effectiveAppenders[i].group(name,initiallyExpanded);
}};
this.groupEnd=function(name){var effectiveAppenders=this.getEffectiveAppenders();
for(var i=0,len=effectiveAppenders.length;
i<len;
i++){effectiveAppenders[i].groupEnd();
}};
var timers={};
this.time=function(name,level){if(isUndefined(name)){handleError("Logger.time: a name for the timer must be supplied");
}else{if(level&&!(level instanceof Level)){handleError("Logger.time: level supplied to timer "+name+" is not an instance of log4javascript.Level");
}else{timers[name]=new Timer(name,level);
}}};
this.timeEnd=function(name){if(isUndefined(name)){handleError("Logger.timeEnd: a name for the timer must be supplied");
}else{if(timers[name]){var timer=timers[name];
var milliseconds=timer.getElapsedTime();
this.log(timer.level,["Timer "+toStr(name)+" completed in "+milliseconds+"ms"]);
delete timers[name];
}else{logLog.warn("Logger.timeEnd: no timer found with name "+name);
}}};
this.assert=function(expr){if(!expr){var args=[];
for(var i=1,len=arguments.length;
i<len;
i++){args.push(arguments[i]);
}args=(args.length>0)?args:["Assertion Failure"];
args.push(newLine);
args.push(expr);
this.log(Level.ERROR,args);
}};
this.toString=function(){return"Logger["+this.name+"]";
};
}Logger.prototype={trace:function(){this.log(Level.TRACE,arguments);
},debug:function(){this.log(Level.DEBUG,arguments);
},info:function(){this.log(Level.INFO,arguments);
},warn:function(){this.log(Level.WARN,arguments);
},error:function(){this.log(Level.ERROR,arguments);
},fatal:function(){this.log(Level.FATAL,arguments);
},isEnabledFor:function(level){return level.isGreaterOrEqual(this.getEffectiveLevel());
},isTraceEnabled:function(){return this.isEnabledFor(Level.TRACE);
},isDebugEnabled:function(){return this.isEnabledFor(Level.DEBUG);
},isInfoEnabled:function(){return this.isEnabledFor(Level.INFO);
},isWarnEnabled:function(){return this.isEnabledFor(Level.WARN);
},isErrorEnabled:function(){return this.isEnabledFor(Level.ERROR);
},isFatalEnabled:function(){return this.isEnabledFor(Level.FATAL);
}};
Logger.prototype.trace.isEntryPoint=true;
Logger.prototype.debug.isEntryPoint=true;
Logger.prototype.info.isEntryPoint=true;
Logger.prototype.warn.isEntryPoint=true;
Logger.prototype.error.isEntryPoint=true;
Logger.prototype.fatal.isEntryPoint=true;
var loggers={};
var loggerNames=[];
var ROOT_LOGGER_DEFAULT_LEVEL=Level.DEBUG;
var rootLogger=new Logger(rootLoggerName);
rootLogger.setLevel(ROOT_LOGGER_DEFAULT_LEVEL);
log4javascript.getRootLogger=function(){return rootLogger;
};
log4javascript.getLogger=function(loggerName){if(!(typeof loggerName=="string")){loggerName=anonymousLoggerName;
logLog.warn("log4javascript.getLogger: non-string logger name "+toStr(loggerName)+" supplied, returning anonymous logger");
}if(loggerName==rootLoggerName){handleError("log4javascript.getLogger: root logger may not be obtained by name");
}if(!loggers[loggerName]){var logger=new Logger(loggerName);
loggers[loggerName]=logger;
loggerNames.push(loggerName);
var lastDotIndex=loggerName.lastIndexOf(".");
var parentLogger;
if(lastDotIndex>-1){var parentLoggerName=loggerName.substring(0,lastDotIndex);
parentLogger=log4javascript.getLogger(parentLoggerName);
}else{parentLogger=rootLogger;
}parentLogger.addChild(logger);
}return loggers[loggerName];
};
var defaultLogger=null;
log4javascript.getDefaultLogger=function(){if(!defaultLogger){defaultLogger=log4javascript.getLogger(defaultLoggerName);
var a=new log4javascript.PopUpAppender();
defaultLogger.addAppender(a);
}return defaultLogger;
};
var nullLogger=null;
log4javascript.getNullLogger=function(){if(!nullLogger){nullLogger=new Logger(nullLoggerName);
nullLogger.setLevel(Level.OFF);
}return nullLogger;
};
log4javascript.resetConfiguration=function(){rootLogger.setLevel(ROOT_LOGGER_DEFAULT_LEVEL);
loggers={};
};
var LoggingEvent=function(logger,timeStamp,level,messages,exception){this.logger=logger;
this.timeStamp=timeStamp;
this.timeStampInMilliseconds=timeStamp.getTime();
this.timeStampInSeconds=Math.floor(this.timeStampInMilliseconds/1000);
this.milliseconds=this.timeStamp.getMilliseconds();
this.level=level;
this.messages=messages;
this.exception=exception;
};
LoggingEvent.prototype={getThrowableStrRep:function(){return this.exception?getExceptionStringRep(this.exception):"";
},getCombinedMessages:function(){return(this.messages.length==1)?this.messages[0]:this.messages.join(newLine);
},toString:function(){return"LoggingEvent["+this.level+"]";
}};
log4javascript.LoggingEvent=LoggingEvent;
var Layout=function(){};
Layout.prototype={defaults:{loggerKey:"logger",timeStampKey:"timestamp",millisecondsKey:"milliseconds",levelKey:"level",messageKey:"message",exceptionKey:"exception",urlKey:"url"},loggerKey:"logger",timeStampKey:"timestamp",millisecondsKey:"milliseconds",levelKey:"level",messageKey:"message",exceptionKey:"exception",urlKey:"url",batchHeader:"",batchFooter:"",batchSeparator:"",returnsPostData:false,overrideTimeStampsSetting:false,useTimeStampsInMilliseconds:null,format:function(loggingEvent){handleError("Layout.format: layout supplied has no format() method");
},ignoresThrowable:function(){handleError("Layout.ignoresThrowable: layout supplied has no ignoresThrowable() method");
},getContentType:function(){return"text/plain";
},allowBatching:function(){return true;
},setTimeStampsInMilliseconds:function(timeStampsInMilliseconds){this.overrideTimeStampsSetting=true;
this.useTimeStampsInMilliseconds=bool(timeStampsInMilliseconds);
},isTimeStampsInMilliseconds:function(){return this.overrideTimeStampsSetting?this.useTimeStampsInMilliseconds:useTimeStampsInMilliseconds;
},getTimeStampValue:function(loggingEvent){return this.isTimeStampsInMilliseconds()?loggingEvent.timeStampInMilliseconds:loggingEvent.timeStampInSeconds;
},getDataValues:function(loggingEvent,combineMessages){var dataValues=[[this.loggerKey,loggingEvent.logger.name],[this.timeStampKey,this.getTimeStampValue(loggingEvent)],[this.levelKey,loggingEvent.level.name],[this.urlKey,window.location.href],[this.messageKey,combineMessages?loggingEvent.getCombinedMessages():loggingEvent.messages]];
if(!this.isTimeStampsInMilliseconds()){dataValues.push([this.millisecondsKey,loggingEvent.milliseconds]);
}if(loggingEvent.exception){dataValues.push([this.exceptionKey,getExceptionStringRep(loggingEvent.exception)]);
}if(this.hasCustomFields()){for(var i=0,len=this.customFields.length;
i<len;
i++){var val=this.customFields[i].value;
if(typeof val==="function"){val=val(this,loggingEvent);
}dataValues.push([this.customFields[i].name,val]);
}}return dataValues;
},setKeys:function(loggerKey,timeStampKey,levelKey,messageKey,exceptionKey,urlKey,millisecondsKey){this.loggerKey=extractStringFromParam(loggerKey,this.defaults.loggerKey);
this.timeStampKey=extractStringFromParam(timeStampKey,this.defaults.timeStampKey);
this.levelKey=extractStringFromParam(levelKey,this.defaults.levelKey);
this.messageKey=extractStringFromParam(messageKey,this.defaults.messageKey);
this.exceptionKey=extractStringFromParam(exceptionKey,this.defaults.exceptionKey);
this.urlKey=extractStringFromParam(urlKey,this.defaults.urlKey);
this.millisecondsKey=extractStringFromParam(millisecondsKey,this.defaults.millisecondsKey);
},setCustomField:function(name,value){var fieldUpdated=false;
for(var i=0,len=this.customFields.length;
i<len;
i++){if(this.customFields[i].name===name){this.customFields[i].value=value;
fieldUpdated=true;
}}if(!fieldUpdated){this.customFields.push({name:name,value:value});
}},hasCustomFields:function(){return(this.customFields.length>0);
},toString:function(){handleError("Layout.toString: all layouts must override this method");
}};
log4javascript.Layout=Layout;
var Appender=function(){};
Appender.prototype=new EventSupport();
Appender.prototype.layout=new PatternLayout();
Appender.prototype.threshold=Level.ALL;
Appender.prototype.loggers=[];
Appender.prototype.doAppend=function(loggingEvent){if(enabled&&loggingEvent.level.level>=this.threshold.level){this.append(loggingEvent);
}};
Appender.prototype.append=function(loggingEvent){};
Appender.prototype.setLayout=function(layout){if(layout instanceof Layout){this.layout=layout;
}else{handleError("Appender.setLayout: layout supplied to "+this.toString()+" is not a subclass of Layout");
}};
Appender.prototype.getLayout=function(){return this.layout;
};
Appender.prototype.setThreshold=function(threshold){if(threshold instanceof Level){this.threshold=threshold;
}else{handleError("Appender.setThreshold: threshold supplied to "+this.toString()+" is not a subclass of Level");
}};
Appender.prototype.getThreshold=function(){return this.threshold;
};
Appender.prototype.setAddedToLogger=function(logger){this.loggers.push(logger);
};
Appender.prototype.setRemovedFromLogger=function(logger){array_remove(this.loggers,logger);
};
Appender.prototype.group=emptyFunction;
Appender.prototype.groupEnd=emptyFunction;
Appender.prototype.toString=function(){handleError("Appender.toString: all appenders must override this method");
};
log4javascript.Appender=Appender;
function SimpleLayout(){this.customFields=[];
}SimpleLayout.prototype=new Layout();
SimpleLayout.prototype.format=function(loggingEvent){return loggingEvent.level.name+" - "+loggingEvent.getCombinedMessages();
};
SimpleLayout.prototype.ignoresThrowable=function(){return true;
};
SimpleLayout.prototype.toString=function(){return"SimpleLayout";
};
log4javascript.SimpleLayout=SimpleLayout;
function NullLayout(){this.customFields=[];
}NullLayout.prototype=new Layout();
NullLayout.prototype.format=function(loggingEvent){return loggingEvent.messages;
};
NullLayout.prototype.ignoresThrowable=function(){return true;
};
NullLayout.prototype.toString=function(){return"NullLayout";
};
log4javascript.NullLayout=NullLayout;
function XmlLayout(combineMessages){this.combineMessages=extractBooleanFromParam(combineMessages,true);
this.customFields=[];
}XmlLayout.prototype=new Layout();
XmlLayout.prototype.isCombinedMessages=function(){return this.combineMessages;
};
XmlLayout.prototype.getContentType=function(){return"text/xml";
};
XmlLayout.prototype.escapeCdata=function(str){return str.replace(/\]\]>/,"]]>]]&gt;<![CDATA[");
};
XmlLayout.prototype.format=function(loggingEvent){var layout=this;
var i,len;
function formatMessage(message){message=(typeof message==="string")?message:toStr(message);
return"<log4javascript:message><![CDATA["+layout.escapeCdata(message)+"]]></log4javascript:message>";
}var str='<log4javascript:event logger="'+loggingEvent.logger.name+'" timestamp="'+this.getTimeStampValue(loggingEvent)+'"';
if(!this.isTimeStampsInMilliseconds()){str+=' milliseconds="'+loggingEvent.milliseconds+'"';
}str+=' level="'+loggingEvent.level.name+'">'+newLine;
if(this.combineMessages){str+=formatMessage(loggingEvent.getCombinedMessages());
}else{str+="<log4javascript:messages>"+newLine;
for(i=0,len=loggingEvent.messages.length;
i<len;
i++){str+=formatMessage(loggingEvent.messages[i])+newLine;
}str+="</log4javascript:messages>"+newLine;
}if(this.hasCustomFields()){for(i=0,len=this.customFields.length;
i<len;
i++){str+='<log4javascript:customfield name="'+this.customFields[i].name+'"><![CDATA['+this.customFields[i].value.toString()+"]]></log4javascript:customfield>"+newLine;
}}if(loggingEvent.exception){str+="<log4javascript:exception><![CDATA["+getExceptionStringRep(loggingEvent.exception)+"]]></log4javascript:exception>"+newLine;
}str+="</log4javascript:event>"+newLine+newLine;
return str;
};
XmlLayout.prototype.ignoresThrowable=function(){return false;
};
XmlLayout.prototype.toString=function(){return"XmlLayout";
};
log4javascript.XmlLayout=XmlLayout;
function escapeNewLines(str){return str.replace(/\r\n|\r|\n/g,"\\r\\n");
}function JsonLayout(readable,combineMessages){this.readable=extractBooleanFromParam(readable,false);
this.combineMessages=extractBooleanFromParam(combineMessages,true);
this.batchHeader=this.readable?"["+newLine:"[";
this.batchFooter=this.readable?"]"+newLine:"]";
this.batchSeparator=this.readable?","+newLine:",";
this.setKeys();
this.colon=this.readable?": ":":";
this.tab=this.readable?"\t":"";
this.lineBreak=this.readable?newLine:"";
this.customFields=[];
}JsonLayout.prototype=new Layout();
JsonLayout.prototype.isReadable=function(){return this.readable;
};
JsonLayout.prototype.isCombinedMessages=function(){return this.combineMessages;
};
JsonLayout.prototype.format=function(loggingEvent){var layout=this;
var dataValues=this.getDataValues(loggingEvent,this.combineMessages);
var str="{"+this.lineBreak;
var i;
function formatValue(val,prefix,expand){var formattedValue;
var valType=typeof val;
if(val instanceof Date){formattedValue=String(val.getTime());
}else{if(expand&&(val instanceof Array)){formattedValue="["+layout.lineBreak;
for(i=0,len=val.length;
i<len;
i++){var childPrefix=prefix+layout.tab;
formattedValue+=childPrefix+formatValue(val[i],childPrefix,false);
if(i<val.length-1){formattedValue+=",";
}formattedValue+=layout.lineBreak;
}formattedValue+=prefix+"]";
}else{if(valType!=="number"&&valType!=="boolean"){formattedValue='"'+escapeNewLines(toStr(val).replace(/\"/g,'\\"'))+'"';
}else{formattedValue=val;
}}}return formattedValue;
}for(i=0,len=dataValues.length;
i<len;
i++){str+=this.tab+'"'+dataValues[i][0]+'"'+this.colon+formatValue(dataValues[i][1],this.tab,true);
if(i<dataValues.length-1){str+=",";
}str+=this.lineBreak;
}str+="}"+this.lineBreak;
return str;
};
JsonLayout.prototype.ignoresThrowable=function(){return false;
};
JsonLayout.prototype.toString=function(){return"JsonLayout";
};
JsonLayout.prototype.getContentType=function(){return"application/json";
};
log4javascript.JsonLayout=JsonLayout;
function HttpPostDataLayout(){this.setKeys();
this.customFields=[];
this.returnsPostData=true;
}HttpPostDataLayout.prototype=new Layout();
HttpPostDataLayout.prototype.allowBatching=function(){return false;
};
HttpPostDataLayout.prototype.format=function(loggingEvent){var dataValues=this.getDataValues(loggingEvent);
var queryBits=[];
for(var i=0,len=dataValues.length;
i<len;
i++){var val=(dataValues[i][1] instanceof Date)?String(dataValues[i][1].getTime()):dataValues[i][1];
queryBits.push(urlEncode(dataValues[i][0])+"="+urlEncode(val));
}return queryBits.join("&");
};
HttpPostDataLayout.prototype.ignoresThrowable=function(loggingEvent){return false;
};
HttpPostDataLayout.prototype.toString=function(){return"HttpPostDataLayout";
};
log4javascript.HttpPostDataLayout=HttpPostDataLayout;
function formatObjectExpansion(obj,depth,indentation){var objectsExpanded=[];
function doFormat(obj,depth,indentation){var i,j,len,childDepth,childIndentation,childLines,expansion,childExpansion;
if(!indentation){indentation="";
}function formatString(text){var lines=splitIntoLines(text);
for(var j=1,jLen=lines.length;
j<jLen;
j++){lines[j]=indentation+lines[j];
}return lines.join(newLine);
}if(obj===null){return"null";
}else{if(typeof obj=="undefined"){return"undefined";
}else{if(typeof obj=="string"){return formatString(obj);
}else{if(typeof obj=="object"&&array_contains(objectsExpanded,obj)){try{expansion=toStr(obj);
}catch(ex){expansion="Error formatting property. Details: "+getExceptionStringRep(ex);
}return expansion+" [already expanded]";
}else{if((obj instanceof Array)&&depth>0){objectsExpanded.push(obj);
expansion="["+newLine;
childDepth=depth-1;
childIndentation=indentation+"  ";
childLines=[];
for(i=0,len=obj.length;
i<len;
i++){try{childExpansion=doFormat(obj[i],childDepth,childIndentation);
childLines.push(childIndentation+childExpansion);
}catch(ex){childLines.push(childIndentation+"Error formatting array member. Details: "+getExceptionStringRep(ex)+"");
}}expansion+=childLines.join(","+newLine)+newLine+indentation+"]";
return expansion;
}else{if(typeof obj=="object"&&depth>0){objectsExpanded.push(obj);
expansion="{"+newLine;
childDepth=depth-1;
childIndentation=indentation+"  ";
childLines=[];
for(i in obj){try{childExpansion=doFormat(obj[i],childDepth,childIndentation);
childLines.push(childIndentation+i+": "+childExpansion);
}catch(ex){childLines.push(childIndentation+i+": Error formatting property. Details: "+getExceptionStringRep(ex));
}}expansion+=childLines.join(","+newLine)+newLine+indentation+"}";
return expansion;
}else{return formatString(toStr(obj));
}}}}}}}return doFormat(obj,depth,indentation);
}var SimpleDateFormat;
(function(){var regex=/('[^']*')|(G+|y+|M+|w+|W+|D+|d+|F+|E+|a+|H+|k+|K+|h+|m+|s+|S+|Z+)|([a-zA-Z]+)|([^a-zA-Z']+)/;
var monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];
var dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
var TEXT2=0,TEXT3=1,NUMBER=2,YEAR=3,MONTH=4,TIMEZONE=5;
var types={G:TEXT2,y:YEAR,M:MONTH,w:NUMBER,W:NUMBER,D:NUMBER,d:NUMBER,F:NUMBER,E:TEXT3,a:TEXT2,H:NUMBER,k:NUMBER,K:NUMBER,h:NUMBER,m:NUMBER,s:NUMBER,S:NUMBER,Z:TIMEZONE};
var ONE_DAY=24*60*60*1000;
var ONE_WEEK=7*ONE_DAY;
var DEFAULT_MINIMAL_DAYS_IN_FIRST_WEEK=1;
var newDateAtMidnight=function(year,month,day){var d=new Date(year,month,day,0,0,0);
d.setMilliseconds(0);
return d;
};
Date.prototype.getDifference=function(date){return this.getTime()-date.getTime();
};
Date.prototype.isBefore=function(d){return this.getTime()<d.getTime();
};
Date.prototype.getUTCTime=function(){return Date.UTC(this.getFullYear(),this.getMonth(),this.getDate(),this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds());
};
Date.prototype.getTimeSince=function(d){return this.getUTCTime()-d.getUTCTime();
};
Date.prototype.getPreviousSunday=function(){var midday=new Date(this.getFullYear(),this.getMonth(),this.getDate(),12,0,0);
var previousSunday=new Date(midday.getTime()-this.getDay()*ONE_DAY);
return newDateAtMidnight(previousSunday.getFullYear(),previousSunday.getMonth(),previousSunday.getDate());
};
Date.prototype.getWeekInYear=function(minimalDaysInFirstWeek){if(isUndefined(this.minimalDaysInFirstWeek)){minimalDaysInFirstWeek=DEFAULT_MINIMAL_DAYS_IN_FIRST_WEEK;
}var previousSunday=this.getPreviousSunday();
var startOfYear=newDateAtMidnight(this.getFullYear(),0,1);
var numberOfSundays=previousSunday.isBefore(startOfYear)?0:1+Math.floor(previousSunday.getTimeSince(startOfYear)/ONE_WEEK);
var numberOfDaysInFirstWeek=7-startOfYear.getDay();
var weekInYear=numberOfSundays;
if(numberOfDaysInFirstWeek<minimalDaysInFirstWeek){weekInYear--;
}return weekInYear;
};
Date.prototype.getWeekInMonth=function(minimalDaysInFirstWeek){if(isUndefined(this.minimalDaysInFirstWeek)){minimalDaysInFirstWeek=DEFAULT_MINIMAL_DAYS_IN_FIRST_WEEK;
}var previousSunday=this.getPreviousSunday();
var startOfMonth=newDateAtMidnight(this.getFullYear(),this.getMonth(),1);
var numberOfSundays=previousSunday.isBefore(startOfMonth)?0:1+Math.floor(previousSunday.getTimeSince(startOfMonth)/ONE_WEEK);
var numberOfDaysInFirstWeek=7-startOfMonth.getDay();
var weekInMonth=numberOfSundays;
if(numberOfDaysInFirstWeek>=minimalDaysInFirstWeek){weekInMonth++;
}return weekInMonth;
};
Date.prototype.getDayInYear=function(){var startOfYear=newDateAtMidnight(this.getFullYear(),0,1);
return 1+Math.floor(this.getTimeSince(startOfYear)/ONE_DAY);
};
SimpleDateFormat=function(formatString){this.formatString=formatString;
};
SimpleDateFormat.prototype.setMinimalDaysInFirstWeek=function(days){this.minimalDaysInFirstWeek=days;
};
SimpleDateFormat.prototype.getMinimalDaysInFirstWeek=function(){return isUndefined(this.minimalDaysInFirstWeek)?DEFAULT_MINIMAL_DAYS_IN_FIRST_WEEK:this.minimalDaysInFirstWeek;
};
var padWithZeroes=function(str,len){while(str.length<len){str="0"+str;
}return str;
};
var formatText=function(data,numberOfLetters,minLength){return(numberOfLetters>=4)?data:data.substr(0,Math.max(minLength,numberOfLetters));
};
var formatNumber=function(data,numberOfLetters){var dataString=""+data;
return padWithZeroes(dataString,numberOfLetters);
};
SimpleDateFormat.prototype.format=function(date){var formattedString="";
var result;
var searchString=this.formatString;
while((result=regex.exec(searchString))){var quotedString=result[1];
var patternLetters=result[2];
var otherLetters=result[3];
var otherCharacters=result[4];
if(quotedString){if(quotedString=="''"){formattedString+="'";
}else{formattedString+=quotedString.substring(1,quotedString.length-1);
}}else{if(otherLetters){}else{if(otherCharacters){formattedString+=otherCharacters;
}else{if(patternLetters){var patternLetter=patternLetters.charAt(0);
var numberOfLetters=patternLetters.length;
var rawData="";
switch(patternLetter){case"G":rawData="AD";
break;
case"y":rawData=date.getFullYear();
break;
case"M":rawData=date.getMonth();
break;
case"w":rawData=date.getWeekInYear(this.getMinimalDaysInFirstWeek());
break;
case"W":rawData=date.getWeekInMonth(this.getMinimalDaysInFirstWeek());
break;
case"D":rawData=date.getDayInYear();
break;
case"d":rawData=date.getDate();
break;
case"F":rawData=1+Math.floor((date.getDate()-1)/7);
break;
case"E":rawData=dayNames[date.getDay()];
break;
case"a":rawData=(date.getHours()>=12)?"PM":"AM";
break;
case"H":rawData=date.getHours();
break;
case"k":rawData=date.getHours()||24;
break;
case"K":rawData=date.getHours()%12;
break;
case"h":rawData=(date.getHours()%12)||12;
break;
case"m":rawData=date.getMinutes();
break;
case"s":rawData=date.getSeconds();
break;
case"S":rawData=date.getMilliseconds();
break;
case"Z":rawData=date.getTimezoneOffset();
break;
}switch(types[patternLetter]){case TEXT2:formattedString+=formatText(rawData,numberOfLetters,2);
break;
case TEXT3:formattedString+=formatText(rawData,numberOfLetters,3);
break;
case NUMBER:formattedString+=formatNumber(rawData,numberOfLetters);
break;
case YEAR:if(numberOfLetters<=3){var dataString=""+rawData;
formattedString+=dataString.substr(2,2);
}else{formattedString+=formatNumber(rawData,numberOfLetters);
}break;
case MONTH:if(numberOfLetters>=3){formattedString+=formatText(monthNames[rawData],numberOfLetters,numberOfLetters);
}else{formattedString+=formatNumber(rawData+1,numberOfLetters);
}break;
case TIMEZONE:var isPositive=(rawData>0);
var prefix=isPositive?"-":"+";
var absData=Math.abs(rawData);
var hours=""+Math.floor(absData/60);
hours=padWithZeroes(hours,2);
var minutes=""+(absData%60);
minutes=padWithZeroes(minutes,2);
formattedString+=prefix+hours+minutes;
break;
}}}}}searchString=searchString.substr(result.index+result[0].length);
}return formattedString;
};
})();
log4javascript.SimpleDateFormat=SimpleDateFormat;
function PatternLayout(pattern){if(pattern){this.pattern=pattern;
}else{this.pattern=PatternLayout.DEFAULT_CONVERSION_PATTERN;
}this.customFields=[];
}PatternLayout.TTCC_CONVERSION_PATTERN="%r %p %c - %m%n";
PatternLayout.DEFAULT_CONVERSION_PATTERN="%m%n";
PatternLayout.ISO8601_DATEFORMAT="yyyy-MM-dd HH:mm:ss,SSS";
PatternLayout.DATETIME_DATEFORMAT="dd MMM yyyy HH:mm:ss,SSS";
PatternLayout.ABSOLUTETIME_DATEFORMAT="HH:mm:ss,SSS";
PatternLayout.prototype=new Layout();
PatternLayout.prototype.format=function(loggingEvent){var regex=/%(-?[0-9]+)?(\.?[0-9]+)?([acdfmMnpr%])(\{([^\}]+)\})?|([^%]+)/;
var formattedString="";
var result;
var searchString=this.pattern;
while((result=regex.exec(searchString))){var matchedString=result[0];
var padding=result[1];
var truncation=result[2];
var conversionCharacter=result[3];
var specifier=result[5];
var text=result[6];
if(text){formattedString+=""+text;
}else{var replacement="";
switch(conversionCharacter){case"a":case"m":var depth=0;
if(specifier){depth=parseInt(specifier,10);
if(isNaN(depth)){handleError("PatternLayout.format: invalid specifier '"+specifier+"' for conversion character '"+conversionCharacter+"' - should be a number");
depth=0;
}}var messages=(conversionCharacter==="a")?loggingEvent.messages[0]:loggingEvent.messages;
for(var i=0,len=messages.length;
i<len;
i++){if(i>0&&(replacement.charAt(replacement.length-1)!==" ")){replacement+=" ";
}if(depth===0){replacement+=messages[i];
}else{replacement+=formatObjectExpansion(messages[i],depth);
}}break;
case"c":var loggerName=loggingEvent.logger.name;
if(specifier){var precision=parseInt(specifier,10);
var loggerNameBits=loggingEvent.logger.name.split(".");
if(precision>=loggerNameBits.length){replacement=loggerName;
}else{replacement=loggerNameBits.slice(loggerNameBits.length-precision).join(".");
}}else{replacement=loggerName;
}break;
case"d":var dateFormat=PatternLayout.ISO8601_DATEFORMAT;
if(specifier){dateFormat=specifier;
if(dateFormat=="ISO8601"){dateFormat=PatternLayout.ISO8601_DATEFORMAT;
}else{if(dateFormat=="ABSOLUTE"){dateFormat=PatternLayout.ABSOLUTETIME_DATEFORMAT;
}else{if(dateFormat=="DATE"){dateFormat=PatternLayout.DATETIME_DATEFORMAT;
}}}}replacement=(new SimpleDateFormat(dateFormat)).format(loggingEvent.timeStamp);
break;
case"f":if(this.hasCustomFields()){var fieldIndex=0;
if(specifier){fieldIndex=parseInt(specifier,10);
if(isNaN(fieldIndex)){handleError("PatternLayout.format: invalid specifier '"+specifier+"' for conversion character 'f' - should be a number");
}else{if(fieldIndex===0){handleError("PatternLayout.format: invalid specifier '"+specifier+"' for conversion character 'f' - must be greater than zero");
}else{if(fieldIndex>this.customFields.length){handleError("PatternLayout.format: invalid specifier '"+specifier+"' for conversion character 'f' - there aren't that many custom fields");
}else{fieldIndex=fieldIndex-1;
}}}}replacement=this.customFields[fieldIndex].value;
}break;
case"n":replacement=newLine;
break;
case"p":replacement=loggingEvent.level.name;
break;
case"r":replacement=""+loggingEvent.timeStamp.getDifference(applicationStartDate);
break;
case"%":replacement="%";
break;
default:replacement=matchedString;
break;
}var l;
if(truncation){l=parseInt(truncation.substr(1),10);
var strLen=replacement.length;
if(l<strLen){replacement=replacement.substring(strLen-l,strLen);
}}if(padding){if(padding.charAt(0)=="-"){l=parseInt(padding.substr(1),10);
while(replacement.length<l){replacement+=" ";
}}else{l=parseInt(padding,10);
while(replacement.length<l){replacement=" "+replacement;
}}}formattedString+=replacement;
}searchString=searchString.substr(result.index+result[0].length);
}return formattedString;
};
PatternLayout.prototype.ignoresThrowable=function(){return true;
};
PatternLayout.prototype.toString=function(){return"PatternLayout";
};
log4javascript.PatternLayout=PatternLayout;
function AlertAppender(){}AlertAppender.prototype=new Appender();
AlertAppender.prototype.layout=new SimpleLayout();
AlertAppender.prototype.append=function(loggingEvent){var formattedMessage=this.getLayout().format(loggingEvent);
if(this.getLayout().ignoresThrowable()){formattedMessage+=loggingEvent.getThrowableStrRep();
}alert(formattedMessage);
};
AlertAppender.prototype.toString=function(){return"AlertAppender";
};
log4javascript.AlertAppender=AlertAppender;
function BrowserConsoleAppender(){}BrowserConsoleAppender.prototype=new log4javascript.Appender();
BrowserConsoleAppender.prototype.layout=new NullLayout();
BrowserConsoleAppender.prototype.threshold=Level.DEBUG;
BrowserConsoleAppender.prototype.append=function(loggingEvent){var appender=this;
var getFormattedMessage=function(){var layout=appender.getLayout();
var formattedMessage=layout.format(loggingEvent);
if(layout.ignoresThrowable()&&loggingEvent.exception){formattedMessage+=loggingEvent.getThrowableStrRep();
}return formattedMessage;
};
if((typeof opera!="undefined")&&opera.postError){opera.postError(getFormattedMessage());
}else{if(window.console&&window.console.log){var formattedMesage=getFormattedMessage();
if(window.console.debug&&Level.DEBUG.isGreaterOrEqual(loggingEvent.level)){window.console.debug(formattedMesage);
}else{if(window.console.info&&Level.INFO.equals(loggingEvent.level)){window.console.info(formattedMesage);
}else{if(window.console.warn&&Level.WARN.equals(loggingEvent.level)){window.console.warn(formattedMesage);
}else{if(window.console.error&&loggingEvent.level.isGreaterOrEqual(Level.ERROR)){window.console.error(formattedMesage);
}else{window.console.log(formattedMesage);
}}}}}}};
BrowserConsoleAppender.prototype.group=function(name){if(window.console&&window.console.group){window.console.group(name);
}};
BrowserConsoleAppender.prototype.groupEnd=function(){if(window.console&&window.console.groupEnd){window.console.groupEnd();
}};
BrowserConsoleAppender.prototype.toString=function(){return"BrowserConsoleAppender";
};
log4javascript.BrowserConsoleAppender=BrowserConsoleAppender;
function getXmlHttp(errorHandler){var xmlHttp=null;
if(typeof XMLHttpRequest=="object"||typeof XMLHttpRequest=="function"){xmlHttp=new XMLHttpRequest();
}else{try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}catch(e1){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}catch(e2){if(errorHandler){errorHandler();
}else{handleError("getXmlHttp: unable to obtain XMLHttpRequest object");
}}}}return xmlHttp;
}function isHttpRequestSuccessful(xmlHttp){return(isUndefined(xmlHttp.status)||xmlHttp.status===0||(xmlHttp.status>=200&&xmlHttp.status<300));
}function AjaxAppender(url){var appender=this;
var isSupported=true;
if(!url){handleError("AjaxAppender: URL must be specified in constructor");
isSupported=false;
}var timed=this.defaults.timed;
var waitForResponse=this.defaults.waitForResponse;
var batchSize=this.defaults.batchSize;
var timerInterval=this.defaults.timerInterval;
var requestSuccessCallback=this.defaults.requestSuccessCallback;
var failCallback=this.defaults.failCallback;
var postVarName=this.defaults.postVarName;
var sendAllOnUnload=this.defaults.sendAllOnUnload;
var sessionId=null;
var queuedLoggingEvents=[];
var queuedRequests=[];
var sending=false;
var initialized=false;
function checkCanConfigure(configOptionName){if(initialized){handleError("AjaxAppender: configuration option '"+configOptionName+"' may not be set after the appender has been initialized");
return false;
}return true;
}this.getSessionId=function(){return sessionId;
};
this.setSessionId=function(sessionIdParam){sessionId=extractStringFromParam(sessionIdParam,null);
this.layout.setCustomField("sessionid",sessionId);
};
this.setLayout=function(layoutParam){if(checkCanConfigure("layout")){this.layout=layoutParam;
if(sessionId!==null){this.setSessionId(sessionId);
}}};
this.isTimed=function(){return timed;
};
this.setTimed=function(timedParam){if(checkCanConfigure("timed")){timed=bool(timedParam);
}};
this.getTimerInterval=function(){return timerInterval;
};
this.setTimerInterval=function(timerIntervalParam){if(checkCanConfigure("timerInterval")){timerInterval=extractIntFromParam(timerIntervalParam,timerInterval);
}};
this.isWaitForResponse=function(){return waitForResponse;
};
this.setWaitForResponse=function(waitForResponseParam){if(checkCanConfigure("waitForResponse")){waitForResponse=bool(waitForResponseParam);
}};
this.getBatchSize=function(){return batchSize;
};
this.setBatchSize=function(batchSizeParam){if(checkCanConfigure("batchSize")){batchSize=extractIntFromParam(batchSizeParam,batchSize);
}};
this.isSendAllOnUnload=function(){return sendAllOnUnload;
};
this.setSendAllOnUnload=function(sendAllOnUnloadParam){if(checkCanConfigure("sendAllOnUnload")){sendAllOnUnload=extractIntFromParam(sendAllOnUnloadParam,sendAllOnUnload);
}};
this.setRequestSuccessCallback=function(requestSuccessCallbackParam){requestSuccessCallback=extractFunctionFromParam(requestSuccessCallbackParam,requestSuccessCallback);
};
this.setFailCallback=function(failCallbackParam){failCallback=extractFunctionFromParam(failCallbackParam,failCallback);
};
this.getPostVarName=function(){return postVarName;
};
this.setPostVarName=function(postVarNameParam){if(checkCanConfigure("postVarName")){postVarName=extractStringFromParam(postVarNameParam,postVarName);
}};
function sendAll(){if(isSupported&&enabled){sending=true;
var currentRequestBatch;
if(waitForResponse){if(queuedRequests.length>0){currentRequestBatch=queuedRequests.shift();
sendRequest(preparePostData(currentRequestBatch),sendAll);
}else{sending=false;
if(timed){scheduleSending();
}}}else{while((currentRequestBatch=queuedRequests.shift())){sendRequest(preparePostData(currentRequestBatch));
}sending=false;
if(timed){scheduleSending();
}}}}this.sendAll=sendAll;
function sendAllRemaining(){if(isSupported&&enabled){var actualBatchSize=appender.getLayout().allowBatching()?batchSize:1;
var currentLoggingEvent;
var postData="";
var batchedLoggingEvents=[];
while((currentLoggingEvent=queuedLoggingEvents.shift())){batchedLoggingEvents.push(currentLoggingEvent);
if(queuedLoggingEvents.length>=actualBatchSize){queuedRequests.push(batchedLoggingEvents);
batchedLoggingEvents=[];
}}if(batchedLoggingEvents.length>0){queuedRequests.push(batchedLoggingEvents);
}waitForResponse=false;
timed=false;
sendAll();
}}function preparePostData(batchedLoggingEvents){var formattedMessages=[];
var currentLoggingEvent;
var postData="";
while((currentLoggingEvent=batchedLoggingEvents.shift())){var currentFormattedMessage=appender.getLayout().format(currentLoggingEvent);
if(appender.getLayout().ignoresThrowable()){currentFormattedMessage+=loggingEvent.getThrowableStrRep();
}formattedMessages.push(currentFormattedMessage);
}if(batchedLoggingEvents.length==1){postData=formattedMessages.join("");
}else{postData=appender.getLayout().batchHeader+formattedMessages.join(appender.getLayout().batchSeparator)+appender.getLayout().batchFooter;
}postData=appender.getLayout().returnsPostData?postData:urlEncode(postVarName)+"="+urlEncode(postData);
if(postData.length>0){postData+="&";
}return postData+"layout="+urlEncode(appender.getLayout().toString());
}function scheduleSending(){setTimeout(sendAll,timerInterval);
}function xmlHttpErrorHandler(){var msg="AjaxAppender: could not create XMLHttpRequest object. AjaxAppender disabled";
handleError(msg);
isSupported=false;
if(failCallback){failCallback(msg);
}}function sendRequest(postData,successCallback){try{var xmlHttp=getXmlHttp(xmlHttpErrorHandler);
if(isSupported){if(xmlHttp.overrideMimeType){xmlHttp.overrideMimeType(appender.getLayout().getContentType());
}xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4){if(isHttpRequestSuccessful(xmlHttp)){if(requestSuccessCallback){requestSuccessCallback(xmlHttp);
}if(successCallback){successCallback(xmlHttp);
}}else{var msg="AjaxAppender.append: XMLHttpRequest request to URL "+url+" returned status code "+xmlHttp.status;
handleError(msg);
if(failCallback){failCallback(msg);
}}xmlHttp.onreadystatechange=emptyFunction;
xmlHttp=null;
}};
xmlHttp.open("POST",url,true);
try{xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
}catch(headerEx){var msg="AjaxAppender.append: your browser's XMLHttpRequest implementation does not support setRequestHeader, therefore cannot post data. AjaxAppender disabled";
handleError(msg);
isSupported=false;
if(failCallback){failCallback(msg);
}return;
}xmlHttp.send(postData);
}}catch(ex){var errMsg="AjaxAppender.append: error sending log message to "+url;
handleError(errMsg,ex);
isSupported=false;
if(failCallback){failCallback(errMsg+". Details: "+getExceptionStringRep(ex));
}}}this.append=function(loggingEvent){if(isSupported){if(!initialized){init();
}queuedLoggingEvents.push(loggingEvent);
var actualBatchSize=this.getLayout().allowBatching()?batchSize:1;
if(queuedLoggingEvents.length>=actualBatchSize){var currentLoggingEvent;
var postData="";
var batchedLoggingEvents=[];
while((currentLoggingEvent=queuedLoggingEvents.shift())){batchedLoggingEvents.push(currentLoggingEvent);
}queuedRequests.push(batchedLoggingEvents);
if(!timed){if(!waitForResponse||(waitForResponse&&!sending)){sendAll();
}}}}};
function init(){initialized=true;
if(sendAllOnUnload){addEvent(window,"unload",sendAllRemaining);
}if(timed){scheduleSending();
}}}AjaxAppender.prototype=new Appender();
AjaxAppender.prototype.defaults={waitForResponse:false,timed:false,timerInterval:1000,batchSize:1,sendAllOnUnload:true,requestSuccessCallback:null,failCallback:null,postVarName:"data"};
AjaxAppender.prototype.layout=new HttpPostDataLayout();
AjaxAppender.prototype.toString=function(){return"AjaxAppender";
};
log4javascript.AjaxAppender=AjaxAppender;
function setCookie(name,value,days,path){var expires;
path=path?"; path="+path:"";
if(days){var date=new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires="; expires="+date.toGMTString();
}else{expires="";
}document.cookie=escape(name)+"="+escape(value)+expires+path;
}function getCookie(name){var nameEquals=escape(name)+"=";
var ca=document.cookie.split(";");
for(var i=0,len=ca.length;
i<len;
i++){var c=ca[i];
while(c.charAt(0)===" "){c=c.substring(1,c.length);
}if(c.indexOf(nameEquals)===0){return unescape(c.substring(nameEquals.length,c.length));
}}return null;
}function getBaseUrl(){var scripts=document.getElementsByTagName("script");
for(var i=0,len=scripts.length;
i<len;
++i){if(scripts[i].src.indexOf("log4javascript")!=-1){var lastSlash=scripts[i].src.lastIndexOf("/");
return(lastSlash==-1)?"":scripts[i].src.substr(0,lastSlash+1);
}}return null;
}function isLoaded(win){try{return bool(win.loaded);
}catch(ex){return false;
}}var ConsoleAppender;
(function(){var getConsoleHtmlLines=function(){return['<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">','<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">',"<head>","<title>log4javascript</title>",'<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />',"<!-- Make IE8 behave like IE7, having gone to all the trouble of making IE work -->",'<meta http-equiv="X-UA-Compatible" content="IE=7" />','<script type="text/javascript">var isIe = false, isIePre7 = false;<\/script>','<!--[if IE]><script type="text/javascript">isIe = true<\/script><![endif]-->','<!--[if lt IE 7]><script type="text/javascript">isIePre7 = true<\/script><![endif]-->','<script type="text/javascript">',"//<![CDATA[","var loggingEnabled=true;var logQueuedEventsTimer=null;var logEntries=[];var logEntriesAndSeparators=[];var logItems=[];var renderDelay=100;var unrenderedLogItemsExist=false;var rootGroup,currentGroup=null;var loaded=false;var currentLogItem=null;var logMainContainer;function copyProperties(obj,props){for(var i in props){obj[i]=props[i];}}","function LogItem(){}","LogItem.prototype={mainContainer:null,wrappedContainer:null,unwrappedContainer:null,group:null,appendToLog:function(){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].appendToLog();}","this.group.update();},doRemove:function(doUpdate,removeFromGroup){if(this.rendered){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].remove();}","this.unwrappedElementContainer=null;this.wrappedElementContainer=null;this.mainElementContainer=null;}","if(this.group&&removeFromGroup){this.group.removeChild(this,doUpdate);}","if(this===currentLogItem){currentLogItem=null;}},remove:function(doUpdate,removeFromGroup){this.doRemove(doUpdate,removeFromGroup);},render:function(){},accept:function(visitor){visitor.visit(this);},getUnwrappedDomContainer:function(){return this.group.unwrappedElementContainer.contentDiv;},getWrappedDomContainer:function(){return this.group.wrappedElementContainer.contentDiv;},getMainDomContainer:function(){return this.group.mainElementContainer.contentDiv;}};LogItem.serializedItemKeys={LOG_ENTRY:0,GROUP_START:1,GROUP_END:2};function LogItemContainerElement(){}",'LogItemContainerElement.prototype={appendToLog:function(){var insertBeforeFirst=(newestAtTop&&this.containerDomNode.hasChildNodes());if(insertBeforeFirst){this.containerDomNode.insertBefore(this.mainDiv,this.containerDomNode.firstChild);}else{this.containerDomNode.appendChild(this.mainDiv);}}};function SeparatorElementContainer(containerDomNode){this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.className="separator";this.mainDiv.innerHTML="&nbsp;";}',"SeparatorElementContainer.prototype=new LogItemContainerElement();SeparatorElementContainer.prototype.remove=function(){this.mainDiv.parentNode.removeChild(this.mainDiv);this.mainDiv=null;};function Separator(){this.rendered=false;}","Separator.prototype=new LogItem();copyProperties(Separator.prototype,{render:function(){var containerDomNode=this.group.contentDiv;if(isIe){this.unwrappedElementContainer=new SeparatorElementContainer(this.getUnwrappedDomContainer());this.wrappedElementContainer=new SeparatorElementContainer(this.getWrappedDomContainer());this.elementContainers=[this.unwrappedElementContainer,this.wrappedElementContainer];}else{this.mainElementContainer=new SeparatorElementContainer(this.getMainDomContainer());this.elementContainers=[this.mainElementContainer];}",'this.content=this.formattedMessage;this.rendered=true;}});function GroupElementContainer(group,containerDomNode,isRoot,isWrapped){this.group=group;this.containerDomNode=containerDomNode;this.isRoot=isRoot;this.isWrapped=isWrapped;this.expandable=false;if(this.isRoot){if(isIe){this.contentDiv=logMainContainer.appendChild(document.createElement("div"));this.contentDiv.id=this.isWrapped?"log_wrapped":"log_unwrapped";}else{this.contentDiv=logMainContainer;}}else{var groupElementContainer=this;this.mainDiv=document.createElement("div");this.mainDiv.className="group";this.headingDiv=this.mainDiv.appendChild(document.createElement("div"));this.headingDiv.className="groupheading";this.expander=this.headingDiv.appendChild(document.createElement("span"));this.expander.className="expander unselectable greyedout";this.expander.unselectable=true;var expanderText=this.group.expanded?"-":"+";this.expanderTextNode=this.expander.appendChild(document.createTextNode(expanderText));this.headingDiv.appendChild(document.createTextNode(" "+this.group.name));this.contentDiv=this.mainDiv.appendChild(document.createElement("div"));var contentCssClass=this.group.expanded?"expanded":"collapsed";this.contentDiv.className="groupcontent "+contentCssClass;this.expander.onclick=function(){if(groupElementContainer.group.expandable){groupElementContainer.group.toggleExpanded();}};}}','GroupElementContainer.prototype=new LogItemContainerElement();copyProperties(GroupElementContainer.prototype,{toggleExpanded:function(){if(!this.isRoot){var oldCssClass,newCssClass,expanderText;if(this.group.expanded){newCssClass="expanded";oldCssClass="collapsed";expanderText="-";}else{newCssClass="collapsed";oldCssClass="expanded";expanderText="+";}',"replaceClass(this.contentDiv,newCssClass,oldCssClass);this.expanderTextNode.nodeValue=expanderText;}},remove:function(){if(!this.isRoot){this.headingDiv=null;this.expander.onclick=null;this.expander=null;this.expanderTextNode=null;this.contentDiv=null;this.containerDomNode=null;this.mainDiv.parentNode.removeChild(this.mainDiv);this.mainDiv=null;}},reverseChildren:function(){var node=null;var childDomNodes=[];while((node=this.contentDiv.firstChild)){this.contentDiv.removeChild(node);childDomNodes.push(node);}",'while((node=childDomNodes.pop())){this.contentDiv.appendChild(node);}},update:function(){if(!this.isRoot){if(this.group.expandable){removeClass(this.expander,"greyedout");}else{addClass(this.expander,"greyedout");}}},clear:function(){if(this.isRoot){this.contentDiv.innerHTML="";}}});function Group(name,isRoot,initiallyExpanded){this.name=name;this.group=null;this.isRoot=isRoot;this.initiallyExpanded=initiallyExpanded;this.elementContainers=[];this.children=[];this.expanded=initiallyExpanded;this.rendered=false;this.expandable=false;}',"Group.prototype=new LogItem();copyProperties(Group.prototype,{addChild:function(logItem){this.children.push(logItem);logItem.group=this;},render:function(){if(isIe){var unwrappedDomContainer,wrappedDomContainer;if(this.isRoot){unwrappedDomContainer=logMainContainer;wrappedDomContainer=logMainContainer;}else{unwrappedDomContainer=this.getUnwrappedDomContainer();wrappedDomContainer=this.getWrappedDomContainer();}","this.unwrappedElementContainer=new GroupElementContainer(this,unwrappedDomContainer,this.isRoot,false);this.wrappedElementContainer=new GroupElementContainer(this,wrappedDomContainer,this.isRoot,true);this.elementContainers=[this.unwrappedElementContainer,this.wrappedElementContainer];}else{var mainDomContainer=this.isRoot?logMainContainer:this.getMainDomContainer();this.mainElementContainer=new GroupElementContainer(this,mainDomContainer,this.isRoot,false);this.elementContainers=[this.mainElementContainer];}","this.rendered=true;},toggleExpanded:function(){this.expanded=!this.expanded;for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].toggleExpanded();}},expand:function(){if(!this.expanded){this.toggleExpanded();}},accept:function(visitor){visitor.visitGroup(this);},reverseChildren:function(){if(this.rendered){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].reverseChildren();}}},update:function(){var previouslyExpandable=this.expandable;this.expandable=(this.children.length!==0);if(this.expandable!==previouslyExpandable){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].update();}}},flatten:function(){var visitor=new GroupFlattener();this.accept(visitor);return visitor.logEntriesAndSeparators;},removeChild:function(child,doUpdate){array_remove(this.children,child);child.group=null;if(doUpdate){this.update();}},remove:function(doUpdate,removeFromGroup){for(var i=0,len=this.children.length;i<len;i++){this.children[i].remove(false,false);}","this.children=[];this.update();if(this===currentGroup){currentGroup=this.group;}","this.doRemove(doUpdate,removeFromGroup);},serialize:function(items){items.push([LogItem.serializedItemKeys.GROUP_START,this.name]);for(var i=0,len=this.children.length;i<len;i++){this.children[i].serialize(items);}","if(this!==currentGroup){items.push([LogItem.serializedItemKeys.GROUP_END]);}},clear:function(){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].clear();}}});function LogEntryElementContainer(){}",'LogEntryElementContainer.prototype=new LogItemContainerElement();copyProperties(LogEntryElementContainer.prototype,{remove:function(){this.doRemove();},doRemove:function(){this.mainDiv.parentNode.removeChild(this.mainDiv);this.mainDiv=null;this.contentElement=null;this.containerDomNode=null;},setContent:function(content,wrappedContent){if(content===this.formattedMessage){this.contentElement.innerHTML="";this.contentElement.appendChild(document.createTextNode(this.formattedMessage));}else{this.contentElement.innerHTML=content;}},setSearchMatch:function(isMatch){var oldCssClass=isMatch?"searchnonmatch":"searchmatch";var newCssClass=isMatch?"searchmatch":"searchnonmatch";replaceClass(this.mainDiv,newCssClass,oldCssClass);},clearSearch:function(){removeClass(this.mainDiv,"searchmatch");removeClass(this.mainDiv,"searchnonmatch");}});function LogEntryWrappedElementContainer(logEntry,containerDomNode){this.logEntry=logEntry;this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.appendChild(document.createTextNode(this.logEntry.formattedMessage));this.mainDiv.className="logentry wrapped "+this.logEntry.level;this.contentElement=this.mainDiv;}','LogEntryWrappedElementContainer.prototype=new LogEntryElementContainer();LogEntryWrappedElementContainer.prototype.setContent=function(content,wrappedContent){if(content===this.formattedMessage){this.contentElement.innerHTML="";this.contentElement.appendChild(document.createTextNode(this.formattedMessage));}else{this.contentElement.innerHTML=wrappedContent;}};function LogEntryUnwrappedElementContainer(logEntry,containerDomNode){this.logEntry=logEntry;this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.className="logentry unwrapped "+this.logEntry.level;this.pre=this.mainDiv.appendChild(document.createElement("pre"));this.pre.appendChild(document.createTextNode(this.logEntry.formattedMessage));this.pre.className="unwrapped";this.contentElement=this.pre;}','LogEntryUnwrappedElementContainer.prototype=new LogEntryElementContainer();LogEntryUnwrappedElementContainer.prototype.remove=function(){this.doRemove();this.pre=null;};function LogEntryMainElementContainer(logEntry,containerDomNode){this.logEntry=logEntry;this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.className="logentry nonielogentry "+this.logEntry.level;this.contentElement=this.mainDiv.appendChild(document.createElement("span"));this.contentElement.appendChild(document.createTextNode(this.logEntry.formattedMessage));}',"LogEntryMainElementContainer.prototype=new LogEntryElementContainer();function LogEntry(level,formattedMessage){this.level=level;this.formattedMessage=formattedMessage;this.rendered=false;}",'LogEntry.prototype=new LogItem();copyProperties(LogEntry.prototype,{render:function(){var logEntry=this;var containerDomNode=this.group.contentDiv;if(isIe){this.formattedMessage=this.formattedMessage.replace(/\\r\\n/g,"\\r");this.unwrappedElementContainer=new LogEntryUnwrappedElementContainer(this,this.getUnwrappedDomContainer());this.wrappedElementContainer=new LogEntryWrappedElementContainer(this,this.getWrappedDomContainer());this.elementContainers=[this.unwrappedElementContainer,this.wrappedElementContainer];}else{this.mainElementContainer=new LogEntryMainElementContainer(this,this.getMainDomContainer());this.elementContainers=[this.mainElementContainer];}','this.content=this.formattedMessage;this.rendered=true;},setContent:function(content,wrappedContent){if(content!=this.content){if(isIe&&(content!==this.formattedMessage)){content=content.replace(/\\r\\n/g,"\\r");}',"for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].setContent(content,wrappedContent);}",'this.content=content;}},getSearchMatches:function(){var matches=[];var i,len;if(isIe){var unwrappedEls=getElementsByClass(this.unwrappedElementContainer.mainDiv,"searchterm","span");var wrappedEls=getElementsByClass(this.wrappedElementContainer.mainDiv,"searchterm","span");for(i=0,len=unwrappedEls.length;i<len;i++){matches[i]=new Match(this.level,null,unwrappedEls[i],wrappedEls[i]);}}else{var els=getElementsByClass(this.mainElementContainer.mainDiv,"searchterm","span");for(i=0,len=els.length;i<len;i++){matches[i]=new Match(this.level,els[i]);}}',"return matches;},setSearchMatch:function(isMatch){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].setSearchMatch(isMatch);}},clearSearch:function(){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].clearSearch();}},accept:function(visitor){visitor.visitLogEntry(this);},serialize:function(items){items.push([LogItem.serializedItemKeys.LOG_ENTRY,this.level,this.formattedMessage]);}});function LogItemVisitor(){}","LogItemVisitor.prototype={visit:function(logItem){},visitParent:function(logItem){if(logItem.group){logItem.group.accept(this);}},visitChildren:function(logItem){for(var i=0,len=logItem.children.length;i<len;i++){logItem.children[i].accept(this);}},visitLogEntry:function(logEntry){this.visit(logEntry);},visitSeparator:function(separator){this.visit(separator);},visitGroup:function(group){this.visit(group);}};function GroupFlattener(){this.logEntriesAndSeparators=[];}",'GroupFlattener.prototype=new LogItemVisitor();GroupFlattener.prototype.visitGroup=function(group){this.visitChildren(group);};GroupFlattener.prototype.visitLogEntry=function(logEntry){this.logEntriesAndSeparators.push(logEntry);};GroupFlattener.prototype.visitSeparator=function(separator){this.logEntriesAndSeparators.push(separator);};window.onload=function(){if(location.search){var queryBits=unescape(location.search).substr(1).split("&"),nameValueBits;for(var i=0,len=queryBits.length;i<len;i++){nameValueBits=queryBits[i].split("=");if(nameValueBits[0]=="log4javascript_domain"){document.domain=nameValueBits[1];break;}}}','logMainContainer=$("log");if(isIePre7){addClass(logMainContainer,"oldIe");}','rootGroup=new Group("root",true);rootGroup.render();currentGroup=rootGroup;setCommandInputWidth();setLogContainerHeight();toggleLoggingEnabled();toggleSearchEnabled();toggleSearchFilter();toggleSearchHighlight();applyFilters();checkAllLevels();toggleWrap();toggleNewestAtTop();toggleScrollToLatest();renderQueuedLogItems();loaded=true;$("command").value="";$("command").autocomplete="off";$("command").onkeydown=function(evt){evt=getEvent(evt);if(evt.keyCode==10||evt.keyCode==13){evalCommandLine();stopPropagation(evt);}else if(evt.keyCode==27){this.value="";this.focus();}else if(evt.keyCode==38&&commandHistory.length>0){currentCommandIndex=Math.max(0,currentCommandIndex-1);this.value=commandHistory[currentCommandIndex];moveCaretToEnd(this);}else if(evt.keyCode==40&&commandHistory.length>0){currentCommandIndex=Math.min(commandHistory.length-1,currentCommandIndex+1);this.value=commandHistory[currentCommandIndex];moveCaretToEnd(this);}};$("command").onkeypress=function(evt){evt=getEvent(evt);if(evt.keyCode==38&&commandHistory.length>0&&evt.preventDefault){evt.preventDefault();}};$("command").onkeyup=function(evt){evt=getEvent(evt);if(evt.keyCode==27&&evt.preventDefault){evt.preventDefault();this.focus();}};document.onkeydown=function keyEventHandler(evt){evt=getEvent(evt);switch(evt.keyCode){case 69:if(evt.shiftKey&&(evt.ctrlKey||evt.metaKey)){evalLastCommand();cancelKeyEvent(evt);return false;}',"break;case 75:if(evt.shiftKey&&(evt.ctrlKey||evt.metaKey)){focusSearch();cancelKeyEvent(evt);return false;}","break;case 40:case 76:if(evt.shiftKey&&(evt.ctrlKey||evt.metaKey)){focusCommandLine();cancelKeyEvent(evt);return false;}","break;}};setTimeout(setLogContainerHeight,20);setShowCommandLine(showCommandLine);doSearch();};window.onunload=function(){if(mainWindowExists()){appender.unload();}",'appender=null;};function toggleLoggingEnabled(){setLoggingEnabled($("enableLogging").checked);}',"function setLoggingEnabled(enable){loggingEnabled=enable;}","var appender=null;function setAppender(appenderParam){appender=appenderParam;}",'function setShowCloseButton(showCloseButton){$("closeButton").style.display=showCloseButton?"inline":"none";}','function setShowHideButton(showHideButton){$("hideButton").style.display=showHideButton?"inline":"none";}',"var newestAtTop=false;function LogItemContentReverser(){}","LogItemContentReverser.prototype=new LogItemVisitor();LogItemContentReverser.prototype.visitGroup=function(group){group.reverseChildren();this.visitChildren(group);};function setNewestAtTop(isNewestAtTop){var oldNewestAtTop=newestAtTop;var i,iLen,j,jLen;newestAtTop=Boolean(isNewestAtTop);if(oldNewestAtTop!=newestAtTop){var visitor=new LogItemContentReverser();rootGroup.accept(visitor);if(currentSearch){var currentMatch=currentSearch.matches[currentMatchIndex];var matchIndex=0;var matches=[];var actOnLogEntry=function(logEntry){var logEntryMatches=logEntry.getSearchMatches();for(j=0,jLen=logEntryMatches.length;j<jLen;j++){matches[matchIndex]=logEntryMatches[j];if(currentMatch&&logEntryMatches[j].equals(currentMatch)){currentMatchIndex=matchIndex;}","matchIndex++;}};if(newestAtTop){for(i=logEntries.length-1;i>=0;i--){actOnLogEntry(logEntries[i]);}}else{for(i=0,iLen=logEntries.length;i<iLen;i++){actOnLogEntry(logEntries[i]);}}","currentSearch.matches=matches;if(currentMatch){currentMatch.setCurrent();}}else if(scrollToLatest){doScrollToLatest();}}",'$("newestAtTop").checked=isNewestAtTop;}','function toggleNewestAtTop(){var isNewestAtTop=$("newestAtTop").checked;setNewestAtTop(isNewestAtTop);}',"var scrollToLatest=true;function setScrollToLatest(isScrollToLatest){scrollToLatest=isScrollToLatest;if(scrollToLatest){doScrollToLatest();}",'$("scrollToLatest").checked=isScrollToLatest;}','function toggleScrollToLatest(){var isScrollToLatest=$("scrollToLatest").checked;setScrollToLatest(isScrollToLatest);}','function doScrollToLatest(){var l=logMainContainer;if(typeof l.scrollTop!="undefined"){if(newestAtTop){l.scrollTop=0;}else{var latestLogEntry=l.lastChild;if(latestLogEntry){l.scrollTop=l.scrollHeight;}}}}',"var closeIfOpenerCloses=true;function setCloseIfOpenerCloses(isCloseIfOpenerCloses){closeIfOpenerCloses=isCloseIfOpenerCloses;}","var maxMessages=null;function setMaxMessages(max){maxMessages=max;pruneLogEntries();}",'var showCommandLine=false;function setShowCommandLine(isShowCommandLine){showCommandLine=isShowCommandLine;if(loaded){$("commandLine").style.display=showCommandLine?"block":"none";setCommandInputWidth();setLogContainerHeight();}}','function focusCommandLine(){if(loaded){$("command").focus();}}','function focusSearch(){if(loaded){$("searchBox").focus();}}',"function getLogItems(){var items=[];for(var i=0,len=logItems.length;i<len;i++){logItems[i].serialize(items);}","return items;}","function setLogItems(items){var loggingReallyEnabled=loggingEnabled;loggingEnabled=true;for(var i=0,len=items.length;i<len;i++){switch(items[i][0]){case LogItem.serializedItemKeys.LOG_ENTRY:log(items[i][1],items[i][2]);break;case LogItem.serializedItemKeys.GROUP_START:group(items[i][1]);break;case LogItem.serializedItemKeys.GROUP_END:groupEnd();break;}}","loggingEnabled=loggingReallyEnabled;}","function log(logLevel,formattedMessage){if(loggingEnabled){var logEntry=new LogEntry(logLevel,formattedMessage);logEntries.push(logEntry);logEntriesAndSeparators.push(logEntry);logItems.push(logEntry);currentGroup.addChild(logEntry);if(loaded){if(logQueuedEventsTimer!==null){clearTimeout(logQueuedEventsTimer);}","logQueuedEventsTimer=setTimeout(renderQueuedLogItems,renderDelay);unrenderedLogItemsExist=true;}}}","function renderQueuedLogItems(){logQueuedEventsTimer=null;var pruned=pruneLogEntries();var initiallyHasMatches=currentSearch?currentSearch.hasMatches():false;for(var i=0,len=logItems.length;i<len;i++){if(!logItems[i].rendered){logItems[i].render();logItems[i].appendToLog();if(currentSearch&&(logItems[i]instanceof LogEntry)){currentSearch.applyTo(logItems[i]);}}}","if(currentSearch){if(pruned){if(currentSearch.hasVisibleMatches()){if(currentMatchIndex===null){setCurrentMatchIndex(0);}","displayMatches();}else{displayNoMatches();}}else if(!initiallyHasMatches&&currentSearch.hasVisibleMatches()){setCurrentMatchIndex(0);displayMatches();}}","if(scrollToLatest){doScrollToLatest();}","unrenderedLogItemsExist=false;}","function pruneLogEntries(){if((maxMessages!==null)&&(logEntriesAndSeparators.length>maxMessages)){var numberToDelete=logEntriesAndSeparators.length-maxMessages;var prunedLogEntries=logEntriesAndSeparators.slice(0,numberToDelete);if(currentSearch){currentSearch.removeMatches(prunedLogEntries);}","var group;for(var i=0;i<numberToDelete;i++){group=logEntriesAndSeparators[i].group;array_remove(logItems,logEntriesAndSeparators[i]);array_remove(logEntries,logEntriesAndSeparators[i]);logEntriesAndSeparators[i].remove(true,true);if(group.children.length===0&&group!==currentGroup&&group!==rootGroup){array_remove(logItems,group);group.remove(true,true);}}","logEntriesAndSeparators=array_removeFromStart(logEntriesAndSeparators,numberToDelete);return true;}","return false;}",'function group(name,startExpanded){if(loggingEnabled){initiallyExpanded=(typeof startExpanded==="undefined")?true:Boolean(startExpanded);var newGroup=new Group(name,false,initiallyExpanded);currentGroup.addChild(newGroup);currentGroup=newGroup;logItems.push(newGroup);if(loaded){if(logQueuedEventsTimer!==null){clearTimeout(logQueuedEventsTimer);}',"logQueuedEventsTimer=setTimeout(renderQueuedLogItems,renderDelay);unrenderedLogItemsExist=true;}}}","function groupEnd(){currentGroup=(currentGroup===rootGroup)?rootGroup:currentGroup.group;}","function mainPageReloaded(){currentGroup=rootGroup;var separator=new Separator();logEntriesAndSeparators.push(separator);logItems.push(separator);currentGroup.addChild(separator);}","function closeWindow(){if(appender&&mainWindowExists()){appender.close(true);}else{window.close();}}","function hide(){if(appender&&mainWindowExists()){appender.hide();}}",'var mainWindow=window;var windowId="log4javascriptConsoleWindow_"+new Date().getTime()+"_"+(""+Math.random()).substr(2);function setMainWindow(win){mainWindow=win;mainWindow[windowId]=window;if(opener&&closeIfOpenerCloses){pollOpener();}}',"function pollOpener(){if(closeIfOpenerCloses){if(mainWindowExists()){setTimeout(pollOpener,500);}else{closeWindow();}}}","function mainWindowExists(){try{return(mainWindow&&!mainWindow.closed&&mainWindow[windowId]==window);}catch(ex){}","return false;}",'var logLevels=["TRACE","DEBUG","INFO","WARN","ERROR","FATAL"];function getCheckBox(logLevel){return $("switch_"+logLevel);}','function getIeWrappedLogContainer(){return $("log_wrapped");}','function getIeUnwrappedLogContainer(){return $("log_unwrapped");}',"function applyFilters(){for(var i=0;i<logLevels.length;i++){if(getCheckBox(logLevels[i]).checked){addClass(logMainContainer,logLevels[i]);}else{removeClass(logMainContainer,logLevels[i]);}}","updateSearchFromFilters();}",'function toggleAllLevels(){var turnOn=$("switch_ALL").checked;for(var i=0;i<logLevels.length;i++){getCheckBox(logLevels[i]).checked=turnOn;if(turnOn){addClass(logMainContainer,logLevels[i]);}else{removeClass(logMainContainer,logLevels[i]);}}}','function checkAllLevels(){for(var i=0;i<logLevels.length;i++){if(!getCheckBox(logLevels[i]).checked){getCheckBox("ALL").checked=false;return;}}','getCheckBox("ALL").checked=true;}',"function clearLog(){rootGroup.clear();currentGroup=rootGroup;logEntries=[];logItems=[];logEntriesAndSeparators=[];doSearch();}",'function toggleWrap(){var enable=$("wrap").checked;if(enable){addClass(logMainContainer,"wrap");}else{removeClass(logMainContainer,"wrap");}',"refreshCurrentMatch();}","var searchTimer=null;function scheduleSearch(){try{clearTimeout(searchTimer);}catch(ex){}","searchTimer=setTimeout(doSearch,500);}","function Search(searchTerm,isRegex,searchRegex,isCaseSensitive){this.searchTerm=searchTerm;this.isRegex=isRegex;this.searchRegex=searchRegex;this.isCaseSensitive=isCaseSensitive;this.matches=[];}","Search.prototype={hasMatches:function(){return this.matches.length>0;},hasVisibleMatches:function(){if(this.hasMatches()){for(var i=0;i<this.matches.length;i++){if(this.matches[i].isVisible()){return true;}}}","return false;},match:function(logEntry){var entryText=String(logEntry.formattedMessage);var matchesSearch=false;if(this.isRegex){matchesSearch=this.searchRegex.test(entryText);}else if(this.isCaseSensitive){matchesSearch=(entryText.indexOf(this.searchTerm)>-1);}else{matchesSearch=(entryText.toLowerCase().indexOf(this.searchTerm.toLowerCase())>-1);}","return matchesSearch;},getNextVisibleMatchIndex:function(){for(var i=currentMatchIndex+1;i<this.matches.length;i++){if(this.matches[i].isVisible()){return i;}}","for(i=0;i<=currentMatchIndex;i++){if(this.matches[i].isVisible()){return i;}}","return-1;},getPreviousVisibleMatchIndex:function(){for(var i=currentMatchIndex-1;i>=0;i--){if(this.matches[i].isVisible()){return i;}}","for(var i=this.matches.length-1;i>=currentMatchIndex;i--){if(this.matches[i].isVisible()){return i;}}",'return-1;},applyTo:function(logEntry){var doesMatch=this.match(logEntry);if(doesMatch){logEntry.group.expand();logEntry.setSearchMatch(true);var logEntryContent;var wrappedLogEntryContent;var searchTermReplacementStartTag="<span class=\\"searchterm\\">";var searchTermReplacementEndTag="<"+"/span>";var preTagName=isIe?"pre":"span";var preStartTag="<"+preTagName+" class=\\"pre\\">";var preEndTag="<"+"/"+preTagName+">";var startIndex=0;var searchIndex,matchedText,textBeforeMatch;if(this.isRegex){var flags=this.isCaseSensitive?"g":"gi";var capturingRegex=new RegExp("("+this.searchRegex.source+")",flags);var rnd=(""+Math.random()).substr(2);var startToken="%%s"+rnd+"%%";var endToken="%%e"+rnd+"%%";logEntryContent=logEntry.formattedMessage.replace(capturingRegex,startToken+"$1"+endToken);logEntryContent=escapeHtml(logEntryContent);var result;var searchString=logEntryContent;logEntryContent="";wrappedLogEntryContent="";while((searchIndex=searchString.indexOf(startToken,startIndex))>-1){var endTokenIndex=searchString.indexOf(endToken,searchIndex);matchedText=searchString.substring(searchIndex+startToken.length,endTokenIndex);textBeforeMatch=searchString.substring(startIndex,searchIndex);logEntryContent+=preStartTag+textBeforeMatch+preEndTag;logEntryContent+=searchTermReplacementStartTag+preStartTag+matchedText+',"preEndTag+searchTermReplacementEndTag;if(isIe){wrappedLogEntryContent+=textBeforeMatch+searchTermReplacementStartTag+","matchedText+searchTermReplacementEndTag;}","startIndex=endTokenIndex+endToken.length;}",'logEntryContent+=preStartTag+searchString.substr(startIndex)+preEndTag;if(isIe){wrappedLogEntryContent+=searchString.substr(startIndex);}}else{logEntryContent="";wrappedLogEntryContent="";var searchTermReplacementLength=searchTermReplacementStartTag.length+',"this.searchTerm.length+searchTermReplacementEndTag.length;var searchTermLength=this.searchTerm.length;var searchTermLowerCase=this.searchTerm.toLowerCase();var logTextLowerCase=logEntry.formattedMessage.toLowerCase();while((searchIndex=logTextLowerCase.indexOf(searchTermLowerCase,startIndex))>-1){matchedText=escapeHtml(logEntry.formattedMessage.substr(searchIndex,this.searchTerm.length));textBeforeMatch=escapeHtml(logEntry.formattedMessage.substring(startIndex,searchIndex));var searchTermReplacement=searchTermReplacementStartTag+","preStartTag+matchedText+preEndTag+searchTermReplacementEndTag;logEntryContent+=preStartTag+textBeforeMatch+preEndTag+searchTermReplacement;if(isIe){wrappedLogEntryContent+=textBeforeMatch+searchTermReplacementStartTag+","matchedText+searchTermReplacementEndTag;}","startIndex=searchIndex+searchTermLength;}","var textAfterLastMatch=escapeHtml(logEntry.formattedMessage.substr(startIndex));logEntryContent+=preStartTag+textAfterLastMatch+preEndTag;if(isIe){wrappedLogEntryContent+=textAfterLastMatch;}}","logEntry.setContent(logEntryContent,wrappedLogEntryContent);var logEntryMatches=logEntry.getSearchMatches();this.matches=this.matches.concat(logEntryMatches);}else{logEntry.setSearchMatch(false);logEntry.setContent(logEntry.formattedMessage,logEntry.formattedMessage);}","return doesMatch;},removeMatches:function(logEntries){var matchesToRemoveCount=0;var currentMatchRemoved=false;var matchesToRemove=[];var i,iLen,j,jLen;for(i=0,iLen=this.matches.length;i<iLen;i++){for(j=0,jLen=logEntries.length;j<jLen;j++){if(this.matches[i].belongsTo(logEntries[j])){matchesToRemove.push(this.matches[i]);if(i===currentMatchIndex){currentMatchRemoved=true;}}}}","var newMatch=currentMatchRemoved?null:this.matches[currentMatchIndex];if(currentMatchRemoved){for(i=currentMatchIndex,iLen=this.matches.length;i<iLen;i++){if(this.matches[i].isVisible()&&!array_contains(matchesToRemove,this.matches[i])){newMatch=this.matches[i];break;}}}","for(i=0,iLen=matchesToRemove.length;i<iLen;i++){array_remove(this.matches,matchesToRemove[i]);matchesToRemove[i].remove();}","if(this.hasVisibleMatches()){if(newMatch===null){setCurrentMatchIndex(0);}else{var newMatchIndex=0;for(i=0,iLen=this.matches.length;i<iLen;i++){if(newMatch===this.matches[i]){newMatchIndex=i;break;}}","setCurrentMatchIndex(newMatchIndex);}}else{currentMatchIndex=null;displayNoMatches();}}};function getPageOffsetTop(el,container){var currentEl=el;var y=0;while(currentEl&&currentEl!=container){y+=currentEl.offsetTop;currentEl=currentEl.offsetParent;}","return y;}",'function scrollIntoView(el){var logContainer=logMainContainer;if(!$("wrap").checked){var logContainerLeft=logContainer.scrollLeft;var logContainerRight=logContainerLeft+logContainer.offsetWidth;var elLeft=el.offsetLeft;var elRight=elLeft+el.offsetWidth;if(elLeft<logContainerLeft||elRight>logContainerRight){logContainer.scrollLeft=elLeft-(logContainer.offsetWidth-el.offsetWidth)/2;}}',"var logContainerTop=logContainer.scrollTop;var logContainerBottom=logContainerTop+logContainer.offsetHeight;var elTop=getPageOffsetTop(el)-getToolBarsHeight();var elBottom=elTop+el.offsetHeight;if(elTop<logContainerTop||elBottom>logContainerBottom){logContainer.scrollTop=elTop-(logContainer.offsetHeight-el.offsetHeight)/2;}}","function Match(logEntryLevel,spanInMainDiv,spanInUnwrappedPre,spanInWrappedDiv){this.logEntryLevel=logEntryLevel;this.spanInMainDiv=spanInMainDiv;if(isIe){this.spanInUnwrappedPre=spanInUnwrappedPre;this.spanInWrappedDiv=spanInWrappedDiv;}","this.mainSpan=isIe?spanInUnwrappedPre:spanInMainDiv;}",'Match.prototype={equals:function(match){return this.mainSpan===match.mainSpan;},setCurrent:function(){if(isIe){addClass(this.spanInUnwrappedPre,"currentmatch");addClass(this.spanInWrappedDiv,"currentmatch");var elementToScroll=$("wrap").checked?this.spanInWrappedDiv:this.spanInUnwrappedPre;scrollIntoView(elementToScroll);}else{addClass(this.spanInMainDiv,"currentmatch");scrollIntoView(this.spanInMainDiv);}},belongsTo:function(logEntry){if(isIe){return isDescendant(this.spanInUnwrappedPre,logEntry.unwrappedPre);}else{return isDescendant(this.spanInMainDiv,logEntry.mainDiv);}},setNotCurrent:function(){if(isIe){removeClass(this.spanInUnwrappedPre,"currentmatch");removeClass(this.spanInWrappedDiv,"currentmatch");}else{removeClass(this.spanInMainDiv,"currentmatch");}},isOrphan:function(){return isOrphan(this.mainSpan);},isVisible:function(){return getCheckBox(this.logEntryLevel).checked;},remove:function(){if(isIe){this.spanInUnwrappedPre=null;this.spanInWrappedDiv=null;}else{this.spanInMainDiv=null;}}};var currentSearch=null;var currentMatchIndex=null;function doSearch(){var searchBox=$("searchBox");var searchTerm=searchBox.value;var isRegex=$("searchRegex").checked;var isCaseSensitive=$("searchCaseSensitive").checked;var i;if(searchTerm===""){$("searchReset").disabled=true;$("searchNav").style.display="none";removeClass(document.body,"searching");removeClass(searchBox,"hasmatches");removeClass(searchBox,"nomatches");for(i=0;i<logEntries.length;i++){logEntries[i].clearSearch();logEntries[i].setContent(logEntries[i].formattedMessage,logEntries[i].formattedMessage);}','currentSearch=null;setLogContainerHeight();}else{$("searchReset").disabled=false;$("searchNav").style.display="block";var searchRegex;var regexValid;if(isRegex){try{searchRegex=isCaseSensitive?new RegExp(searchTerm,"g"):new RegExp(searchTerm,"gi");regexValid=true;replaceClass(searchBox,"validregex","invalidregex");searchBox.title="Valid regex";}catch(ex){regexValid=false;replaceClass(searchBox,"invalidregex","validregex");searchBox.title="Invalid regex: "+(ex.message?ex.message:(ex.description?ex.description:"unknown error"));return;}}else{searchBox.title="";removeClass(searchBox,"validregex");removeClass(searchBox,"invalidregex");}','addClass(document.body,"searching");currentSearch=new Search(searchTerm,isRegex,searchRegex,isCaseSensitive);for(i=0;i<logEntries.length;i++){currentSearch.applyTo(logEntries[i]);}',"setLogContainerHeight();if(currentSearch.hasVisibleMatches()){setCurrentMatchIndex(0);displayMatches();}else{displayNoMatches();}}}","function updateSearchFromFilters(){if(currentSearch){if(currentSearch.hasMatches()){if(currentMatchIndex===null){currentMatchIndex=0;}","var currentMatch=currentSearch.matches[currentMatchIndex];if(currentMatch.isVisible()){displayMatches();setCurrentMatchIndex(currentMatchIndex);}else{currentMatch.setNotCurrent();var nextVisibleMatchIndex=currentSearch.getNextVisibleMatchIndex();if(nextVisibleMatchIndex>-1){setCurrentMatchIndex(nextVisibleMatchIndex);displayMatches();}else{displayNoMatches();}}}else{displayNoMatches();}}}","function refreshCurrentMatch(){if(currentSearch&&currentSearch.hasVisibleMatches()){setCurrentMatchIndex(currentMatchIndex);}}",'function displayMatches(){replaceClass($("searchBox"),"hasmatches","nomatches");$("searchBox").title=""+currentSearch.matches.length+" matches found";$("searchNav").style.display="block";setLogContainerHeight();}','function displayNoMatches(){replaceClass($("searchBox"),"nomatches","hasmatches");$("searchBox").title="No matches found";$("searchNav").style.display="none";setLogContainerHeight();}','function toggleSearchEnabled(enable){enable=(typeof enable=="undefined")?!$("searchDisable").checked:enable;$("searchBox").disabled=!enable;$("searchReset").disabled=!enable;$("searchRegex").disabled=!enable;$("searchNext").disabled=!enable;$("searchPrevious").disabled=!enable;$("searchCaseSensitive").disabled=!enable;$("searchNav").style.display=(enable&&($("searchBox").value!=="")&&currentSearch&&currentSearch.hasVisibleMatches())?"block":"none";if(enable){removeClass($("search"),"greyedout");addClass(document.body,"searching");if($("searchHighlight").checked){addClass(logMainContainer,"searchhighlight");}else{removeClass(logMainContainer,"searchhighlight");}','if($("searchFilter").checked){addClass(logMainContainer,"searchfilter");}else{removeClass(logMainContainer,"searchfilter");}','$("searchDisable").checked=!enable;}else{addClass($("search"),"greyedout");removeClass(document.body,"searching");removeClass(logMainContainer,"searchhighlight");removeClass(logMainContainer,"searchfilter");}',"setLogContainerHeight();}",'function toggleSearchFilter(){var enable=$("searchFilter").checked;if(enable){addClass(logMainContainer,"searchfilter");}else{removeClass(logMainContainer,"searchfilter");}',"refreshCurrentMatch();}",'function toggleSearchHighlight(){var enable=$("searchHighlight").checked;if(enable){addClass(logMainContainer,"searchhighlight");}else{removeClass(logMainContainer,"searchhighlight");}}','function clearSearch(){$("searchBox").value="";doSearch();}','function searchNext(){if(currentSearch!==null&&currentMatchIndex!==null){currentSearch.matches[currentMatchIndex].setNotCurrent();var nextMatchIndex=currentSearch.getNextVisibleMatchIndex();if(nextMatchIndex>currentMatchIndex||confirm("Reached the end of the page. Start from the top?")){setCurrentMatchIndex(nextMatchIndex);}}}','function searchPrevious(){if(currentSearch!==null&&currentMatchIndex!==null){currentSearch.matches[currentMatchIndex].setNotCurrent();var previousMatchIndex=currentSearch.getPreviousVisibleMatchIndex();if(previousMatchIndex<currentMatchIndex||confirm("Reached the start of the page. Continue from the bottom?")){setCurrentMatchIndex(previousMatchIndex);}}}',"function setCurrentMatchIndex(index){currentMatchIndex=index;currentSearch.matches[currentMatchIndex].setCurrent();}",'function addClass(el,cssClass){if(!hasClass(el,cssClass)){if(el.className){el.className+=" "+cssClass;}else{el.className=cssClass;}}}','function hasClass(el,cssClass){if(el.className){var classNames=el.className.split(" ");return array_contains(classNames,cssClass);}',"return false;}",'function removeClass(el,cssClass){if(hasClass(el,cssClass)){var existingClasses=el.className.split(" ");var newClasses=[];for(var i=0,len=existingClasses.length;i<len;i++){if(existingClasses[i]!=cssClass){newClasses[newClasses.length]=existingClasses[i];}}','el.className=newClasses.join(" ");}}',"function replaceClass(el,newCssClass,oldCssClass){removeClass(el,oldCssClass);addClass(el,newCssClass);}","function getElementsByClass(el,cssClass,tagName){var elements=el.getElementsByTagName(tagName);var matches=[];for(var i=0,len=elements.length;i<len;i++){if(hasClass(elements[i],cssClass)){matches.push(elements[i]);}}","return matches;}","function $(id){return document.getElementById(id);}","function isDescendant(node,ancestorNode){while(node!=null){if(node===ancestorNode){return true;}","node=node.parentNode;}","return false;}","function isOrphan(node){var currentNode=node;while(currentNode){if(currentNode==document.body){return false;}","currentNode=currentNode.parentNode;}","return true;}",'function escapeHtml(str){return str.replace(/&/g,"&amp;").replace(/[<]/g,"&lt;").replace(/>/g,"&gt;");}',"function getWindowWidth(){if(window.innerWidth){return window.innerWidth;}else if(document.documentElement&&document.documentElement.clientWidth){return document.documentElement.clientWidth;}else if(document.body){return document.body.clientWidth;}","return 0;}","function getWindowHeight(){if(window.innerHeight){return window.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){return document.documentElement.clientHeight;}else if(document.body){return document.body.clientHeight;}","return 0;}",'function getToolBarsHeight(){return $("switches").offsetHeight;}','function getChromeHeight(){var height=getToolBarsHeight();if(showCommandLine){height+=$("commandLine").offsetHeight;}',"return height;}",'function setLogContainerHeight(){if(logMainContainer){var windowHeight=getWindowHeight();$("body").style.height=getWindowHeight()+"px";logMainContainer.style.height=""+','Math.max(0,windowHeight-getChromeHeight())+"px";}}','function setCommandInputWidth(){if(showCommandLine){$("command").style.width=""+Math.max(0,$("commandLineContainer").offsetWidth-','($("evaluateButton").offsetWidth+13))+"px";}}',"window.onresize=function(){setCommandInputWidth();setLogContainerHeight();};if(!Array.prototype.push){Array.prototype.push=function(){for(var i=0,len=arguments.length;i<len;i++){this[this.length]=arguments[i];}","return this.length;};}","if(!Array.prototype.pop){Array.prototype.pop=function(){if(this.length>0){var val=this[this.length-1];this.length=this.length-1;return val;}};}","if(!Array.prototype.shift){Array.prototype.shift=function(){if(this.length>0){var firstItem=this[0];for(var i=0,len=this.length-1;i<len;i++){this[i]=this[i+1];}","this.length=this.length-1;return firstItem;}};}","if(!Array.prototype.splice){Array.prototype.splice=function(startIndex,deleteCount){var itemsAfterDeleted=this.slice(startIndex+deleteCount);var itemsDeleted=this.slice(startIndex,startIndex+deleteCount);this.length=startIndex;var argumentsArray=[];for(var i=0,len=arguments.length;i<len;i++){argumentsArray[i]=arguments[i];}","var itemsToAppend=(argumentsArray.length>2)?itemsAfterDeleted=argumentsArray.slice(2).concat(itemsAfterDeleted):itemsAfterDeleted;for(i=0,len=itemsToAppend.length;i<len;i++){this.push(itemsToAppend[i]);}","return itemsDeleted;};}","function array_remove(arr,val){var index=-1;for(var i=0,len=arr.length;i<len;i++){if(arr[i]===val){index=i;break;}}","if(index>=0){arr.splice(index,1);return index;}else{return false;}}","function array_removeFromStart(array,numberToRemove){if(Array.prototype.splice){array.splice(0,numberToRemove);}else{for(var i=numberToRemove,len=array.length;i<len;i++){array[i-numberToRemove]=array[i];}","array.length=array.length-numberToRemove;}","return array;}","function array_contains(arr,val){for(var i=0,len=arr.length;i<len;i++){if(arr[i]==val){return true;}}","return false;}","function getErrorMessage(ex){if(ex.message){return ex.message;}else if(ex.description){return ex.description;}",'return""+ex;}',"function moveCaretToEnd(input){if(input.setSelectionRange){input.focus();var length=input.value.length;input.setSelectionRange(length,length);}else if(input.createTextRange){var range=input.createTextRange();range.collapse(false);range.select();}","input.focus();}",'function stopPropagation(evt){if(evt.stopPropagation){evt.stopPropagation();}else if(typeof evt.cancelBubble!="undefined"){evt.cancelBubble=true;}}',"function getEvent(evt){return evt?evt:event;}","function getTarget(evt){return evt.target?evt.target:evt.srcElement;}",'function getRelatedTarget(evt){if(evt.relatedTarget){return evt.relatedTarget;}else if(evt.srcElement){switch(evt.type){case"mouseover":return evt.fromElement;case"mouseout":return evt.toElement;default:return evt.srcElement;}}}',"function cancelKeyEvent(evt){evt.returnValue=false;stopPropagation(evt);}",'function evalCommandLine(){var expr=$("command").value;evalCommand(expr);$("command").value="";}',"function evalLastCommand(){if(lastCommand!=null){evalCommand(lastCommand);}}",'var lastCommand=null;var commandHistory=[];var currentCommandIndex=0;function evalCommand(expr){if(appender){appender.evalCommandAndAppend(expr);}else{var prefix=">>> "+expr+"\\r\\n";try{log("INFO",prefix+eval(expr));}catch(ex){log("ERROR",prefix+"Error: "+getErrorMessage(ex));}}',"if(expr!=commandHistory[commandHistory.length-1]){commandHistory.push(expr);if(appender){appender.storeCommandHistory(commandHistory);}}","currentCommandIndex=(expr==commandHistory[currentCommandIndex])?currentCommandIndex+1:commandHistory.length;lastCommand=expr;}","//]]>","<\/script>",'<style type="text/css">',"body{background-color:white;color:black;padding:0;margin:0;font-family:tahoma,verdana,arial,helvetica,sans-serif;overflow:hidden}div#switchesContainer input{margin-bottom:0}div.toolbar{border-top:solid #ffffff 1px;border-bottom:solid #aca899 1px;background-color:#f1efe7;padding:3px 5px;font-size:68.75%}div.toolbar,div#search input{font-family:tahoma,verdana,arial,helvetica,sans-serif}div.toolbar input.button{padding:0 5px;font-size:100%}div.toolbar input.hidden{display:none}div#switches input#clearButton{margin-left:20px}div#levels label{font-weight:bold}div#levels label,div#options label{margin-right:5px}div#levels label#wrapLabel{font-weight:normal}div#search label{margin-right:10px}div#search label.searchboxlabel{margin-right:0}div#search input{font-size:100%}div#search input.validregex{color:green}div#search input.invalidregex{color:red}div#search input.nomatches{color:white;background-color:#ff6666}div#search input.nomatches{color:white;background-color:#ff6666}div#searchNav{display:none}div#commandLine{display:none}div#commandLine input#command{font-size:100%;font-family:Courier New,Courier}div#commandLine input#evaluateButton{}*.greyedout{color:gray !important;border-color:gray !important}*.greyedout *.alwaysenabled{color:black}*.unselectable{-khtml-user-select:none;-moz-user-select:none;user-select:none}div#log{font-family:Courier New,Courier;font-size:75%;width:100%;overflow:auto;clear:both;position:relative}div.group{border-color:#cccccc;border-style:solid;border-width:1px 0 1px 1px;overflow:visible}div.oldIe div.group,div.oldIe div.group *,div.oldIe *.logentry{height:1%}div.group div.groupheading span.expander{border:solid black 1px;font-family:Courier New,Courier;font-size:0.833em;background-color:#eeeeee;position:relative;top:-1px;color:black;padding:0 2px;cursor:pointer;cursor:hand;height:1%}div.group div.groupcontent{margin-left:10px;padding-bottom:2px;overflow:visible}div.group div.expanded{display:block}div.group div.collapsed{display:none}*.logentry{overflow:visible;display:none;white-space:pre}span.pre{white-space:pre}pre.unwrapped{display:inline !important}pre.unwrapped pre.pre,div.wrapped pre.pre{display:inline}div.wrapped pre.pre{white-space:normal}div.wrapped{display:none}body.searching *.logentry span.currentmatch{color:white !important;background-color:green !important}body.searching div.searchhighlight *.logentry span.searchterm{color:black;background-color:yellow}div.wrap *.logentry{white-space:normal !important;border-width:0 0 1px 0;border-color:#dddddd;border-style:dotted}div.wrap #log_wrapped,#log_unwrapped{display:block}div.wrap #log_unwrapped,#log_wrapped{display:none}div.wrap *.logentry span.pre{overflow:visible;white-space:normal}div.wrap *.logentry pre.unwrapped{display:none}div.wrap *.logentry span.wrapped{display:inline}div.searchfilter *.searchnonmatch{display:none !important}div#log *.TRACE,label#label_TRACE{color:#666666}div#log *.DEBUG,label#label_DEBUG{color:green}div#log *.INFO,label#label_INFO{color:#000099}div#log *.WARN,label#label_WARN{color:#999900}div#log *.ERROR,label#label_ERROR{color:red}div#log *.FATAL,label#label_FATAL{color:#660066}div.TRACE#log *.TRACE,div.DEBUG#log *.DEBUG,div.INFO#log *.INFO,div.WARN#log *.WARN,div.ERROR#log *.ERROR,div.FATAL#log *.FATAL{display:block}div#log div.separator{background-color:#cccccc;margin:5px 0;line-height:1px}","</style>","</head>",'<body id="body">','<div id="switchesContainer">','<div id="switches">','<div id="levels" class="toolbar">',"Filters:",'<input type="checkbox" id="switch_TRACE" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide trace messages" /><label for="switch_TRACE" id="label_TRACE">trace</label>','<input type="checkbox" id="switch_DEBUG" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide debug messages" /><label for="switch_DEBUG" id="label_DEBUG">debug</label>','<input type="checkbox" id="switch_INFO" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide info messages" /><label for="switch_INFO" id="label_INFO">info</label>','<input type="checkbox" id="switch_WARN" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide warn messages" /><label for="switch_WARN" id="label_WARN">warn</label>','<input type="checkbox" id="switch_ERROR" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide error messages" /><label for="switch_ERROR" id="label_ERROR">error</label>','<input type="checkbox" id="switch_FATAL" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide fatal messages" /><label for="switch_FATAL" id="label_FATAL">fatal</label>','<input type="checkbox" id="switch_ALL" onclick="toggleAllLevels(); applyFilters()" checked="checked" title="Show/hide all messages" /><label for="switch_ALL" id="label_ALL">all</label>',"</div>",'<div id="search" class="toolbar">','<label for="searchBox" class="searchboxlabel">Search:</label> <input type="text" id="searchBox" onclick="toggleSearchEnabled(true)" onkeyup="scheduleSearch()" size="20" />','<input type="button" id="searchReset" disabled="disabled" value="Reset" onclick="clearSearch()" class="button" title="Reset the search" />','<input type="checkbox" id="searchRegex" onclick="doSearch()" title="If checked, search is treated as a regular expression" /><label for="searchRegex">Regex</label>','<input type="checkbox" id="searchCaseSensitive" onclick="doSearch()" title="If checked, search is case sensitive" /><label for="searchCaseSensitive">Match case</label>','<input type="checkbox" id="searchDisable" onclick="toggleSearchEnabled()" title="Enable/disable search" /><label for="searchDisable" class="alwaysenabled">Disable</label>','<div id="searchNav">','<input type="button" id="searchNext" disabled="disabled" value="Next" onclick="searchNext()" class="button" title="Go to the next matching log entry" />','<input type="button" id="searchPrevious" disabled="disabled" value="Previous" onclick="searchPrevious()" class="button" title="Go to the previous matching log entry" />','<input type="checkbox" id="searchFilter" onclick="toggleSearchFilter()" title="If checked, non-matching log entries are filtered out" /><label for="searchFilter">Filter</label>','<input type="checkbox" id="searchHighlight" onclick="toggleSearchHighlight()" title="Highlight matched search terms" /><label for="searchHighlight" class="alwaysenabled">Highlight all</label>',"</div>","</div>",'<div id="options" class="toolbar">',"Options:",'<input type="checkbox" id="enableLogging" onclick="toggleLoggingEnabled()" checked="checked" title="Enable/disable logging" /><label for="enableLogging" id="enableLoggingLabel">Log</label>','<input type="checkbox" id="wrap" onclick="toggleWrap()" title="Enable / disable word wrap" /><label for="wrap" id="wrapLabel">Wrap</label>','<input type="checkbox" id="newestAtTop" onclick="toggleNewestAtTop()" title="If checked, causes newest messages to appear at the top" /><label for="newestAtTop" id="newestAtTopLabel">Newest at the top</label>','<input type="checkbox" id="scrollToLatest" onclick="toggleScrollToLatest()" checked="checked" title="If checked, window automatically scrolls to a new message when it is added" /><label for="scrollToLatest" id="scrollToLatestLabel">Scroll to latest</label>','<input type="button" id="clearButton" value="Clear" onclick="clearLog()" class="button" title="Clear all log messages"  />','<input type="button" id="hideButton" value="Hide" onclick="hide()" class="hidden button" title="Hide the console" />','<input type="button" id="closeButton" value="Close" onclick="closeWindow()" class="hidden button" title="Close the window" />',"</div>","</div>","</div>",'<div id="log" class="TRACE DEBUG INFO WARN ERROR FATAL"></div>','<div id="commandLine" class="toolbar">','<div id="commandLineContainer">','<input type="text" id="command" title="Enter a JavaScript command here and hit return or press \'Evaluate\'" />','<input type="button" id="evaluateButton" value="Evaluate" class="button" title="Evaluate the command" onclick="evalCommandLine()" />',"</div>","</div>","</body>","</html>",""];
};
var defaultCommandLineFunctions=[];
ConsoleAppender=function(){};
var consoleAppenderIdCounter=1;
ConsoleAppender.prototype=new Appender();
ConsoleAppender.prototype.create=function(inPage,container,lazyInit,initiallyMinimized,useDocumentWrite,width,height,focusConsoleWindow){var appender=this;
var initialized=false;
var consoleWindowCreated=false;
var consoleWindowLoaded=false;
var consoleClosed=false;
var queuedLoggingEvents=[];
var isSupported=true;
var consoleAppenderId=consoleAppenderIdCounter++;
initiallyMinimized=extractBooleanFromParam(initiallyMinimized,this.defaults.initiallyMinimized);
lazyInit=extractBooleanFromParam(lazyInit,this.defaults.lazyInit);
useDocumentWrite=extractBooleanFromParam(useDocumentWrite,this.defaults.useDocumentWrite);
var newestMessageAtTop=this.defaults.newestMessageAtTop;
var scrollToLatestMessage=this.defaults.scrollToLatestMessage;
width=width?width:this.defaults.width;
height=height?height:this.defaults.height;
var maxMessages=this.defaults.maxMessages;
var showCommandLine=this.defaults.showCommandLine;
var commandLineObjectExpansionDepth=this.defaults.commandLineObjectExpansionDepth;
var showHideButton=this.defaults.showHideButton;
var showCloseButton=this.defaults.showCloseButton;
var showLogEntryDeleteButtons=this.defaults.showLogEntryDeleteButtons;
this.setLayout(this.defaults.layout);
var init,createWindow,safeToAppend,getConsoleWindow,open;
var appenderName=inPage?"InPageAppender":"PopUpAppender";
var checkCanConfigure=function(configOptionName){if(consoleWindowCreated){handleError(appenderName+": configuration option '"+configOptionName+"' may not be set after the appender has been initialized");
return false;
}return true;
};
var consoleWindowExists=function(){return(consoleWindowLoaded&&isSupported&&!consoleClosed);
};
this.isNewestMessageAtTop=function(){return newestMessageAtTop;
};
this.setNewestMessageAtTop=function(newestMessageAtTopParam){newestMessageAtTop=bool(newestMessageAtTopParam);
if(consoleWindowExists()){getConsoleWindow().setNewestAtTop(newestMessageAtTop);
}};
this.isScrollToLatestMessage=function(){return scrollToLatestMessage;
};
this.setScrollToLatestMessage=function(scrollToLatestMessageParam){scrollToLatestMessage=bool(scrollToLatestMessageParam);
if(consoleWindowExists()){getConsoleWindow().setScrollToLatest(scrollToLatestMessage);
}};
this.getWidth=function(){return width;
};
this.setWidth=function(widthParam){if(checkCanConfigure("width")){width=extractStringFromParam(widthParam,width);
}};
this.getHeight=function(){return height;
};
this.setHeight=function(heightParam){if(checkCanConfigure("height")){height=extractStringFromParam(heightParam,height);
}};
this.getMaxMessages=function(){return maxMessages;
};
this.setMaxMessages=function(maxMessagesParam){maxMessages=extractIntFromParam(maxMessagesParam,maxMessages);
if(consoleWindowExists()){getConsoleWindow().setMaxMessages(maxMessages);
}};
this.isShowCommandLine=function(){return showCommandLine;
};
this.setShowCommandLine=function(showCommandLineParam){showCommandLine=bool(showCommandLineParam);
if(consoleWindowExists()){getConsoleWindow().setShowCommandLine(showCommandLine);
}};
this.isShowHideButton=function(){return showHideButton;
};
this.setShowHideButton=function(showHideButtonParam){showHideButton=bool(showHideButtonParam);
if(consoleWindowExists()){getConsoleWindow().setShowHideButton(showHideButton);
}};
this.isShowCloseButton=function(){return showCloseButton;
};
this.setShowCloseButton=function(showCloseButtonParam){showCloseButton=bool(showCloseButtonParam);
if(consoleWindowExists()){getConsoleWindow().setShowCloseButton(showCloseButton);
}};
this.getCommandLineObjectExpansionDepth=function(){return commandLineObjectExpansionDepth;
};
this.setCommandLineObjectExpansionDepth=function(commandLineObjectExpansionDepthParam){commandLineObjectExpansionDepth=extractIntFromParam(commandLineObjectExpansionDepthParam,commandLineObjectExpansionDepth);
};
var minimized=initiallyMinimized;
this.isInitiallyMinimized=function(){return initiallyMinimized;
};
this.setInitiallyMinimized=function(initiallyMinimizedParam){if(checkCanConfigure("initiallyMinimized")){initiallyMinimized=bool(initiallyMinimizedParam);
minimized=initiallyMinimized;
}};
this.isUseDocumentWrite=function(){return useDocumentWrite;
};
this.setUseDocumentWrite=function(useDocumentWriteParam){if(checkCanConfigure("useDocumentWrite")){useDocumentWrite=bool(useDocumentWriteParam);
}};
function QueuedLoggingEvent(loggingEvent,formattedMessage){this.loggingEvent=loggingEvent;
this.levelName=loggingEvent.level.name;
this.formattedMessage=formattedMessage;
}QueuedLoggingEvent.prototype.append=function(){getConsoleWindow().log(this.levelName,this.formattedMessage);
};
function QueuedGroup(name,initiallyExpanded){this.name=name;
this.initiallyExpanded=initiallyExpanded;
}QueuedGroup.prototype.append=function(){getConsoleWindow().group(this.name,this.initiallyExpanded);
};
function QueuedGroupEnd(){}QueuedGroupEnd.prototype.append=function(){getConsoleWindow().groupEnd();
};
var checkAndAppend=function(){safeToAppend();
if(!initialized){init();
}else{if(consoleClosed&&reopenWhenClosed){createWindow();
}}if(safeToAppend()){appendQueuedLoggingEvents();
}};
this.append=function(loggingEvent){if(isSupported){var formattedMessage=appender.getLayout().format(loggingEvent);
if(this.getLayout().ignoresThrowable()){formattedMessage+=loggingEvent.getThrowableStrRep();
}queuedLoggingEvents.push(new QueuedLoggingEvent(loggingEvent,formattedMessage));
checkAndAppend();
}};
this.group=function(name,initiallyExpanded){if(isSupported){queuedLoggingEvents.push(new QueuedGroup(name,initiallyExpanded));
checkAndAppend();
}};
this.groupEnd=function(){if(isSupported){queuedLoggingEvents.push(new QueuedGroupEnd());
checkAndAppend();
}};
var appendQueuedLoggingEvents=function(){var currentLoggingEvent;
while(queuedLoggingEvents.length>0){queuedLoggingEvents.shift().append();
}if(focusConsoleWindow){getConsoleWindow().focus();
}};
this.setAddedToLogger=function(logger){this.loggers.push(logger);
if(enabled&&!lazyInit){init();
}};
this.clear=function(){if(consoleWindowExists()){getConsoleWindow().clearLog();
}queuedLoggingEvents.length=0;
};
this.focus=function(){if(consoleWindowExists()){getConsoleWindow().focus();
}};
this.focusCommandLine=function(){if(consoleWindowExists()){getConsoleWindow().focusCommandLine();
}};
this.focusSearch=function(){if(consoleWindowExists()){getConsoleWindow().focusSearch();
}};
var commandWindow=window;
this.getCommandWindow=function(){return commandWindow;
};
this.setCommandWindow=function(commandWindowParam){commandWindow=commandWindowParam;
};
this.executeLastCommand=function(){if(consoleWindowExists()){getConsoleWindow().evalLastCommand();
}};
var commandLayout=new PatternLayout("%m");
this.getCommandLayout=function(){return commandLayout;
};
this.setCommandLayout=function(commandLayoutParam){commandLayout=commandLayoutParam;
};
this.evalCommandAndAppend=function(expr){var commandReturnValue={appendResult:true,isError:false};
var commandOutput="";
try{var result,i;
if(!commandWindow.eval&&commandWindow.execScript){commandWindow.execScript("null");
}var commandLineFunctionsHash={};
for(i=0,len=commandLineFunctions.length;
i<len;
i++){commandLineFunctionsHash[commandLineFunctions[i][0]]=commandLineFunctions[i][1];
}var objectsToRestore=[];
var addObjectToRestore=function(name){objectsToRestore.push([name,commandWindow[name]]);
};
addObjectToRestore("appender");
commandWindow.appender=appender;
addObjectToRestore("commandReturnValue");
commandWindow.commandReturnValue=commandReturnValue;
addObjectToRestore("commandLineFunctionsHash");
commandWindow.commandLineFunctionsHash=commandLineFunctionsHash;
var addFunctionToWindow=function(name){addObjectToRestore(name);
commandWindow[name]=function(){return this.commandLineFunctionsHash[name](appender,arguments,commandReturnValue);
};
};
for(i=0,len=commandLineFunctions.length;
i<len;
i++){addFunctionToWindow(commandLineFunctions[i][0]);
}if(commandWindow===window&&commandWindow.execScript){addObjectToRestore("evalExpr");
addObjectToRestore("result");
window.evalExpr=expr;
commandWindow.execScript("window.result=eval(window.evalExpr);");
result=window.result;
}else{result=commandWindow.eval(expr);
}commandOutput=isUndefined(result)?result:formatObjectExpansion(result,commandLineObjectExpansionDepth);
for(i=0,len=objectsToRestore.length;
i<len;
i++){commandWindow[objectsToRestore[i][0]]=objectsToRestore[i][1];
}}catch(ex){commandOutput="Error evaluating command: "+getExceptionStringRep(ex);
commandReturnValue.isError=true;
}if(commandReturnValue.appendResult){var message=">>> "+expr;
if(!isUndefined(commandOutput)){message+=newLine+commandOutput;
}var level=commandReturnValue.isError?Level.ERROR:Level.INFO;
var loggingEvent=new LoggingEvent(null,new Date(),level,[message],null);
var mainLayout=this.getLayout();
this.setLayout(commandLayout);
this.append(loggingEvent);
this.setLayout(mainLayout);
}};
var commandLineFunctions=defaultCommandLineFunctions.concat([]);
this.addCommandLineFunction=function(functionName,commandLineFunction){commandLineFunctions.push([functionName,commandLineFunction]);
};
var commandHistoryCookieName="log4javascriptCommandHistory";
this.storeCommandHistory=function(commandHistory){setCookie(commandHistoryCookieName,commandHistory.join(","));
};
var writeHtml=function(doc){var lines=getConsoleHtmlLines();
doc.open();
for(var i=0,len=lines.length;
i<len;
i++){doc.writeln(lines[i]);
}doc.close();
};
this.setEventTypes(["load","unload"]);
var consoleWindowLoadHandler=function(){var win=getConsoleWindow();
win.setAppender(appender);
win.setNewestAtTop(newestMessageAtTop);
win.setScrollToLatest(scrollToLatestMessage);
win.setMaxMessages(maxMessages);
win.setShowCommandLine(showCommandLine);
win.setShowHideButton(showHideButton);
win.setShowCloseButton(showCloseButton);
win.setMainWindow(window);
var storedValue=getCookie(commandHistoryCookieName);
if(storedValue){win.commandHistory=storedValue.split(",");
win.currentCommandIndex=win.commandHistory.length;
}appender.dispatchEvent("load",{win:win});
};
this.unload=function(){logLog.debug("unload "+this+", caller: "+this.unload.caller);
if(!consoleClosed){logLog.debug("really doing unload "+this);
consoleClosed=true;
consoleWindowLoaded=false;
consoleWindowCreated=false;
appender.dispatchEvent("unload",{});
}};
var pollConsoleWindow=function(windowTest,interval,successCallback,errorMessage){function doPoll(){try{if(consoleClosed){clearInterval(poll);
}if(windowTest(getConsoleWindow())){clearInterval(poll);
successCallback();
}}catch(ex){clearInterval(poll);
isSupported=false;
handleError(errorMessage,ex);
}}var poll=setInterval(doPoll,interval);
};
var getConsoleUrl=function(){var documentDomainSet=(document.domain!=location.hostname);
return useDocumentWrite?"":getBaseUrl()+"console.html"+(documentDomainSet?"?log4javascript_domain="+escape(document.domain):"");
};
if(inPage){var containerElement=null;
var cssProperties=[];
this.addCssProperty=function(name,value){if(checkCanConfigure("cssProperties")){cssProperties.push([name,value]);
}};
var windowCreationStarted=false;
var iframeContainerDiv;
var iframeId=uniqueId+"_InPageAppender_"+consoleAppenderId;
this.hide=function(){if(initialized&&consoleWindowCreated){if(consoleWindowExists()){getConsoleWindow().$("command").blur();
}iframeContainerDiv.style.display="none";
minimized=true;
}};
this.show=function(){if(initialized){if(consoleWindowCreated){iframeContainerDiv.style.display="block";
this.setShowCommandLine(showCommandLine);
minimized=false;
}else{if(!windowCreationStarted){createWindow(true);
}}}};
this.isVisible=function(){return !minimized&&!consoleClosed;
};
this.close=function(fromButton){if(!consoleClosed&&(!fromButton||confirm("This will permanently remove the console from the page. No more messages will be logged. Do you wish to continue?"))){iframeContainerDiv.parentNode.removeChild(iframeContainerDiv);
this.unload();
}};
open=function(){var initErrorMessage="InPageAppender.open: unable to create console iframe";
function finalInit(){try{if(!initiallyMinimized){appender.show();
}consoleWindowLoadHandler();
consoleWindowLoaded=true;
appendQueuedLoggingEvents();
}catch(ex){isSupported=false;
handleError(initErrorMessage,ex);
}}function writeToDocument(){try{var windowTest=function(win){return isLoaded(win);
};
if(useDocumentWrite){writeHtml(getConsoleWindow().document);
}if(windowTest(getConsoleWindow())){finalInit();
}else{pollConsoleWindow(windowTest,100,finalInit,initErrorMessage);
}}catch(ex){isSupported=false;
handleError(initErrorMessage,ex);
}}minimized=false;
iframeContainerDiv=containerElement.appendChild(document.createElement("div"));
iframeContainerDiv.style.width=width;
iframeContainerDiv.style.height=height;
iframeContainerDiv.style.border="solid gray 1px";
for(var i=0,len=cssProperties.length;
i<len;
i++){iframeContainerDiv.style[cssProperties[i][0]]=cssProperties[i][1];
}var iframeSrc=useDocumentWrite?"":" src='"+getConsoleUrl()+"'";
iframeContainerDiv.innerHTML="<iframe id='"+iframeId+"' name='"+iframeId+"' width='100%' height='100%' frameborder='0'"+iframeSrc+"scrolling='no'></iframe>";
consoleClosed=false;
var iframeDocumentExistsTest=function(win){try{return bool(win)&&bool(win.document);
}catch(ex){return false;
}};
if(iframeDocumentExistsTest(getConsoleWindow())){writeToDocument();
}else{pollConsoleWindow(iframeDocumentExistsTest,100,writeToDocument,initErrorMessage);
}consoleWindowCreated=true;
};
createWindow=function(show){if(show||!initiallyMinimized){var pageLoadHandler=function(){if(!container){containerElement=document.createElement("div");
containerElement.style.position="fixed";
containerElement.style.left="0";
containerElement.style.right="0";
containerElement.style.bottom="0";
document.body.appendChild(containerElement);
appender.addCssProperty("borderWidth","1px 0 0 0");
appender.addCssProperty("zIndex",1000000);
open();
}else{try{var el=document.getElementById(container);
if(el.nodeType==1){containerElement=el;
}open();
}catch(ex){handleError("InPageAppender.init: invalid container element '"+container+"' supplied",ex);
}}};
if(pageLoaded&&container&&container.appendChild){containerElement=container;
open();
}else{if(pageLoaded){pageLoadHandler();
}else{log4javascript.addEventListener("load",pageLoadHandler);
}}windowCreationStarted=true;
}};
init=function(){createWindow();
initialized=true;
};
getConsoleWindow=function(){var iframe=window.frames[iframeId];
if(iframe){return iframe;
}};
safeToAppend=function(){if(isSupported&&!consoleClosed){if(consoleWindowCreated&&!consoleWindowLoaded&&getConsoleWindow()&&isLoaded(getConsoleWindow())){consoleWindowLoaded=true;
}return consoleWindowLoaded;
}return false;
};
}else{var useOldPopUp=appender.defaults.useOldPopUp;
var complainAboutPopUpBlocking=appender.defaults.complainAboutPopUpBlocking;
var reopenWhenClosed=this.defaults.reopenWhenClosed;
this.isUseOldPopUp=function(){return useOldPopUp;
};
this.setUseOldPopUp=function(useOldPopUpParam){if(checkCanConfigure("useOldPopUp")){useOldPopUp=bool(useOldPopUpParam);
}};
this.isComplainAboutPopUpBlocking=function(){return complainAboutPopUpBlocking;
};
this.setComplainAboutPopUpBlocking=function(complainAboutPopUpBlockingParam){if(checkCanConfigure("complainAboutPopUpBlocking")){complainAboutPopUpBlocking=bool(complainAboutPopUpBlockingParam);
}};
this.isFocusPopUp=function(){return focusConsoleWindow;
};
this.setFocusPopUp=function(focusPopUpParam){focusConsoleWindow=bool(focusPopUpParam);
};
this.isReopenWhenClosed=function(){return reopenWhenClosed;
};
this.setReopenWhenClosed=function(reopenWhenClosedParam){reopenWhenClosed=bool(reopenWhenClosedParam);
};
this.close=function(){logLog.debug("close "+this);
try{popUp.close();
this.unload();
}catch(ex){}};
this.hide=function(){logLog.debug("hide "+this);
if(consoleWindowExists()){this.close();
}};
this.show=function(){logLog.debug("show "+this);
if(!consoleWindowCreated){open();
}};
this.isVisible=function(){return safeToAppend();
};
var popUp;
open=function(){var windowProperties="width="+width+",height="+height+",status,resizable";
var windowName="PopUp_"+location.host.replace(/[^a-z0-9]/gi,"_")+"_"+consoleAppenderId;
if(!useOldPopUp||!useDocumentWrite){windowName=windowName+"_"+uniqueId;
}var checkPopUpClosed=function(win){if(consoleClosed){return true;
}else{try{return bool(win)&&win.closed;
}catch(ex){}}return false;
};
var popUpClosedCallback=function(){if(!consoleClosed){appender.unload();
}};
function finalInit(){getConsoleWindow().setCloseIfOpenerCloses(!useOldPopUp||!useDocumentWrite);
consoleWindowLoadHandler();
consoleWindowLoaded=true;
appendQueuedLoggingEvents();
pollConsoleWindow(checkPopUpClosed,500,popUpClosedCallback,"PopUpAppender.checkPopUpClosed: error checking pop-up window");
}try{popUp=window.open(getConsoleUrl(),windowName,windowProperties);
consoleClosed=false;
consoleWindowCreated=true;
if(popUp){if(useDocumentWrite&&useOldPopUp&&isLoaded(popUp)){popUp.mainPageReloaded();
finalInit();
}else{if(useDocumentWrite){writeHtml(popUp.document);
}var popUpLoadedTest=function(win){return bool(win)&&isLoaded(win);
};
if(isLoaded(popUp)){finalInit();
}else{pollConsoleWindow(popUpLoadedTest,100,finalInit,"PopUpAppender.init: unable to create console window");
}}}else{isSupported=false;
logLog.warn("PopUpAppender.init: pop-ups blocked, please unblock to use PopUpAppender");
if(complainAboutPopUpBlocking){handleError("log4javascript: pop-up windows appear to be blocked. Please unblock them to use pop-up logging.");
}}}catch(ex){handleError("PopUpAppender.init: error creating pop-up",ex);
}};
createWindow=function(){if(!initiallyMinimized){open();
}};
init=function(){createWindow();
initialized=true;
};
getConsoleWindow=function(){return popUp;
};
safeToAppend=function(){if(isSupported&&!isUndefined(popUp)&&!consoleClosed){if(popUp.closed||(consoleWindowLoaded&&isUndefined(popUp.closed))){appender.unload();
logLog.debug("PopUpAppender: pop-up closed");
return false;
}if(!consoleWindowLoaded&&isLoaded(popUp)){consoleWindowLoaded=true;
}}return isSupported&&consoleWindowLoaded&&!consoleClosed;
};
}this.getConsoleWindow=getConsoleWindow;
};
ConsoleAppender.addGlobalCommandLineFunction=function(functionName,commandLineFunction){defaultCommandLineFunctions.push([functionName,commandLineFunction]);
};
function PopUpAppender(lazyInit,initiallyMinimized,useDocumentWrite,width,height){this.create(false,null,lazyInit,initiallyMinimized,useDocumentWrite,width,height,this.defaults.focusPopUp);
}PopUpAppender.prototype=new ConsoleAppender();
PopUpAppender.prototype.defaults={layout:new PatternLayout("%d{HH:mm:ss} %-5p - %m{1}%n"),initiallyMinimized:false,focusPopUp:false,lazyInit:true,useOldPopUp:true,complainAboutPopUpBlocking:true,newestMessageAtTop:false,scrollToLatestMessage:true,width:"600",height:"400",reopenWhenClosed:false,maxMessages:null,showCommandLine:true,commandLineObjectExpansionDepth:1,showHideButton:false,showCloseButton:true,showLogEntryDeleteButtons:true,useDocumentWrite:true};
PopUpAppender.prototype.toString=function(){return"PopUpAppender";
};
log4javascript.PopUpAppender=PopUpAppender;
function InPageAppender(container,lazyInit,initiallyMinimized,useDocumentWrite,width,height){this.create(true,container,lazyInit,initiallyMinimized,useDocumentWrite,width,height,false);
}InPageAppender.prototype=new ConsoleAppender();
InPageAppender.prototype.defaults={layout:new PatternLayout("%d{HH:mm:ss} %-5p - %m{1}%n"),initiallyMinimized:false,lazyInit:true,newestMessageAtTop:false,scrollToLatestMessage:true,width:"100%",height:"220px",maxMessages:null,showCommandLine:true,commandLineObjectExpansionDepth:1,showHideButton:false,showCloseButton:false,showLogEntryDeleteButtons:true,useDocumentWrite:true};
InPageAppender.prototype.toString=function(){return"InPageAppender";
};
log4javascript.InPageAppender=InPageAppender;
log4javascript.InlineAppender=InPageAppender;
})();
function padWithSpaces(str,len){if(str.length<len){var spaces=[];
var numberOfSpaces=Math.max(0,len-str.length);
for(var i=0;
i<numberOfSpaces;
i++){spaces[i]=" ";
}str+=spaces.join("");
}return str;
}(function(){function dir(obj){var maxLen=0;
for(var p in obj){maxLen=Math.max(toStr(p).length,maxLen);
}var propList=[];
for(p in obj){var propNameStr="  "+padWithSpaces(toStr(p),maxLen+2);
var propVal;
try{propVal=splitIntoLines(toStr(obj[p])).join(padWithSpaces(newLine,maxLen+6));
}catch(ex){propVal="[Error obtaining property. Details: "+getExceptionMessage(ex)+"]";
}propList.push(propNameStr+propVal);
}return propList.join(newLine);
}var nodeTypes={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};
var preFormattedElements=["script","pre"];
var emptyElements=["br","img","hr","param","link","area","input","col","base","meta"];
var indentationUnit="  ";
function getXhtml(rootNode,includeRootNode,indentation,startNewLine,preformatted){includeRootNode=(typeof includeRootNode=="undefined")?true:(includeRootNode?true:false);
if(typeof indentation!="string"){indentation="";
}startNewLine=startNewLine?true:false;
preformatted=preformatted?true:false;
var xhtml;
function isWhitespace(node){return((node.nodeType==nodeTypes.TEXT_NODE)&&/^[ \t\r\n]*$/.test(node.nodeValue));
}function fixAttributeValue(attrValue){return attrValue.toString().replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/\"/g,"&quot;");
}function getStyleAttributeValue(el){var stylePairs=el.style.cssText.split(";");
var styleValue="";
var isFirst=true;
for(var j=0,len=stylePairs.length;
j<len;
j++){var nameValueBits=stylePairs[j].split(":");
var props=[];
if(!/^\s*$/.test(nameValueBits[0])){props.push(trim(nameValueBits[0]).toLowerCase()+":"+trim(nameValueBits[1]));
}styleValue=props.join(";");
}return styleValue;
}function getNamespace(el){if(el.prefix){return el.prefix;
}else{if(el.outerHTML){var regex=new RegExp("<([^:]+):"+el.tagName+"[^>]*>","i");
if(regex.test(el.outerHTML)){return RegExp.$1.toLowerCase();
}}}return"";
}var lt="<";
var gt=">";
if(includeRootNode&&rootNode.nodeType!=nodeTypes.DOCUMENT_FRAGMENT_NODE){switch(rootNode.nodeType){case nodeTypes.ELEMENT_NODE:var tagName=rootNode.tagName.toLowerCase();
xhtml=startNewLine?newLine+indentation:"";
xhtml+=lt;
var prefix=getNamespace(rootNode);
var hasPrefix=prefix?true:false;
if(hasPrefix){xhtml+=prefix+":";
}xhtml+=tagName;
for(i=0,len=rootNode.attributes.length;
i<len;
i++){var currentAttr=rootNode.attributes[i];
if(!currentAttr.specified||currentAttr.nodeValue===null||currentAttr.nodeName.toLowerCase()==="style"||typeof currentAttr.nodeValue!=="string"||currentAttr.nodeName.indexOf("_moz")===0){continue;
}xhtml+=" "+currentAttr.nodeName.toLowerCase()+'="';
xhtml+=fixAttributeValue(currentAttr.nodeValue);
xhtml+='"';
}if(rootNode.style.cssText){var styleValue=getStyleAttributeValue(rootNode);
if(styleValue!==""){xhtml+=' style="'+getStyleAttributeValue(rootNode)+'"';
}}if(array_contains(emptyElements,tagName)||(hasPrefix&&!rootNode.hasChildNodes())){xhtml+="/"+gt;
}else{xhtml+=gt;
var childStartNewLine=!(rootNode.childNodes.length===1&&rootNode.childNodes[0].nodeType===nodeTypes.TEXT_NODE);
var childPreformatted=array_contains(preFormattedElements,tagName);
for(var i=0,len=rootNode.childNodes.length;
i<len;
i++){xhtml+=getXhtml(rootNode.childNodes[i],true,indentation+indentationUnit,childStartNewLine,childPreformatted);
}var endTag=lt+"/"+tagName+gt;
xhtml+=childStartNewLine?newLine+indentation+endTag:endTag;
}return xhtml;
case nodeTypes.TEXT_NODE:if(isWhitespace(rootNode)){xhtml="";
}else{if(preformatted){xhtml=rootNode.nodeValue;
}else{var lines=splitIntoLines(trim(rootNode.nodeValue));
var trimmedLines=[];
for(var i=0,len=lines.length;
i<len;
i++){trimmedLines[i]=trim(lines[i]);
}xhtml=trimmedLines.join(newLine+indentation);
}if(startNewLine){xhtml=newLine+indentation+xhtml;
}}return xhtml;
case nodeTypes.CDATA_SECTION_NODE:return"<![CDATA["+rootNode.nodeValue+"]]>"+newLine;
case nodeTypes.DOCUMENT_NODE:xhtml="";
for(var i=0,len=rootNode.childNodes.length;
i<len;
i++){xhtml+=getXhtml(rootNode.childNodes[i],true,indentation);
}return xhtml;
default:return"";
}}else{xhtml="";
for(var i=0,len=rootNode.childNodes.length;
i<len;
i++){xhtml+=getXhtml(rootNode.childNodes[i],true,indentation+indentationUnit);
}return xhtml;
}}var layouts={};
function createCommandLineFunctions(appender){ConsoleAppender.addGlobalCommandLineFunction("$",function(appender,args,returnValue){return document.getElementById(args[0]);
});
ConsoleAppender.addGlobalCommandLineFunction("dir",function(appender,args,returnValue){var lines=[];
for(var i=0,len=args.length;
i<len;
i++){lines[i]=dir(args[i]);
}return lines.join(newLine+newLine);
});
ConsoleAppender.addGlobalCommandLineFunction("dirxml",function(appender,args,returnValue){var lines=[];
for(var i=0,len=args.length;
i<len;
i++){var win=appender.getCommandWindow();
lines[i]=getXhtml(args[i]);
}return lines.join(newLine+newLine);
});
ConsoleAppender.addGlobalCommandLineFunction("cd",function(appender,args,returnValue){var win,message;
if(args.length===0||args[0]===""){win=window;
message="Command line set to run in main window";
}else{if(args[0].window==args[0]){win=args[0];
message="Command line set to run in frame '"+args[0].name+"'";
}else{win=window.frames[args[0]];
if(win){message="Command line set to run in frame '"+args[0]+"'";
}else{returnValue.isError=true;
message="Frame '"+args[0]+"' does not exist";
win=appender.getCommandWindow();
}}}appender.setCommandWindow(win);
return message;
});
ConsoleAppender.addGlobalCommandLineFunction("clear",function(appender,args,returnValue){returnValue.appendResult=false;
appender.clear();
});
ConsoleAppender.addGlobalCommandLineFunction("keys",function(appender,args,returnValue){var keys=[];
for(var k in args[0]){keys.push(k);
}return keys;
});
ConsoleAppender.addGlobalCommandLineFunction("values",function(appender,args,returnValue){var values=[];
for(var k in args[0]){try{values.push(args[0][k]);
}catch(ex){logLog.warn("values(): Unable to obtain value for key "+k+". Details: "+getExceptionMessage(ex));
}}return values;
});
ConsoleAppender.addGlobalCommandLineFunction("expansionDepth",function(appender,args,returnValue){var expansionDepth=parseInt(args[0],10);
if(isNaN(expansionDepth)||expansionDepth<0){returnValue.isError=true;
return""+args[0]+" is not a valid expansion depth";
}else{appender.setCommandLineObjectExpansionDepth(expansionDepth);
return"Object expansion depth set to "+expansionDepth;
}});
}function init(){createCommandLineFunctions();
initialized=true;
}init();
})();
function addWindowLoadListener(listener){var oldOnload=window.onload;
if(typeof window.onload!="function"){window.onload=listener;
}else{window.onload=function(evt){if(oldOnload){oldOnload(evt);
}listener(evt);
};
}}addWindowLoadListener(function(){pageLoaded=true;
log4javascript.dispatchEvent("load",{});
});
window.log4javascript=log4javascript;
})();
var MD5=function(C){function M(b,a){return(b<<a)|(b>>>(32-a));
}function K(k,c){var F,b,d,x,a;
d=(k&2147483648);
x=(c&2147483648);
F=(k&1073741824);
b=(c&1073741824);
a=(k&1073741823)+(c&1073741823);
if(F&b){return(a^2147483648^d^x);
}if(F|b){if(a&1073741824){return(a^3221225472^d^x);
}else{return(a^1073741824^d^x);
}}else{return(a^d^x);
}}function s(a,c,b){return(a&c)|((~a)&b);
}function r(a,c,b){return(a&b)|(c&(~b));
}function q(a,c,b){return(a^c^b);
}function p(a,c,b){return(c^(a|(~b)));
}function v(G,F,aa,Z,k,H,I){G=K(G,K(K(s(F,aa,Z),k),I));
return K(M(G,H),F);
}function f(G,F,aa,Z,k,H,I){G=K(G,K(K(r(F,aa,Z),k),I));
return K(M(G,H),F);
}function E(G,F,aa,Z,k,H,I){G=K(G,K(K(q(F,aa,Z),k),I));
return K(M(G,H),F);
}function u(G,F,aa,Z,k,H,I){G=K(G,K(K(p(F,aa,Z),k),I));
return K(M(G,H),F);
}function e(d){var H;
var k=d.length;
var c=k+8;
var b=(c-(c%64))/64;
var F=(b+1)*16;
var G=Array(F-1);
var a=0;
var x=0;
while(x<k){H=(x-(x%4))/4;
a=(x%4)*8;
G[H]=(G[H]|(d.charCodeAt(x)<<a));
x++;
}H=(x-(x%4))/4;
a=(x%4)*8;
G[H]=G[H]|(128<<a);
G[F-2]=k<<3;
G[F-1]=k>>>29;
return G;
}function t(a){var c="",d="",k,b;
for(b=0;
b<=3;
b++){k=(a>>>(b*8))&255;
d="0"+k.toString(16);
c=c+d.substr(d.length-2,2);
}return c;
}function j(a){a=a.replace(/\r\n/g,"\n");
var b="";
for(var k=0;
k<a.length;
k++){var d=a.charCodeAt(k);
if(d<128){b+=String.fromCharCode(d);
}else{if((d>127)&&(d<2048)){b+=String.fromCharCode((d>>6)|192);
b+=String.fromCharCode((d&63)|128);
}else{b+=String.fromCharCode((d>>12)|224);
b+=String.fromCharCode(((d>>6)&63)|128);
b+=String.fromCharCode((d&63)|128);
}}}return b;
}var D=Array();
var Q,h,J,w,g,Y,X,W,V;
var S=7,P=12,N=17,L=22;
var B=5,A=9,z=14,y=20;
var o=4,n=11,m=16,l=23;
var U=6,T=10,R=15,O=21;
C=j(C);
D=e(C);
Y=1732584193;
X=4023233417;
W=2562383102;
V=271733878;
for(Q=0;
Q<D.length;
Q+=16){h=Y;
J=X;
w=W;
g=V;
Y=v(Y,X,W,V,D[Q+0],S,3614090360);
V=v(V,Y,X,W,D[Q+1],P,3905402710);
W=v(W,V,Y,X,D[Q+2],N,606105819);
X=v(X,W,V,Y,D[Q+3],L,3250441966);
Y=v(Y,X,W,V,D[Q+4],S,4118548399);
V=v(V,Y,X,W,D[Q+5],P,1200080426);
W=v(W,V,Y,X,D[Q+6],N,2821735955);
X=v(X,W,V,Y,D[Q+7],L,4249261313);
Y=v(Y,X,W,V,D[Q+8],S,1770035416);
V=v(V,Y,X,W,D[Q+9],P,2336552879);
W=v(W,V,Y,X,D[Q+10],N,4294925233);
X=v(X,W,V,Y,D[Q+11],L,2304563134);
Y=v(Y,X,W,V,D[Q+12],S,1804603682);
V=v(V,Y,X,W,D[Q+13],P,4254626195);
W=v(W,V,Y,X,D[Q+14],N,2792965006);
X=v(X,W,V,Y,D[Q+15],L,1236535329);
Y=f(Y,X,W,V,D[Q+1],B,4129170786);
V=f(V,Y,X,W,D[Q+6],A,3225465664);
W=f(W,V,Y,X,D[Q+11],z,643717713);
X=f(X,W,V,Y,D[Q+0],y,3921069994);
Y=f(Y,X,W,V,D[Q+5],B,3593408605);
V=f(V,Y,X,W,D[Q+10],A,38016083);
W=f(W,V,Y,X,D[Q+15],z,3634488961);
X=f(X,W,V,Y,D[Q+4],y,3889429448);
Y=f(Y,X,W,V,D[Q+9],B,568446438);
V=f(V,Y,X,W,D[Q+14],A,3275163606);
W=f(W,V,Y,X,D[Q+3],z,4107603335);
X=f(X,W,V,Y,D[Q+8],y,1163531501);
Y=f(Y,X,W,V,D[Q+13],B,2850285829);
V=f(V,Y,X,W,D[Q+2],A,4243563512);
W=f(W,V,Y,X,D[Q+7],z,1735328473);
X=f(X,W,V,Y,D[Q+12],y,2368359562);
Y=E(Y,X,W,V,D[Q+5],o,4294588738);
V=E(V,Y,X,W,D[Q+8],n,2272392833);
W=E(W,V,Y,X,D[Q+11],m,1839030562);
X=E(X,W,V,Y,D[Q+14],l,4259657740);
Y=E(Y,X,W,V,D[Q+1],o,2763975236);
V=E(V,Y,X,W,D[Q+4],n,1272893353);
W=E(W,V,Y,X,D[Q+7],m,4139469664);
X=E(X,W,V,Y,D[Q+10],l,3200236656);
Y=E(Y,X,W,V,D[Q+13],o,681279174);
V=E(V,Y,X,W,D[Q+0],n,3936430074);
W=E(W,V,Y,X,D[Q+3],m,3572445317);
X=E(X,W,V,Y,D[Q+6],l,76029189);
Y=E(Y,X,W,V,D[Q+9],o,3654602809);
V=E(V,Y,X,W,D[Q+12],n,3873151461);
W=E(W,V,Y,X,D[Q+15],m,530742520);
X=E(X,W,V,Y,D[Q+2],l,3299628645);
Y=u(Y,X,W,V,D[Q+0],U,4096336452);
V=u(V,Y,X,W,D[Q+7],T,1126891415);
W=u(W,V,Y,X,D[Q+14],R,2878612391);
X=u(X,W,V,Y,D[Q+5],O,4237533241);
Y=u(Y,X,W,V,D[Q+12],U,1700485571);
V=u(V,Y,X,W,D[Q+3],T,2399980690);
W=u(W,V,Y,X,D[Q+10],R,4293915773);
X=u(X,W,V,Y,D[Q+1],O,2240044497);
Y=u(Y,X,W,V,D[Q+8],U,1873313359);
V=u(V,Y,X,W,D[Q+15],T,4264355552);
W=u(W,V,Y,X,D[Q+6],R,2734768916);
X=u(X,W,V,Y,D[Q+13],O,1309151649);
Y=u(Y,X,W,V,D[Q+4],U,4149444226);
V=u(V,Y,X,W,D[Q+11],T,3174756917);
W=u(W,V,Y,X,D[Q+2],R,718787259);
X=u(X,W,V,Y,D[Q+9],O,3951481745);
Y=K(Y,h);
X=K(X,J);
W=K(W,w);
V=K(V,g);
}var i=t(Y)+t(X)+t(W)+t(V);
return i.toLowerCase();
};
var OAuth;
if(OAuth==null){OAuth={};
}OAuth.setProperties=function setProperties(a,c){if(a!=null&&c!=null){for(var b in c){a[b]=c[b];
}}return a;
};
OAuth.setProperties(OAuth,{percentEncode:function percentEncode(b){if(b==null){return"";
}if(b instanceof Array){var c="";
for(var a=0;
a<b.length;
++b){if(c!=""){c+="&";
}c+=OAuth.percentEncode(b[a]);
}return c;
}b=encodeURIComponent(b);
b=b.replace(/\!/g,"%21");
b=b.replace(/\*/g,"%2A");
b=b.replace(/\'/g,"%27");
b=b.replace(/\(/g,"%28");
b=b.replace(/\)/g,"%29");
return b;
},decodePercent:function decodePercent(a){if(a!=null){a=a.replace(/\+/g," ");
}return decodeURIComponent(a);
},getParameterList:function getParameterList(a){if(a==null){return[];
}if(typeof a!="object"){return OAuth.decodeForm(a+"");
}if(a instanceof Array){return a;
}var b=[];
for(var c in a){b.push([c,a[c]]);
}return b;
},getParameterMap:function getParameterMap(b){if(b==null){return{};
}if(typeof b!="object"){return OAuth.getParameterMap(OAuth.decodeForm(b+""));
}if(b instanceof Array){var d={};
for(var c=0;
c<b.length;
++c){var a=b[c][0];
if(d[a]===undefined){d[a]=b[c][1];
}}return d;
}return b;
},getParameter:function getParameter(b,a){if(b instanceof Array){for(var c=0;
c<b.length;
++c){if(b[c][0]==a){return b[c][1];
}}}else{return OAuth.getParameterMap(b)[a];
}return null;
},formEncode:function formEncode(b){var a="";
var d=OAuth.getParameterList(b);
for(var e=0;
e<d.length;
++e){var c=d[e][1];
if(c==null){c="";
}if(a!=""){a+="&";
}a+=OAuth.percentEncode(d[e][0])+"="+OAuth.percentEncode(c);
}return a;
},decodeForm:function decodeForm(d){var f=[];
var h=d.split("&");
for(var g=0;
g<h.length;
++g){var b=h[g];
if(b==""){continue;
}var a=b.indexOf("=");
var c;
var e;
if(a<0){c=OAuth.decodePercent(b);
e=null;
}else{c=OAuth.decodePercent(b.substring(0,a));
e=OAuth.decodePercent(b.substring(a+1));
}f.push([c,e]);
}return f;
},setParameter:function setParameter(c,a,d){var b=c.parameters;
if(b instanceof Array){for(var e=0;
e<b.length;
++e){if(b[e][0]==a){if(d===undefined){b.splice(e,1);
}else{b[e][1]=d;
d=undefined;
}}}if(d!==undefined){b.push([a,d]);
}}else{b=OAuth.getParameterMap(b);
b[a]=d;
c.parameters=b;
}},setParameters:function setParameters(c,b){var d=OAuth.getParameterList(b);
for(var a=0;
a<d.length;
++a){OAuth.setParameter(c,d[a][0],d[a][1]);
}},completeRequest:function completeRequest(a,b){if(a.method==null){a.method="GET";
}var c=OAuth.getParameterMap(a.parameters);
if(c.oauth_consumer_key==null){OAuth.setParameter(a,"oauth_consumer_key",b.consumerKey||"");
}if(c.oauth_token==null&&b.token!=null){OAuth.setParameter(a,"oauth_token",b.token);
}if(c.oauth_version==null){OAuth.setParameter(a,"oauth_version","1.0");
}if(c.oauth_timestamp==null){OAuth.setParameter(a,"oauth_timestamp",OAuth.timestamp());
}if(c.oauth_nonce==null){OAuth.setParameter(a,"oauth_nonce",OAuth.nonce(6));
}OAuth.SignatureMethod.sign(a,b);
},setTimestampAndNonce:function setTimestampAndNonce(a){OAuth.setParameter(a,"oauth_timestamp",OAuth.timestamp());
OAuth.setParameter(a,"oauth_nonce",OAuth.nonce(6));
},addToURL:function addToURL(a,c){newURL=a;
if(c!=null){var b=OAuth.formEncode(c);
if(b.length>0){var d=a.indexOf("?");
if(d<0){newURL+="?";
}else{newURL+="&";
}newURL+=b;
}}return newURL;
},getAuthorizationHeader:function getAuthorizationHeader(a,c){var f='OAuth realm="'+OAuth.percentEncode(a)+'"';
var d=OAuth.getParameterList(c);
for(var e=0;
e<d.length;
++e){var g=d[e];
var b=g[0];
if(b.indexOf("oauth_")==0){f+=","+OAuth.percentEncode(b)+'="'+OAuth.percentEncode(g[1])+'"';
}}return f;
},correctTimestampFromSrc:function correctTimestampFromSrc(c){c=c||"oauth_timestamp";
var a=document.getElementsByTagName("script");
if(a==null||!a.length){return;
}var e=a[a.length-1].src;
if(!e){return;
}var d=e.indexOf("?");
if(d<0){return;
}parameters=OAuth.getParameterMap(OAuth.decodeForm(e.substring(d+1)));
var b=parameters[c];
if(b==null){return;
}OAuth.correctTimestamp(b);
},correctTimestamp:function correctTimestamp(a){OAuth.timeCorrectionMsec=(a*1000)-(new Date()).getTime();
},timeCorrectionMsec:0,timestamp:function timestamp(){var a=(new Date()).getTime()+OAuth.timeCorrectionMsec;
return Math.floor(a/1000);
},nonce:function nonce(a){var d=OAuth.nonce.CHARS;
var e="";
for(var c=0;
c<a;
++c){var b=Math.floor(Math.random()*d.length);
e+=d.substring(b,b+1);
}return e;
}});
OAuth.nonce.CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
OAuth.declareClass=function declareClass(b,d,c){var a=b[d];
b[d]=c;
if(c!=null&&a!=null){for(var e in a){if(e!="prototype"){c[e]=a[e];
}}}return c;
};
OAuth.declareClass(OAuth,"SignatureMethod",function OAuthSignatureMethod(){});
OAuth.setProperties(OAuth.SignatureMethod.prototype,{sign:function sign(c){var b=OAuth.SignatureMethod.getBaseString(c);
var a=this.getSignature(b);
OAuth.setParameter(c,"oauth_signature",a);
return a;
},initialize:function initialize(a,c){var b;
if(c.accessorSecret!=null&&a.length>9&&a.substring(a.length-9)=="-Accessor"){b=c.accessorSecret;
}else{b=c.consumerSecret;
}this.key=OAuth.percentEncode(b)+"&"+OAuth.percentEncode(c.tokenSecret);
}});
OAuth.setProperties(OAuth.SignatureMethod,{sign:function sign(b,c){var a=OAuth.getParameterMap(b.parameters).oauth_signature_method;
if(a==null||a==""){a="HMAC-SHA1";
OAuth.setParameter(b,"oauth_signature_method",a);
}OAuth.SignatureMethod.newMethod(a,c).sign(b);
},newMethod:function newMethod(b,f){var a=OAuth.SignatureMethod.REGISTERED[b];
if(a!=null){var g=new a();
g.initialize(b,f);
return g;
}var e=new Error("signature_method_rejected");
var c="";
for(var d in OAuth.SignatureMethod.REGISTERED){if(c!=""){c+="&";
}c+=OAuth.percentEncode(d);
}e.oauth_acceptable_signature_methods=c;
throw e;
},REGISTERED:{},registerMethodClass:function registerMethodClass(b,a){for(var c=0;
c<b.length;
++c){OAuth.SignatureMethod.REGISTERED[b[c]]=a;
}},makeSubclass:function makeSubclass(c){var b=OAuth.SignatureMethod;
var a=function(){b.call(this);
};
a.prototype=new b();
a.prototype.getSignature=c;
a.prototype.constructor=a;
return a;
},getBaseString:function getBaseString(f){var b=f.action;
var g=b.indexOf("?");
var e;
if(g<0){e=f.parameters;
}else{e=OAuth.decodeForm(b.substring(g+1));
var d=OAuth.getParameterList(f.parameters);
for(var c=0;
c<d.length;
++c){e.push(d[c]);
}}return OAuth.percentEncode(f.method.toUpperCase())+"&"+OAuth.percentEncode(OAuth.SignatureMethod.normalizeUrl(b))+"&"+OAuth.percentEncode(OAuth.SignatureMethod.normalizeParameters(e));
},normalizeUrl:function normalizeUrl(b){var d=OAuth.SignatureMethod.parseUri(b);
var c=d.protocol.toLowerCase();
var g=d.authority.toLowerCase();
var f=(c=="http"&&d.port==80)||(c=="https"&&d.port==443);
if(f){var a=g.lastIndexOf(":");
if(a>=0){g=g.substring(0,a);
}}var e=d.path;
if(!e){e="/";
}return c+"://"+g+e;
},parseUri:function parseUri(e){var d={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}};
var a=d.parser.strict.exec(e);
var c={};
var b=14;
while(b--){c[d.key[b]]=a[b]||"";
}return c;
},normalizeParameters:function normalizeParameters(d){if(d==null){return"";
}var e=OAuth.getParameterList(d);
var g=[];
for(var f=0;
f<e.length;
++f){var a=e[f];
if(a[0]!="oauth_signature"){g.push([OAuth.percentEncode(a[0])+" "+OAuth.percentEncode(a[1]),a]);
}}g.sort(function(i,h){if(i[0]<h[0]){return -1;
}if(i[0]>h[0]){return 1;
}return 0;
});
var c=[];
for(var b=0;
b<g.length;
++b){c.push(g[b][1]);
}return OAuth.formEncode(c);
}});
OAuth.SignatureMethod.registerMethodClass(["PLAINTEXT","PLAINTEXT-Accessor"],OAuth.SignatureMethod.makeSubclass(function getSignature(a){return this.key;
}));
OAuth.SignatureMethod.registerMethodClass(["HMAC-SHA1","HMAC-SHA1-Accessor"],OAuth.SignatureMethod.makeSubclass(function getSignature(b){b64pad="=";
var a=b64_hmac_sha1(this.key,b);
return a;
}));
OAuth.correctTimestampFromSrc();
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(u,o){u[o>>5]|=128<<(24-o%32);
u[((o+64>>9)<<4)+15]=o;
var y=Array(80);
var v=1732584193;
var s=-271733879;
var r=-1732584194;
var q=271733878;
var p=-1009589776;
for(var l=0;
l<u.length;
l+=16){var n=v;
var m=s;
var k=r;
var h=q;
var f=p;
for(var g=0;
g<80;
g++){if(g<16){y[g]=u[l+g];
}else{y[g]=rol(y[g-3]^y[g-8]^y[g-14]^y[g-16],1);
}var z=safe_add(safe_add(rol(v,5),sha1_ft(g,s,r,q)),safe_add(safe_add(p,y[g]),sha1_kt(g)));
p=q;
q=r;
r=rol(s,30);
s=v;
v=z;
}v=safe_add(v,n);
s=safe_add(s,m);
r=safe_add(r,k);
q=safe_add(q,h);
p=safe_add(p,f);
}return Array(v,s,r,q,p);
}function sha1_ft(e,a,g,f){if(e<20){return(a&g)|((~a)&f);
}if(e<40){return a^g^f;
}if(e<60){return(a&g)|(a&f)|(g&f);
}return a^g^f;
}function sha1_kt(a){return(a<20)?1518500249:(a<40)?1859775393:(a<60)?-1894007588:-899497514;
}function core_hmac_sha1(c,f){var e=str2binb(c);
if(e.length>16){e=core_sha1(e,c.length*chrsz);
}var a=Array(16),d=Array(16);
for(var b=0;
b<16;
b++){a[b]=e[b]^909522486;
d[b]=e[b]^1549556828;
}var g=core_sha1(a.concat(str2binb(f)),512+f.length*chrsz);
return core_sha1(d.concat(g),512+160);
}function safe_add(a,d){var c=(a&65535)+(d&65535);
var b=(a>>16)+(d>>16)+(c>>16);
return(b<<16)|(c&65535);
}function rol(a,b){return(a<<b)|(a>>>(32-b));
}function str2binb(d){var c=Array();
var a=(1<<chrsz)-1;
for(var b=0;
b<d.length*chrsz;
b+=chrsz){c[b>>5]|=(d.charCodeAt(b/chrsz)&a)<<(32-chrsz-b%32);
}return c;
}function binb2str(c){var d="";
var a=(1<<chrsz)-1;
for(var b=0;
b<c.length*32;
b+=chrsz){d+=String.fromCharCode((c[b>>5]>>>(32-chrsz-b%32))&a);
}return d;
}function binb2hex(c){var b=hexcase?"0123456789ABCDEF":"0123456789abcdef";
var d="";
for(var a=0;
a<c.length*4;
a++){d+=b.charAt((c[a>>2]>>((3-a%4)*8+4))&15)+b.charAt((c[a>>2]>>((3-a%4)*8))&15);
}return d;
}function binb2b64(d){var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var f="";
for(var b=0;
b<d.length*4;
b+=3){var e=(((d[b>>2]>>8*(3-b%4))&255)<<16)|(((d[b+1>>2]>>8*(3-(b+1)%4))&255)<<8)|((d[b+2>>2]>>8*(3-(b+2)%4))&255);
for(var a=0;
a<4;
a++){if(b*8+a*6>d.length*32){f+=b64pad;
}else{f+=c.charAt((e>>6*(3-a))&63);
}}}return f;
}