var MooTools={version:"1.2.4",build:"0d9113241a90b9cd5643b926795852a2026710d4"};var Native=function(k){k=k||{};var a=k.name;var i=k.legacy;var b=k.protect;var c=k.implement;var h=k.generics;var f=k.initialize;var g=k.afterImplement||function(){};var d=f||i;h=h!==false;d.constructor=Native;d.$family={name:"native"};if(i&&f){d.prototype=i.prototype}d.prototype.constructor=d;if(a){var e=a.toLowerCase();d.prototype.$family={name:e};Native.typize(d,e)}var j=function(n,l,o,m){if(!b||m||!n.prototype[l]){n.prototype[l]=o}if(h){Native.genericize(n,l,b)}g.call(n,l,o);return n};d.alias=function(n,l,p){if(typeof n=="string"){var o=this.prototype[n];if((n=o)){return j(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 j(this,m,l,o)}for(var n in m){j(this,n,m[n],l)}return this};if(c){d.implement(c)}return d};Native.genericize=function(b,c,a){if((!a||!b[c])&&typeof b.prototype[c]=="function"){b[c]=function(){var d=Array.prototype.slice.call(arguments);return b.prototype[c].apply(d.shift(),d)}}};Native.implement=function(d,c){for(var b=0,a=d.length;b<a;b++){d[b].implement(c)}};Native.typize=function(a,b){if(!a.type){a.type=function(c){return($type(c)===b)}}};(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(a){if($type(a)=="hash"){a=$unlink(a.getClean())}for(var b in a){this[b]=a[b]}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 b=0;for(var a in this){if(this.hasOwnProperty(a)){b++}}return b}});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(c,a){for(var b in (a||{})){c[b]=a[b]}return c}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 b=arguments[d];if($type(b)!="object"){continue}for(var c in b){var g=b[c],f=e[c];e[c]=(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 b;switch($type(c)){case"object":b={};for(var e in c){b[e]=$unlink(c[e])}break;case"hash":b=new Hash(c);break;case"array":b=[];for(var d=0,a=c.length;d<a;d++){b[d]=$unlink(c[d])}break;default:return c}return b}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(b,a){window[b]=Window.Prototype[b]=a}});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(b,a){document[b]=Document.Prototype[b]=a}});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={},b=Math.min(this.length,c.length);for(var a=0;a<b;a++){d[c[a]]=this[a]}return d},link:function(c){var a={};for(var e=0,b=this.length;e<b;e++){for(var d in c){if(c[d](this[e])){a[d]=this[e];delete c[d];break}}}return a},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(a){for(var b in a){this[b]=a[b]}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(a,b){return this.replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1)}return(a[c]!=undefined)?a[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,e){if(a){e=a+"["+e+"]"}var d;switch($type(f)){case"object":d=Hash.toQueryString(f,e);break;case"array":var c={};f.each(function(h,g){c[g]=h});d=Hash.toQueryString(c,e);break;default:d=e+"="+encodeURIComponent(f)}if(f!=undefined){b.push(d)}});return b.join("&")}});Hash.alias({keyOf:"indexOf",hasValue:"contains"});var Event=new Native({name:"Event",initialize:function(a,f){f=f||window;var k=f.document;a=a||f.event;if(a.$extended){return a}this.$extended=true;var j=a.type;var g=a.target||a.srcElement;while(g&&g.nodeType==3){g=g.parentNode}if(j.test(/key/)){var b=a.which||a.keyCode;var m=Event.Keys.keyOf(b);if(j=="keydown"){var d=b-111;if(d>0&&d<13){m="f"+d}}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 c={x:(a.pageX)?a.pageX-f.pageXOffset:a.clientX,y:(a.pageY)?a.pageY-f.pageYOffset:a.clientY};if(j.match(/DOMMouseScroll|mousewheel/)){var h=(a.wheelDelta)?a.wheelDelta/120:-(a.detail||0)/3}var e=(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:c,rightClick:e,wheel:h,relatedTarget:l,target:g,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(a,c){if(c==null){for(var e in a){Object.reset(a,e)}return a}delete a[c];switch($type(a[c])){case"object":var d=function(){};d.prototype=a[c];var b=new d;a[c]=Object.reset(b);break;case"array":a[c]=$unlink(a[c]);break}return a};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 e=this.caller,f=this._current;this.caller=f;this._current=arguments.callee;var d=c.apply(this,arguments);this._current=f;this.caller=e;return d}.extend({_owner:a,_origin:c,_name:b})}});Class.implement({implement:function(a,d){if($type(a)=="object"){for(var e in a){this.implement(e,a[e])}return this}var f=Class.Mutators[a];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[a]=Class.wrap(this,a,d);break;case"object":var b=c[a];if($type(b)=="object"){$mixin(b,d)}else{c[a]=$unlink(d)}break;case"array":c[a]=$unlink(d);break;default:c[a]=d}return this}});Class.Mutators={Extends:function(a){this.parent=a;this.prototype=Class.instantiate(a);this.implement("parent",function(){var b=this.caller._name,c=this.caller._owner.parent.prototype[b];if(!c){throw new Error('The method "'+b+'" has no parent.')}return c.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(c){var d;if($type(c)=="object"){for(d in c){this.removeEvent(d,c[d])}return this}if(c){c=Events.removeOn(c)}for(d in this.$events){if(c&&c!=d){continue}var b=this.$events[d];for(var a=b.length;a--;a){this.removeEvent(d,b[a])}}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 c=[],g=true;for(var e=0,d=this.length;e<d;e++){var f=this[e][a].apply(this[e],arguments);c.push(f);if(g){g=($type(f)=="element")}}return(g)?new Elements(c):c})}});Element.Prototype={$family:{name:"element"}};Element.Constructors=new Hash;var IFrame=new Native({name:"IFrame",generics:false,initialize:function(){var f=Array.link(arguments,{properties:Object.type,iframe:$defined});var d=f.properties||{};var c=document.id(f.iframe);var e=d.onload||$empty;delete d.onload;d.id=d.name=$pick(d.id,d.name,c?(c.id||c.name):"IFrame_"+$time());c=new Element(c||"iframe",d);var b=function(){var g=$try(function(){return c.contentWindow.location.host});if(!g||g==window.location.host){var h=new Window(c.contentWindow);new Document(c.contentWindow.document);$extend(h.Element.prototype,Element.Prototype)}e.call(c.contentWindow,c.contentWindow.document)};var a=$try(function(){return c.contentWindow});((a&&a.document.body)||window.frames[d.id])?b():c.addListener("load",b);return c}});var Elements=new Native({initialize:function(f,b){b=$extend({ddup:true,cash:true},b);f=f||[];if(b.ddup||b.cash){var g={},e=[];for(var c=0,a=f.length;c<a;c++){var d=document.id(f[c],!b.cash);if(b.ddup){if(g[d.uid]){continue}g[d.uid]=true}if(d){e.push(d)}}f=e}return(b.cash)?$extend(f,this):f}});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(a){if(arguments.length==1&&typeof a=="string"){return this.document.getElements(a)}var f=[];var c=Array.flatten(arguments);for(var d=0,b=c.length;d<b;d++){var e=c[d];switch($type(e)){case"element":f.push(e);break;case"string":f.extend(this.document.getElements(e,true))}}return new Elements(f)},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(a,d){a=a.split(",");var c=[];var b=(a.length>1);a.each(function(e){var f=this.getElementsByTagName(e.trim());(b)?c.extend(f):c=f},this);return new Elements(c,{ddup:b,cash:!d})}});(function(){var h={},f={};var i={input:"checked",option:"selected",textarea:(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerHTML":"value"};var c=function(l){return(f[l]||(f[l]={}))};var g=function(n,l){if(!n){return}var m=n.uid;if(Browser.Engine.trident){if(n.clearAttributes){var q=l&&n.cloneNode(false);n.clearAttributes();if(q){n.mergeAttributes(q)}}else{if(n.removeEvents){n.removeEvents()}}if((/object/i).test(n.tagName)){for(var o in n){if(typeof n[o]=="function"){n[o]=$empty}}Element.dispose(n)}}if(!m){return}h[m]=f[m]=null};var d=function(){Hash.each(h,g);if(Browser.Engine.trident){$A(document.getElementsByTagName("object")).each(g)}if(window.CollectGarbage){CollectGarbage()}h=f=null};var j=function(n,l,s,m,p,r){var o=n[s||l];var q=[];while(o){if(o.nodeType==1&&(!m||Element.match(o,m))){if(!p){return document.id(o,r)}q.push(o)}o=o[l]}return(p)?new Elements(q,{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 b=["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"];var k=["value","type","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"];b=b.associate(b);Hash.extend(e,b);Hash.extend(e,k.associate(k.map(String.toLowerCase)));var a={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)}};a.inside=a.bottom;Hash.each(a,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&&b[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(b[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&&b[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){a[l||"bottom"](document.id(m,true),this);return this},inject:function(m,l){a[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 j(this,"previousSibling",null,l,false,m)},getAllPrevious:function(l,m){return j(this,"previousSibling",null,l,true,m)},getNext:function(l,m){return j(this,"nextSibling",null,l,false,m)},getAllNext:function(l,m){return j(this,"nextSibling",null,l,true,m)},getFirst:function(l,m){return j(this,"nextSibling","firstChild",l,false,m)},getLast:function(l,m){return j(this,"previousSibling","lastChild",l,false,m)},getParent:function(l,m){return j(this,"parentNode",null,l,false,m)},getParents:function(l,m){return j(this,"parentNode",null,l,true,m)},getSiblings:function(l,m){return this.getParent().getChildren(l,m).erase(this)},getChildren:function(l,m){return j(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(m){if(this.currentStyle){return this.currentStyle[m.camelCase()]}var l=this.getDocument().defaultView.getComputedStyle(this,null);return(l)?l.getPropertyValue([m.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(o,l){o=o!==false;var r=this.cloneNode(o);var n=function(v,u){if(!l){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(o){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);g(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{h[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(m,l){var o=c(this.uid),n=o[m];if(l!=undefined&&n==undefined){n=o[m]=l}return $pick(n)},store:function(m,l){var n=c(this.uid);n[m]=l;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 a={table:[1,"<table>","</table>"],select:[1,"<select>","</select>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"]};a.thead=a.tfoot=a.tbody;var b={set:function(){var e=Array.flatten(arguments).join("");var f=Browser.Engine.trident&&a[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}}};b.erase=b.set;return b})();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(e,g){var h=this.retrieve("events",{});h[e]=h[e]||{keys:[],values:[]};if(h[e].keys.contains(g)){return this}h[e].keys.push(g);var f=e,a=Element.Events.get(e),c=g,i=this;if(a){if(a.onAdd){a.onAdd.call(this,g)}if(a.condition){c=function(j){if(a.condition.call(this,j)){return g.call(this,j)}return true}}f=a.base||f}var d=function(){return g.call(i)};var b=Element.NativeEvents[f];if(b){if(b==2){d=function(j){j=new Event(j,i.getWindow());if(c.call(i,j)===false){j.stop()}}}this.addListener(f,d)}h[e].values.push(d);return this},removeEvent:function(c,b){var a=this.retrieve("events");if(!a||!a[c]){return this}var f=a[c].keys.indexOf(b);if(f==-1){return this}a[c].keys.splice(f,1);var e=a[c].values.splice(f,1)[0];var d=Element.Events.get(c);if(d){if(d.onRemove){d.onRemove.call(this,b)}c=d.base||c}return(Element.NativeEvents[c])?this.removeListener(c,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,b,a){var c=this.retrieve("events");if(!c||!c[d]){return this}c[d].keys.each(function(e){e.create({bind:this,delay:a,"arguments":b})()},this);return this},cloneEvents:function(d,a){d=document.id(d);var c=d.retrieve("events");if(!c){return this}if(!a){for(var b in c){this.cloneEvents(d,b)}}else{if(c[a]){c[a].keys.each(function(e){this.addEvent(a,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(b,a){switch(b){case"opacity":return this.set("opacity",parseFloat(a));case"float":b=(Browser.Engine.trident)?"styleFloat":"cssFloat"}b=b.camelCase();if($type(a)!="string"){var c=(Element.Styles.get(b)||"@").split(" ");a=$splat(a).map(function(e,d){if(!c[d]){return""}return($type(e)=="number")?c[d].replace("@",Math.round(e)):e}).join(" ")}else{if(a==String(Number(a))){a=Math.round(a)}}this.style[b]=a;return this},getStyle:function(g){switch(g){case"opacity":return this.get("opacity");case"float":g=(Browser.Engine.trident)?"styleFloat":"cssFloat"}g=g.camelCase();var a=this.style[g];if(!$chk(a)){a=[];for(var f in Element.ShortStyles){if(g!=f){continue}for(var e in Element.ShortStyles[f]){a.push(this.getStyle(e))}return a.join(" ")}a=this.getComputedStyle(g)}if(a){a=String(a);var c=a.match(/rgba?\([\d\s,]+\)/);if(c){a=a.replace(c[0],c[0].rgbToHex())}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(a,10)))){if(g.test(/^(height|width)$/)){var b=(g=="width")?["left","right"]:["top","bottom"],d=0;b.each(function(h){d+=this.getStyle("border-"+h+"-width").toInt()+this.getStyle("padding-"+h).toInt()},this);return this["offset"+g.capitalize()]-d+"px"}if((Browser.Engine.presto)&&String(a).test("px")){return a}if(g.test(/(border(.+)Width|margin|padding)/)){return"0px"}}return a},setStyles:function(b){for(var a in b){this.setStyle(a,b[a])}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(b(this)){this.getWindow().scrollTo(h,i)}else{this.scrollLeft=h;this.scrollTop=i}return this},getSize:function(){if(b(this)){return this.getWindow().getSize()}return{x:this.offsetWidth,y:this.offsetHeight}},getScrollSize:function(){if(b(this)){return this.getWindow().getScrollSize()}return{x:this.scrollWidth,y:this.scrollHeight}},getScroll:function(){if(b(this)){return this.getWindow().getScroll()}return{x:this.scrollLeft,y:this.scrollTop}},getScrolls:function(){var i=this,h={x:0,y:0};while(i&&!b(i)){h.x+=i.scrollLeft;h.y+=i.scrollTop;i=i.parentNode}return h},getOffsetParent:function(){var h=this;if(b(h)){return null}if(!Browser.Engine.trident){return h.offsetParent}while((h=h.parentNode)&&!b(h)){if(d(h,"position")!="static"){return h}}return null},getOffsets:function(){if(this.getBoundingClientRect){var j=this.getBoundingClientRect(),m=document.id(this.getDocument().documentElement),p=m.getScroll(),k=this.getScrolls(),i=this.getScroll(),h=(d(this,"position")=="fixed");return{x:j.left.toInt()+k.x-i.x+((h)?0:p.x)-m.clientLeft,y:j.top.toInt()+k.y-i.y+((h)?0:p.y)-m.clientTop}}var l=this,n={x:0,y:0};if(b(this)){return n}while(l&&!b(l)){n.x+=l.offsetLeft;n.y+=l.offsetTop;if(Browser.Engine.gecko){if(!f(l)){n.x+=c(l);n.y+=g(l)}var o=l.parentNode;if(o&&d(o,"overflow")!="visible"){n.x+=c(o);n.y+=g(o)}}else{if(l!=this&&Browser.Engine.webkit){n.x+=c(l);n.y+=g(l)}}l=l.offsetParent}if(Browser.Engine.gecko&&!f(this)){n.x-=c(this);n.y-=g(this)}return n},getPosition:function(k){if(b(this)){return{x:0,y:0}}var l=this.getOffsets(),i=this.getScrolls();var h={x:l.x-i.x,y:l.y-i.y};var j=(k&&(k=document.id(k)))?k.getPosition():{x:0,y:0};return{x:h.x-j.x,y:h.y-j.y}},getCoordinates:function(j){if(b(this)){return this.getWindow().getCoordinates()}var h=this.getPosition(j),i=this.getSize();var k={left:h.x,top:h.y,width:i.x,height:i.y};k.right=k.left+k.width;k.bottom=k.top+k.height;return k},computePosition:function(h){return{left:h.x-e(this,"margin-left"),top:h.y-e(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=a(this);return{x:h.clientWidth,y:h.clientHeight}},getScroll:function(){var i=this.getWindow(),h=a(this);return{x:i.pageXOffset||h.scrollLeft,y:i.pageYOffset||h.scrollTop}},getScrollSize:function(){var i=a(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 d=Element.getComputedStyle;function e(h,i){return d(h,i).toInt()||0}function f(h){return d(h,"-moz-box-sizing")=="border-box"}function g(h){return e(h,"border-top-width")}function c(h){return e(h,"border-left-width")}function b(h){return(/^(?:body|html)$/i).test(h.tagName)}function a(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 c,e={};for(var d=0,b=h.length;d<b;d++){var a=h[d],f=Selectors.Utils.search(this,a,e);if(d!=0&&f.item){f=$A(f)}c=(d==0)?f:(c.item)?$A(c).concat(f):c.concat(f)}return new Elements(c,{ddup:(h.length>1),cash:!g})}});Element.implement({match:function(b){if(!b||(b==this)){return true}var d=Selectors.Utils.parseTagAndID(b);var a=d[0],e=d[1];if(!Selectors.Filters.byID(this,e)||!Selectors.Filters.byTag(this,a)){return false}var c=Selectors.Utils.parseSelector(b);return(c)?Selectors.Utils.filter(this,c,{}):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(h){if(Selectors.Cache.nth[h]){return Selectors.Cache.nth[h]}var e=h.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!e){return false}var g=parseInt(e[1],10);var d=(g||g===0)?g:1;var f=e[2]||false;var c=parseInt(e[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":e={a:d,b:c,special:"n"};break;case"odd":e={a:2,b:0,special:"n"};break;case"even":e={a:2,b:1,special:"n"};break;case"first":e={a:0,special:"index"};break;case"last":e={special:"last-child"};break;case"only":e={special:"only-child"};break;default:e={a:(d-1),special:"index"}}return Selectors.Cache.nth[h]=e},parseSelector:function(e){if(Selectors.Cache.parsed[e]){return Selectors.Cache.parsed[e]}var d,h={classes:[],pseudos:[],attributes:[]};while((d=Selectors.RegExps.combined.exec(e))){var i=d[1],g=d[2],f=d[3],b=d[5],c=d[6],j=d[7];if(i){h.classes.push(i)}else{if(c){var a=Selectors.Pseudo.get(c);if(a){h.pseudos.push({parser:a,argument:j})}else{h.attributes.push({name:c,operator:"=",value:j})}}else{if(g){h.attributes.push({name:g,operator:f,value:b})}}}}if(!h.classes.length){delete h.classes}if(!h.attributes.length){delete h.attributes}if(!h.pseudos.length){delete h.pseudos}if(!h.classes&&!h.attributes&&!h.pseudos){h=null}return Selectors.Cache.parsed[e]=h},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,c,e){var d;if(c.classes){for(d=c.classes.length;d--;d){var g=c.classes[d];if(!Selectors.Filters.byClass(f,g)){return false}}}if(c.attributes){for(d=c.attributes.length;d--;d){var b=c.attributes[d];if(!Selectors.Filters.byAttribute(f,b.name,b.operator,b.value)){return false}}}if(c.pseudos){for(d=c.pseudos.length;d--;d){var a=c.pseudos[d];if(!Selectors.Filters.byPseudo(f,a.parser,a.argument,e)){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,h,t){var b=[];var c=h.trim().replace(Selectors.RegExps.splitter,function(k,j,i){b.push(j);return":)"+i}).split(":)");var p,e,A;for(var z=0,v=c.length;z<v;z++){var y=c[z];if(z==0&&Selectors.RegExps.quick.test(y)){p=o.getElementsByTagName(y);continue}var a=b[z-1];var q=Selectors.Utils.parseTagAndID(y);var B=q[0],r=q[1];if(z==0){p=Selectors.Utils.getByTagAndID(o,B,r)}else{var d={},g=[];for(var x=0,w=p.length;x<w;x++){g=Selectors.Getters[a](g,p[x],B,r,d)}p=g}var f=Selectors.Utils.parseSelector(y);if(f){e=[];for(var u=0,s=p.length;u<s;u++){A=p[u];if(Selectors.Utils.filter(A,f,t)){e.push(A)}}p=e}}return p}};Selectors.Getters={" ":function(h,g,j,a,e){var d=Selectors.Utils.getByTagAndID(g,j,a);for(var c=0,b=d.length;c<b;c++){var f=d[c];if(Selectors.Utils.chk(f,e)){h.push(f)}}return h},">":function(h,g,j,a,f){var c=Selectors.Utils.getByTagAndID(g,j,a);for(var e=0,d=c.length;e<d;e++){var b=c[e];if(b.parentNode==g&&Selectors.Utils.chk(b,f)){h.push(b)}}return h},"+":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(a,d,c,b){return d.call(a,c,b)},byAttribute:function(c,d,b,e){var a=Element.prototype.getProperty.call(c,d);if(!a){return(b=="!=")}if(!b||e==undefined){return true}switch(b){case"=":return(a==e);case"*=":return(a.contains(e));case"^=":return(a.substr(0,e.length)==e);case"$=":return(a.substr(a.length-e.length)==e);case"!=":return(a!=e);case"~=":return a.contains(e," ");case"|=":return a.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(g,e){g=(g==undefined)?"n":g;var c=Selectors.Utils.parseNthArgument(g);if(c.special!="n"){return Selectors.Pseudo[c.special].call(this,c.a,e)}var f=0;e.positions=e.positions||{};var d=$uid(this);if(!e.positions[d]){var b=this;while((b=b.previousSibling)){if(b.nodeType!=1){continue}f++;var a=e.positions[$uid(b)];if(a!=undefined){f=a+f;break}}e.positions[d]=f}return(e.positions[d]%c.a==c.b)},index:function(a){var b=this,c=0;while((b=b.previousSibling)){if(b.nodeType==1&&++c>a){return false}}return(c==a)},even:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n+1",a)},odd:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n",a)},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 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(d,e,b){b=$splat(b);var c=b[1];if(!$chk(c)){b[1]=b[0];b[0]=d.getStyle(e)}var a=b.map(this.parse);return{from:a[0],to:a[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,e){if(b){return}var d=f.parse(c);if($chk(d)){b={value:d,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(a,d,c,b){a.setStyle(d,this.serve(c,b))},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,g){if(!j.style){return}var h=(j.selectorText)?j.selectorText.replace(/^\w+/,function(i){return i.toLowerCase()}):null;if(!h||!h.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(b,a){this.element=this.subject=document.id(b);this.parent(a)},set:function(b,a){if(arguments.length==1){a=b;b=this.property||this.options.property}this.render(this.element,b,a,this.options.unit);return this},start:function(c,e,d){if(!this.check(c,e,d)){return this}var b=Array.flatten(arguments);this.property=this.options.property||b.shift();var a=this.prepare(this.element,this.property,b);return this.parent(a.from,a.to)}});Element.Properties.tween={set:function(a){var b=this.retrieve("tween");if(b){b.cancel()}return this.eliminate("tween").store("tween:options",$extend({link:"cancel"},a))},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(c){var e=this.get("tween"),d="opacity",a;c=$pick(c,"toggle");switch(c){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 b=this.retrieve("fade:flag",this.get("opacity")==1);e.start(d,(b)?0:1);this.store("fade:flag",!b);a=true;break;default:e.start(d,arguments)}if(!a){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}});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(k){if(!this.check(k)){return this}this.running=true;var i=$type(k);if(i=="string"||i=="element"){k={data:k}}var d=this.options;k=$extend({data:d.data,url:d.url,method:d.method},k);var g=k.data,b=String(k.url),a=k.method.toLowerCase();switch($type(g)){case"element":g=document.id(g).toQueryString();break;case"object":case"hash":g=Hash.toQueryString(g)}if(this.options.format){var j="format="+this.options.format;g=(g)?j+"&"+g:j}if(this.options.emulation&&!["get","post"].contains(a)){var h="_method="+a;g=(g)?h+"&"+g:h;a="post"}if(this.options.urlEncoded&&a=="post"){var c=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers.set("Content-type","application/x-www-form-urlencoded"+c)}if(this.options.noCache){var f="noCache="+new Date().getTime();g=(g)?f+"&"+g:f}var e=b.lastIndexOf("/");if(e>-1&&(e=b.indexOf("#"))>-1){b=b.substr(0,e)}if(g&&a=="get"){b=b+(b.contains("?")?"&":"?")+g;g=null}this.xhr.open(a.toUpperCase(),b,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(g);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(a){var b=this.get("send");b.send({data:this,url:a||b.options.url});return this}});Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false},processHTML:function(c){var b=c.match(/<body[^>]*>([\s\S]*?)<\/body>/i);c=(b)?b[1]:c;var a=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){a.grab(h)}}return a})||a.set("html",c)},success:function(d){var c=this.options,b=this.response;b.html=d.stripScripts(function(e){b.javascript=e});var a=this.processHTML(b.html);b.tree=a.childNodes;b.elements=a.getElements("*");if(c.filter){b.tree=b.elements.filter(c.filter)}if(c.update){document.id(c.update).empty().set("html",b.html)}else{if(c.append){document.id(c.append).adopt(a.getChildren())}}if(c.evalScripts){$exec(b.javascript)}this.onSuccess(b.tree,b.elements,b.html,b.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)}});MooTools.More={version:"1.2.4.4",build:"6f6057dc645fdb7547689183b2311063bd653ddf"};Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a);var d=this.cancel.bind(this,false);if($type(this.element)!="element"){this.element=document.id(this.element.getDocument().body)}var c=this.element;if(this.options.wheelStops){this.addEvent("start",function(){c.addEvent("mousewheel",d)},true);this.addEvent("complete",function(){c.removeEvent("mousewheel",d)},true)}},set:function(){var a=Array.flatten(arguments);if(Browser.Engine.gecko){a=[Math.round(a[0]),Math.round(a[1])]}this.element.scrollTo(a[0],a[1])},compute:function(c,b,a){return[0,1].map(function(d){return Fx.compute(c[d],b[d],a)})},start:function(c,g){if(!this.check(c,g)){return this}var e=this.element.getScrollSize(),b=this.element.getScroll(),d={x:c,y:g};for(var f in d){var a=e[f];if($chk(d[f])){d[f]=($type(d[f])=="number")?d[f]:a}else{d[f]=b[f]}d[f]+=this.options.offset[f]}return this.parent([b.x,b.y],[d.x,d.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(b){var a=document.id(b).getPosition(this.element);return this.start(a.x,a.y)},scrollIntoView:function(c,e,d){e=e?$splat(e):["x","y"];var h={};c=document.id(c);var f=c.getPosition(this.element);var i=c.getSize();var g=this.element.getScroll();var a=this.element.getSize();var b={x:f.x+i.x,y:f.y+i.y};["x","y"].each(function(j){if(e.contains(j)){if(b[j]>g[j]+a[j]){h[j]=b[j]-a[j]}if(f[j]<g[j]){h[j]=f[j]}}if(h[j]==null){h[j]=g[j]}if(d&&d[j]){h[j]=h[j]+d[j]}},this);if(h.x!=g.x||h.y!=g.y){this.start(h.x,h.y)}return this},scrollToCenter:function(c,e,d){e=e?$splat(e):["x","y"];c=$(c);var h={},f=c.getPosition(this.element),i=c.getSize(),g=this.element.getScroll(),a=this.element.getSize(),b={x:f.x+i.x,y:f.y+i.y};["x","y"].each(function(j){if(e.contains(j)){h[j]=f[j]-(a[j]-i[j])/2}if(h[j]==null){h[j]=g[j]}if(d&&d[j]){h[j]=h[j]+d[j]}},this);if(h.x!=g.x||h.y!=g.y){this.start(h.x,h.y)}return this}});var Asset={javascript:function(f,d){d=$extend({onload:$empty,document:document,check:$lambda(true)},d);if(d.onLoad){d.onload=d.onLoad}var b=new Element("script",{src:f,type:"text/javascript"});var e=d.onload.bind(b),a=d.check,g=d.document;delete d.onload;delete d.check;delete d.document;b.addEvents({load:e,readystatechange:function(){if(["loaded","complete"].contains(this.readyState)){e()}}}).set(d);if(Browser.Engine.webkit419){var c=(function(){if(!$try(a)){return}$clear(c);e()}).periodical(50)}return b.inject(g.head)},css:function(b,a){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:b},a)).inject(document.head)},image:function(c,b){b=$merge({onload:$empty,onabort:$empty,onerror:$empty},b);var d=new Image();var a=document.id(d)||new Element("img");["load","abort","error"].each(function(e){var g="on"+e;var f=e.capitalize();if(b["on"+f]){b[g]=b["on"+f]}var h=b[g];delete b[g];d[g]=function(){if(!d){return}if(!a.parentNode){a.width=d.width;a.height=d.height}d=d.onload=d.onabort=d.onerror=null;h.delay(1,a,a);a.fireEvent(e,a,1)}});d.src=a.src=c;if(d&&d.complete){d.onload.delay(1)}return a.set(b)},images:function(d,c){c=$merge({onComplete:$empty,onProgress:$empty,onError:$empty,properties:{}},c);d=$splat(d);var a=[];var b=0;return new Elements(d.map(function(e){return Asset.image(e,$extend(c.properties,{onload:function(){c.onProgress.call(this,b,d.indexOf(e));b++;if(b==d.length){c.onComplete()}},onerror:function(){c.onError.call(this,b,d.indexOf(e));b++;if(b==d.length){c.onComplete()}}}))}))}};
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
if(!window.FB){FB={}}if(!FB.dynData){FB.dynData={site_vars:{canvas_client_compute_content_size_method:1,use_postMessage:1,use_xdProxy:0,use_ui_server:1,monitor_usage_regex:"somethingtoputhere.com|huffingtonpost.com|lala.com",monitor_usage_rate:0.05,enable_custom_href:1},resources:{base_url_format:"http://{0}.connect.facebook.com/",base_cdn_url:"http://static.ak.fbcdn.net/",api_channel:210036,api_server:210036,www_channel:210036,xd_proxy:205601,xd_comm_swf_url:"http://static.ak.fbcdn.net/rsrc.php/z48NA/hash/6r2djk2l.swf",share_button:"http://b.static.ak.fbcdn.net/rsrc.php/z1NNP/hash/4273uaqa.png",login_img_dark_small_short:"http://b.static.ak.fbcdn.net/rsrc.php/zATAA/hash/a969rwcd.png",login_img_dark_medium_short:"http://b.static.ak.fbcdn.net/rsrc.php/zI08N/hash/156b4b3s.png",login_img_dark_medium_long:"http://b.static.ak.fbcdn.net/rsrc.php/zDFXV/hash/85b5jlja.png",login_img_dark_large_short:"http://b.static.ak.fbcdn.net/rsrc.php/zHW0N/hash/a22m3ibb.png",login_img_dark_large_long:"http://static.ak.fbcdn.net/rsrc.php/zC8F0/hash/8mzymam2.png",login_img_light_small_short:"http://b.static.ak.fbcdn.net/rsrc.php/z68PZ/hash/8t35mjql.png",login_img_light_medium_short:"http://static.ak.fbcdn.net/rsrc.php/zEV10/hash/6ad3z8m6.png",login_img_light_medium_long:"http://b.static.ak.fbcdn.net/rsrc.php/z7T3O/hash/4li2k73z.png",login_img_light_large_short:"http://static.ak.fbcdn.net/rsrc.php/zEYEC/hash/7e3mp7ee.png",login_img_light_large_long:"http://b.static.ak.fbcdn.net/rsrc.php/z1RA7/hash/8rc0izvz.png",login_img_white_small_short:"http://static.ak.fbcdn.net/rsrc.php/z79GY/hash/di0gkqrt.png",login_img_white_medium_short:"http://static.ak.fbcdn.net/rsrc.php/zDTB7/hash/cdozw38w.png",login_img_white_medium_long:"http://static.ak.fbcdn.net/rsrc.php/z6AST/hash/338d3m67.png",login_img_white_large_short:"http://static.ak.fbcdn.net/rsrc.php/z6FD4/hash/8yzn0wu3.png",login_img_white_large_long:"http://static.ak.fbcdn.net/rsrc.php/z5V8V/hash/5pwowlag.png",logout_img_small:"http://static.ak.fbcdn.net/rsrc.php/z68NS/hash/cxrz4k7j.png",logout_img_medium:"http://static.ak.fbcdn.net/rsrc.php/zATSY/hash/4lsqsd7l.png",logout_img_large:"http://b.static.ak.fbcdn.net/rsrc.php/z8P0T/hash/4515xk7j.png"}}}if(!FB.locale){FB.locale="en_US"}if(!FB.localeIsRTL){FB.localeIsRTL=false}if(!window.FB){FB={}}if(!FB.Monitor){FB.Monitor={wrapObject:function(a,b,f){if(typeof(a)!="object"){return a}if(!FB.Monitor.loggingEnabled()){return a}if(b=="FB.Debug"||b=="FB.HiddenContainer"||b=="FB.XdComm.Server"||b.indexOf("FBIntern")==0){return a}for(var d in a){var c=a[d];if(!a.hasOwnProperty(d)||typeof(c)!="function"||c.wrapped){continue}var e={containerName:b,functionName:d};a[d]=FB.Monitor._monitorWrapper(c,a,f,e);a[d].wrapped=true}return a},disableLogging:function(){FB.Monitor.loggingEnabledCache=false},loggingEnabled:function(){if(FB.Monitor.loggingEnabledCache===null){var c=FB.dynData&&FB.dynData.site_vars&&FB.dynData.site_vars.monitor_usage_regex;if(!c){FB.Monitor.loggingEnabledCache=false}else{var a=new RegExp(c);var b=FB.dynData.site_vars.monitor_usage_rate;FB.Monitor.loggingEnabledCache=a.test(document.domain)?(Math.random()/b)<1:false}}return FB.Monitor.loggingEnabledCache},externalCallback:function(a){if(typeof(a)!="function"){return a}return function(){var d=FB.Monitor.internalCallStackDepth;FB.Monitor.internalCallStackDepth=0;var b=Array.prototype.slice.call(arguments);var c=a.apply(this,b);FB.Monitor.internalCallStackDepth=d;return c}},_monitorWrapper:function(b,a,d,c){return function(){var e=Array.prototype.slice.call(arguments);context=d?this:(a||window);c=c||{containerName:"unknown",functionName:"unknown"};if(FB.Monitor.internalCallStackDepth==0){if(c.functionName.substr(0,1)!="_"){FB.Monitor.logFunction(c,e)}}++FB.Monitor.internalCallStackDepth;var f=b.apply(context,e);--FB.Monitor.internalCallStackDepth;return f}},logFunction:function(e,c){var b=[];for(var d=0;d<c.length;d++){var a=c[d];b[d]=a?a.toString():a}FB.Monitor.log("functions",e.containerName+"."+e.functionName,b)},logXFBML:function(c){var b={};for(var d=0;d<c.attributes.length;++d){var a=c.attributes[d];if(a.specified!==false&&a.nodeName&&a.nodeValue&&a.nodeName!="class"){b[a.nodeName]=a.nodeValue.toString()}}var e=c.nodeName.toLowerCase();FB.Monitor.log("tags",e,b)},log:function(b,d,a){var c={name:d,args:a};FB.Monitor.loggingQueue[b].push(c);if(!FB.Monitor.pendingTimer){setTimeout(FB.Monitor.send,FB.Monitor.TIMER_INTERVAL);FB.Monitor.pendingTimer=true}},clearQueues:function(){var a=FB.Monitor.loggingQueue;FB.Monitor.pendingTimer=false;FB.Monitor.loggingQueue={tags:[],functions:[]};return a},send:function(){if(FB.MonitorSender){FB.bind(FB.MonitorSender.send)()}else{FB.Monitor.TIMER_INTERVAL=FB.Monitor.TIMER_INTERVAL*1.5;setTimeout(FB.Monitor.send,FB.Monitor.TIMER_INTERVAL)}},TIMER_INTERVAL:6*1000,internalCallStackDepth:0,loggingQueue:{tags:[],functions:[]},pendingTimer:false,loggingEnabledCache:null}}if(!window.FB){FB={}}FB.forEach=function(c,a,f){if(Object.prototype.toString.apply(c)==="[object Array]"){if(c.forEach){c.forEach(a)}else{for(var b=0,e=c.length;b<e;b++){a(c[b],b,c)}}}else{for(var d in c){if(f||c.hasOwnProperty(d)){a(c[d],d,c)}}}};FB.copy=function(c,b,a){FB.forEach(b,function(e,d){if(a||typeof c[d]==="undefined"){c[d]=e}})};FB.copy(FB,{$:function(a){return document.getElementById(a)},TypeLoader:{NOTIFY:{},LOADED_MODULES:{},LOADED_CLASSES:{},resolve:function(f,e,a){for(var b=0,c=e.length;b<c;b++){var d=e[b];if(d===""){continue}if(typeof f[d]==="undefined"){if(a){f[d]={}}else{return false}}f=f[d]}return f},provide:function(c,b,a){FB.Monitor.wrapObject(b,c,false);var d=this.resolve(window,c.split("."),true);if(a||!this.LOADED_MODULES[c]){FB.copy(d,b,true);if(b._onLoad){d._onLoad()}}this.LOADED_MODULES[c]=true},subclass:function(e,a,i){if(this.LOADED_CLASSES[e]){return}if(a!=="FB.Class"&&!this.LOADED_CLASSES[a]){FB.Log.debug('"'+e+'" needs to wait for "'+a+'"');var j=FB.redo(arguments,this);this.NOTIFY[a]?this.NOTIFY[a].push(j):this.NOTIFY[a]=[j];return}var b=this.resolve(window,a.split(".")),f=b.extend(i),g=this.NOTIFY[e],h=e.split("."),d=this.resolve(window,h,true),c=h.pop();FB.Monitor.wrapObject(f.prototype,e,true);FB.Monitor.wrapObject(f,e,false);FB.copy(f,d);this.resolve(window,h)[c]=f;this.LOADED_CLASSES[e]=true;if(g){FB.forEach(g,function(k){k()});delete this.NOTIFY[e]}}},bind:function(){var a=Array.prototype.slice.call(arguments),c=a.shift(),b=a.shift();var d=function(){++FB.Monitor.internalCallStackDepth;var e=c.apply(b,a.concat(Array.prototype.slice.call(arguments)));--FB.Monitor.internalCallStackDepth;return e};d._targets=[b,c];return d},redo:function(a,c){var b=Array.prototype.slice.call(a);b.unshift(c);b.unshift(a.callee);return FB.bind.apply(FB,b)}});FB.provide=FB.bind(FB.TypeLoader.provide,FB.TypeLoader);FB.subclass=FB.bind(FB.TypeLoader.subclass,FB.TypeLoader);FB.provide("FB.Log",{level:3,Level:{DEBUG:3,INFO:2,WARNING:1,ERROR:0},_helper:function(){var a=Array.prototype.slice.call(arguments),c=a.shift(),b=a.shift();if(this.level>=b&&window.console){(console[c]||console.log).apply(console,a)}}});FB.provide("FB.Log",{debug:FB.bind(FB.Log._helper,FB.Log,"debug",FB.Log.Level.DEBUG),info:FB.bind(FB.Log._helper,FB.Log,"info",FB.Log.Level.INFO),warn:FB.bind(FB.Log._helper,FB.Log,"warn",FB.Log.Level.WARNING),error:FB.bind(FB.Log._helper,FB.Log,"error",FB.Log.Level.ERROR)},true);(function(){var b=false,a=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;FB.Class=function(){};FB.Class.extend=function(e){var d=this.prototype;b=true;var f=new this();b=false;FB.forEach(e,function(h,g){f[g]=typeof h==="function"&&typeof d[g]==="function"&&a.test(h)?(function(j,i){return function(){var l=this._super;this._super=d[j];var k=i.apply(this,arguments);this._super=l;return k}})(g,h):h});var c=function(){if(!b){var g;if(this instanceof c){g=this}else{b=true;g=new c();b=false}if(g.init){g.init.apply(g,arguments)}return g}};c.prototype=f;c.constructor=c;c.extend=FB.Class.extend;return c}})();if(!window.FB){FB={}}if(!FB.Type){FB.Type={createNamespace:function(b){var d=window;var c=b.split(".");for(var a=0;a<c.length;a++){var f=c[a];var e=d[f];if(!e){d[f]=e={}}d=e}return d},createEnum:function(e,c,d){if(this.getObj(e)){return}var a=function(){};a.prototype=c;for(var b in c){a[b]=c[b]}if(d){a.__flags=true}this.setObj(e,a)},createClass2:function(cls,baseType){if(baseType&&typeof(baseType)=="string"){baseType=eval(baseType)}cls.prototype.constructor=cls;this.extend(cls,FB.Type.Methods);cls.__baseType=baseType||Object;if(baseType){cls.__basePrototypePending=true}},setObj:function(fullName,value){var i=fullName.lastIndexOf(".");var objName;var scope=window;if(i>0){var ns=fullName.substring(0,i);this.createNamespace(ns);objName=fullName.substring(i+1);scope=eval(ns)}else{objName=fullName}scope[objName]=value},getObj:function(b){var d=window;var c=b.split(".");for(var a=0;a<c.length;a++){var e=c[a];d=d[e];if(!d){break}}return d},createClass:function(a,b){if(this.getObj(a)){return}if(arguments.length==1&&typeof(a)!="string"){return this._createClass(a)}else{this.setObj(a,this._createClass(b))}},_createClass:function(b){var a=b.ctor||function(){};if(b.static_ctor){this.addStaticInit(b.static_ctor)}if(b.instance){a.prototype=b.instance}if(b["static"]){this.extend(a,b["static"])}this.createClass2(a,b.base);return a},addStaticInit:function(a){if(!FB.Type._pendingInits){FB.Type._pendingInits=[]}FB.Type._pendingInits[FB.Type._pendingInits.length]=a;window.setTimeout(FB.Type.runPendingInits,0)},runPendingInits:function(){if(FB.Type._pendingInits){var b=FB.Type._pendingInits;FB.Type._pendingInits=null;var a=b.length;for(var c=0;c<a;c++){b[c]()}}},extend:function(a,c){for(var b in c){a[b]=c[b]}return a},getInstanceType:function(a){return a.constructor}};FB.Type.Methods={setupBase:function(){if(this.__basePrototypePending){var a=this.__baseType;if(a.__basePrototypePending){a.setupBase()}for(var b in a.prototype){var c=a.prototype[b];if(!this.prototype[b]){this.prototype[b]=c}}delete this.__basePrototypePending}},constructBase:function(b,a){if(this.__basePrototypePending){this.setupBase()}if(!a){this.__baseType.apply(b)}else{this.__baseType.apply(b,a)}},callBase:function(c,d,a){var b=this.__baseType.prototype[d];if(!a){return b.apply(c)}else{return b.apply(c,a)}},get_baseType:function(){return this.__baseType||null}}}FB.provide("FB.HiddenContainer",{_onLoad:function(){if(document.getElementById("FB_HiddenContainer")==null){var a;try{var b=window.navigator.userAgent.toLowerCase().indexOf("msie")>=0&&window.attachEvent;if((!b||document.readyState=="completed")&&document.body){a=document.createElement("div");a.id="FB_HiddenContainer";a.style.position="absolute";a.style.top="-10000px";a.style.width="0px";a.style.height="0px";document.body.appendChild(a)}}catch(e){a=null}if(!a){document.write('<div id="FB_HiddenContainer" style="position:absolute; top:-10000px; left:-10000px; width:0px; height:0px;" ></div>')}}},get:function(){return FB.$("FB_HiddenContainer")}});FB.provide("FB.HiddenContainerLoader",{_onLoad:function(){FB.HiddenContainer.get()}});FB.subclass("FB.Delegate","FB.Class",{});FB.provide("FB.Delegate",{Null:function(){},_create:function(b){var a=function(){if(b.length==2){return b[1].apply(b[0],arguments)}else{var d=b.slice();for(var c=0;c<d.length;c+=2){d[c+1].apply(d[c],arguments)}return null}};a._targets=b;return a},create:function(b,a){if(!b){return a}return FB.Delegate._create([b,a])},combine:function(a,b){if(!a){if(!b._targets){return FB.Delegate.create(null,b)}return b}if(!b){if(!a._targets){return FB.Delegate.create(null,a)}return a}var c=a._targets?a._targets:[null,a];var d=b._targets?b._targets:[null,b];return FB.Delegate._create(c.concat(d))},remove:function(a,b){if(!a||(a===b)){return null}if(!b){return a}var f=a._targets;var e=null;var d;if(b._targets){e=b._targets[0];d=b._targets[1]}else{d=b}for(var c=0;c<f.length;c+=2){if((f[c]===e)&&(f[c+1]===d)){if(f.length==2){return null}f.splice(c,2);return FB.Delegate._create(f)}}return a}});if(!window.Delegate){window.Delegate=FB.Delegate}if(!window.FB){FB={}}if(!FB.Loader){FB.Loader={loaded:{},loading:{},loadedCss:{},loadedCallback:null,onScriptLoaded:function(b){var a=b.length;for(var c=0;c<a;c++){var d=b[c];FB.Loader.loaded[d]=true}if(FB.Loader.loadedCallback){window.setTimeout(function(){FB.Loader.loadedCallback(b)},0)}},loadCssComps:function(a){var b=FB.Loader.getStaticResourceUrl("connect.php/"+FB.locale+"/css/"+a.join("/"));if(!this.loadedCss[b]){var c=document.createElement("link");c.setAttribute("rel","stylesheet");c.setAttribute("type","text/css");c.setAttribute("href",b);document.getElementsByTagName("head")[0].appendChild(c);this.loadedCss[b]=true}},getStaticResourceUrl:function(b){var a=FB.dynData.resources.base_url_format;var c=(a.indexOf("https")===0)?"ssl":"static.ak";return a.replace("{0}",c)+b}}}if(!FB.Bootstrap){FB.Bootstrap={requireFeatures:function(e,c){if(FB.Bootstrap.isXdChannel){return}var i={features:e,callback:FB.Monitor.externalCallback(c),completed:false};if(FB.Bootstrap._checkRequest(i)){return}FB.Bootstrap._featureReqQueue.push(i);FB.Loader.loadedCallback=FB.Delegate.combine(FB.Loader.loadedCallback,FB.Bootstrap._onCompLoaded);FB.Bootstrap._transformFeatureList(e);var h={};var a=[];var f;var b=e.length;var g=0;for(f=0;f<b;f++){var d=e[f];if(!(FB.Loader.loaded[d])){if(!(FB.Loader.loaded[d]||FB.Loader.loading[d])){h[d]=true;a[a.length]=d}}}a.sort();var j=FB.Loader.getStaticResourceUrl("connect.php/"+FB.locale+"/js/"+a.join("/"));FB.Bootstrap.addScript(j)},_requireFeatures:function(b,a){this.requireFeatures(b,FB.bind(a))},_checkRequest:function(d){if(!d.completed){var b=0;var e=d.features.length;var c=0;for(b=0;b<e;b++){var a=d.features[b];if(FB.Loader.loaded[a]){c++}}if(c==e){d.completed=true;if(d.callback){d.callback(true)}}}return d.completed},_transformFeatureList:function(b){var c={Api:true,CanvasUtil:true,Connect:true,XFBML:true};var a=b.length;var g=false;var f={};for(var d=0;d<a;d++){f[b[d]]=true;if(c[b[d]]){g=true}}if(g){for(var e in c){if(!f[e]){b[b.length]=e}}}},ensureInit:function(a){if(!a){throw ("FB.ensureInit called without a valid callback")}a=FB.Monitor.externalCallback(a);if(FB.Facebook&&FB.Facebook.get_initialized&&FB.Facebook.get_initialized().get_isReady()&&FB.Facebook.get_initialized().result){return a()}FB.Bootstrap._requireFeatures(FB.Bootstrap.features,function(){FB.Facebook.get_initialized().waitForValue(true,a)})},init:function(a,c,b){FB.Bootstrap._requireFeatures(FB.Bootstrap.features,function(){if(FB.Facebook){FB.Facebook.init(a,c,b)}})},addScript:function(f){var d;var e=document.getElementsByTagName("script");if(e){var a=e.length;for(var b=0;b<a;b++){d=e[b];if(d.src==f){return}}}d=document.createElement("script");d.type="text/javascript";d.src=f;var c=document.getElementsByTagName("HEAD")[0]||document.body;c.appendChild(d)},setLocale:function(b,a){window.FB.locale=b;window.FB.localeIsRTL=a},_initializeXdChannel:function(){FB.Bootstrap.isXdChannel=window.location.search.indexOf(FB.Bootstrap.fbc_channel_token)>=0},_detectDocumentNamespaces:function(){if(document.namespaces&&!document.namespaces.item.fb){document.namespaces.add("fb")}},createDefaultXdChannelUrl:function(){var a=location.protocol+"//"+location.hostname+location.pathname+location.search;if(location.search||location.search.length>0){a+="&"}else{a+="?"}a+="fbc_channel=1";return a},_onCompLoaded:function(){var b=0;var a=FB.Bootstrap._featureReqQueue.length;for(b=0;b<a;b++){FB.Bootstrap._checkRequest(FB.Bootstrap._featureReqQueue[b])}},_onLoad:function(){this._initializeXdChannel();this._detectDocumentNamespaces()},features:["XFBML","CanvasUtil"],fbc_channel_token:"fbc_channel=1",_featureReqQueue:[]};FB.Monitor.wrapObject(FB.Bootstrap,"FB.Bootstrap");window.FB_RequireFeatures=FB.Bootstrap.requireFeatures;window.FB.init=FB.Bootstrap.init;window.FB.ensureInit=FB.Bootstrap.ensureInit;FB.Bootstrap._onLoad()}if(!window.FBIntern){FBIntern={}}if(!FBIntern.XdReceiver){FBIntern.XdReceiver={delay:100,timerId:-1,dispatchMessage:function(){var i=document.URL;var e=i.indexOf("#");var d;if(e>0){d=i.substring(e+1)}else{e=i.indexOf("fb_login&");if(e>0){d=i.substring(e+9)}else{return}}var a="debug=1&";if(d.indexOf(a)==0){d=d.substring(a.length)}var h;var c=null;try{var f=window.parent;if(d.indexOf("fname=")==0){var g=d.indexOf("&");var b=d.substr(6,g-6);if(b=="_opener"){f=f.opener}else{if(b=="_oparen"){f=f.opener.parent}else{if(b!="_parent"){f=f.frames[b]}}}h=d.substr(g+1)}else{f=f.parent;h=d}c=f.FB.XdComm.Server.singleton.onReceiverLoaded}catch(e){if(e.number==-2146828218){return}}if(c){f.FB.XdComm.Server.singleton.onReceiverLoaded(h);if(FBIntern.XdReceiver.timerId!=-1){window.clearInterval(FBIntern.XdReceiver.timerId);FBIntern.XdReceiver.timerId=-1}}else{if(FBIntern.XdReceiver.timerId==-1){try{FBIntern.XdReceiver.timerId=window.setInterval(FBIntern.XdReceiver.dispatchMessage,FBIntern.XdReceiver.delay)}catch(e){}}}}};if(!(window.FB&&FB.Bootstrap&&!FB.Bootstrap.isXdChannel)){try{FBIntern.XdReceiver.dispatchMessage()}catch(e){}}}(function(){var c=document.getElementsByTagName("script");var d=c[c.length-1];if(d!=undefined){var a=d.getAttribute("fb-api-key");var b=d.getAttribute("fb-xd-receiver");if(a!=null){window.setTimeout(function(){FB.init(a,b)},0)}}})();if(FB&&FB.Loader){FB.Loader.onScriptLoaded(["FB.monitor-wrapper","FB.Prelude","FB.Log","FB.Class","FB.Type","FB.HiddenContainer","FB.HiddenContainerLoader","FB.Delegate","FB.Loader","FB.Bootstrap","XdCommReceiver"])};
var IS_IE="\v"=="v";var containers={map:{"c959fa4-ffffff-6x6":{x:0,y:0},"cb4bdc1-ffffff-6x6":{x:13,y:0},"cb4bdc1-b8d9ea-6x6":{x:52,y:0},"c959fa4-6x6":{x:26,y:0},"c5b6468-6x6":{x:39,y:0},"cffffff-6x6":{x:78,y:0},"crgb-6x6":{x:65,y:0}},getClass:function(){return"containersPng"},getPosition:function(className,corner){var pos=$merge(this.map[className.toLowerCase()]);if(pos==null){return null}if(corner==2||corner==3){pos.x+=6}if(corner==3||corner==4){pos.y+=6}var str=pos.x>0?"-":"";str+=pos.x+"px "+(pos.y>0?"-":"");str+=pos.y+"px";return str}};function getAttributeValue(el,attr){el=$(el);var val=el.getAttribute(attr);if(val!=null&&val!=""){return val}val=el.getProperty(attr);if(val!=null){return val}return eval("el."+attr)}function getStringAsJSON(str){if($type(str)!="string"){return str}if(str.charAt(0)!="{"){str="{"+str}if(str.charAt(str.length-1)!="}"){str+="}"}str=str.replace(/''/g,"%27'");return eval("("+str+")")}function getAttributeValueAsJSON(el,attr){return getStringAsJSON(getAttributeValue(el,attr))}function getEvent(e){return(e==null||!e)?window.event:e}function cancelPropagation(e){e=getEvent(e);if(e==null){return}e.cancelBubble=true;if(e.stopPropagation!=null){e.stopPropagation()}}function getSource(e){return e.target?e.target:e.srcElement}function getExtendedSize(el){var size=el.getSize();size.x+=el.getStyle("margin-left").toInt()+el.getStyle("margin-right").toInt()+el.getStyle("padding-left").toInt()+el.getStyle("padding-right").toInt();size.y+=el.getStyle("margin-top").toInt()+el.getStyle("margin-bottom").toInt()+el.getStyle("padding-top").toInt()+el.getStyle("padding-bottom").toInt();return size}function getCoordinatesFor(el){if(!document.all){return $(el).getCoordinates()}var obj=new Object();obj.width=el.offsetWidth;obj.height=el.offsetHeight;var curleft=curtop=0;if(el.offsetParent){do{curleft+=el.offsetLeft;curtop+=el.offsetTop}while(el=el.offsetParent)}obj.left=curleft;obj.top=curtop;obj.right=obj.left+obj.width;obj.bottom=obj.top+obj.height;return obj}function getPressedKeyCode(e){e=getEvent(e);return e.keyCode==null?e.code:e.keyCode}function mergeObjects(obj1,obj2,remove){var obj3=new Object();for(var name in obj1){if(remove==null||!remove.contains(name)){obj3[name]=obj1[name]}}for(var name in obj2){if(remove==null||!remove.contains(name)){obj3[name]=obj2[name]}}return obj3}function createListOptionsContainer(){var listOptions={isFocused:false,dom:{element:$(document.createElement("div"))},maxHeight:200,clear:function(){this.dom.element.content.empty();this.dom.options=$(document.createElement("div"));this.dom.options.id="optionsContainer";this.dom.element.addEvent("focus",this.focused.bind(this));this.dom.element.addEvent("blur",this.blured.bind(this));this.dom.element.content.appendChild(this.dom.options);$(this.dom.header.childNodes[1]).setStyle("width",5);$(this.dom.footer.childNodes[1]).setStyle("width",5);this.dom.element.setStyle("left",0);this.dom.element.setStyle("top",0)},addItem:function(item){this.dom.options.appendChild(item)},focused:function(event){this.isFocused=true},blured:function(event){this.isFocused=false;if(this.handler!=null){this.handler.blured(event)}},show:function(point){this.dom.element.setProperty("tabindex",-1);this.dom.element.setStyle("left",point.left);this.dom.element.setStyle("top",point.top);this.dom.element.setStyle("display","block");var children=this.dom.options.getChildren();var size={x:0,y:0};for(var i=0;i<children.length;i++){size.x=Math.max(size.x,children[i].getSize().x);size.y+=children[i].getSize().y}if(size.y>this.maxHeight){this.dom.options.setStyle("overflow","auto");this.dom.options.setStyle("height",this.maxHeight);size.x+=17}this.dom.options.setStyle("width",size.x);var w=size.x-$(this.dom.header.childNodes[0]).getSize().x*2+3;$(this.dom.header.childNodes[1]).setStyle("width",w);$(this.dom.footer.childNodes[1]).setStyle("width",w)},hide:function(){this.dom.element.removeProperty("tabindex");this.dom.element.setStyle("display","none")},getItemAt:function(index){return this.dom.options.getChildren()[index].handler},getItemFor:function(text){var children=this.dom.options.getChildren();for(var i=0;i<children.length;i++){if(children[i].get("text").indexOf(text)==0){return children[i]}}return null},scrollTo:function(item){var currentTop=this.dom.options.getScroll().y;var currentBottom=currentTop+this.dom.options.getSize().y;var myFx=new Fx.Scroll(this.dom.options,{offset:{x:0,y:item.dom.getPosition(this.dom.options).y}});if(item.dom.getPosition(this.dom.options).y>currentBottom){myFx.toTop()}else{if(item.dom.getPosition(this.dom.options).y<currentTop){myFx.toTop()}}}};listOptions.dom.element.id="listsOptionsContainer";document.body.appendChild(listOptions.dom.element);var properties={className:"cb4bdc1-ffffff-6x6",borderColor:"#b4bdc1",backgroundColor:"#FFFFFF",cornerWidth:6,cornerHeight:6,respect:"width"};wrapWithContainer(listOptions.dom.element,properties);listOptions.dom.header=listOptions.dom.element.header;listOptions.dom.content=listOptions.dom.element.content;listOptions.dom.footer=listOptions.dom.element.footer;return listOptions}function Input(domElement){if(domElement==null){return}domElement.handler=this;this.id=getAttributeValue(domElement,"name");this.title=getAttributeValue(domElement,"title");this.dom={container:domElement.getParent(),element:domElement};this.isFocused=false;this.type="text";if(this.dom.element.tagName.toLowerCase()=="input"){this.type=this.dom.element.type.toLowerCase()}else{this.type=getAttributeValue(this.dom.element,"class")}this.emptyValue=getAttributeValue(domElement,"emptyValue");if(this.emptyValue!=null){this.dom.element.addEvent("focus",this.focused.bind(this));this.dom.element.addEvent("blur",this.blured.bind(this));this.dom.element.value=this.emptyValue;this.text=this.emptyValue;this.realValue=null}}Input.prototype.setValue=function(val){this.dom.element.value=val};Input.prototype.getValue=function(){return this.dom.element.value==this.emptyValue?null:this.dom.element.value};Input.prototype.getTrimmedValue=function(){var value=this.getValue();if(value==null){return null}value=value.trim();return value.length==0?null:value};Input.prototype.focused=function(event){if(this.realValue==null){this.setValue("")}this.isFocused=true};Input.prototype.blured=function(event){if(this.type=="list"){return}var value=this.dom.element.value.trim();if(value.length==0){this.realValue=null}else{if(value==this.emptyValue){this.realValue=null}else{this.realValue=value}}if(this.realValue==null){this.setValue(this.emptyValue)}this.isFocused=false};Button.prototype=Input;function Button(domElement){Input.call(this,domElement);this.type=domElement.className.replace(/button/,"").trim();this.mouseOver=function(event){if(this.isDisabled){return}this.dom.element.className="button over"};this.mouseOut=function(event){if(this.isDisabled){return}this.dom.element.className="button "+this.type};this.setDisabled=function(isDisabled){if(isDisabled==this.isDisabled){return}this.isDisabled=isDisabled};this.dom.element.addEvent("mouseenter",this.mouseOver.bind(this));this.dom.element.addEvent("mouseleave",this.mouseOut.bind(this))}function createContainerProperties(domElement,attributeName){var properties=getAttributeValue(domElement,attributeName==null?"container":attributeName);if(properties==null){return null}properties=eval("({"+properties+"})");if(properties.borderWidth==null){properties.borderWidth=1}if(properties.backgroundColor!=null){properties.className="c";if(properties.borderColor!=null){properties.className+=properties.borderColor.replace("#","")+"-"}properties.className+=properties.backgroundColor.replace("#","")+"-";properties.className+=properties.cornerWidth+"x"+properties.cornerHeight}return properties}function mergeProperties(props1,props2,remove){var properties=mergeObjects(props1,props2,remove);if(properties.className==null||properties.backgroundOffset==null){properties.className="c";if(properties.borderColor!=null&&properties.borderColor!=properties.backgroundColor){properties.className+=properties.borderColor.replace("#","")+"-"}if(properties.backgroundColor!=null){properties.className+=properties.backgroundColor.replace("#","")+"-"}properties.className+=properties.cornerWidth+"x"+properties.cornerHeight}return properties}function wrapWithContainer(domElement,properties,style){if(properties.respect=="width"){return createContainerRespectWidth(domElement,properties,true,style)}else{return createContainerRespectHeight(domElement,properties,true)}}function replaceWithContainer(domElement,properties){if(properties.respect=="width"){return createContainerRespectWidth(domElement,properties,false)}else{return createContainerRespectHeight(domElement,properties)}}function createContainerRespectWidth(domElement,properties,wrap,style){var container=$(document.createElement("div"));container.set("style",style==null?"margin-top: 2px;":style);var w=domElement.getSize().x-properties.cornerWidth*2;var elementsToRest=new Array();if(document.all&&properties.backgroundColor.indexOf("rgba")==0){properties.backgroundColor=properties.backgroundColor.replace("rgba","rgb");properties.backgroundAlpha=properties.backgroundColor.substring(properties.backgroundColor.lastIndexOf(","));properties.backgroundColor=properties.backgroundColor.replace(properties.backgroundAlpha,")");properties.backgroundAlpha=properties.backgroundAlpha.replace(", ","").replace(",","").replace(")","").toFloat()}var header=null,extraStyles="";if(properties.exclude==null||properties.exclude!="header"){header=$(document.createElement("div"));header.set("style","height: "+properties.cornerHeight+"px; width: 100%;");var el=$(document.createElement("div"));extraStyles="";if(properties.backgroundAlpha==1){extraStyles="position: relative; filter:alpha(opacity=100); opacity: 1; -moz-opacity: 1; "}el.set("class",containers.getClass(properties.className));el.set("style",extraStyles+"float: left; width: "+properties.cornerWidth+"px; height: "+properties.cornerHeight+"px; background-position: "+containers.getPosition(properties.className,1)+";");header.appendChild(el);el=$(document.createElement("div"));elementsToRest.push(el);el.set("style","float: left; width: "+w+"px; height: "+properties.cornerHeight+"px; background-color: "+properties.backgroundColor+(properties.borderColor==null?";":"; border-top: 1px solid "+properties.borderColor+";"));if(properties.backgroundAlpha!=null){el.setStyles({filter:"alpha(opacity="+(properties.backgroundAlpha*100)+")",opacity:properties.backgroundAlpha,"-moz-opacity":properties.backgroundAlpha});if(properties.backgroundAlpha==1){el.setStyle("position","relative")}}header.appendChild(el);el=$(document.createElement("div"));extraStyles="";if(properties.backgroundAlpha==1){extraStyles="position: relative; filter: alpha(opacity=100); opacity: 1; -moz-opacity: 1; "}el.set("class",containers.getClass(properties.className));el.set("style",extraStyles+"float: left; width: "+properties.cornerWidth+"px; height: "+properties.cornerHeight+"px; background-position: "+containers.getPosition(properties.className,2)+";");header.appendChild(el)}var content=$(document.createElement("div"));if(domElement.getChildren().length==0){var textContainer=$(document.createElement("span"));textContainer.set("text",domElement.get("text"));content.appendChild(textContainer)}else{while(domElement.getChildren().length>0){el=domElement.removeChild(domElement.getLast());if(el.tagName.toLowerCase()=="table"){el.setStyle("clear","left")}content.appendChild(el)}}var styles={"background-color":properties.backgroundColor,"border-left":(properties.borderColor==null)?null:("1px solid "+properties.borderColor),"border-right":(properties.borderColor==null)?null:("1px solid "+properties.borderColor)};if(properties.backgroundAlpha!=null){if(properties.backgroundAlpha==1){styles.position="relative"}else{styles.opacity=properties.backgroundAlpha;styles["-moz-opacity"]=properties.backgroundAlpha;styles.filter="alpha(opacity="+(properties.backgroundAlpha*100)+")"}}content.setStyles(styles);var footer=null;if(properties.exclude==null||properties.exclude!="footer"){footer=$(document.createElement("div"));footer.set("style","height: "+properties.cornerHeight+"px; width: 100%;");el=$(document.createElement("div"));extraStyles="";if(properties.backgroundAlpha==1){extraStyles="position: relative; filter: alpha(opacity=100); opacity: 1; -moz-opacity: 1; "}el.set("class",containers.getClass(properties.className));el.set("style",extraStyles+"float: left; width: "+properties.cornerWidth+"px; height: "+properties.cornerHeight+"px; background-position: "+containers.getPosition(properties.className,4)+";");footer.appendChild(el);el=$(document.createElement("div"));elementsToRest.push(el);el.set("style","float: left; width: "+w+"px; height: "+properties.cornerHeight+"px; background-color: "+properties.backgroundColor+(properties.borderColor==null?";":"; border-bottom: 1px solid "+properties.borderColor));if(properties.backgroundAlpha!=null){el.setStyles({filter:"alpha(opacity="+(properties.backgroundAlpha*100)+")",opacity:properties.backgroundAlpha,"-moz-opacity":properties.backgroundAlpha});if(properties.backgroundAlpha==1){el.setStyle("position","relative")}}footer.appendChild(el);el=$(document.createElement("div"));extraStyles="";if(properties.backgroundAlpha==1){extraStyles="position: relative; filter: alpha(opacity=100); opacity: 1; -moz-opacity: 1; "}el.set("class",containers.getClass(properties.className));el.set("style",extraStyles+"float: left; width: "+properties.cornerWidth+"px; height: "+properties.cornerHeight+"px; background-position: "+containers.getPosition(properties.className,3)+";");footer.appendChild(el)}if(header!=null){container.appendChild(header)}container.appendChild(content);if(footer!=null){container.appendChild(footer)}if(wrap){domElement.appendChild(container);domElement.properties=properties;domElement.header=header;domElement.content=content;domElement.footer=footer;domElement.resetElements=elementsToRest;domElement.reset=function(){for(var i=0;i<this.resetElements.length;i++){this.resetElements[i].setStyle("width",null)}};domElement.layout=function(width){if(width==null){width=this.content.getSize().x-(this.header==null?this.footer:this.header).getChildren()[0].getSize().x*2;if(this.header!=null){this.header.getChildren()[1].setStyle("width",width)}if(this.footer!=null){this.footer.getChildren()[1].setStyle("width",width)}}else{this.content.setStyle("width",width-this.content.getStyle("padding-right").toInt()-this.content.getStyle("padding-left").toInt());width-=(this.header==null?this.footer:this.header).getChildren()[0].getSize().x*2;if(this.header!=null){this.header.getChildren()[1].setStyle("width",width)}if(this.footer!=null){this.footer.getChildren()[1].setStyle("width",width)}}};return null}else{domElement.getParent().insertBefore(container,domElement);domElement.getParent().removeChild(domElement);return container}}function replaceContainerRespectHeight(domElement){var properties=domElement.properties;if(properties==null){return}if(properties.top!=null){properties.top=mergeProperties(properties,properties.top,["top","right","bottom","left"])}if(properties.right!=null){properties.right=mergeProperties(properties,properties.right,["top","right","bottom","left"])}if(properties.bottom!=null){properties.bottom=mergeProperties(properties,properties.bottom,["top","right","bottom","left"])}if(properties.left!=null){properties.left=mergeProperties(properties,properties.left,["top","right","bottom","left"])}if(getAttributeValue(domElement,"hover")!=null){domElement.idle=properties;domElement.hover=createContainerProperties(domElement,"hover")}var rows=properties.rows==null?1:properties.rows;domElement.rowsBindings=new Array(rows);if(properties.exclude==null||properties.exclude!="left"){domElement.left=$(document.createElement("div"));domElement.left.set("style","float: left; width: "+properties.cornerWidth+"px;");var hlp;if(properties.exclude!="top"){hlp=$(document.createElement("div"));var className=properties.top!=null?properties.top.className:properties.className;hlp.set("class",containers.getClass(className));hlp.set("style","height:"+properties.cornerHeight+"px; background-position: "+containers.getPosition(className,1)+";");domElement.left.appendChild(hlp)}for(var i=0;i<rows;i++){hlp=$(document.createElement("div"));hlp.set("style","background-color: "+properties.backgroundColor+";"+(properties.borderColor!=null?"border-left: "+properties.borderWidth+"px solid "+properties.borderColor+";":""));domElement.left.appendChild(hlp)}if(properties.exclude!="bottom"){hlp=$(document.createElement("div"));var className=properties.bottom!=null?properties.bottom.className:properties.className;hlp.set("class",containers.getClass(className));hlp.set("style","clear: left; height:"+properties.cornerHeight+"px; width: 100%; background-position: "+containers.getPosition(className,4)+";");domElement.left.appendChild(hlp)}}domElement.content=$(document.createElement("div"));if(properties.top!=null){domElement.contentContainer=$(document.createElement("div"));domElement.contentContainer.set("style","float: left;"+(properties.borderColor!=null?"border-top: "+properties.borderWidth+"px solid "+properties.top.borderColor+"; border-bottom: "+properties.borderWidth+"px solid "+properties.bottom.borderColor+";":""));var hlp=$(document.createElement("div"));hlp.set("style","height: "+(properties.cornerHeight-properties.borderWidth)+"px; background-color: "+properties.top.backgroundColor);domElement.contentContainer.appendChild(hlp);domElement.contentContainer.appendChild(domElement.content)}if(domElement.contentContainer==null){domElement.content.set("style","float: left; background-color: "+properties.backgroundColor+";"+(properties.borderColor!=null?"border-top: "+properties.borderWidth+"px solid "+properties.borderColor+"; border-bottom: "+properties.borderWidth+"px solid "+properties.borderColor+";":""))}else{domElement.content.set("style","background-color: "+properties.backgroundColor+";")}var children=domElement.getChildren();while(domElement.getChildren().length>0){var el=domElement.removeChild(domElement.getFirst());domElement.content.appendChild(el)}if(properties.bottom!=null){var hlp=$(document.createElement("div"));hlp.set("style","clear: left; height: "+(properties.cornerHeight-properties.borderWidth)+"px; width: 100%; background-color: "+properties.bottom.backgroundColor);domElement.contentContainer.appendChild(hlp)}if(properties.exclude==null||properties.exclude!="right"){domElement.right=$(document.createElement("div"));domElement.right.set("style","float: left; width: "+properties.cornerWidth+"px;");var hlp;if(properties.exclude!="top"){hlp=$(document.createElement("div"));var className=properties.top!=null?properties.top.className:properties.className;hlp.set("class",containers.getClass(className));hlp.set("style","height:"+properties.cornerHeight+"px; width: 100%; background-position: "+containers.getPosition(className,2)+";");domElement.right.appendChild(hlp)}for(var i=0;i<rows;i++){hlp=$(document.createElement("div"));hlp.set("style","background-color: "+properties.backgroundColor+";"+(properties.borderColor!=null?"border-right: "+properties.borderWidth+"px solid "+properties.borderColor+";":""));domElement.right.appendChild(hlp)}if(properties.exclude!="bottom"){hlp=$(document.createElement("div"));var className=properties.bottom!=null?properties.bottom.className:properties.className;hlp.set("class",containers.getClass(className));hlp.set("style","height:"+properties.cornerHeight+"px; width: 100%; background-position: "+containers.getPosition(className,3)+";;");domElement.right.appendChild(hlp)}}if(domElement.left!=null){domElement.appendChild(domElement.left)}domElement.appendChild(domElement.contentContainer==null?domElement.content:domElement.contentContainer);if(domElement.right!=null){domElement.appendChild(domElement.right)}domElement.bindRow=function(index,el){if(index>=this.rowsBindings.length){return}this.rowsBindings[index]=el};domElement.layout=function(layoutWidth){var height;if(this.contentContainer!=null){height=this.content.getSize().y;if(this.left!=null){$(this.left.childNodes[1]).setStyle("height",height)}if(this.right!=null){$(this.right.childNodes[1]).setStyle("height",height)}if(this.content.childNodes.length==this.left.childNodes.length-2){for(var i=0;i<this.content.childNodes.length;i++){$(this.left.childNodes[i+1]).setStyle("height",$(this.content.childNodes[i]).getSize().y-this.properties.cornerHeight);$(this.left.childNodes[i+1]).setStyle("background-color",$(this.content.childNodes[i]).getStyle("background-color"));$(this.right.childNodes[i+1]).setStyle("height",$(this.content.childNodes[i]).getSize().y-this.properties.cornerHeight);$(this.right.childNodes[i+1]).setStyle("background-color",$(this.content.childNodes[i]).getStyle("background-color"))}}else{if(this.content.childNodes.length==1&&this.content.childNodes[0].tagName.toLowerCase()=="table"&&this.content.childNodes[0].rows.length==this.left.childNodes.length-2){for(var i=0;i<this.content.childNodes[0].rows.length;i++){$(this.left.childNodes[i+1]).setStyle("height",$(this.content.childNodes[0].rows[i].cells[0]).getSize().y);$(this.left.childNodes[i+1]).setStyle("background-color",$(this.content.childNodes[0].rows[i].cells[0]).getStyle("background-color"));$(this.right.childNodes[i+1]).setStyle("height",$(this.content.childNodes[0].rows[i].cells[0]).getSize().y);$(this.right.childNodes[i+1]).setStyle("background-color",$(this.content.childNodes[0].rows[i].cells[0]).getStyle("background-color"))}}}}else{var extra,el;for(var i=0;i<this.rowsBindings.length;i++){if(this.rowsBindings[i]!=null&&this.rowsBindings[i].getStyle("display")=="none"){if(this.left!=null){$(this.left.childNodes[i+1]).setStyle("height",0)}if(this.right!=null){$(this.right.childNodes[i+1]).setStyle("height",0)}continue}extra=0;if((i==0&&domElement.properties.exclude!="top")||(i==1&&this.rowsBindings[0].getStyle("display")=="none")){extra+=properties.cornerHeight}if((i==this.rowsBindings.length-1&&domElement.properties.exclude!="bottom")||(i==this.rowsBindings.length-2&&this.rowsBindings[this.rowsBindings.length-1].getStyle("display")=="none")){extra+=properties.cornerHeight}el=this.rowsBindings[i]==null?this.content:this.rowsBindings[i];height=(el.getSize().y+el.getStyle("margin-top").toInt()+el.getStyle("padding-top").toInt()+el.getStyle("margin-bottom").toInt()+el.getStyle("padding-bottom").toInt())-extra;if(this.left!=null){$(this.left.childNodes[i+1]).setStyle("height",height)}if(this.right!=null){$(this.right.childNodes[i+1]).setStyle("height",height)}}}if(layoutWidth){var width=this.getSize().x-this.getStyle("padding-left").toInt()-this.getStyle("padding-right").toInt();if(this.left!=null){width-=this.left.getSize().x}if(this.right!=null){width-=this.right.getSize().x}this.content.setStyle("width",width)}}}function createContainerRespectHeight(domElement,properties){var tbl=$(document.createElement("table"));if(properties.id!=null){tbl.id=properties.id}if(properties.cssclass!=null){tbl.className=properties.cssclass}var styles=domElement.getStyles("display","width","height","margin","cursor");if(IS_IE){for(style in styles){if(style=="height"&&styles[style].toInt()<0){tbl.setStyle("height","auto")}else{tbl.setStyle(style,styles[style])}}}else{tbl.setStyles(styles)}tbl.cellPadding="0";tbl.cellSpacing="0";var row=tbl.insertRow(-1);var cells=[$(row.insertCell(-1)),$(row.insertCell(-1)),$(row.insertCell(-1))];cells[0].innerHTML='<div class="'+properties.className+'" style="width: '+properties.cornerWidth+"px; height: "+properties.cornerHeight+"px; background-position: "+(properties.backgroundOffset!=null?(properties.backgroundOffset.left+"px "+properties.backgroundOffset.top+"px"):"0px 0px")+';"></div>';cells[0].innerHTML+='<div style="width: '+(properties.borderColor!=null?properties.cornerWidth-properties.borderWidth:properties.cornerWidth)+"px; height: "+(domElement.getSize().y-properties.cornerHeight*2)+"px; background-color: "+properties.backgroundColor+";"+(properties.borderColor!=null?"border-left: "+properties.borderWidth+"px solid "+properties.borderColor:"")+'"></div>';cells[0].innerHTML+='<div class="'+properties.className+'" style="width: '+properties.cornerWidth+"px; height: "+properties.cornerHeight+"px; background-position: "+(properties.backgroundOffset!=null?(properties.backgroundOffset.left+"px "+(properties.backgroundOffset.top-properties.cornerHeight)+"px"):"0px -"+properties.cornerHeight+"px")+';"></div>';cells[1].setStyles(domElement.getStyles("padding","font-size","font-weight","color","text-align","vertical-align"));cells[1].setStyle("background-color",properties.backgroundColor);cells[1].setStyle("white-space","nowrap");if(properties.borderColor!=null){cells[1].setStyle("border-top",properties.borderWidth+"px solid "+properties.borderColor);cells[1].setStyle("border-bottom",properties.borderWidth+"px solid "+properties.borderColor)}cells[1].setStyle("width",domElement.getSize().x);cells[1].setStyle("padding","0px 5px");cells[1].innerHTML=domElement.innerHTML;cells[2].innerHTML='<div class="'+properties.className+'" style="width: '+properties.cornerWidth+"px; height: "+properties.cornerHeight+"px; background-position: "+(properties.backgroundOffset!=null?((properties.backgroundOffset.left-properties.cornerWidth)+"px "+properties.backgroundOffset.top+"px"):("-"+properties.cornerWidth+"px 0px"))+';"></div>';cells[2].innerHTML+='<div style="width: '+(properties.borderColor!=null?properties.cornerWidth-properties.borderWidth:properties.cornerWidth)+"px; height: "+(domElement.getSize().y-properties.cornerHeight*2)+"px; background-color: "+properties.backgroundColor+";"+(properties.borderColor!=null?"border-right: "+properties.borderWidth+"px solid "+properties.borderColor:"")+'"></div>';cells[2].innerHTML+='<div class="'+properties.className+'" style="width: '+properties.cornerWidth+"px; height: "+properties.cornerHeight+"px; background-position: "+(properties.backgroundOffset!=null?((properties.backgroundOffset.left-properties.cornerWidth)+"px "+(properties.backgroundOffset.top-properties.cornerHeight)+"px"):("-"+properties.cornerWidth+"px -"+properties.cornerHeight+"px"))+';"></div>';var parent=domElement.getParent();parent.insertBefore(tbl,domElement);parent.removeChild(domElement);tbl.content=cells[1];tbl.layout=function(){if(IS_IE){this.content.set("html",this.content.get("text").replace(/\s/g,"&nbsp;"))}var size=$(this.rows[0].cells[1]).getSize();$(this.rows[0].cells[0]).getChildren()[1].setStyle("height",size.y-properties.cornerHeight*2);$(this.rows[0].cells[2]).getChildren()[1].setStyle("height",size.y-properties.cornerHeight*2)};return tbl}function makeTicker(el){el.ticker={initialized:false,dom:el,position:"left",init:function(){this.initialized=true;var delta=this.dom.getScrollSize().x-this.dom.getSize().x;if(delta==0){this.state="disabled";return false}this.state="idle";var options={onComplete:this.end.bind(this),duration:delta*20};this.tickerFx=new Fx.Scroll(this.dom,options);return true},start:function(delay){if(!this.initialized&&!this.init()){return}if(this.state=="disabled"){return}if(delay==null||delay){this.state="active";setTimeout(function(){this.start(false)}.bind(this),800);return}this.run()},run:function(){if(this.state=="idle"&&this.position=="left"){return}if(this.position=="left"){this.tickerFx.toRight()}else{this.tickerFx.toLeft()}},stop:function(){this.state=this.state=="disabled"?"disabled":"idle"},end:function(){this.position=this.position=="left"?"right":"left";setTimeout(function(){this.run()}.bind(this),1000)}};var styles={overflow:"hidden","white-space":"nowrap"};el.setStyles(styles)};
function ConnectionManager(){var mRequestsQueue=new Hash();var mAwaitingRequests=new Hash();this.makeRequest=function(url,params,callback,awaitReply,errorCallback,method){var request=new RequestWrapper(this,callback,errorCallback,awaitReply);mRequestsQueue.set(request.getID(),request);if(page.logger!=null){page.logger.info('message out, url: "'+url+'", params: "'+params+'"')}if(method==="post"){request.sendPost(url,params)}else{request.sendGet(url,params)}return request};this.handleSentRequest=function(request){mRequestsQueue.erase(request.getID());if(request.isAwaitingReply()){mAwaitingRequests.set(request.getID(),request)}if(request.status==200||request.status==0){var callback=request.getCallback();callback(request)}else{if(request.status==500){var callback=request.getErrorCallback();if(callback!=null){callback(request)}}}};this.handleRequestAnswer=function(requestID){mRequestsQueue.erase(requestID)}}function RequestWrapper(owner,callback,errorCallback,awaitReply){var mOwner=owner;var mCallback=callback;var mErrorCallback=errorCallback;var mID=(new Date()).getTime();var mAwaitingReply=awaitReply==null?false:awaitReply;var mRequest;try{mRequest=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP")}catch(e){if(IS_IE){mRequest=new ActiveXObject("Microsoft.XMLHTTP")}else{mRequest=new XMLHttpRequest()}}this.getID=function(){return mID};this.isAwaitingReply=function(){return mAwaitingReply};this.sendGet=function(url,params){url+=(url.lastIndexOf("?")>0?"&":"?")+"rid="+mID;if(params!=null){url+="&"+params}mRequest.open("GET",url,true);send.bind(this)("GET",url,null)};this.sendPost=function(url,params){mRequest.open("POST",url,true);mRequest.setRequestHeader("Content-type","application/x-www-form-urlencoded");mRequest.setRequestHeader("Content-length",params.length);mRequest.setRequestHeader("Connection","close");send.bind(this)("POST",url,params)};this.getResponseAsJSON=function(){var text=mRequest.responseText;try{return eval("("+text+")")}catch(e){return null}};this.getCallback=function(){return mCallback};this.getErrorCallback=function(){return mErrorCallback};function send(method,url,params){if(!window.XMLHttpRequest){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead")}catch(e){alert("Permission UniversalBrowserRead denied.")}}mRequest.onreadystatechange=manageStateChange.bind(this);mRequest.send(params)}function manageStateChange(){var readyState,status;try{readyState=mRequest.readyState}catch(e){return}if(readyState==4){try{status=""+mRequest.status;if(status=="OK"){status=200}else{status=parseInt(status,10)}}catch(e){}this.status=status;mOwner.handleSentRequest(this)}}};
function PageForm(){this.forms=new Hash();this.validators=createValidators();this.domForm=$(document.createElement("form"));this.domForm.set("style","display: none;");document.body.appendChild(this.domForm);$$("[formed]").each(function(el,i){var formid=getAttributeValue(el,"formid");var form=this.forms.get(formid);if(form==null){form=new Form(formid);this.forms.set(formid,form)}var iclass=getAttributeValue(el,"class");var input;switch(iclass){case"list":var properties=getAttributeValue(el,"properties");if(properties==null){input=new ListInput(el,form)}else{el.properties=eval("({"+properties+"})");if(el.properties.series!=null){input=new SeriesListInput(el,form)}else{if(el.properties.list!=null){input=new SingleValueLocalListInput(el,form)}}}input.initList();break;case"checkbox":input=form.inputExists(getAttributeValue(el,"name"));if(input!=null){input.addInput(el);input=null}else{input=new CheckboxFormInput(el,form)}break;default:input=new FormedInput(el,form);break}if(input!=null){form.addInput(input)}}.bind(this));this.submit=function(method,action,formid){if(this.forms.getKeys().length>1&&formid==null){return}var form=this.forms.get(formid);var errors=form.validate(this.validators);if(form.domForm==null){while(this.domForm.hasChildNodes()){this.domForm.removeChild(this.domForm.getFirst())}this.domForm.method=method==null?"get":method;this.domForm.action=action}if(errors==null){form.submit(this.domForm)}else{return errors}};this.getAsAjaxParameters=function(formid){if(this.forms.getKeys().length>1&&formid==null){return}var form=this.forms.get(formid);var errors=form.validate(this.validators);if(errors==null){return form.getAsAjaxParameters()}else{return errors}};this.showErrors=function(properties,errors){properties.header.text="Form Error";var el;properties.content.init=function(domElement){domElement.clear();el=$(document.createElement("div"));el.set("style","padding-bottom: 4px; color: #4a5053; font-size: 12px; font-weight: bold; text-decoration: underline; text-align: left;");el.set("text",errors.length>1?"Nice try, but there were a few problems:":"Nice try, but there was a problem:");domElement.appendChild(el);errors.each(function(error,index){el=$(document.createElement("div"));el.set("style","padding: 0px 4px 2px 2px; color: #4a5053; font-size: 12px; text-align: left;");el.set("text",error);domElement.appendChild(el)})};properties.actions=[];properties.actions.push({caption:"OK",click:function(){this.hide()}.bind(page.popup)})}}function Form(id){this.domForm=$(id);this.inputs=new Hash();this.additionalData=new Array();this.addInput=function(input){this.inputs.set(input.id,input)};this.addAdditionalData=function(name,value){var found=false;for(var i=0;i<this.additionalData.length;i++){if(this.additionalData[i].name==name){this.additionalData[i].value=value;found=true;break}}if(!found){this.additionalData.push({name:name,value:value})}};this.inputExists=function(id){var input=this.inputs.get(id);return input};this.validate=function(validators){var inputs=this.inputs.getValues();var errors=new Array();var error=null,input=null,validator=null;for(var i=0;i<inputs.length;i++){input=inputs[i];validator=input.validator==null?null:validators.get(input.validator.key);error=input.validate(validator);if(error!=null){errors.push(error)}}return errors.length==0?null:errors};this.submit=function(domForm){var input;var dosubmit;if(this.domForm!=null){domForm=this.domForm;dosubmit=false}else{dosubmit=true}this.inputs.each(function(inputObj,inputID){if(inputObj.getValue()!=null&&(dosubmit||inputObj.type=="checkbox")){input=$(document.createElement("input"));input.type="hidden";input.name=inputID;input.value=inputObj.getValue();input.setStyle("display","none");domForm.appendChild(input)}});this.additionalData.each(function(obj,i){input=$(document.createElement("input"));input.type="hidden";input.name=obj.name;input.value=obj.value;input.setStyle("display","none");domForm.appendChild(input)});if(dosubmit){domForm.submit()}};this.getAsAjaxParameters=function(){var params="";this.inputs.each(function(input,id){params+="&"+id+"="+encodeURIComponent(input.getValue())});this.additionalData.each(function(input,i){params+="&"+input.name+"="+encodeURIComponent(input.value)});return params.substring(1)}}FormedInput.prototype=new Input;function FormedInput(domElement,form){if(domElement==null){return}Input.call(this,domElement);this.form=form;this.required=getAttributeValue(domElement,"formed")=="required";this.validator=getAttributeValue(domElement,"validator");if(this.validator!=null){var arr=this.validator.split(":");this.validator={key:arr.shift(),args:arr.length==0?null:arr[0].split(",")}}if(this.emptyValue!=null&&this.type=="password"){this.dom.element.type="text"}var event,events=getAttributeValue(domElement,"events");if(events!=null){events=eval("({"+events+"})");for(var eventEl in events){var lefunc=function(event){eval(events[eventEl])};if(eventEl=="enter"){domElement.addEvent("keypress",function(event){if(event.key=="enter"){cancelPropagation(event);return false}});domElement.addEvent("keydown",function(event){if(event.key=="enter"){this.valueBeforeEnter=this.value}});domElement.addEvent("keyup",function(event){if(event.key=="enter"){if(this.valueBeforeEnter!=null&&this.valueBeforeEnter!=this.value){return}lefunc()}})}}}this.validate=function(validator){if(this.required&&this.getTrimmedValue()==null){return"The field "+this.title+" can not be empty"}if(this.validator==null){return null}if(this.validator.args==null){return validator(this)}else{return msg=validator(this,this.validator.args)}};this.tabindex=getAttributeValue(domElement,"tabindex")}FormedInput.prototype.focused=function(event){Input.prototype.focused.call(this,event);if(this.realValue==null&&this.type=="password"){this.dom.element.type="password"}};FormedInput.prototype.blured=function(event){Input.prototype.blured.call(this,event);if(this.realValue==null&&this.type=="password"){this.dom.element.type="text"}};SingleValueFromMultipleFormInputs.prototype=new FormedInput;function SingleValueFromMultipleFormInputs(domElement,form){if(domElement==null){return}FormedInput.call(this,domElement,form);domElement.realValue=getAttributeValue(domElement,"realValue");domElement.index=0;this.selectedItem=null;this.dom.elements=new Array();this.dom.elements.push(domElement);delete this.dom.element;this.initInput(domElement)}SingleValueFromMultipleFormInputs.prototype.addInput=function(domElement){domElement.realValue=getAttributeValue(domElement,"realValue");domElement.index=this.dom.elements.length-1;this.dom.elements.push(domElement);this.initInput(domElement)};SingleValueFromMultipleFormInputs.prototype.initInput=function(domElement){};SingleValueFromMultipleFormInputs.prototype.getValue=function(){return this.selectedItem==null?null:this.selectedItem.realValue};CheckboxFormInput.prototype=new SingleValueFromMultipleFormInputs;function CheckboxFormInput(domElement,form){if(domElement==null){return}SingleValueFromMultipleFormInputs.call(this,domElement,form);this.type="checkbox";this.click=function(event,el,stopPropagation){if(this.selectedItem==el){this.selectedItem=null;el.selected=false;el.box.setStyle("background-position","0px 0px");if(this.clickCallback!=null&&(stopPropagation==null||!stopPropagation)){this.clickCallback(this)}return}else{if(this.selectedItem!=null){this.selectedItem.box.setStyle("background-position","0px 0px")}}this.selectedItem=el;el.selected=true;el.box.setStyle("background-position","-15px 0px");if(this.clickCallback!=null&&(stopPropagation==null||!stopPropagation)){this.clickCallback(this)}};this.setClickCallback=function(callback){this.clickCallback=callback};str=getAttributeValue(domElement,"state");if(str!=null&&str=="selected"){domElement.handler.click(null,domElement)}}CheckboxFormInput.prototype.addInput=function(domElement){domElement.handler=this;SingleValueFromMultipleFormInputs.prototype.addInput.call(this,domElement);str=getAttributeValue(domElement,"state");if(str!=null&&str=="selected"){domElement.handler.click(null,domElement)}};CheckboxFormInput.prototype.initInput=function(domElement){SingleValueFromMultipleFormInputs.prototype.initInput.call(this,domElement);domElement.addEvent("keydown",function(event){if(event.key=="space"){this.handler.click(event,this)}return false});var str=getAttributeValue(domElement,"caption");domElement.box=$(document.createElement("div"));domElement.box.set("class","bgInputsPng box");domElement.caption=$(document.createElement("div"));domElement.caption.set("class","caption");domElement.caption.set("text",str);domElement.appendChild(domElement.box);domElement.appendChild(domElement.caption);domElement.addEvent("click",function(event){this.handler.click(event,this)})};ListInput.prototype=new FormedInput;function ListInput(domElement,form){if(domElement==null){return}FormedInput.call(this,domElement,form);this.type="list";if(this.dom.element.properties==null){this.dom.element.properties=getAttributeValueAsJSON(domElement,"properties")}if(this.dom.element.properties.omitArrow==null||!this.dom.element.properties.omitArrow){var arrow=$(document.createElement("div"));arrow.addClass("bgInputsPng");arrow.setStyles({width:9,height:7,"background-position":"-30px -2px",margin:"5px 0px 0px 2px"});this.dom.container=$(document.createElement("div"));this.dom.container.className="clearfix";this.dom.element.getParent().insertBefore(this.dom.container,this.dom.element);this.dom.container.appendChild(this.dom.element);this.dom.element.setStyles({"border-right":"0px","float":"left"});this.dom.dropDownArrow=$(document.createElement("div"));this.dom.dropDownArrow.setStyles({"border-top":"1px solid #b8d9ea","border-right":"1px solid #b8d9ea","border-bottom":"1px solid #b8d9ea","background-color":"#f6c431","float":"left",width:12,height:17});this.dom.dropDownArrow.input=this.dom.element;this.dom.dropDownArrow.addEvent("click",function(event){if(this.input.isFocused){this.input.blur()}else{this.input.focus()}});this.dom.dropDownArrow.addEvent("mouseenter",function(event){this.setStyle("background-color","#bdd8e5")});this.dom.dropDownArrow.addEvent("mouseleave",function(event){this.setStyle("background-color","#f6c431")});this.dom.element.arrow=this.dom.dropDownArrow;this.dom.element.addEvent("mouseenter",function(event){this.arrow.fireEvent("mouseleave")});this.dom.dropDownArrow.appendChild(arrow);this.dom.container.appendChild(this.dom.dropDownArrow);this.layout=function(){if(this.dom.element.getSize().x>18){this.dom.element.setStyle("width",this.dom.element.getSize().x-18)}};this.layout()}else{this.layout=function(){}}if(this.emptyValue==null){this.emptyValue=-1;this.dom.element.addEvent("focus",this.focused.bind(this));this.dom.element.addEvent("blur",this.blured.bind(this))}this.dom.element.addEvent("click",function(event){if(this.isFocused){this.focused(event)}});this.updated=false;this.isVisible=false;this.dom.element.getSubmitOnEnter=function(){return !this.isVisible}.bind(this);this.clickToOpen=false;this.dom.element.addEvent("keydown",function(event){var code=getPressedKeyCode(event);if(code==38){this.ignorePress=true;return this.handler.keyScroll("up")}else{if(code==40){this.ignorePress=true;return this.handler.keyScroll("down")}else{this.ignorePress=false}}});this.dom.element.addEvent("keypress",function(event){if(this.ignorePress){this.ignorePress=false;return}return this.handler.keyPressed(event)})}ListInput.prototype.show=function(event){var coords=getCoordinatesFor(this.dom.element);coords.top+=this.dom.element.getSize().y;page.listOptionsContainer.show(coords);page.listOptionsContainer.handler=this;this.updated=false;this.isVisible=true;this.clickToOpen=true};ListInput.prototype.hide=function(){page.listOptionsContainer.hide();this.isVisible=false;page.listOptionsContainer.handler=null};ListInput.prototype.focused=function(event){FormedInput.prototype.focused.call(this,event)};ListInput.prototype.blured=function(event,callTime){var now=new Date().getTime();if(callTime==null||now-callTime<200){try{cancelPropagation(event)}catch(err){}setTimeout(function(){this.blured(event,callTime==null?now:callTime)}.bind(this),50);return}if(page.listOptionsContainer.isFocused){return}this.isFocused=false;FormedInput.prototype.blured.call(this,event);if(page.listOptionsContainer.handler==this){this.hide()}};ListInput.prototype.arrowClick=function(event){};ListInput.prototype.keyScroll=function(direction){};ListInput.prototype.keyPressed=function(event){};SingleValueLocalListInput.prototype=new ListInput;function SingleValueLocalListInput(domElement,form){if(domElement==null){return}ListInput.call(this,domElement,form);this.selectedItem=null;this.isImageList=domElement.properties.type=="imaged"?true:false;domElement.properties=getStringAsJSON(domElement.properties);if(domElement.properties.list!=null){this.list=domElement.properties.list;delete domElement.properties.list;for(var i=0;i<this.list.length;i++){if(this.list[i].selected){this.realValue=this.list[i].id;this.setValue(this.list[i].title);if(this.isImageList){this.dom.element.setStyles({"padding-left":21,"background-image":"url("+this.list[i].image+")","background-repeat":"no-repeat","background-position":"0px 0px"})}break}}}else{this.list=new Array()}if(domElement.properties.editable!=null){this.editable=domElement.properties.editable;delete domElement.properties.editable}else{this.editable=false}delete domElement.properties.type;if(this.isImageList){this.imagePath=conf.staticVersionUrl+getAttributeValue(domElement,"path");this.imagePostFix=getAttributeValue(domElement,"postFix")}this.layout()}SingleValueLocalListInput.prototype.initList=function(){};SingleValueLocalListInput.prototype.itemClickEvent=function(item){this.dontHide=true;this.setValue(item.dom.get("text"));this.realValue=item.option.id;if(this.isImageList){this.dom.element.setStyles({"padding-left":21,"background-image":"url("+item.option.image+")","background-repeat":"no-repeat","background-position":"0px 0px"})}item.option.selected=true;if(this.selectedItem!=null){this.selectedItem.option.selected=false}this.selectedItem=item;page.listOptionsContainer.blured();if(this.changeCallback!=null){this.changeCallback(item.option.id)}};SingleValueLocalListInput.prototype.showList=function(event){var bindedClick=this.itemClickEvent.bind(this);var bindedMouseEnter=function(item){if(this.selectedItem!=null){this.selectedItem.dom.className=this.selectedItem.dom.defaultClass}if(this.focusedItem!=null){this.focusedItem.dom.className=this.focusedItem.dom.defaultClass}item.dom.defaultClass=item.dom.className;item.dom.className="listItemFocused";this.focusedItem=item}.bind(this);var bindedMouseLeave=function(item){if(this.selectedItem==item){return}item.dom.className=item.dom.defaultClass;this.focusedItem=null};page.listOptionsContainer.clear();for(var i=0;i<this.list.length;i++){var item={dom:$(document.createElement("span")),option:this.list[i],index:i};item.dom.handler=item;if(this.list[i].selected){item.dom.defaultClass="listItem"+((i%2)+1);item.dom.className="listItemFocused";this.selectedItem=item}else{item.dom.className="listItem"+((i%2)+1);item.dom.defaultClass=item.dom.className}if(this.isImageList){item.dom.setStyles({"padding-left":21,"background-image":"url("+item.option.image+")","background-repeat":"no-repeat","background-position":"0px 0px"})}item.dom.set("text",this.list[i].title);item.realValue=this.list[i].id;item.dom.addEvent("click",function(){bindedClick(this.handler)});item.dom.addEvent("mouseenter",function(){bindedMouseEnter(this.handler)});item.dom.addEvent("mouseleave",function(){bindedMouseLeave(this.handler)});item.focus=function(){bindedMouseEnter(this)};page.listOptionsContainer.addItem(item.dom)}ListInput.prototype.show.call(this,event)};SingleValueLocalListInput.prototype.hide=function(){if(this.focusedItem!=null){this.focusedItem.className=this.focusedItem==this.selectedItem?"listItemSelected":this.focusedItem.defaultClass;this.focusedItem=null}ListInput.prototype.hide.call(this)};SingleValueLocalListInput.prototype.focused=function(event){ListInput.prototype.focused.call(this,event);this.showList(event)};SingleValueLocalListInput.prototype.keyPressed=function(event){if(this.editable==null||!this.editable){return false}if(event.key=="enter"&&this.isVisible){this.itemClickEvent(this.focusedItem);this.hide()}else{var text=this.dom.element.value;if(event.key.length==1){text+=event.key}else{if(event.key=="backspace"){text=text.substring(0,text.length-2)}}var item=page.listOptionsContainer.getItemFor(text);if(item==null){return false}item=item.handler;item.focus();page.listOptionsContainer.scrollTo(item)}};SingleValueLocalListInput.prototype.keyScroll=function(direction){if(!this.isVisible){this.showList();return}var index;if(this.focusedItem==null){if(direction=="up"){index=this.list.length-1}else{index=0}}else{if(direction=="up"){index=this.focusedItem.index-1}else{index=this.focusedItem.index+1}if(index>=this.list.length){index=0}else{if(index<0){index=this.list.length-1}}}if(this.focusedItem!=null){this.focusedItem.dom.className=this.focusedItem.dom.defaultClass}this.focusedItem=page.listOptionsContainer.getItemAt(index);this.focusedItem.dom.className="listItemFocused";page.listOptionsContainer.scrollTo(this.focusedItem)};SingleValueLocalListInput.prototype.getValue=function(){if(this.realValue!=null){return this.realValue+""}if(this.dom.element.value.trim().length>0){return this.dom.element.value.trim()}return null};MultipleValueLocalListInput.prototype=new ListInput;function MultipleValueLocalListInput(domElement,form){if(domElement==null){return}ListInput.call(this,domElement,form);this.options=getStringAsJSON(this.dom.element.properties).options;this.events=getAttributeValueAsJSON(domElement,"events");this.itemClicked=false;this.updateValue=function(){var val="";for(var i=0;i<this.options.length;i++){if(!this.options[i].checked){val="Custom"}}if(val==""){val="All"}this.dom.element.value=val};this.updateValue();this.getSelected=function(){var values="";for(var i=0;i<this.options.length;i++){if(this.options[i].checked){values+=","+this.options[i].id}}if(values==""){return null}return values.substring(1)}}MultipleValueLocalListInput.prototype.showList=function(event){var bindedItemClick=function(event,item){this.itemClicked=true;item.option.checked=!item.option.checked;item.dom.getFirst().setStyle("background-position",item.option.checked?"-17px -1px":"-2px -1px")}.bind(this);page.listOptionsContainer.clear();for(var i=0;i<this.options.length;i++){var item={dom:$(document.createElement("div")),option:this.options[i],index:i};var checkbox=$(document.createElement("div"));checkbox.addClass("bgInputsPng");checkbox.setStyles({"float":"left",width:10,height:9,"margin-top":2,"background-repeat":"no-repeat","background-position":item.option.checked?"-17px -1px":"-2px -1px"});var caption=$(document.createElement("div"));caption.set("text",item.option.title);caption.setStyles({"float":"left","margin-left":5});item.dom.handler=item;item.dom.className="clearfix listItem"+((i%2)+1);item.dom.appendChild(checkbox);item.dom.appendChild(caption);item.dom.addEvent("click",function(event){bindedItemClick(event,this.handler)});item.realValue=item.option.id;page.listOptionsContainer.addItem(item.dom)}var action=$(document.createElement("div"));action.setStyles({overflow:"hidden","margin-top":5,cursor:"pointer"});action.icon=$(document.createElement("div"));action.icon.setStyles({"float":"left",width:17,height:17,background:"url("+conf.staticVersionUrl+"/images/trails.png) no-repeat -501px -76px"});action.caption=$(document.createElement("div"));action.caption.setStyles({"float":"left",color:"#4a5053","text-decoration":"underline","text-align":"left","margin-top":1,"font-size":12});action.caption.set("text",getStringAsJSON(this.dom.element.properties).caption);action.appendChild(action.icon);action.appendChild(action.caption);action.addEvent("mouseenter",function(event){this.caption.setStyle("text-decoration","none")});action.addEvent("mouseleave",function(event){this.caption.setStyle("text-decoration","underline")});action.addEvent("click",function(event){eval(this.events.change)}.bind(this));page.listOptionsContainer.addItem(action);ListInput.prototype.show.call(this,event)};MultipleValueLocalListInput.prototype.hide=function(){ListInput.prototype.hide.call(this);this.updateValue()};MultipleValueLocalListInput.prototype.focused=function(event){ListInput.prototype.focused.call(this,event);this.showList(event)};MultipleValueLocalListInput.prototype.blured=function(event,callTime){var now=new Date().getTime();if(callTime==null||now-callTime<200||!this.itemClicked){ListInput.prototype.blured.call(this,event,callTime)}else{this.itemClicked=false;this.dom.element.focus()}};MultipleValueLocalListInput.prototype.keyPressed=function(event){return false};SeriesListInput.prototype=new SingleValueLocalListInput;function SeriesListInput(domElement,form){if(domElement==null){return}SingleValueLocalListInput.call(this,domElement,form);this.series=domElement.properties.series;this.selectedID=domElement.properties.selected;if(this.selectedID!=null){this.setValue(this.selectedID);this.realValue=this.selectedID;domElement.value=this.selectedID}delete domElement.properties.series}SeriesListInput.prototype.initList=function(){var data=new Object();if(this.series.lastIndexOf(":")>0){data.difference=this.series.substring(this.series.lastIndexOf(":")+1).toInt();this.series=this.series.replace(":"+data.difference,"")}else{data.difference=1}this.series=this.series.split("-");data.start=this.series[0].toInt();data.end=this.series[1].toInt();for(var i=data.start;i<data.end+1;i+=data.difference){var option={id:i,title:i,image:null,selected:this.selectedID!=null&&this.selectedID==i};if(option.selected){this.selectedItem=option}this.list.push(option)}};function createValidators(){var validators=new Hash();validators.set("alpha",function(el,params){return null});validators.set("username",function(el,params){var reg=/^([^0-9!@#$%\^&\*\(\)\+]+$)/;if(el.getValue()!=null&&!reg.test(el.getValue())){return el.title+" can contain letters and ' - . only"}return null});validators.set("number",function(el,params){if(el.getValue()!=null&&!el.getValue().toInt()){return el.title+" must be a number"}return null});validators.set("numberGreaterThan",function(el,params){if(el.getValue()!=null&&!el.getValue().toInt()){return el.title+" must be a number"}if(el.getValue().toInt()<=params[0].toInt()){return el.title+" must be greater than "+params[0]}return null});validators.set("numberSmallerThan",function(el,params){if(el.getValue()!=null&&!el.getValue().toInt()){return el.title+" must be a number"}if(el.getValue().toInt()>=params[0].toInt()){return el.title+" must be smaller than "+params[0]}return null});validators.set("numberBetween",function(el,params){if(el.getValue()!=null&&!el.getValue().toInt()){return el.title+" must be a number"}if(el.getValue().toInt()<params[0].toInt()||el.getValue().toInt()>params[1].toInt()){return el.title+" must be between "+params[0]+" and "+params[1]}return null});validators.set("lengthMin",function(el,params){if(el.getValue()!=null&&el.getValue().length<params[0]){return el.title+" must be at least "+params[0]+" chars long"}return null});validators.set("lengthMax",function(el,params){if(el.getValue()!=null&&el.getValue().length>params[0]){return el.title+" must be less than "+params[0]+" chars long"}return null});validators.set("lengthBetween",function(el,params){if(el.getValue()!=null&&(el.getValue().length<params[0]||el.getValue().length>params[1])){return el.title+" must be at least "+params[0]+" and less than "+params[1]+" chars long"}return null});validators.set("lengthExact",function(el,params){if(el.getValue()!=null&&el.getValue().length!=params[0]){return el.title+" must be exactly "+params[0]+" chars long"}return null});validators.set("email",function(el,params){var reg=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;if(el.getValue()!=null&&!reg.test(el.getValue())){return el.title+" is not a valid e-mail address"}return null});return validators};
function createControlBox(domElement){var properties=eval("({"+getAttributeValue(domElement,"properties")+"})");var box=null;switch(properties.type){case"friends":box=new FriendsBox(domElement,properties);break;default:box=new GenericControlBox(domElement,properties)}return box}function GenericControlBox(domElement,properties){if(domElement==null){return}this.id=domElement.id;this.properties=properties;if(this.properties.state==null){this.properties.state="expended"}this.dom={element:domElement,header:$(document.createElement("div")),content:$(document.createElement("div"))};this.createHeader();this.dom.element.appendChild(this.dom.content)}GenericControlBox.prototype.createHeader=function(){this.dom.header.set("class","header bgcMainPng");this.dom.header.setStyle("height",31);this.dom.header.caption=$(document.createElement("div"));this.dom.header.caption.set("style","padding: 6px 0px 0px 10px;");this.dom.header.caption.set("text",this.properties.caption);this.dom.header.appendChild(this.dom.header.caption);this.dom.element.insertBefore(this.dom.header,this.dom.element.getFirst());if(this.properties.toggling==null||this.properties.toggling){this.dom.header.setStyle("cursor","pointer");this.dom.header.addEvent("click",this.toggle.bind(this));this.dom.header.toggler=$(document.createElement("div"));this.dom.header.toggler.addClass("bgcMainPng");this.dom.header.toggler.set("style","position: absolute; top: 13px; right: 10px; width: 9px; height: 8px; background-position: "+(this.properties.state=="expended"?"-824px -48px;":"-842px -48px"));this.dom.header.appendChild(this.dom.header.toggler);this.dom.header.addEvent("mouseenter",function(event){var pos=this.properties.state=="expended"?"-833px -48px":"-851px -48px";this.dom.header.toggler.setStyle("background-position",pos)}.bind(this));this.dom.header.addEvent("mouseleave",function(event){var pos=this.properties.state=="expended"?"-824px -48px":"-842px -48px";this.dom.header.toggler.setStyle("background-position",pos)}.bind(this))}};GenericControlBox.prototype.toggle=function(){this.dom.content.set("tween",{onComplete:this.togglingEnd.bind(this)});if(this.properties.state=="expended"){this.properties.state="collapsed";this.properties.expendedHeight=this.dom.content.getSize().y;this.dom.content.setStyle("width",this.dom.content.getSize().x);this.dom.content.setStyle("overflow","hidden");this.dom.content.tween("height",this.dom.content.getSize().y,0)}else{this.properties.state="expended";this.dom.content.tween("height",0,this.dom.content.getScrollSize().y)}};GenericControlBox.prototype.togglingEnd=function(){if(this.properties.state=="collapsed"){this.dom.header.toggler.setStyle("background-position","-842px -48px")}else{this.dom.header.toggler.setStyle("background-position","-824px -48px");this.dom.content.setStyle("overflow","visible");this.dom.content.setStyle("height",null);this.properties.expendedHeight=null}};TogglingHeaderControlBox.prototype=new GenericControlBox;function TogglingHeaderControlBox(domElement,properties){GenericControlBox.call(this,domElement,properties)}TogglingHeaderControlBox.prototype.createHeader=function(){GenericControlBox.prototype.createHeader.call(this);this.dom.headerExtension={state:"collapsed",container:$(document.createElement("div")),shadow:$(document.createElement("div")),content:$(document.createElement("div")),toggler:$(document.createElement("div"))};if(this.properties.state=="collapsed"){this.dom.headerExtension.container.setStyles({overflow:"hidden",height:0})}if(this.dom.header.getNext()==null){this.dom.element.appendChild(this.dom.headerExtension.container)}else{this.dom.element.insertBefore(this.dom.headerExtension.container,this.dom.header.getNext())}this.dom.headerExtension.container.appendChild(this.dom.headerExtension.shadow);this.dom.headerExtension.container.appendChild(this.dom.headerExtension.content);this.dom.headerExtension.container.appendChild(this.dom.headerExtension.toggler);this.dom.headerExtension.shadow.setStyles({height:4});this.dom.headerExtension.content.setStyles({height:0,margin:"0px 4px 0px 3px"});this.dom.headerExtension.toggler.setStyles({height:5})};TogglingHeaderControlBox.prototype.toggleHeader=function(){};FriendsBox.prototype=new TogglingHeaderControlBox;function FriendsBox(domElement,properties){this.user=properties.user?page.profileUser:null;delete properties.user;if(this.user==null){properties.caption="Your Friends"}else{properties.caption=this.user.gender=="m"?"His Friends":"Her Friends"}TogglingHeaderControlBox.call(this,domElement,properties);this.currentPage=null;this.pageCount=null;this.userCount=null;domElement.addClass("clearfix");this.dom.header.icon=$(document.createElement("div"));if(this.user==null){this.dom.header.icon.addClass("bgcIconsPng");this.dom.header.icon.set("style","position: absolute; top: 8px; left: 6px; width: 15px; height: 14px; background-position: 0px 0px;")}else{this.dom.header.icon.addClass("bgcIconsPng");this.dom.header.icon.set("style","position: absolute; top: 8px; left: 6px; width: 15px; height: 14px; background-position: -34px -17px;")}this.dom.header.insertBefore(this.dom.header.icon,this.dom.header.getFirst());this.dom.header.caption.setStyle("padding-left",28);var styles={"text-align":"right"};if(this.properties.state=="collapsed"){styles.overflow="hidden";styles.height=0}this.dom.content.className="clearfix";this.dom.content.setStyles(styles);var url="/friends.ajax";if(this.user!=null){url+="?userid="+this.user.userid}page.connectionManager.makeRequest(url,null,function(request){this.handleFriendsList(request.getResponseAsJSON())}.bind(this));this.handleFriendsList=function(friendsData){if(this.userCount==null){this.userCount=friendsData.count}if(this.pageCount==null){this.pageCount=friendsData.pageCount}this.currentPage=friendsData.currentPage;var cells=this.dom.headerExtension.navigator.tbl.rows[0].cells;var currentPage=(friendsData.currentPage+1)+"";var pageCount=friendsData.pageCount+"";while(currentPage.length<pageCount.length){currentPage="0"+currentPage}cells[2].set("text",currentPage);cells[4].set("text",pageCount);cells[6].set("text",friendsData.count);this.dom.content.empty();var users=friendsData.users;for(var i=0;i<users.length;i++){if(users[i].isSelf){continue}var userBlock=$(document.createElement("div"));this.dom.content.appendChild(userBlock);new FriendBlock(userBlock,users[i])}};this.moveToPage=function(direction){var url="/friends.ajax?";if(direction=="next"){url+="page="+(this.currentPage+1)}else{url+="page="+(this.currentPage-1)}if(this.user!=null){url+="&userid="+this.user.userid}page.connectionManager.makeRequest(url,null,function(request){this.handleFriendsList(request.getResponseAsJSON())}.bind(this))}}FriendsBox.prototype.createHeader=function(){TogglingHeaderControlBox.prototype.createHeader.call(this);this.dom.headerExtension.navigator=$(document.createElement("div"));this.dom.headerExtension.navigator.set("style","margin: 3px 4px 0px 3px; padding-bottom: 1px; text-align: center;");this.dom.headerExtension.container.insertBefore(this.dom.headerExtension.navigator,this.dom.headerExtension.content);this.dom.headerExtension.navigator.tbl=$(document.createElement("table"));this.dom.headerExtension.navigator.tbl.align="center";this.dom.headerExtension.navigator.tbl.cellPadding="0";this.dom.headerExtension.navigator.tbl.cellSpacing="0";this.dom.headerExtension.navigator.appendChild(this.dom.headerExtension.navigator.tbl);var row=this.dom.headerExtension.navigator.tbl.insertRow(-1);var cells=[$(row.insertCell(-1)),$(row.insertCell(-1)),$(row.insertCell(-1)),$(row.insertCell(-1)),$(row.insertCell(-1)),$(row.insertCell(-1)),$(row.insertCell(-1)),$(row.insertCell(-1)),$(row.insertCell(-1))];this.pagePrevious=$(document.createElement("div"));this.pagePrevious.addClass("bgcMainPng");this.pagePrevious.set("style","width: 7px; height: 10px; background-position: -807px -46px;");cells[0].appendChild(this.pagePrevious);this.pagePrevious.addEvent("mouseenter",function(event){if(this.currentPage==0){return}this.pagePrevious.setStyles({"background-position":"-798px -46px",cursor:"pointer"})}.bind(this));this.pagePrevious.addEvent("mouseleave",function(event){if(this.currentPage==0){return}this.pagePrevious.setStyles({"background-position":"-807px -46px",cursor:"default"})}.bind(this));this.pagePrevious.addEvent("click",function(event){if(this.currentPage>0){this.moveToPage("previous")}this.pagePrevious.setStyles({"background-position":"-807px -46px",cursor:"default"})}.bind(this));cells[0].set("style","padding-right: 3px;");cells[1].set("style","padding: 1px 3px 0px 3px; font-size: 10px; color: #959fa4;");cells[1].set("text","Page");cells[2].set("style","padding-top: 1px; font-size: 10px;  color: #f6c431;");cells[3].set("style","padding: 1px 3px 0px 3px; font-size: 10px; color: #959fa4;");cells[3].set("text","of");cells[4].set("style","padding-top: 1px; font-size: 10px;  color: #f6c431;");cells[5].set("style","padding: 1px 3px 0px 3px; font-size: 10px; color: #959fa4;");cells[5].set("text","|");cells[6].set("style","padding-top: 1px; font-size: 10px;  color: #f6c431;");cells[7].set("style","padding: 1px 3px 0px 3px; font-size: 10px; color: #959fa4;");cells[7].set("text","Friends");this.pageNext=$(document.createElement("div"));this.pageNext.addClass("bgcMainPng");this.pageNext.set("style","width: 7px; height: 10px; background-position: -807px -56px;");cells[8].appendChild(this.pageNext);this.pageNext.addEvent("mouseenter",function(event){if(this.currentPage==this.pageCount-1){return}this.pageNext.setStyles({"background-position":"-798px -56px",cursor:"pointer"})}.bind(this));this.pageNext.addEvent("mouseleave",function(event){if(this.currentPage<this.pageCount-1){this.pageNext.setStyles({"background-position":"-807px -56px",cursor:"default"})}}.bind(this));this.pageNext.addEvent("click",function(event){if(this.currentPage<this.pageCount-1){this.moveToPage("next")}this.pageNext.setStyles({"background-position":"-807px -56px",cursor:"default"})}.bind(this));cells[8].set("style","padding-left: 3px;");var tbl=$(document.createElement("table"));this.dom.headerExtension.content.appendChild(tbl);tbl.cellPadding="0";tbl.cellSpacing="0";tbl.set("style","display: none; width: 100%; margin: 2px 5px;");var row=tbl.insertRow(-1);var cells=[$(row.insertCell(-1)),$(row.insertCell(-1))];cells[0].setStyles({"font-size":11,color:"white","text-align":"left"});cells[0].set("text","Sort:");cells[1].set("html","&nbsp;");row=tbl.insertRow(-1);cells=[$(row.insertCell(-1)),$(row.insertCell(-1))];cells[0].setStyles({"font-size":11,color:"white","text-align":"left"});cells[0].set("text","Order:");cells[1].set("html","&nbsp;")};FriendsBox.prototype.toggleHeader=function(){if(this.dom.headerExtension.state=="collapsed"){this.dom.headerExtension.state="expended";var tbl=this.dom.headerExtension.content.getFirst("table");this.dom.headerExtension.content.setStyle("overflow","hidden");tbl.setStyle("display",IS_IE?"block":"table");this.dom.headerExtension.content.set("tween",{onComplete:function(){this.dom.headerExtension.content.setStyle("overflow","visible")}.bind(this)});this.dom.headerExtension.content.tween("height",0,tbl.getSize().y)}else{this.dom.headerExtension.state="collapsed";this.dom.headerExtension.content.setStyle("overflow","hidden");this.dom.headerExtension.content.set("tween",{onComplete:function(){this.dom.headerExtension.content.getFirst("table").setStyle("display","none");this.dom.headerExtension.content.setStyle("overflow","visible")}.bind(this)});this.dom.headerExtension.content.tween("height",this.dom.headerExtension.content.getSize().y-3,0)}};FriendsBox.prototype.togglingEnd=function(){this.dom.headerExtension.container.set("tween",{onComplete:function(){TogglingHeaderControlBox.prototype.togglingEnd.call(this)}.bind(this)});if(this.properties.state=="collapsed"){this.dom.headerExtension.container.setStyle("overflow","hidden");this.dom.headerExtension.container.tween("height",this.dom.headerExtension.container.getSize().y,0)}else{var height=this.dom.headerExtension.container.getScrollSize().y;if(IS_IE&&(conf.browserInfo==null||conf.browserInfo.version=="7"||conf.browserInfo.state=="7.0")){height-=12}this.dom.headerExtension.container.tween("height",0,height)}};function FriendBlock(domElement,user){var properties={className:"cb4bdc1-ffffff-6x6",borderColor:"#b4bdc1",borderWidth:1,backgroundColor:"#ffffff",cornerWidth:6,cornerHeight:6,respect:"height",rows:2};domElement.handler=this;this.isVisible=true;domElement.className="clearfix";domElement.set("style","clear: left; width: 197px; margin: 5px auto;");domElement.properties=properties;replaceContainerRespectHeight(domElement);domElement.content.header=$(document.createElement("div"));domElement.content.header.set("style","clear: left;");domElement.content.actions=$(document.createElement("div"));domElement.content.actions.set("style","display: none; clear: left;");domElement.content.appendChild(domElement.content.header);domElement.content.appendChild(domElement.content.actions);domElement.bindRow(0,domElement.content.header);domElement.bindRow(1,domElement.content.actions);domElement.content.header.icon=$(document.createElement("div"));domElement.content.header.icon.image=$(document.createElement("img"));domElement.content.header.icon.image.set("style","display: inline;");domElement.content.header.icon.set("style","float: left; width: 24px; height: 24px; margin: 2px 0px 2px 0px; border: 1px solid #e0e0e0; cursor: pointer;");domElement.content.header.icon.addEvent("click",function(event){if(this.handler.isVisible){cancelPropagation(event);document.location.href="/profile/"+user.nickname+"/"+user.userid}}.bind(domElement));domElement.content.header.appendChild(domElement.content.header.icon);domElement.content.header.icon.appendChild(domElement.content.header.icon.image);domElement.content.header.status=$(document.createElement("div"));domElement.content.header.status.addClass("bgcIconsPng");domElement.content.header.status.set("style","float: left; width: 12px; height: 12px; margin: 8px 2px 0px 5px;");switch(user.status){case"online":domElement.content.header.status.setStyle("background-position","-24px -64px");domElement.content.header.status.title="Online";break;case"busy":domElement.content.header.status.setStyle("background-position","-12px -64px");domElement.content.header.status.title="Busy";break;case"offline":domElement.content.header.status.setStyle("background-position","0px -64px");domElement.content.header.status.title="Offline";break}domElement.content.header.appendChild(domElement.content.header.status);domElement.content.header.uname=$(document.createElement("div"));domElement.content.header.uname.set("style","float: left; width: 114px; padding: 7px 0px 0px 4px; font-size: 11px; color: #4a5053; text-align: left; cursor: pointer;");domElement.content.header.uname.set("text",user.nickname);makeTicker(domElement.content.header.uname);domElement.content.header.uname.addEvent("mouseenter",function(event){this.content.header.uname.ticker.start();if(!this.handler.isVisible){return}this.content.header.uname.setStyle("text-decoration","underline")}.bind(domElement));domElement.content.header.uname.addEvent("mouseleave",function(event){this.content.header.uname.ticker.stop();if(!this.handler.isVisible){return}this.content.header.uname.setStyle("text-decoration","none")}.bind(domElement));domElement.content.header.uname.addEvent("click",function(event){if(this.handler.isVisible){cancelPropagation(event);document.location.href="/profile/"+user.nickname+"/"+user.userid}}.bind(domElement));domElement.content.header.appendChild(domElement.content.header.uname);domElement.content.header.toggler=$(document.createElement("div"));domElement.content.header.toggler.set("style","float: right; height: 100%; padding-left: 5px; border-left: 1px solid "+properties.borderColor+";");domElement.content.header.toggler.image=$(document.createElement("div"));domElement.content.header.toggler.image.addClass("bgcMainPng");domElement.content.header.toggler.image.set("style","width: 7px; height: 10px; margin: 10px 2px 0px 0px; background-position: -807px -46px;");domElement.content.header.toggler.appendChild(domElement.content.header.toggler.image);domElement.content.header.appendChild(domElement.content.header.toggler);domElement.content.header.setStyle("height",domElement.content.header.icon.getSize().y);domElement.content.header.toggler.setStyle("height",domElement.content.getSize().y);domElement.content.actions.inviteAction=$(document.createElement("div"));domElement.content.actions.inviteAction.set("style","clear: left; padding: 5px 0px 3px 0px; cursor: pointer;");domElement.content.actions.appendChild(domElement.content.actions.inviteAction);domElement.content.actions.inviteAction.addEvent("mouseenter",function(event){this.caption.setStyle("text-decoration","underline")});domElement.content.actions.inviteAction.addEvent("mouseleave",function(event){this.caption.setStyle("text-decoration","none")});domElement.content.actions.inviteAction.addEvent("click",function(event){page.startSession(user)});domElement.content.actions.inviteAction.icon=$(document.createElement("div"));domElement.content.actions.inviteAction.icon.addClass("bgcIconsPng");domElement.content.actions.inviteAction.icon.set("style","float: left; width: 18px; height: 12px; background-position: -32px 0px;");domElement.content.actions.inviteAction.appendChild(domElement.content.actions.inviteAction.icon);domElement.content.actions.inviteAction.caption=$(document.createElement("div"));domElement.content.actions.inviteAction.caption.set("style","float: left; color: #4a5053; padding-left: 5px; font-size: 10px; color: #352c2b;");domElement.content.actions.inviteAction.caption.set("text","One on One");domElement.content.actions.inviteAction.appendChild(domElement.content.actions.inviteAction.caption);domElement.content.actions.messageAction=$(document.createElement("div"));domElement.content.actions.messageAction.set("style","clear: left; padding: 3px 0px 5px 0px; cursor: pointer;");domElement.content.actions.appendChild(domElement.content.actions.messageAction);domElement.content.actions.messageAction.addEvent("mouseenter",function(event){this.caption.setStyle("text-decoration","underline")});domElement.content.actions.messageAction.addEvent("mouseleave",function(event){this.caption.setStyle("text-decoration","none")});domElement.content.actions.messageAction.addEvent("click",function(event){page.composeMessage(user)});domElement.content.actions.messageAction.icon=$(document.createElement("div"));domElement.content.actions.messageAction.icon.addClass("bgcIconsPng");domElement.content.actions.messageAction.icon.set("style","float: left; width: 18px; height: 12px; background-position: -1px -16px;");domElement.content.actions.messageAction.appendChild(domElement.content.actions.messageAction.icon);domElement.content.actions.messageAction.caption=$(document.createElement("div"));domElement.content.actions.messageAction.caption.set("style","float: left; color: #4a5053; padding-left: 5px; font-size: 10px; color: #352c2b;");domElement.content.actions.messageAction.caption.set("text","Send a Message");domElement.content.actions.messageAction.appendChild(domElement.content.actions.messageAction.caption);if(!user.isFriend){domElement.content.actions.freindRequestAction=$(document.createElement("div"));domElement.content.actions.freindRequestAction.set("style","clear: left; padding: 3px 0px 5px 0px; cursor: pointer; height: 12px;");domElement.content.actions.appendChild(domElement.content.actions.freindRequestAction);domElement.content.actions.freindRequestAction.addEvent("mouseenter",function(event){this.caption.setStyle("text-decoration","underline")});domElement.content.actions.freindRequestAction.addEvent("mouseleave",function(event){this.caption.setStyle("text-decoration","none")});domElement.content.actions.freindRequestAction.addEvent("click",function(event){page.promptForFriendRequest(user)});domElement.content.actions.freindRequestAction.icon=$(document.createElement("div"));domElement.content.actions.freindRequestAction.icon.addClass("bgcIconsPng");domElement.content.actions.freindRequestAction.icon.set("style","float: left; width: 15px; height: 14px; background-position: 0px 0px;");domElement.content.actions.freindRequestAction.appendChild(domElement.content.actions.freindRequestAction.icon);domElement.content.actions.freindRequestAction.caption=$(document.createElement("div"));domElement.content.actions.freindRequestAction.caption.set("style","float: left; color: #4a5053; padding-left: 5px; font-size: 10px; color: #352c2b;");domElement.content.actions.freindRequestAction.caption.set("text","Add to Friends");domElement.content.actions.freindRequestAction.appendChild(domElement.content.actions.freindRequestAction.caption)}domElement.layout(true);domElement.addEvent("mouseenter",function(event){if(this.handler.isVisible){return}this.content.header.toggler.setStyle("background-color","#b8d9ea");var children=this.right.getChildren();children[0].set("class",containers.getClass("cb4bdc1-b8d9ea-6x6"));children[0].setStyle("background-position",containers.getPosition("cb4bdc1-b8d9ea-6x6",2));children[1].setStyle("background-color","#b8d9ea");children[3].set("class",containers.getClass("cb4bdc1-b8d9ea-6x6"));children[3].setStyle("background-position",containers.getPosition("cb4bdc1-b8d9ea-6x6",3))});domElement.addEvent("mouseleave",function(event){if(this.handler.isVisible){return}this.content.header.toggler.setStyle("background-color","#ffffff");var children=this.right.getChildren();children[0].set("class",containers.getClass("cb4bdc1-ffffff-6x6"));children[0].setStyle("background-position",containers.getPosition("cb4bdc1-ffffff-6x6",2));children[1].setStyle("background-color","#ffffff");children[3].set("class",containers.getClass("cb4bdc1-ffffff-6x6"));children[3].setStyle("background-position",containers.getPosition("cb4bdc1-ffffff-6x6",3))});domElement.addEvent("click",function(event){this.fireEvent("mouseleave");var height=0;if(this.handler.isVisible){coords=getCoordinatesFor(this.content.header);if(event!=null&&(event.page.x<coords.left||event.page.x>coords.right||event.page.y<coords.top||event.page.y>coords.bottom)){return}$(this.left.childNodes[0]).set("class",containers.getClass("cb4bdc1-ffffff-6x6"));$(this.left.childNodes[0]).setStyle("background-position",containers.getPosition("cb4bdc1-ffffff-6x6",1));$(this.left.childNodes[1]).setStyle("background-color","#ffffff");this.content.header.setStyle("background-color","#ffffff");this.content.header.toggler.setStyle("background-color","#ffffff");this.content.header.toggler.image.setStyles({width:7,"margin-right":2,"background-position":"-807px -46px"});$(this.right.childNodes[0]).set("class",containers.getClass("cb4bdc1-ffffff-6x6"));$(this.right.childNodes[0]).setStyle("background-position",containers.getPosition("cb4bdc1-ffffff-6x6",2));$(this.right.childNodes[1]).setStyle("background-color","#ffffff");this.content.actions.setStyle("display","none")}else{$(this.left.childNodes[0]).set("class",containers.getClass("c959fa4-6x6"));$(this.left.childNodes[0]).setStyle("background-position",containers.getPosition("c959fa4-6x6",1));$(this.left.childNodes[1]).setStyle("background-color","#959fa4");this.content.header.setStyle("background-color","#959fa4");this.content.header.toggler.setStyle("background-color","#959fa4");this.content.header.toggler.image.setStyles({width:9,"margin-right":0,"background-position":"-785px -46px"});$(this.right.childNodes[0]).set("class",containers.getClass("c959fa4-6x6"));$(this.right.childNodes[0]).setStyle("background-position",containers.getPosition("c959fa4-6x6",2));$(this.right.childNodes[1]).setStyle("background-color","#959fa4");this.content.actions.setStyle("display","block");this.content.actions.inviteAction.setStyle("height",this.content.actions.inviteAction.icon.getSize().y);this.content.actions.messageAction.setStyle("height",this.content.actions.messageAction.icon.getSize().y)}this.content.setStyle("height",this.content.header.getSize().y+this.content.actions.getSize().y);this.layout();var el=$(this.left.childNodes[1]);el.setStyle("height",el.getSize().y+(this.handler.isVisible?2:1));el=$(this.left.childNodes[2]);el.setStyle("height",this.handler.isVisible?0:el.getSize().y+1);el=$(this.right.childNodes[1]);el.setStyle("height",el.getSize().y+(this.handler.isVisible?2:1));el=$(this.right.childNodes[2]);el.setStyle("height",this.handler.isVisible?0:el.getSize().y+1);this.handler.isVisible=!this.handler.isVisible});domElement.content.header.icon.image.onerror=function(){this.src=conf.staticVersionUrl+"/images/global/cantLoad/small.png"};domElement.content.header.icon.image.src=user.imgurl;var func=function(){this.content.header.icon.setStyle("border","0px");var height=this.content.header.icon.getSize().y+this.content.header.icon.getStyle("margin-top").toInt()+this.content.header.icon.getStyle("margin-bottom").toInt();this.content.setStyle("height",height);this.content.header.setStyle("height",height);this.content.header.toggler.setStyle("height",height);this.isVisible=true;this.fireEvent("click")}.bind(domElement);func()};
function Popup(){this.popped=false;this.queue=new Array();this.extraData=null;this.dom={pageMask:$(document.createElement("div")),container:$(document.createElement("div")),header:$(document.createElement("div")),content:$(document.createElement("div")),actions:$(document.createElement("div"))};this.dom.pageMask.id="pageMask";this.dom.container.id="popup";document.body.appendChild(this.dom.pageMask);document.body.appendChild(this.dom.container);this.init=function(){var properties={className:"crgb-6x6",borderColor:null,backgroundColor:"rgba(91, 100, 104, 0.37)",cornerWidth:6,cornerHeight:6,respect:"width"};wrapWithContainer(this.dom.container,properties);this.dom.container.content.setStyle("padding","0px 8px");this.dom.container.content.empty();this.createHeader();this.createContent();this.createActions()};this.createHeader=function(){var properties={className:"c5b6468-6x6",borderColor:"#5b6468",backgroundColor:"#5b6468",backgroundAlpha:1,cornerWidth:6,cornerHeight:6,respect:"width",exclude:"footer"};wrapWithContainer(this.dom.header,properties,"");this.dom.header.setStyle("overflow","hidden");this.dom.header.content.empty();this.dom.header.content.set("class","header");this.dom.header.caption=$(document.createElement("div"));this.dom.header.caption.set("class","caption");this.dom.header.content.appendChild(this.dom.header.caption);this.dom.header.icon=$(document.createElement("div"));this.dom.header.icon.set("class","icon");this.dom.header.content.appendChild(this.dom.header.icon);this.dom.header.closer=$(document.createElement("div"));this.dom.header.closer.set("class","closer");this.dom.header.closer.innerHTML='<a href="#">X</a>';this.dom.header.closer.getFirst("a").addEvent("click",function(event){this.hide();return false}.bind(this));this.dom.header.content.appendChild(this.dom.header.closer);this.dom.container.content.appendChild(this.dom.header)};this.createContent=function(){this.dom.content.set("class","content");this.dom.container.content.appendChild(this.dom.content);this.dom.content.icon=$(document.createElement("div"));this.dom.content.icon.set("class","icon");this.dom.content.appendChild(this.dom.content.icon);this.dom.content.clear=function(){this.dom.content.empty();this.dom.content.appendChild(this.dom.content.icon);if(this.dom.content.showingUserAlert){this.dom.content.getParent().removeChild(this.dom.content.getNext())}this.dom.content.showingUserAlert=false}.bind(this);this.dom.content.layout=function(){var height=0;var children=this.getChildren();for(var i=1;i<children.length;i++){height+=children[i].getSize().y}this.setStyle("height",height)};this.dom.content.alertUser=function(text){var alert;if(!this.showingUserAlert){alert=$(document.createElement("div"));alert.set("style","position:relative;z-index:10;padding: 0px 0px 6px 0px; font-size: 12px; font-weight: bold; color: #c95745;");alert.setStyles(this.getStyles("background-color","border-left","border-right"));this.getParent().insertBefore(alert,this.getNext());this.showingUserAlert=true;if(conf.browserInfo.name=="explorer"&&conf.browserInfo.version=="7.0"){alert.setStyles({border:"none",margin:"0 1px"})}}else{alert=this.getNext()}alert.set("text",text)};if(conf.browserInfo.name=="explorer"&&conf.browserInfo.version=="7.0"){this.dom.content.setStyles({"border-left":"1px solid #fff","border-right":"1px solid #fff"})}};this.createActions=function(){var properties={className:"c959fa4-6x6",borderColor:null,backgroundColor:"#959fa4",backgroundAlpha:1,cornerWidth:6,cornerHeight:6,respect:"width",exclude:"header"};wrapWithContainer(this.dom.actions,properties,"");this.dom.actions.content.set("class","actions");this.dom.container.content.appendChild(this.dom.actions)};this.show=function(type,point,extendProperties,fromQueue){if((fromQueue==null||!fromQueue)&&this.popped){this.queue.push({type:type,point:point,extendProperties:extendProperties});return}var popupType;switch(type){case Popup.Types.Message.Alert:popupType=new AlertMessage();break;case Popup.Types.Message.Error:popupType=new ErrorMessage();break;case Popup.Types.Message.Compose:popupType=new ComposeMessage();break;case Popup.Types.Invite.OneOnOne:popupType=new InviteOneOnOne();break;case Popup.Types.Invite.Friend:popupType=new MakeFriendRequest();break;case Popup.Types.System.Logout:popupType=new LogoutWindow();break;case Popup.Types.System.Feedback:popupType=new FeedbackWindow();break;default:popupType=new PopupType()}if(extendProperties!=null){extendProperties(popupType.properties)}this.dom.content.clear();this.dom.actions.content.empty();this.dom.header.reset();this.dom.actions.reset();this.dom.container.reset();var func=function(el){var kids=el.getChildren();kids.each(function(kid,i){if(kid.hasClass("icon")){return}var width=kid.getStyle("width");if(width!=null&&width!="100%"&&width!="auto"&&width.toInt()!="NaN"&&width.toInt()>30){kid.setStyle("width",null)}if(kid.getChildren.length>0){func(kid)}})};func(this.dom.container);if(popupType.properties.header.close){this.dom.header.closer.setStyle("display","block")}else{this.dom.header.closer.setStyle("display","none")}if(popupType.properties.header.icon.image!=null){this.dom.header.icon.setStyle("background-image","url("+conf.staticVersionUrl+popupType.properties.header.icon.image+")");this.dom.header.icon.setStyle("background-position",popupType.properties.header.icon.offset)}else{this.dom.header.icon.setStyle("background-image","none")}this.dom.header.icon.setStyle("width",popupType.properties.header.icon.width);this.dom.header.caption.set("text",popupType.properties.header.text);this.dom.content.icon.setStyle("background-image","url()");if(popupType.properties.content.icon!=null){this.dom.content.icon.setStyle("width",94);this.dom.content.setStyle("padding","10px 10px 10px 110px");var img=new Image();img.icon=this.dom.content.icon;img.onload=function(){this.icon.setStyle("background-image","url("+this.src+")")};img.onerror=function(){this.icon.setStyle("background-image","url("+conf.staticVersionUrl+"/images/global/cantLoad/popups-transparent.png)")};img.src=popupType.properties.content.icon}else{this.dom.content.icon.setStyle("width",0);if(popupType.properties.content.noPadding){this.dom.content.setStyle("padding",0)}else{this.dom.content.setStyle("padding",10)}}popupType.properties.content.init(this.dom.content);this.dom.pageMask.setStyles({display:"block",height:document.getScrollSize().y});this.dom.container.setStyle("display","block");var button;if(popupType.properties.bottomLabel!=null){this.dom.actions.content.setStyles({"font-size":"11px",padding:"2px 4px","text-align":"left"});this.dom.actions.content.set("html",popupType.properties.bottomLabel)}else{this.dom.actions.content.setStyles({"text-align":null,"font-size":null,padding:null});popupType.properties.actions.each(function(action,index){button=$(document.createElement("input"));button.type="button";button.className="button "+(action.type==null?"full":action.type);button.value=action.caption;button.onclick=action.click;this.dom.actions.content.appendChild(button);button=new Button(button);button.dom.element.setStyle("margin","0px 4px")}.bind(this))}var popupSize=this.dom.container.getSize();if(popupSize.x<322){this.dom.content.setStyle("width",300)}if(popupSize.y<185){this.dom.content.setStyle("height",150)}var width=document.all?this.dom.content.getSize().x:null;this.dom.header.layout(width);this.dom.content.layout();this.dom.actions.layout(width);this.dom.container.layout();if(this.dom.content.getSize().y<this.dom.content.icon.getSize().y){this.dom.content.setStyle("height",this.dom.content.icon.getStyle("height").toInt()+this.dom.content.icon.getStyle("top").toInt())}this.popped=true;if(popupType.properties.sound!=null){page.playSound(popupType.properties.sound)}if(popupType.properties.events.load!=null){popupType.properties.events.load()}popupSize=this.dom.container.getSize();if(point==null){var windowSize=$(window).getSize();var windowScroll=$(window).getScroll();point={x:windowSize.x/2+windowScroll.x-popupSize.x/2,y:windowSize.y/2+windowScroll.y-popupSize.y/2}}this.dom.container.setStyle("left",point.x);this.dom.container.setStyle("top",point.y)};this.hide=function(){this.dom.pageMask.setStyle("display","none");this.dom.container.setStyle("display","none");this.extraData=null;if(this.queue.length>0){var newdata=this.queue.shift();this.show(newdata.type,newdata.point,newdata.extendProperties,true)}else{this.popped=false}}}Popup.Types={Empty:0,General:1,Message:{Alert:2,Error:3,Compose:4},Invite:{OneOnOne:5,Friend:6},System:{Logout:7,Feedback:8}};function PopupType(ignore){if(ignore){return}this.properties={header:{icon:{offset:"0px 0px",width:18,image:"/images/global/popupHeaderIcons.png"},text:null,close:true},content:{icon:null,init:function(domElement){}},sound:null,actions:[],events:{}}}AlertMessage.prototype=new PopupType(true);function AlertMessage(ignore){if(ignore){return}PopupType.call(this);this.properties.header.icon.offset="-36px 0px";this.properties.header.icon.width=14;this.properties.content.icon=conf.staticVersionUrl+"/images/global/alertPopupIcon.png";this.properties.sound="alert.mp3"}ErrorMessage.prototype=new PopupType(true);function ErrorMessage(ignore){if(ignore){return}PopupType.call(this);this.properties.header.icon.offset="-34px 0px";this.properties.header.icon.width=16;this.properties.content.icon=conf.staticVersionUrl+"/images/global/errorPopupIcon.png";this.properties.sound="error.mp3"}ComposeMessage.prototype=new PopupType(true);function ComposeMessage(){PopupType.call(this);this.properties.header.icon.offset="-19px 0px";this.properties.header.text="Compose a Message";this.properties.actions.push({caption:"Send",click:function(event){}});this.properties.actions.push({caption:"Cancel",type:"bordered",click:function(event){page.popup.hide()}})}InviteOneOnOne.prototype=new PopupType(true);function InviteOneOnOne(){PopupType.call(this);this.properties.header.iconOffset="0px 0px";this.properties.header.text="One on One Invitation";this.properties.actions.push({caption:"Invite",click:function(event){}});this.properties.actions.push({caption:"Cancel",type:"bordered",click:function(event){page.popup.hide()}})}MakeFriendRequest.prototype=new PopupType(true);function MakeFriendRequest(){PopupType.call(this);this.properties.header.icon.image="/images/global/icons.png";this.properties.header.icon.ffset="0px 0px";this.properties.header.icon.width=15;this.properties.header.text="Friend Request";this.properties.actions.push({caption:"Add Friend",click:function(event){}});this.properties.actions.push({caption:"Cancel",type:"bordered",click:function(event){page.popup.hide()}})}LogoutWindow.prototype=new AlertMessage(true);function LogoutWindow(){AlertMessage.call(this);this.properties.header.close=false;this.properties.header.text="Logged out";this.properties.actions.push({caption:"OK",click:function(event){page.popup.hide();document.location.href="/"}});this.properties.content.init=function(domElement){var el=$(document.createElement("div"));el.set("style","font-size: 13px; font-weight: bold;, text-align: left;");el.set("html","You were logged out of the system.<br/>Press OK to log back in.");domElement.appendChild(el)}}FadingWindow.prototype=new PopupType(true);function FadingWindow(obj){if(obj!=null&&$type(obj)=="boolean"&&obj){return}PopupType.call(this);this.properties.events.load=function(){setTimeout(function(){this.hide()}.bind(page.popup),(obj==null||obj.interval==null)?2500:obj.interval)}}FeedbackWindow.prototype=new FadingWindow(true);function FeedbackWindow(ignore){if(ignore){return}FadingWindow.call(this);this.properties.header.icon.offset="-36px 0px";this.properties.header.icon.width=14;this.properties.header.close=false;this.properties.content.icon=conf.staticVersionUrl+"/images/global/alertPopupIcon.png"};
function Tracker(){this.capacity=5;this.count=0;this.messages=new Hash();this.messagesOrder=new Array();this.dom={toggler:$("trackerToggler"),messagesPanel:$(document.createElement("div"))};createTrackerPanel(this.dom.toggler);this.dom.messagesPanel.isVisible=false;this.dom.messagesPanel.set("style","position: absolute; top: 40px; left: 40px; width: 265px; display: none; z-index: 999;");document.body.appendChild(this.dom.messagesPanel);createMessagesPanel(this.dom.messagesPanel);this.handleRequestedMessages=function(request){var json=request.getResponseAsJSON();if(json==null||json.count==0){return}var msgid,message;for(var i=0;i<json.list.length;i++){msgid=json.list[i].id;if(this.messages.get(msgid)!=null){continue}this.count+=1;message=wrapServerMessage(this,json.list[i]);this.messages.set(msgid,message);this.messagesOrder.push(msgid)}this.dom.toggler.setCount(this.count);if(this.dom.messagesPanel.isVisible){for(var i=0;i<this.capacity;i++){message=this.messages.get(this.messagesOrder[i]);if(message==null){continue}if(!message.showing){message.createDom(this.dom.messagesPanel.content.messages);message.showing=true}}this.updateFooterCount()}this.flickerTracker(15,500)};this.handlePushedMessages=function(messages){if($type(messages)!="array"){var temp=new Array();temp.push(messages);messages=temp}var newMessagesOrder=new Array();var message;for(var i=0;i<messages.length;i++){message=messages[i];if($type(message.header)!="object"){message.header=eval("("+message.header+")")}if($type(message.content)!="object"){message.content=eval("("+message.content+")")}if(this.messages.get(message.id)!=null){continue}this.count+=1;dommessage=wrapServerMessage(this,message);this.messages.set(message.id,dommessage);newMessagesOrder.push(message.id);this.dom.messagesPanel.pushMessage(dommessage)}this.dom.toggler.setCount(this.count);newMessagesOrder.combine(this.messagesOrder);this.messagesOrder=newMessagesOrder;this.flickerTracker(15,500);page.playSound("tracker.mp3")};this.flickerTracker=function(count,delta){this.dom.toggler.flicker(count,delta)};this.documentClickEvent=function(event){var coords=getCoordinatesFor(this.dom.messagesPanel);if(event.page.x<coords.left||event.page.x>coords.right){this.hideMessagesPanel()}if(event.page.y<coords.top||event.page.y>coords.bottom){this.hideMessagesPanel()}};this.showMessagesPanel=function(){this.dom.messagesPanel.isVisible=true;this.dom.toggler.setStyle("background-position","-24px -78px");this.dom.messagesPanel.setStyle("display","block");var last=Math.min(5,this.messagesOrder.length);var dombox,message;for(var i=0;i<last;i++){message=this.messages.get(this.messagesOrder[i]);message.showing=true;dombox=message.createDom(this.dom.messagesPanel.content.messages)}var coords=getCoordinatesFor(this.dom.toggler);this.dom.messagesPanel.setStyle("left",coords.left+this.dom.toggler.getSize().x-this.dom.messagesPanel.getSize().x+6);this.dom.messagesPanel.setStyle("top",coords.top+this.dom.toggler.getSize().y);$(document.body).addEvent("click",this.documentClickEvent.bind(this));this.updateFooterCount()};this.updateFooterCount=function(){var msg="";if(this.count-this.capacity>0){msg="You have "+this.count+" new trails"}else{msg="You have no new trails"}this.dom.messagesPanel.content.footer.caption.set("text",msg)};this.hideMessagesPanel=function(){document.body.removeEvent("click",this.documentClickEvent);this.dom.messagesPanel.isVisible=false;this.dom.toggler.fireEvent("mouseleave");this.dom.messagesPanel.setStyle("display","none");this.dom.messagesPanel.clear();var message;for(var i=0;i<this.messagesOrder.length;i++){message=this.messages.get(this.messagesOrder[i]);if(!message.showing){break}message.showing=false}};this.messageRemoved=function(message){this.count--;if(this.count<0){this.count=0}this.dom.toggler.setCount(this.count);if(message.showing){message.dom.spacer.setStyle("height",0);this.dom.messagesPanel.content.messages.removeChild(message.dom.spacer)}this.messages.erase(message.serverMessage.id);this.messagesOrder.erase(message.serverMessage.id);var url="/trackerMessages.ajax?state=unshown&amount=1&offset="+(this.capacity-1);page.connectionManager.makeRequest(url,null,this.handleRequestedMessages.bind(this))};this.removeMessageById=function(id){var msg=this.messages.get(id);if(msg!=null){this.messageRemoved(msg)}}}function createTrackerPanel(domElement){domElement.className="clearfix";domElement.leftCorner=$(document.createElement("div"));domElement.leftCorner.addClass("bgcIconsPng");domElement.leftCorner.set("style","float: left; width: 5px; height: 21px; background-position: -24px -99px;");domElement.appendChild(domElement.leftCorner);domElement.caption=$(document.createElement("div"));domElement.caption.set("style","float: left; height: 18px; padding-top: 3px; background-color: #959fa4; white-space: nowrap; font-size: 11px; font-weight: bold; color: white;");domElement.caption.set("text","Nothing New");domElement.appendChild(domElement.caption);domElement.spacer=$(document.createElement("div"));domElement.spacer.set("style","float: left; height: 18px; padding: 2px 5px 1px 5px; background-color: #959fa4; font-size: 12px; font-weight: bold; color: white;");domElement.spacer.set("text"," | ");domElement.appendChild(domElement.spacer);domElement.counter=$(document.createElement("div"));domElement.counter.set("style","float: left; height: 18px; padding-top: 3px; background-color: #959fa4; font-size: 11px; font-weight: bold; color: white;");domElement.counter.set("text","0");domElement.appendChild(domElement.counter);domElement.rightCorner=$(document.createElement("div"));domElement.rightCorner.addClass("bgcIconsPng");domElement.rightCorner.set("style","float: left; width: 5px; height: 21px; background-position: -43px -99px;");domElement.appendChild(domElement.rightCorner);domElement.setCount=function(count){if(count==0){this.caption.set("text","Nothing New")}else{this.caption.set("text","What's New?")}this.counter.set("text",count)};domElement.changeSkin=function(color){switch(color){case"blue":this.leftCorner.setStyle("background-position","-24px -78px");this.caption.setStyles({"background-color":"#b8d9ea",color:"black"});this.spacer.setStyles({"background-color":"#b8d9ea",color:"black"});this.counter.setStyles({"background-color":"#b8d9ea",color:"black"});this.rightCorner.setStyle("background-position","-43px -78px");break;case"yellow":this.leftCorner.setStyle("background-position","0px -78px");this.caption.setStyles({"background-color":"#f6c431",color:"black"});this.spacer.setStyles({"background-color":"#f6c431",color:"black"});this.counter.setStyles({"background-color":"#f6c431",color:"black"});this.rightCorner.setStyle("background-position","-19px -78px");break;default:this.leftCorner.setStyle("background-position","-24px -99px");this.caption.setStyles({"background-color":"#959fa4",color:"white"});this.spacer.setStyles({"background-color":"#959fa4",color:"white"});this.counter.setStyles({"background-color":"#959fa4",color:"white"});this.rightCorner.setStyle("background-position","-43px -99px");break}};domElement.addEvent("mouseenter",function(event){this.changeSkin("blue")});domElement.addEvent("mouseleave",function(event){if(page.tracker.count==0){this.changeSkin("gray")}else{this.changeSkin("yellow")}});domElement.addEvent("click",function(event){cancelPropagation(event);if(this.flickerTimer!=null){clearTimeout(this.flickerTimer);this.flickerTimer=null}if(page.tracker.dom.messagesPanel.isVisible){page.tracker.hideMessagesPanel()}else{page.tracker.showMessagesPanel()}});domElement.flicker=function(count,delta){if(count%2==0){this.changeSkin("yellow")}else{this.changeSkin("blue")}if(count==0){this.flickerTimer=null;return}else{this.flickerTimer=setTimeout(function(){this.flicker(--count,delta)}.bind(this),delta==null?500:delta)}}}function createMessagesPanel(domElement){domElement.top=$(document.createElement("div"));domElement.top.set("class","containersPng");domElement.top.set("style","height: 10px; background-position: 0px -12px;");domElement.appendChild(domElement.top);domElement.content=$(document.createElement("div"));domElement.content.set("style","padding: 0px 14px 10px 10px; background: url("+conf.staticVersionUrl+"/images/global/trackerBody.png) repeat-y;");domElement.appendChild(domElement.content);domElement.content.messages=$(document.createElement("div"));domElement.content.messages.className="clearfix";domElement.content.appendChild(domElement.content.messages);domElement.content.footer=$(document.createElement("div"));domElement.content.appendChild(domElement.content.footer);domElement.content.footer.className="clearfix";domElement.content.footer.set("style","width: 100%; padding-top: 5px; border-top: 1px solid #939da2;");domElement.content.footer.caption=$(document.createElement("div"));domElement.content.footer.caption.set("style","float: left; font-size: 11px;");domElement.content.footer.caption.set("text","You have no new trails");domElement.content.footer.appendChild(domElement.content.footer.caption);domElement.content.footer.action=$(document.createElement("div"));domElement.content.footer.action.set("style","float: right; font-size: 11px; cursor: pointer;");domElement.content.footer.action.set("text","Go to trails");domElement.content.footer.action.addEvent("mouseenter",function(event){this.setStyle("text-decoration","underline")});domElement.content.footer.action.addEvent("mouseleave",function(event){this.setStyle("text-decoration","none")});domElement.content.footer.action.addEvent("click",function(event){document.location.href="/trails"});domElement.content.footer.appendChild(domElement.content.footer.action);domElement.bottom=$(document.createElement("div"));domElement.bottom.set("class","containersPng");domElement.bottom.set("style","height: 17px; background-position: 0px -22px;");domElement.appendChild(domElement.bottom);domElement.clear=function(){this.content.messages.empty()};domElement.pushMessage=function(message){if(!this.isVisible){return}message.createDom(this.content.messages,true);while(this.content.messages.getChildren().length>5){this.content.messages.removeChild(this.content.messages.getLast())}}}function wrapServerMessage(tracker,msg){switch(msg.type.toInt()){case TrackerMessage.Types.FriendRequest:return new FriendRequestTrackerMessage(tracker,msg);case TrackerMessage.Types.PrivateMessage:return new PrivateMessageTrackerMessage(tracker,msg);case TrackerMessage.Types.OneOnOneRequest:return new OneOnOneRequestTrackerMessage(tracker,msg);case TrackerMessage.Types.FriendRequestApproval:return new FriendRequestApprovalTrackerMessage(tracker,msg);default:return null}}function TrackerMessage(tracker,type,msg){if(type==null){return}this.tracker=tracker;this.type=type;this.serverMessage=msg;this.showing=false;this.actions=new Array();this.dom={};this.createDom=function(domParent,pushFirst){this.dom.element=$(document.createElement("div"));this.dom.spacer=$(document.createElement("div"));var userImage=$(document.createElement("img"));userImage.onerror=function(){this.src=conf.staticVersionUrl+"/images/global/cantLoad/medium.png"};userImage.src=this.serverMessage.content.picture;userImage.set("style","position: absolute; left: 0px; top: 0px; margin-top: 10px; cursor: pointer;");userImage.addEvent("click",function(event){document.location.href="/profile/"+this.serverMessage.username+"/"+this.serverMessage.user}.bind(this));this.dom.spacer.className="clearfix";this.dom.spacer.set("style","width: 241px; clear: left; position: relative; "+(IS_IE?"padding: 2px 0px;":"padding: 8px 0px"));this.dom.element.className="clearfix";this.dom.spacer.appendChild(this.dom.element);this.dom.spacer.appendChild(userImage);if(pushFirst==null||!pushFirst||domParent.getChildren().length==0){domParent.appendChild(this.dom.spacer)}else{domParent.insertBefore(this.dom.spacer,domParent.getFirst())}this.dom.element.properties={rows:2,backgroundColor:"#ffffff",borderColor:"#ffffff",respect:"height",cornerWidth:6,cornerHeight:6,top:{backgroundColor:"#ffffff",borderColor:"#ffffff"},bottom:{backgroundColor:"#959fa4",borderColor:"#959fa4"}};replaceContainerRespectHeight(this.dom.element);var boxContent=$(document.createElement("div"));boxContent.set("style","background-color: #ffffff; padding: 10px 0px 0px 66px; color: #4a5053; text-align: left; font-size: 11px;");boxContent.set("html",this.serverMessage.content.text.replace(this.serverMessage.username,'<a class="trackerProfileLink" href="/profile/'+this.serverMessage.username+"/"+this.serverMessage.user+'">'+this.serverMessage.username+"</a>"));this.dom.element.content.appendChild(boxContent);if(boxContent.getSize().y<50){boxContent.setStyle("height",50)}var boxActions=$(document.createElement("div"));boxActions.className="boxActions";boxActions.set("style","background-color: #959fa4; text-align: right;"+(IS_IE?"padding: 3px 0px;":"padding-bottom: 4px;"));this.dom.element.content.appendChild(boxActions);var button;for(var i=0;i<this.actions.length;i++){button=$(document.createElement("input"));button.type="button";button.set("class","button "+(this.actions[i].type==null?"full":this.actions[i].type));button.value=this.actions[i].text;boxActions.appendChild(button);button=new Button(button);if(this.actions[i].click!=null){button.dom.element.onclick=this.actions[i].click}else{button.dom.element.setStyle("cursor","default");button.dom.element.title="Coming soon..."}button.dom.element.setStyle("margin","0px 4px")}this.dom.element.bindRow(0,boxContent);this.dom.element.bindRow(1,boxActions);this.dom.element.layout(true);return this.dom.element};this.remove=function(){var url="/markAsShown.ajax?activityid="+this.serverMessage.id;page.connectionManager.makeRequest(url,null,this.removed.bind(this))};this.removed=function(request){this.dom.spacer.set("tween",{onComplete:function(){this.tracker.messageRemoved(this)}.bind(this)});this.dom.spacer.tween("opacity",0)}}TrackerMessage.Types={FriendRequest:1,PrivateMessage:2,OneOnOneRequest:3,FriendRequestApproval:4};FriendRequestTrackerMessage.prototype=new TrackerMessage;function FriendRequestTrackerMessage(tracker,msg){TrackerMessage.call(this,tracker,TrackerMessage.Types.FriendRequest,msg);this.actions.push({text:"Accept",click:function(){this.remove();var url="/friendRequest.ajax?activityid="+this.serverMessage.id+"&response=True&targetuserid="+msg.user;page.connectionManager.makeRequest(url,null,function(request){})}.bind(this)});this.actions.push({text:"Reject",type:"bordered",click:function(){this.remove();var url="/friendRequest.ajax?activityid="+this.serverMessage.id+"&response=False&targetuserid="+msg.user;page.connectionManager.makeRequest(url,null,function(request){})}.bind(this)})}PrivateMessageTrackerMessage.prototype=new TrackerMessage;function PrivateMessageTrackerMessage(tracker,msg){TrackerMessage.call(this,tracker,TrackerMessage.Types.PrivateMessage,msg);this.actions.push({text:"Read",click:function(){document.location.href="/trails.thread?refer=in&id="+this.serverMessage.thread}.bind(this)});this.actions.push({text:"Remove",type:"bordered",click:this.remove.bind(this)})}OneOnOneRequestTrackerMessage.prototype=new TrackerMessage;function OneOnOneRequestTrackerMessage(tracker,msg){if(page.flashVersion==null||page.flashVersion<10){msg.content.text+=" - install flash to continue"}TrackerMessage.call(this,tracker,TrackerMessage.Types.OneOnOneRequest,msg);if(page.flashVersion==null||page.flashVersion<10){this.actions.push({text:"Download Flash",click:function(){window.open("http://get.adobe.com/flashplayer/","mywindow")}.bind(this)});this.actions.push({text:"Remove",type:"bordered",click:this.remove.bind(this)});return}if(this.serverMessage.state=="wait"){this.actions.push({text:"Accept",click:function(){this.remove();var url="/httpbind?cmd=acceptinvitation&isacceped=1&fuserid="+this.serverMessage.user+"&fusername="+this.serverMessage.username+"&sessionid="+this.serverMessage.sessionid+"&interaction="+this.serverMessage.sessionInteraction+"&type="+this.serverMessage.sessionType;page.connectionManager.makeRequest(url,null,function(request){},true);url="/videopage?sessionid="+this.serverMessage.sessionid+"&interaction="+this.serverMessage.sessionInteraction+"&type="+this.serverMessage.sessionType;var params="width=1000,height=700,resizable=yes,scrollbars=yes,toolbar=no,location=yes,directories=no,status=no,menubar=no,copyhistory=no";var win=window.open(url,"videoWindow",params)}.bind(this)});this.actions.push({text:"Reject",type:"bordered",click:function(){this.remove();var url="/httpbind?cmd=acceptinvitation&isacceped=0&fuserid="+this.serverMessage.user+"&fusername="+this.serverMessage.username+"&sessionid="+this.serverMessage.sessionid+"&interaction="+this.serverMessage.sessionInteraction+"&type="+this.serverMessage.sessionType;page.connectionManager.makeRequest(url,null,function(request){},true)}.bind(this)});this.sessionTimedOut=function(){this.actions=new Array();this.actions.push({text:"Re-invite",click:function(){this.remove();console.log("yo 1",msg);page.startSession('userid:"'+msg.user+'",nickname:"'+msg.username+'",lastUpdate: "'+msg.userlastupdate+'",gender:"'+msg.usergender+'"')}.bind(this)});this.actions.push({text:"Remove",type:"bordered",click:this.remove.bind(this)});if(this.tracker.dom.messagesPanel.isVisible){actionsBox=this.dom.element.getElement(".boxActions");actionsBox.empty();var button=$(document.createElement("input"));button.type="button";button.set("class","button");button.set("class","button full");button.value="Re-invite";actionsBox.appendChild(button);button=new Button(button);button.dom.element.onclick=function(){this.remove();page.startSession('userid:"'+msg.user+'",nickname:"'+msg.username+'"')}.bind(this);button.dom.element.setStyle("margin","0px 4px");button=$(document.createElement("input"));button.type="button";button.set("class","button bordered");button.value="Remove";actionsBox.appendChild(button);button=new Button(button);button.dom.element.onclick=this.remove.bind(this);button.dom.element.setStyle("margin","0px 4px")}}}else{this.actions.push({text:"Re-invite",click:function(){this.remove();var str='userid:"'+msg.user+'",nickname:"'+msg.username+'",gender:"'+msg.usergender+'"';if(msg.userlastupdate!=null){str+=',lastUpdate:"'+msg.userlastupdate+'"'}else{str+=",lastUpdate:null"}str+=",isFriend:"+(msg.isFriend!=null?msg.userlastupdate:"null")+"";page.startSession(str)}.bind(this)});this.actions.push({text:"Remove",type:"bordered",click:this.remove.bind(this)})}}FriendRequestApprovalTrackerMessage.prototype=new TrackerMessage;function FriendRequestApprovalTrackerMessage(tracker,msg){TrackerMessage.call(this,tracker,TrackerMessage.Types.FriendRequestApproval,msg);this.actions.push({text:"Remove",type:"bordered",click:this.remove.bind(this)})};

