var MD5=function(s){function L(b,a){return(b<<a)|(b>>>(32-a))
}function K(k,b){var F,a,d,x,c;
d=(k&2147483648);
x=(b&2147483648);
F=(k&1073741824);
a=(b&1073741824);
c=(k&1073741823)+(b&1073741823);
if(F&a){return(c^2147483648^d^x)
}if(F|a){if(c&1073741824){return(c^3221225472^d^x)
}else{return(c^1073741824^d^x)
}}else{return(c^d^x)
}}function r(a,c,b){return(a&c)|((~a)&b)
}function q(a,c,b){return(a&b)|(c&(~b))
}function p(a,c,b){return(a^c^b)
}function n(a,c,b){return(c^(a|(~b)))
}function u(G,F,aa,Z,k,H,I){G=K(G,K(K(r(F,aa,Z),k),I));
return K(L(G,H),F)
}function f(G,F,aa,Z,k,H,I){G=K(G,K(K(q(F,aa,Z),k),I));
return K(L(G,H),F)
}function D(G,F,aa,Z,k,H,I){G=K(G,K(K(p(F,aa,Z),k),I));
return K(L(G,H),F)
}function t(G,F,aa,Z,k,H,I){G=K(G,K(K(n(F,aa,Z),k),I));
return K(L(G,H),F)
}function e(k){var G;
var d=k.length;
var c=d+8;
var b=(c-(c%64))/64;
var F=(b+1)*16;
var H=Array(F-1);
var a=0;
var x=0;
while(x<d){G=(x-(x%4))/4;
a=(x%4)*8;
H[G]=(H[G]|(k.charCodeAt(x)<<a));
x++
}G=(x-(x%4))/4;
a=(x%4)*8;
H[G]=H[G]|(128<<a);
H[F-2]=d<<3;
H[F-1]=d>>>29;
return H
}function B(c){var b="",d="",k,a;
for(a=0;
a<=3;
a++){k=(c>>>(a*8))&255;
d="0"+k.toString(16);
b=b+d.substr(d.length-2,2)
}return b
}function J(b){b=b.replace(/\r\n/g,"\n");
var a="";
for(var k=0;
k<b.length;
k++){var d=b.charCodeAt(k);
if(d<128){a+=String.fromCharCode(d)
}else{if((d>127)&&(d<2048)){a+=String.fromCharCode((d>>6)|192);
a+=String.fromCharCode((d&63)|128)
}else{a+=String.fromCharCode((d>>12)|224);
a+=String.fromCharCode(((d>>6)&63)|128);
a+=String.fromCharCode((d&63)|128)
}}}return a
}var C=Array();
var P,h,E,v,g,Y,X,W,V;
var S=7,Q=12,N=17,M=22;
var A=5,z=9,y=14,w=20;
var o=4,m=11,l=16,j=23;
var U=6,T=10,R=15,O=21;
s=J(s);
C=e(s);
Y=1732584193;
X=4023233417;
W=2562383102;
V=271733878;
for(P=0;
P<C.length;
P+=16){h=Y;
E=X;
v=W;
g=V;
Y=u(Y,X,W,V,C[P+0],S,3614090360);
V=u(V,Y,X,W,C[P+1],Q,3905402710);
W=u(W,V,Y,X,C[P+2],N,606105819);
X=u(X,W,V,Y,C[P+3],M,3250441966);
Y=u(Y,X,W,V,C[P+4],S,4118548399);
V=u(V,Y,X,W,C[P+5],Q,1200080426);
W=u(W,V,Y,X,C[P+6],N,2821735955);
X=u(X,W,V,Y,C[P+7],M,4249261313);
Y=u(Y,X,W,V,C[P+8],S,1770035416);
V=u(V,Y,X,W,C[P+9],Q,2336552879);
W=u(W,V,Y,X,C[P+10],N,4294925233);
X=u(X,W,V,Y,C[P+11],M,2304563134);
Y=u(Y,X,W,V,C[P+12],S,1804603682);
V=u(V,Y,X,W,C[P+13],Q,4254626195);
W=u(W,V,Y,X,C[P+14],N,2792965006);
X=u(X,W,V,Y,C[P+15],M,1236535329);
Y=f(Y,X,W,V,C[P+1],A,4129170786);
V=f(V,Y,X,W,C[P+6],z,3225465664);
W=f(W,V,Y,X,C[P+11],y,643717713);
X=f(X,W,V,Y,C[P+0],w,3921069994);
Y=f(Y,X,W,V,C[P+5],A,3593408605);
V=f(V,Y,X,W,C[P+10],z,38016083);
W=f(W,V,Y,X,C[P+15],y,3634488961);
X=f(X,W,V,Y,C[P+4],w,3889429448);
Y=f(Y,X,W,V,C[P+9],A,568446438);
V=f(V,Y,X,W,C[P+14],z,3275163606);
W=f(W,V,Y,X,C[P+3],y,4107603335);
X=f(X,W,V,Y,C[P+8],w,1163531501);
Y=f(Y,X,W,V,C[P+13],A,2850285829);
V=f(V,Y,X,W,C[P+2],z,4243563512);
W=f(W,V,Y,X,C[P+7],y,1735328473);
X=f(X,W,V,Y,C[P+12],w,2368359562);
Y=D(Y,X,W,V,C[P+5],o,4294588738);
V=D(V,Y,X,W,C[P+8],m,2272392833);
W=D(W,V,Y,X,C[P+11],l,1839030562);
X=D(X,W,V,Y,C[P+14],j,4259657740);
Y=D(Y,X,W,V,C[P+1],o,2763975236);
V=D(V,Y,X,W,C[P+4],m,1272893353);
W=D(W,V,Y,X,C[P+7],l,4139469664);
X=D(X,W,V,Y,C[P+10],j,3200236656);
Y=D(Y,X,W,V,C[P+13],o,681279174);
V=D(V,Y,X,W,C[P+0],m,3936430074);
W=D(W,V,Y,X,C[P+3],l,3572445317);
X=D(X,W,V,Y,C[P+6],j,76029189);
Y=D(Y,X,W,V,C[P+9],o,3654602809);
V=D(V,Y,X,W,C[P+12],m,3873151461);
W=D(W,V,Y,X,C[P+15],l,530742520);
X=D(X,W,V,Y,C[P+2],j,3299628645);
Y=t(Y,X,W,V,C[P+0],U,4096336452);
V=t(V,Y,X,W,C[P+7],T,1126891415);
W=t(W,V,Y,X,C[P+14],R,2878612391);
X=t(X,W,V,Y,C[P+5],O,4237533241);
Y=t(Y,X,W,V,C[P+12],U,1700485571);
V=t(V,Y,X,W,C[P+3],T,2399980690);
W=t(W,V,Y,X,C[P+10],R,4293915773);
X=t(X,W,V,Y,C[P+1],O,2240044497);
Y=t(Y,X,W,V,C[P+8],U,1873313359);
V=t(V,Y,X,W,C[P+15],T,4264355552);
W=t(W,V,Y,X,C[P+6],R,2734768916);
X=t(X,W,V,Y,C[P+13],O,1309151649);
Y=t(Y,X,W,V,C[P+4],U,4149444226);
V=t(V,Y,X,W,C[P+11],T,3174756917);
W=t(W,V,Y,X,C[P+2],R,718787259);
X=t(X,W,V,Y,C[P+9],O,3951481745);
Y=K(Y,h);
X=K(X,E);
W=K(W,v);
V=K(V,g)
}var i=B(Y)+B(X)+B(W)+B(V);
return i.toLowerCase()
};
var Roar=new Class({Implements:[Options,Events,Chain],options:{duration:3000,position:"upperLeft",container:null,bodyFx:null,itemFx:null,margin:{x:10,y:10},offset:10,className:"roar",onShow:$empty,onHide:$empty,onRender:$empty},initialize:function(a){this.setOptions(a);
this.items=[];
this.container=$(this.options.container)||document
},alert:function(e,c,b){var d=Array.link(arguments,{title:String.type,message:String.type,options:Object.type});
var a=[new Element("h3",{html:$pick(d.title,"")})];
if(d.message){a.push(new Element("p",{html:d.message}))
}return this.inject(a,d.options)
},inject:function(e,a){if(!this.body){this.render()
}a=a||{};
var b=a.className||this.options.className;
var f=a.duration||this.options.duration;
var g=[-this.options.offset,0];
var d=this.items.getLast();
if(d){g[0]=d.retrieve("roar:offset");
g[1]=g[0]+d.offsetHeight+this.options.offset
}var h={opacity:1};
h[this.align.y]=g;
var c=new Element("div",{"class":b,opacity:0}).adopt(new Element("div",{"class":"roar-bg",opacity:0.7}),e);
c.setStyle(this.align.x,0).store("roar:offset",g[1]).set("morph",$merge({unit:"px",link:"cancel",onStart:Chain.prototype.clearChain,transition:Fx.Transitions.Back.easeOut},this.options.itemFx));
this.items.push(c);
if(f){this.startRemoveCountdown(c,f)
}c.inject(this.body).morph(h);
return this.fireEvent("onShow",[c,this.items.length])
},startRemoveCountdown:function(c,e){Log.logger("startRemoveCountdown called");
var a=this.remove.create({bind:this,arguments:[c],delay:10});
c.addEvent("click",a);
c.expires=$time()+e*0.9;
var d=false;
var b=(function(){b=null;
Log.logger("checking if remove should still happen, expires="+c.expires+", $time()="+$time());
if(!d&&c.expires&&$time()>=c.expires){a()
}}).delay(e);
c.addEvents({mouseover:function(){d=true
},mouseout:function(){d=false;
if(!b&&c.expires&&$time()>=c.expires){a()
}}})
},remove:function(b){Log.logger("remove called");
var a=this.items.indexOf(b);
if(a==-1){Log.logger("index==-1!");
return this
}this.items.splice(a,1);
b.removeEvents();
var c={opacity:0};
c[this.align.y]=b.getStyle(this.align.y).toInt()-b.offsetHeight-this.options.offset;
b.morph(c).get("morph").chain(this.destroy.bind(this,b));
return this.fireEvent("onHide",[b,this.items.length]).callChain(b)
},destroy:function(a){Log.logger("destroy called");
a.destroy.apply(a)
},empty:function(){while(this.items.length){this.remove(this.items[0])
}return this
},render:function(){this.position=this.options.position;
if($type(this.position)=="string"){var a={x:"center",y:"center"};
this.align={x:"left",y:"top"};
if((/left|west/i).test(this.position)){a.x="left"
}else{if((/right|east/i).test(this.position)){this.align.x=a.x="right"
}}if((/upper|top|north/i).test(this.position)){a.y="top"
}else{if((/bottom|lower|south/i).test(this.position)){this.align.y=a.y="bottom"
}}this.position=a
}this.body=new Element("div",{"class":"roar-body"}).inject(document.body);
if(Browser.Engine.trident4){this.body.addClass("roar-body-ugly")
}this.moveTo=this.body.setStyles.bind(this.body);
this.reposition();
if(this.options.bodyFx){var c=new Fx.Morph(this.body,$merge({unit:"px",chain:"cancel",transition:Fx.Transitions.Circ.easeOut},this.options.bodyFx));
this.moveTo=c.start.bind(c)
}var b=this.reposition.bind(this);
window.addEvents({scroll:b,resize:b});
this.fireEvent("onRender",this.body)
},reposition:function(){var c=document.getCoordinates(),b=document.getScroll(),d=this.options.margin;
c.left+=b.x;
c.right+=b.x;
c.top+=b.y;
c.bottom+=b.y;
var a=($type(this.container)=="element")?this.container.getCoordinates():c;
this.moveTo({left:(this.position.x=="right")?(Math.min(a.right,c.right)-d.x):(Math.max(a.left,c.left)+d.x),top:(this.position.y=="bottom")?(Math.min(a.bottom,c.bottom)-d.y):(Math.max(a.top,c.top)+d.y)})
}});
var SqueezeBox={presets:{onOpen:$empty,onClose:$empty,onUpdate:$empty,onResize:$empty,onMove:$empty,onShow:$empty,onHide:$empty,size:{x:600,y:450},sizeLoading:{x:200,y:150},marginInner:{x:20,y:20},marginImage:{x:50,y:75},handler:false,target:null,closable:true,closeBtn:true,zIndex:65555,overlayOpacity:0.7,classWindow:"",classOverlay:"",overlayFx:{},resizeFx:{},contentFx:{},parse:false,parseSecure:false,shadow:true,document:null,ajaxOptions:{}},initialize:function(){this.bound={window:this.reposition.bind(this,[null]),scroll:this.checkTarget.bind(this),close:this.close.bind(this),key:this.onKey.bind(this)};
this.isOpen=this.isLoading=false;
return this
},build:function(){$$("#sbox-overlay","#sbox-window").dispose();
this.doc=this.options.document||document;
this.overlay=new Element("div",{id:"sbox-overlay",styles:{display:"none",zIndex:this.options.zIndex}});
this.win=new Element("div",{id:"sbox-window",styles:{display:"none",zIndex:this.options.zIndex+2}});
if(this.options.shadow){if(Browser.Engine.webkit420){this.win.setStyle("-webkit-box-shadow","0 0 10px rgba(0, 0, 0, 0.7)")
}else{if(!Browser.Engine.trident4){var b=new Element("div",{"class":"sbox-bg-wrap"}).inject(this.win);
var a=function(c){this.overlay.fireEvent("click",[c])
}.bind(this);
["n","ne","e","se","s","sw","w","nw"].each(function(c){new Element("div",{"class":"sbox-bg sbox-bg-"+c}).inject(b).addEvent("click",a)
})
}}}this.content=new Element("div",{id:"sbox-content"}).inject(this.win);
if(this.options.closable){this.closeBtn=new Element("a",{id:"sbox-btn-close",href:"#"}).inject(this.win)
}this.fx={overlay:new Fx.Tween(this.overlay,$merge({property:"opacity",onStart:Events.prototype.clearChain,duration:250,link:"cancel"},this.options.overlayFx)).set(0),win:new Fx.Morph(this.win,$merge({onStart:Events.prototype.clearChain,unit:"px",duration:750,transition:Fx.Transitions.Quint.easeOut,link:"cancel",unit:"px"},this.options.resizeFx)),content:new Fx.Tween(this.content,$merge({property:"opacity",duration:250,link:"cancel"},this.options.contentFx)).set(0)};
$(this.doc.body).adopt(this.overlay,this.win)
},assign:function(b,a){return($(b)||$$(b)).addEvent("click",function(){return !SqueezeBox.fromElement(this,a)
})
},open:function(c,b){this.initialize();
if(this.element!=null){this.trash()
}this.element=$(c)||false;
this.setOptions($merge(this.presets,b||{})).build();
if(this.element&&this.options.parse){var e=this.element.getProperty(this.options.parse);
if(e&&(e=JSON.decode(e,this.options.parseSecure))){this.setOptions(e)
}}this.url=((this.element)?(this.element.get("href")):c)||this.options.url||"";
this.assignOptions();
var d=d||this.options.handler;
if(d=="string"){return this.setContent(d,c)
}if(d){return this.setContent(d,this.parsers[d].call(this,true))
}var a=false;
return this.parsers.some(function(h,f){var g=h.call(this);
if(g){a=this.setContent(f,g);
return true
}return false
},this)
},fromElement:function(b,a){return this.open(b,a)
},assignOptions:function(){this.overlay.set("class",this.options.classOverlay);
this.win.set("class",this.options.classWindow);
if(Browser.Engine.trident4){this.win.addClass("sbox-window-ie6")
}},close:function(b){var a=($type(b)=="event");
if(a){b.stop()
}if(!this.isOpen||(a&&!$lambda(this.options.closable).call(this,b))){return this
}this.fx.overlay.start(0).chain(this.toggleOverlay.bind(this));
this.win.setStyle("display","none");
this.fireEvent("onClose",[this.content]);
this.trash();
this.toggleListeners();
this.isOpen=false;
return this
},trash:function(){this.element=this.asset=null;
this.content.empty();
this.options={};
this.removeEvents().setOptions(this.presets).callChain()
},onError:function(){this.asset=null;
this.setContent("string",this.options.errorMsg||"An error occurred")
},setContent:function(a,b){if(!this.handlers[a]){return false
}this.content.className="sbox-content-"+a;
this.applyTimer=this.applyContent.delay(this.fx.overlay.options.duration,this,this.handlers[a].call(this,b));
if(this.overlay.retrieve("opacity")){return this
}this.toggleOverlay(true);
this.fx.overlay.start(this.options.overlayOpacity);
return this.reposition()
},applyContent:function(b,a){if(!this.isOpen&&!this.applyTimer){return
}this.applyTimer=$clear(this.applyTimer);
this.hideContent();
if(!b){this.toggleLoading(true)
}else{if(this.isLoading){this.toggleLoading(false)
}this.fireEvent("onUpdate",[this.content],20)
}if(b){if(["string","array"].contains($type(b))){this.content.set("html",b)
}else{if(!this.content.hasChild(b)){this.content.adopt(b)
}}}this.callChain();
if(!this.isOpen){this.toggleListeners(true);
this.resize(a,true);
this.isOpen=true;
this.fireEvent("onOpen",[this.content])
}else{this.resize(a)
}},resize:function(c,b){this.showTimer=$clear(this.showTimer||null);
var d=this.doc.getSize(),a=this.doc.getScroll();
this.size=$merge((this.isLoading)?this.options.sizeLoading:this.options.size,c);
var e={width:this.size.x,height:this.size.y,left:(a.x+(d.x-this.size.x-this.options.marginInner.x)/2).toInt(),top:(a.y+(d.y-this.size.y-this.options.marginInner.y)/2).toInt()};
this.hideContent();
if(!b){this.fx.win.start(e).chain(this.showContent.bind(this))
}else{this.win.setStyles(e).setStyle("display","");
this.showTimer=this.showContent.delay(50,this)
}return this.reposition()
},toggleListeners:function(b){var a=(b)?"addEvent":"removeEvent";
if(this.closeBtn){this.closeBtn[a]("click",this.bound.close)
}this.overlay[a]("click",this.bound.close);
this.doc[a]("keydown",this.bound.key)[a]("mousewheel",this.bound.scroll);
this.doc.getWindow()[a]("resize",this.bound.window)[a]("scroll",this.bound.window)
},toggleLoading:function(a){this.isLoading=a;
this.win[(a)?"addClass":"removeClass"]("sbox-loading");
if(a){this.fireEvent("onLoading",[this.win])
}},toggleOverlay:function(b){var a=this.doc.getSize().x;
this.overlay.setStyle("display",(b)?"":"none");
this.doc.body[(b)?"addClass":"removeClass"]("body-overlayed");
if(b){this.scrollOffset=this.doc.getWindow().getSize().x-a;
this.doc.body.setStyle("margin-right",this.scrollOffset)
}else{this.doc.body.setStyle("margin-right","")
}},showContent:function(){if(this.content.get("opacity")){this.fireEvent("onShow",[this.win])
}this.fx.content.start(1)
},hideContent:function(){if(!this.content.get("opacity")){this.fireEvent("onHide",[this.win])
}this.fx.content.cancel().set(0)
},onKey:function(a){switch(a.key){case"esc":this.close(a);
case"up":case"down":return false
}},checkTarget:function(a){return this.content.hasChild(a.target)
},reposition:function(){var c=this.doc.getSize(),a=this.doc.getScroll(),b=this.doc.getScrollSize();
this.overlay.setStyles({width:b.x+"px",height:b.y+"px"});
this.win.setStyles({left:(a.x+(c.x-this.win.offsetWidth)/2-this.scrollOffset).toInt()+"px",top:(a.y+(c.y-this.win.offsetHeight)/2).toInt()+"px"});
return this.fireEvent("onMove",[this.overlay,this.win])
},removeEvents:function(a){if(!this.$events){return this
}if(!a){this.$events=null
}else{if(this.$events[a]){this.$events[a]=null
}}return this
},extend:function(a){return $extend(this,a)
},handlers:new Hash(),parsers:new Hash()};
SqueezeBox.extend(new Events($empty)).extend(new Options($empty)).extend(new Chain($empty));
SqueezeBox.parsers.extend({image:function(a){return(a||(/\.(?:jpg|png|gif)$/i).test(this.url))?this.url:false
},clone:function(a){if($(this.options.target)){return $(this.options.target)
}if(this.element&&!this.element.parentNode){return this.element
}var b=this.url.match(/#([\w-]+)$/);
return(b)?$(b[1]):(a?this.element:false)
},ajax:function(a){return(a||(this.url&&!(/^(?:javascript|#)/i).test(this.url)))?this.url:false
},iframe:function(a){return(a||this.url)?this.url:false
},string:function(a){true
}});
SqueezeBox.handlers.extend({image:function(a){var c,b=new Image();
this.asset=null;
b.onload=b.onabort=b.onerror=(function(){b.onload=b.onabort=b.onerror=null;
if(!b.width){this.onError.delay(10,this);
return
}var e=this.doc.getSize();
e.x-=this.options.marginImage.x;
e.y-=this.options.marginImage.y;
c={x:b.width,y:b.height};
for(var d=2;
d--;
){if(c.x>e.x){c.y*=e.x/c.x;
c.x=e.x
}else{if(c.y>e.y){c.x*=e.y/c.y;
c.y=e.y
}}}c.x=c.x.toInt();
c.y=c.y.toInt();
this.asset=$(b);
b=null;
this.asset.width=c.x;
this.asset.height=c.y;
this.applyContent(this.asset,c)
}).bind(this);
b.src=a;
if(b&&b.onload&&b.complete){b.onload()
}return(this.asset)?[this.asset,c]:null
},clone:function(a){if(a){return a.clone()
}return this.onError()
},adopt:function(a){if(a){return a
}return this.onError()
},ajax:function(b){var a=this.options.ajaxOptions||{};
this.asset=new Request.HTML($merge({method:"get",evalScripts:false},this.options.ajaxOptions)).addEvents({onSuccess:function(c){this.applyContent(c);
if(a.evalScripts!==null&&!a.evalScripts){$exec(this.asset.response.javascript)
}this.fireEvent("onAjax",[c,this.asset]);
this.asset=null
}.bind(this),onFailure:this.onError.bind(this)});
this.asset.send.delay(10,this.asset,[{url:b}])
},iframe:function(a){this.asset=new Element("iframe",$merge({src:a,frameBorder:0,width:this.options.size.x,height:this.options.size.y},this.options.iframeOptions));
if(this.options.iframePreload){this.asset.addEvent("load",function(){this.applyContent(this.asset.setStyle("display",""))
}.bind(this));
this.asset.setStyle("display","none").inject(this.content);
return false
}return this.asset
},string:function(a){return a
}});
SqueezeBox.handlers.url=SqueezeBox.handlers.ajax;
SqueezeBox.parsers.url=SqueezeBox.parsers.ajax;
SqueezeBox.parsers.adopt=SqueezeBox.parsers.clone;
var uvumiCropper=new Class({Implements:[Events,Options],options:{maskOpacity:0.5,maskClassName:"cropperMask",handleClassName:"cropperHandle",resizerClassName:"cropperResize",wrapperClassName:"cropperWrapper",coordinatesClassName:"cropperCoordinates",mini:{x:80,y:60},handles:[["top","left"],"top",["top","right"],"right","left",["bottom","left"],"bottom",["bottom","right"]],onComplete:$empty,onDestroy:$empty,keepRatio:false,doubleClik:true,handleSize:16,coordinates:false,preview:false,previewSize:false,cropperSize:false,downloadButton:false,cancelButton:false,saveButton:false,adopt:false,parameters:{},coordinatesOpacity:0.25,serverScriptSave:"save-thumb.php",serverScriptDownload:"download-thumb.php",onRequestFail:function(){alert("The request could not be performed.")
},onCropFail:function(a){alert(a)
},onCropSuccess:function(a){alert("Thumbnail was generated successfully.");
new Asset.image("images/thumbs/"+a,{onload:function(b){$$(this.previewWrapper,this.toolBox).destroy();
this.wrapper.empty().setStyle("height","auto");
b.inject(this.wrapper)
}.bind(this)});
this.removeEvents();
this.crop=$empty
},onDestroy:$empty},initialize:function(b,a){window.addEvent("domready",function(){this.target=$(b);
if(!this.target.match("img")){return false
}this.setOptions(a);
this.params=this.options.parameters;
this.mini={};
this.mini.x=this.options.mini.x.toInt();
this.mini.y=this.options.mini.y.toInt();
this.runonce=false;
new Asset.image(this.target.get("src"),{onload:function(c){if(this.runonce){return
}this.runonce=true;
this.width=c.get("width");
this.buildCropper();
if(this.options.maskOpacity){this.buildMask()
}else{this.updateMask=$empty
}this.drag=new Drag.Move(this.resizer,{container:this.target,snap:0,onStart:this.hideHandles.bind(this),onComplete:function(){this.showHandles();
this.fireEvent("onComplete",[this.cropperSize?Math.round(this.top/this.scaleRatio):this.top,this.cropperSize?Math.round(this.left/this.scaleRatio):this.left,this.cropperSize?Math.round(this.width/this.scaleRatio):this.width,this.cropperSize?Math.round(this.height/this.scaleRatio):this.height])
}.bind(this)});
if(this.options.handles&&this.options.handles.length){this.resizeX=new Drag(this.resizer,{snap:0,modifiers:{x:"width",y:false},onComplete:this.stopResize.bind(this)}).detach();
this.resizeY=new Drag(this.resizer,{snap:0,modifiers:{x:false,y:"height"},onComplete:this.stopResize.bind(this)}).detach();
if(this.options.doubleClik){this.resizer.addEvent("dblclick",this.expandToMax.bind(this))
}if(this.options.keepRatio){this.ratioOn()
}else{this.ratioOff()
}}else{this.drag.addEvent("drag",this.onDrag.bind(this))
}this.drag.fireEvent("onDrag");
this.drag.fireEvent("onComplete");
this.show()
}.bind(this)})
}.bind(this))
},buildCropper:function(){this.wrapper=new Element("div",{"class":this.options.wrapperClassName,styles:{position:"relative",width:this.target.getSize().x,height:this.target.getSize().y,overflow:"hidden",padding:6,"margin-top":-6,"margin-left":-6}}).wraps(this.target);
this.border=this.target.getStyle("border-left");
this.target.setStyles({margin:0,border:0,"float":"none"});
this.target_coord=this.target.getCoordinates(this.wrapper);
this.scaleRatio=this.width/this.target_coord.width;
this.previewSize=this.options.previewSize||{x:this.mini.x,y:this.mini.y};
if(this.target_coord.width<this.mini.x){this.mini.y=this.target_coord.width*this.mini.y/this.mini.x;
this.mini.x=this.target_coord.width
}if(this.target_coord.height<this.mini.y){this.mini.x=this.target_coord.height*this.mini.x/this.mini.y;
this.mini.y=this.target_coord.height
}this.cropperSize=this.options.cropperSize;
Log.logger("scaleRatio="+this.scaleRatio);
this.resizer=new Element("div",{"class":this.options.resizerClassName,title:"Hold mouse down to move",styles:{position:"absolute",display:"block",margin:0,opacity:0,width:this.cropperSize?this.cropperSize.x:this.scaleRatio<1?(this.mini.x/this.scaleRatio).toInt():this.mini.x,height:this.cropperSize?this.cropperSize.y:this.scaleRatio<1?(this.mini.y/this.scaleRatio).toInt():this.mini.y,left:(this.target_coord.left+(this.cropperSize?this.cropperSize.left:this.mini.left||((this.target_coord.width/2)-(this.mini.x/2)))).toInt(),top:(this.target_coord.top+(this.cropperSize?this.cropperSize.top:this.mini.left||((this.target_coord.height/2)-(this.mini.y/2)))).toInt(),zIndex:5}}).inject(this.target,"after");
this.margin=2*this.resizer.getStyle("border-width").toInt();
this.resizer.setStyles({width:(this.cropperSize?this.cropperSize.x:this.scaleRatio<1?(this.mini.x/this.scaleRatio).toInt():this.mini.x)-this.margin,height:(this.cropperSize?this.cropperSize.y:this.scaleRatio<1?(this.mini.y/this.scaleRatio).toInt():this.mini.y)-this.margin});
if(this.options.coordinates||(this.options.preview&&!$(this.options.preview))||this.options.saveButton||this.options.downloadButton||this.options.cancelButton||this.options.adopt){this.buildToolBox()
}else{this.updateCoordinates=$empty
}if(this.options.coordinates){this.buildCoordinates()
}if(this.options.preview){if($(this.options.preview)){this.preview=$(this.options.preview);
this.previewWrapper=new Element("div",{styles:{height:this.previewSize.y+2*this.preview.getStyle("border-width").toInt()+this.preview.getStyle("margin-top").toInt()+this.preview.getStyle("margin-bottom").toInt()}}).wraps(this.preview)
}else{var a=new Element("div",{"class":"preview"}).inject(this.toolBox,"top");
this.preview=new Element("div").inject(a)
}this.preview.setStyles({display:"block",position:"relative",width:this.previewSize.x,height:this.previewSize.y,overflow:"hidden",margin:"auto",fontSize:0,lineHeight:0,opacity:0});
this.previewImage=this.target.clone();
this.previewImage.removeProperties("width","height").setStyle("position","absolute").inject(this.preview);
this.addEvent("onPreview",this.updatePreview.bind(this))
}if(this.options.adopt){var d=new Element("div",{styles:{clear:"both"}}).inject(this.toolBox);
switch($type(this.options.adopt)){case"string":d.set("html",this.options.adopt);
break;
case"element":case"collection":d.adopt(this.options.adopt);
break
}}if(this.options.downloadButton||this.options.saveButton||this.options.cancelButton){var c=new Element("p").inject(this.toolBox);
if(this.options.downloadButton){var b=new Element("button",{type:"button",html:($type(this.options.downloadButton)=="string"?this.options.downloadButton:"Download"),events:{click:this.cropDownload.bind(this,($type(this.options.downloadButton)=="objecy"?this.options.downloadButton:false))}}).inject(c)
}if(this.options.saveButton){var b=new Element("button",{type:"button",html:($type(this.options.saveButton)=="string"?this.options.saveButton:"Save"),events:{click:this.cropSave.bind(this,($type(this.options.saveButton)=="object"?this.options.saveButton:false))}}).inject(c)
}if(this.options.cancelButton){var b=new Element("button",{type:"button",html:($type(this.options.cancelButton)=="string"?this.options.cancelButton:"cancel"),events:{click:this.destroy.bind(this)}}).inject(c)
}}if(this.options.handles&&this.options.handles.length){this.options.handles.each(this.buildHandle,this)
}this.rezr_coord=this.resizer.getCoordinates(this.wrapper)
},buildHandle:function(d){d=$splat(d);
var a="";
var c="";
["left","right"].each(function(e){if(d.contains(e)){a=e
}});
["top","bottom"].each(function(e){if(d.contains(e)){c=e
}});
var b=new Element("div",{"class":this.options.handleClassName+" "+c+" "+a,title:(this.options.keepRatio?"Drag to resize":"Hold Shift to maintain aspect ratio"),tween:{duration:250,link:"cancel"},styles:{position:"absolute",height:this.options.handleSize,width:this.options.handleSize,fontSize:0},events:{mousedown:this.startResize.bind(this)}});
b.inject(this.resizer);
if(c=="top"){b.setStyle("top",-((this.options.handleSize+this.margin)/2).toInt())
}else{if(c=="bottom"){b.setStyle("bottom",-((this.options.handleSize+this.margin)/2).toInt())
}else{b.setStyles({top:"50%",marginTop:-(this.options.handleSize/2).toInt()})
}}if(a=="left"){b.setStyle("left",-((this.options.handleSize+this.margin)/2).toInt())
}else{if(a=="right"){b.setStyle("right",-((this.options.handleSize+this.margin)/2).toInt())
}else{b.setStyles({left:"50%",marginLeft:-(this.options.handleSize/2).toInt()})
}}},buildMask:function(){this.innermask=this.target.clone();
this.innermask.setProperties(this.target.getProperties("width","height"));
this.innermask.setStyles({position:"absolute",padding:0,margin:6,top:0,left:0,zIndex:4,opacity:0}).inject(this.wrapper);
this.outtermask=new Element("div",{"class":this.options.maskClassName,styles:{position:"absolute",padding:0,margin:6,top:0,left:0,width:this.target_coord.width,height:this.target_coord.height,zIndex:3,opacity:0},events:{click:this.moveToClick.bind(this)}}).inject(this.wrapper);
this.slide=new Fx.Elements($$(this.resizer,this.innermask,this.previewImage,this.toolBox),{onComplete:function(){this.drag.fireEvent("onDrag");
this.drag.fireEvent("onComplete")
}.bind(this)})
},buildToolBox:function(){this.toolBox=new Element("div",{"class":this.options.coordinatesClassName+(Browser.Engine.trident?" IE":""),styles:{position:"absolute",zIndex:5,opacity:0}}).inject($(document.body));
this.toolBoxOffesetLeft=0;
this.toolBoxOffesetTop=10;
if(this.options.coordinatesOpacity&&this.options.coordinatesOpacity<1){this.toolBox.set("tween",{duration:"short",link:"cancel"}).addEvents({mouseenter:function(){this.fade("in")
},mouseleave:function(){this.toolBox.fade(this.options.coordinatesOpacity)
}.bind(this)})
}this.toolBoxTopBar=new Element("div",{"class":"topbar",html:"=drag here=",styles:{position:"absolute",top:0,left:0,width:"100%"}}).inject(this.toolBox,"top");
new Drag(this.toolBox,{handle:this.toolBoxTopBar,onComplete:function(){var b=this.resizer.getCoordinates();
var a=this.toolBox.getCoordinates();
this.toolBoxOffesetLeft=a.left-b.left;
this.toolBoxOffesetTop=a.top-b.bottom
}.bind(this)})
},buildCoordinates:function(){this.topcoord=new Element("input",{type:"text"});
this.leftcoord=new Element("input",{type:"text"});
this.heightcoord=new Element("input",{type:"text"});
this.widthcoord=new Element("input",{type:"text"});
$$(this.topcoord,this.leftcoord,this.heightcoord,this.widthcoord).addEvent("change",this.updateFromInput.bind(this));
var b=new Element("label",{html:"x : "});
var a=new Element("label",{html:"y : "});
var c=new Element("label",{html:"w : "});
var d=new Element("label",{html:"h : "});
this.toolBox.adopt(b,this.leftcoord,a,this.topcoord,new Element("br"),c,this.widthcoord,d,this.heightcoord,new Element("br"))
},startResize:function(b){this.resizing=true;
var a=$(b.target);
if(b.shift&&!this.options.keepRatio){this.ratioOn()
}this.drag.addEvent("beforeStart",function(){this.drag.options.limit={x:[0,(this.rezr_coord.right-(this.mini.x/this.scaleRatio).toInt())],y:[0,(this.rezr_coord.bottom-(this.mini.y/this.scaleRatio).toInt())]}
}.bind(this));
if(a.hasClass("left")){this.resizeX.options.invert=true;
this.drag.options.modifiers.x="left";
this.resizeX.options.limit={x:[((this.mini.x/this.scaleRatio).toInt()-this.margin),(this.rezr_coord.right-this.margin)]};
this.resizeX.start(b)
}else{if(a.hasClass("right")||this.ratio){this.resizeX.options.invert=false;
this.drag.options.modifiers.x=false;
this.resizeX.options.limit={x:[((this.mini.x/this.scaleRatio).toInt()-this.margin),((this.target_coord.width-this.margin)-this.rezr_coord.left)]};
this.resizeX.start(b)
}else{this.drag.options.modifiers.x=false
}}if(a.hasClass("top")){this.resizeY.options.invert=true;
this.drag.options.modifiers.y="top";
this.resizeY.options.limit={y:[((this.mini.y/this.scaleRatio).toInt()-this.margin),(this.rezr_coord.bottom-this.margin)]};
this.resizeY.start(b)
}else{if(a.hasClass("bottom")||this.ratio){this.resizeY.options.invert=false;
this.drag.options.modifiers.y=false;
this.resizeY.options.limit={y:[((this.mini.y/this.scaleRatio).toInt()-this.margin),((this.target_coord.height-this.margin)-this.rezr_coord.top)]};
this.resizeY.start(b)
}else{this.drag.options.modifiers.y=false
}}},stopResize:function(){this.resizing=false;
this.drag.options.modifiers={x:"left",y:"top"};
this.drag.options.limit=false;
this.drag.removeEvents("beforeStart");
if(this.ratio){this.check();
this.onDrag();
if(!this.options.keepRatio){this.ratioOff()
}}},hideHandles:function(){if(!this.resizing){$$("."+this.options.handleClassName).fade("out")
}},showHandles:function(){if(!this.resizing){$$("."+this.options.handleClassName).fade("in")
}},onDrag:function(){this.updateMask();
this.top=((this.rezr_coord.top-this.target_coord.top)*this.scaleRatio).toInt();
this.left=((this.rezr_coord.left-this.target_coord.left)*this.scaleRatio).toInt();
this.width=Math.max((this.rezr_coord.width*this.scaleRatio).toInt(),this.mini.x);
this.height=Math.max((this.rezr_coord.height*this.scaleRatio).toInt(),this.mini.y);
this.updateCoordinates();
this.fireEvent("onPreview",[this.top,this.left,this.width,this.height])
},onDragRatio:function(){if(this.resizing){this.check()
}this.onDrag()
},check:function(){this.rezr_coord=this.resizer.getCoordinates(this.wrapper);
if(this.ratio>1){var b=(this.rezr_coord.height*this.ratio).toInt();
var a=this.rezr_coord.height;
this.resizer.setStyle("width",Math.min(b,this.target_coord.width-this.rezr_coord.left)-this.margin)
}else{var b=this.rezr_coord.width;
var a=(this.rezr_coord.width/this.ratio).toInt();
this.resizer.setStyle("height",Math.min(a,this.target_coord.height-this.rezr_coord.top)-this.margin)
}if(this.drag.options.modifiers.x){this.resizer.setStyle("left",Math.max(this.rezr_coord.right-b,0))
}if(this.drag.options.modifiers.y){this.resizer.setStyle("top",Math.max(this.rezr_coord.bottom-a,0))
}this.rezr_coord=this.resizer.getCoordinates(this.wrapper);
if(this.rezr_coord.right>=this.target_coord.width){this.resizer.setStyle("height",(this.rezr_coord.width/this.ratio).toInt()-this.margin)
}if(this.rezr_coord.bottom>=this.target_coord.height){this.resizer.setStyle("width",(this.rezr_coord.height*this.ratio).toInt()-this.margin)
}},updatePreview:function(d,c,b,a){if(a*this.previewSize.x/b<this.previewSize.y){this.preview.setStyles({width:this.previewSize.x,height:(this.previewSize.x*a/b).toInt()});
this.previewImage.setStyles({width:(this.target_coord.width*this.previewSize.x*this.scaleRatio/b).toInt(),height:"auto",top:-(d*this.previewSize.x/b).toInt(),left:-(c*this.previewSize.x/b).toInt()})
}else{this.preview.setStyles({height:this.previewSize.y,width:(this.previewSize.y*b/a).toInt()});
this.previewImage.setStyles({height:(this.target_coord.height*this.previewSize.y*this.scaleRatio/a).toInt(),width:"auto",top:-(d*this.previewSize.y/a).toInt(),left:-(c*this.previewSize.y/a).toInt()})
}},updateMask:function(){this.rezr_coord=this.resizer.getCoordinates(this.wrapper);
this.innermask.setStyle("clip","rect("+(this.rezr_coord.top-6)+"px "+(this.rezr_coord.right-6)+"px "+(this.rezr_coord.bottom-6)+"px "+(this.rezr_coord.left-6)+"px)")
},updateCoordinates:function(){if(this.options.coordinates){this.leftcoord.set("value",this.left);
this.topcoord.set("value",this.top);
this.widthcoord.set("value",this.width);
this.heightcoord.set("value",this.height)
}var a=this.resizer.getCoordinates();
this.toolBox.setStyles({top:a.bottom+this.toolBoxOffesetTop,left:a.left+this.toolBoxOffesetLeft})
},updateFromInput:function(f){var d=(this.topcoord.get("value").clean()/this.scaleRatio||0).toInt();
var c=(this.leftcoord.get("value").clean()/this.scaleRatio||0).toInt();
var a=(this.heightcoord.get("value").clean()/this.scaleRatio||0).toInt();
var b=(this.widthcoord.get("value").clean()/this.scaleRatio||0).toInt();
d=d.limit(0,this.target_coord.height-this.rezr_coord.height);
c=c.limit(0,this.target_coord.width-this.rezr_coord.width);
a=a.limit((this.mini.y/this.scaleRatio).toInt(),this.target_coord.height-this.rezr_coord.top);
b=b.limit((this.mini.x/this.scaleRatio).toInt(),this.target_coord.width-this.rezr_coord.left);
if(this.ratio){if($(f.target)==this.widthcoord){a=Math.min((b/this.ratio).toInt(),this.target_coord.height-this.rezr_coord.top);
b=(a*this.ratio).toInt()
}else{if($(f.target)==this.heightcoord){b=Math.min((a*this.ratio).toInt(),this.target_coord.width-this.rezr_coord.left);
a=(b/this.ratio).toInt()
}}}this.resizer.setStyles({height:a-this.margin,width:b-this.margin,top:d,left:c});
this.drag.fireEvent("drag");
this.drag.fireEvent("onComplete")
},moveToClick:function(i){var f=i.page.x;
var d=i.page.y;
var c=this.wrapper.getPosition();
var h=f-c.x;
var g=d-c.y;
var j=(g-(this.rezr_coord.height/2).toInt()).limit(0,this.target_coord.height-this.rezr_coord.height);
var b=(h-(this.rezr_coord.width/2).toInt()).limit(0,this.target_coord.width-this.rezr_coord.width);
var l=b+this.rezr_coord.width;
var a=j+this.rezr_coord.height;
var m={0:{top:j,left:b},1:{clip:[[this.rezr_coord.top,this.rezr_coord.right,this.rezr_coord.bottom,this.rezr_coord.left],[j,l,a,b]]}};
if(this.preview){var k=this.preview.getSize();
m[2]={top:-(j*k.y/(a-j)).toInt(),left:-(b*k.x/(l-b)).toInt()}
}if(this.toolBox){m[this.slide.elements.length-1]={top:a+c.y+this.toolBoxOffesetTop,left:b+c.x+this.toolBoxOffesetLeft}
}this.slide.start(m)
},expandToMax:function(){if(this.ratio){if(this.target_coord.width/this.target_coord.height<this.ratio){var f=((this.target_coord.height-(this.target_coord.width/this.ratio))/2).toInt();
var e=0;
var c=this.target_coord.width-this.margin;
var a=(this.target_coord.width/this.ratio).toInt()-this.margin
}else{var f=0;
var e=((this.target_coord.width-(this.target_coord.height*this.ratio))/2).toInt();
var c=(this.target_coord.height*this.ratio).toInt()-this.margin;
var a=this.target_coord.height-this.margin
}}else{var f=0;
var e=0;
var c=this.target_coord.width-this.margin;
var a=this.target_coord.height-this.margin;
if(this.preview){if(a*this.previewSize.x/c<this.previewSize.y){this.preview.setStyles({width:this.previewSize.x,height:(this.previewSize.x*a/c).toInt()})
}else{this.preview.setStyles({height:this.previewSize.y,width:(this.previewSize.y*c/a).toInt()})
}}}var b={0:{top:f,left:e,width:c,height:a},1:{clip:[[this.rezr_coord.top,this.rezr_coord.right,this.rezr_coord.bottom,this.rezr_coord.left],[f,e+c,a+f,e]]}};
if(this.preview){var h=this.previewImage.getCoordinates(this.preview);
h.bottom=null;
h.right=null;
this.previewImage.setStyles(h);
var g=this.preview.getSize();
b[2]={top:-(f*this.previewSize.y/a).toInt(),left:-(e*this.previewSize.x/c).toInt(),width:(this.target_coord.width*g.x*this.scaleRatio/c).toInt(),height:(this.target_coord.height*g.y*this.scaleRatio/a).toInt()}
}if(this.toolBox){var d=this.wrapper.getPosition();
b[this.slide.elements.length-1]={top:a+d.y+this.toolBoxOffesetTop,left:e+d.x+this.toolBoxOffesetLeft}
}this.slide.start(b)
},hide:function(){$$(this.resizer,this.innermask,this.outtermask,this.preview,this.toolBox).fade("out")
},show:function(){$$(this.resizer,this.innermask,this.preview).fade("in");
if(this.options.maskOpacity){this.outtermask.fade(this.options.maskOpacity)
}if(this.toolBox){this.toolBox.fade(this.options.coordinatesOpacity||"in")
}},toggle:function(){if(this.resizer.getStyle("opacity")==1){this.hide()
}else{this.show()
}},destroy:function(){this.hide();
this.target.setStyle("border",this.border);
(function(){this.target.replaces(this.wrapper);
if(this.previewWrapper){this.preview.empty().setStyles({height:0,width:0}).replaces(this.previewWrapper)
}this.fireEvent("onDestroy",this.target);
if(this.toolBox){this.toolBox.destroy()
}}).delay(600,this)
},ratioOn:function(){this.ratio=this.rezr_coord.width/this.rezr_coord.height;
this.drag.removeEvents("drag");
this.drag.addEvent("drag",this.onDragRatio.bind(this))
},ratioOff:function(){this.ratio=false;
this.drag.removeEvents("drag");
this.drag.addEvent("drag",this.onDrag.bind(this))
},changeImage:function(a){new Asset.image(a,{onload:function(b){this.hide();
this.target.get("tween").start("opacity",0).chain(function(){this.scaleRatio=b.get("width")/this.target_coord.width;
var c=(b.get("height")/this.scaleRatio).toInt();
this.wrapper.setStyle("height",c);
this.target.set({width:this.target_coord.width,height:c});
this.target_coord=this.target.getCoordinates(this.wrapper);
this.target.set("src",a);
if(this.target_coord.width<this.mini.x){this.mini.y=this.target_coord.width*this.mini.y/this.mini.x;
this.mini.x=this.target_coord.width
}if(this.target_coord.height<this.mini.y){this.mini.x=this.target_coord.height*this.mini.x/this.mini.y;
this.mini.y=this.target_coord.height
}this.resizer.setStyles({width:(this.mini.x/this.scaleRatio).toInt()-this.margin,height:(this.mini.y/this.scaleRatio).toInt()-this.margin,left:(this.target_coord.left+(this.target_coord.width/2)-(this.mini.x/2)).toInt(),top:(this.target_coord.top+(this.target_coord.height/2)-(this.mini.y/2)).toInt()});
this.innermask.setProperties(this.target.getProperties("width","height","src"));
this.outtermask.setStyle("height",this.target_coord.height);
if(this.previewImage){this.previewImage.set("src",a)
}this.drag.fireEvent("onDrag");
this.drag.fireEvent("onComplete");
this.show();
this.target.get("tween").start("opacity",1)
}.bind(this))
}.bind(this)})
},cropDownload:function(a){this.prepareParameters(a);
params=new Hash(this.params);
location.href=this.options.serverScriptDownload+"?"+params.toQueryString()
},cropSave:function(a){this.prepareParameters(a);
this.request=new Request.JSON({url:this.options.serverScriptSave,data:this.params,onSuccess:function(c,b){if(c){if(c.error){this.fireEvent("onCropFail",c.error)
}else{if(c.success){this.fireEvent("onCropSuccess",c.success)
}}}else{this.fireEvent("onCropFail",b)
}}.bind(this),onFailure:function(){this.fireEvent("onRequestFail")
}.bind(this)}).send()
},prepareParameters:function(b){var a={filename:this.target.get("src").split("/").getLast(),max_height:this.mini.y,max_width:this.mini.x,top:this.top,left:this.left,width:this.width,height:this.height};
this.addParameters(a);
this.addParameters(b)
},addParameters:function(a){if($type(a)=="object"){this.params=$merge(this.params,a)
}}});
var Observer=new Class({Implements:[Options,Events],options:{periodical:false,delay:1000},initialize:function(c,a,b){this.element=$(c)||$$(c);
this.addEvent("onFired",a);
this.setOptions(b);
this.bound=this.changed.bind(this);
this.resume()
},changed:function(){var a=this.element.get("value");
if($equals(this.value,a)){return
}this.clear();
this.value=a;
this.timeout=this.onFired.delay(this.options.delay,this)
},setValue:function(a){this.value=a;
this.element.set("value",a);
return this.clear()
},onFired:function(){this.fireEvent("onFired",[this.value,this.element])
},clear:function(){$clear(this.timeout||null);
return this
},pause:function(){if(this.timer){$clear(this.timer)
}else{this.element.removeEvent("keyup",this.bound)
}return this.clear()
},resume:function(){this.value=this.element.get("value");
if(this.options.periodical){this.timer=this.changed.periodical(this.options.periodical,this)
}else{this.element.addEvent("keyup",this.bound)
}return this
}});
var $equals=function(b,a){return(b==a||JSON.encode(b)==JSON.encode(a))
};
var Autocompleter=new Class({Implements:[Options,Events],options:{minLength:1,markQuery:true,width:"inherit",maxChoices:10,injectChoice:null,customChoices:null,emptyChoices:null,visibleChoices:true,className:"autocompleter-choices",zIndex:42,delay:400,observerOptions:{},fxOptions:{},autoSubmit:false,overflow:false,overflowMargin:25,selectFirst:false,filter:null,filterCase:false,filterSubset:false,forceSelect:false,selectMode:true,choicesMatch:null,multiple:false,separator:", ",separatorSplit:/\s*[,;]\s*/,autoTrim:false,allowDupes:false,cache:true,relative:false},initialize:function(b,a){this.element=$(b);
this.setOptions(a);
this.build();
this.observer=new Observer(this.element,this.prefetch.bind(this),$merge({delay:this.options.delay},this.options.observerOptions));
this.queryValue=null;
if(this.options.filter){this.filter=this.options.filter.bind(this)
}var c=this.options.selectMode;
this.typeAhead=(c=="type-ahead");
this.selectMode=(c===true)?"selection":c;
this.cached=[]
},build:function(){if($(this.options.customChoices)){this.choices=this.options.customChoices
}else{this.choices=new Element("ul",{"class":this.options.className,styles:{zIndex:this.options.zIndex}}).inject(document.body);
this.relative=false;
if(this.options.relative){this.choices.inject(this.element,"after");
this.relative=this.element.getOffsetParent()
}this.fix=new OverlayFix(this.choices)
}if(!this.options.separator.test(this.options.separatorSplit)){this.options.separatorSplit=this.options.separator
}this.fx=(!this.options.fxOptions)?null:new Fx.Tween(this.choices,$merge({property:"opacity",link:"cancel",duration:200},this.options.fxOptions)).addEvent("onStart",Chain.prototype.clearChain).set(0);
this.element.setProperty("autocomplete","off").addEvent((Browser.Engine.trident||Browser.Engine.webkit)?"keydown":"keypress",this.onCommand.bind(this)).addEvent("click",this.onCommand.bind(this,[false])).addEvent("focus",this.toggleFocus.create({bind:this,arguments:true,delay:100})).addEvent("blur",this.toggleFocus.create({bind:this,arguments:false,delay:100}))
},destroy:function(){if(this.fix){this.fix.destroy()
}this.choices=this.selected=this.choices.destroy()
},toggleFocus:function(a){this.focussed=a;
if(!a){this.hideChoices(true)
}this.fireEvent((a)?"onFocus":"onBlur",[this.element])
},onCommand:function(b){if(!b&&this.focussed){return this.prefetch()
}if(b&&b.key&&!b.shift){switch(b.key){case"enter":if(this.element.value!=this.opted){return true
}if(this.selected&&this.visible){this.choiceSelect(this.selected);
return !!(this.options.autoSubmit)
}break;
case"up":case"down":if(!this.prefetch()&&this.queryValue!==null){var a=(b.key=="up");
this.choiceOver((this.selected||this.choices)[(this.selected)?((a)?"getPrevious":"getNext"):((a)?"getLast":"getFirst")](this.options.choicesMatch),true)
}return false;
case"esc":case"tab":this.hideChoices(true);
break
}}return true
},setSelection:function(f){var g=this.selected.inputValue,h=g;
var a=this.queryValue.length,c=g.length;
if(g.substr(0,a).toLowerCase()!=this.queryValue.toLowerCase()){a=0
}if(this.options.multiple){var e=this.options.separatorSplit;
h=this.element.value;
a+=this.queryIndex;
c+=this.queryIndex;
var b=h.substr(this.queryIndex).split(e,1)[0];
h=h.substr(0,this.queryIndex)+g+h.substr(this.queryIndex+b.length);
if(f){var d=h.split(this.options.separatorSplit).filter(function(j){return this.test(j)
},/[^\s,]+/);
if(!this.options.allowDupes){d=[].combine(d)
}var i=this.options.separator;
h=d.join(i)+i;
c=h.length
}}this.observer.setValue(h);
this.opted=h;
if(f||this.selectMode=="pick"){a=c
}this.element.selectRange(a,c);
this.fireEvent("onSelection",[this.element,this.selected,h,g])
},showChoices:function(){var c=this.options.choicesMatch,b=this.choices.getFirst(c);
this.selected=this.selectedValue=null;
if(this.fix){var e=this.element.getCoordinates(this.relative),a=this.options.width||"auto";
this.choices.setStyles({left:e.left,top:e.bottom,width:(a===true||a=="inherit")?e.width:a})
}if(!b){return
}if(!this.visible){this.visible=true;
this.choices.setStyle("display","");
if(this.fx){this.fx.start(1)
}this.fireEvent("onShow",[this.element,this.choices])
}if(this.options.selectFirst||this.typeAhead||b.inputValue==this.queryValue){this.choiceOver(b,this.typeAhead)
}var d=this.choices.getChildren(c),f=this.options.maxChoices;
var i={overflowY:"hidden",height:""};
this.overflown=false;
if(d.length>f){var j=d[f-1];
i.overflowY="scroll";
i.height=j.getCoordinates(this.choices).bottom;
this.overflown=true
}this.choices.setStyles(i);
this.fix.show();
if(this.options.visibleChoices){var h=document.getScroll(),k=document.getSize(),g=this.choices.getCoordinates();
if(g.right>h.x+k.x){h.x=g.right-k.x
}if(g.bottom>h.y+k.y){h.y=g.bottom-k.y
}window.scrollTo(Math.min(h.x,g.left),Math.min(h.y,g.top))
}},hideChoices:function(a){if(a){var c=this.element.value;
if(this.options.forceSelect){c=this.opted
}if(this.options.autoTrim){c=c.split(this.options.separatorSplit).filter($arguments(0)).join(this.options.separator)
}this.observer.setValue(c)
}if(!this.visible){return
}this.visible=false;
if(this.selected){this.selected.removeClass("autocompleter-selected")
}this.observer.clear();
var b=function(){this.choices.setStyle("display","none");
this.fix.hide()
}.bind(this);
if(this.fx){this.fx.start(0).chain(b)
}else{b()
}this.fireEvent("onHide",[this.element,this.choices])
},prefetch:function(){var f=this.element.value,e=f;
if(this.options.multiple){var c=this.options.separatorSplit;
var a=f.split(c);
var b=this.element.getSelectedRange().start;
var g=f.substr(0,b).split(c);
var d=g.length-1;
b-=g[d].length;
e=a[d]
}if(e.length<this.options.minLength){this.hideChoices()
}else{if(e===this.queryValue||(this.visible&&e==this.selectedValue)){if(this.visible){return false
}this.showChoices()
}else{this.queryValue=e;
this.queryIndex=b;
if(!this.fetchCached()){this.query()
}}}return true
},fetchCached:function(){return false;
if(!this.options.cache||!this.cached||!this.cached.length||this.cached.length>=this.options.maxChoices||this.queryValue){return false
}this.update(this.filter(this.cached));
return true
},update:function(b){this.choices.empty();
this.cached=b;
var a=b&&$type(b);
if(!a||(a=="array"&&!b.length)||(a=="hash"&&!b.getLength())){(this.options.emptyChoices||this.hideChoices).call(this)
}else{if(this.options.maxChoices<b.length&&!this.options.overflow){b.length=this.options.maxChoices
}b.each(this.options.injectChoice||function(d){var c=new Element("li",{html:this.markQueryValue(d)});
c.inputValue=d;
this.addChoiceEvents(c).inject(this.choices)
},this);
this.showChoices()
}},choiceOver:function(c,d){if(!c||c==this.selected){return
}if(this.selected){this.selected.removeClass("autocompleter-selected")
}this.selected=c.addClass("autocompleter-selected");
this.fireEvent("onSelect",[this.element,this.selected,d]);
if(!this.selectMode){this.opted=this.element.value
}if(!d){return
}this.selectedValue=this.selected.inputValue;
if(this.overflown){var f=this.selected.getCoordinates(this.choices),e=this.options.overflowMargin,g=this.choices.scrollTop,a=this.choices.offsetHeight,b=g+a;
if(f.top-e<g&&g){this.choices.scrollTop=Math.max(f.top-e,0)
}else{if(f.bottom+e>b){this.choices.scrollTop=Math.min(f.bottom-a+e,b)
}}}if(this.selectMode){this.setSelection()
}},choiceSelect:function(a){if(a){this.choiceOver(a)
}this.setSelection(true);
this.queryValue=false;
this.hideChoices()
},filter:function(a){return(a||this.tokens).filter(function(b){return this.test(b)
},new RegExp(((this.options.filterSubset)?"":"^")+this.queryValue.escapeRegExp(),(this.options.filterCase)?"":"i"))
},markQueryValue:function(a){return(!this.options.markQuery||!this.queryValue)?a:a.replace(new RegExp("("+((this.options.filterSubset)?"":"^")+this.queryValue.escapeRegExp()+")",(this.options.filterCase)?"":"i"),'<span class="autocompleter-queried">$1</span>')
},addChoiceEvents:function(a){return a.addEvents({mouseover:this.choiceOver.bind(this,[a]),click:this.choiceSelect.bind(this,[a])})
}});
var OverlayFix=new Class({initialize:function(a){if(Browser.Engine.trident){this.element=$(a);
this.relative=this.element.getOffsetParent();
this.fix=new Element("iframe",{frameborder:"0",scrolling:"no",src:"javascript:false;",styles:{position:"absolute",border:"none",display:"none",filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}}).inject(this.element,"after")
}},show:function(){if(this.fix){var a=this.element.getCoordinates(this.relative);
delete a.right;
delete a.bottom;
this.fix.setStyles($extend(a,{display:"",zIndex:(this.element.getStyle("zIndex")||1)-1}))
}return this
},hide:function(){if(this.fix){this.fix.setStyle("display","none")
}return this
},destroy:function(){if(this.fix){this.fix=this.fix.destroy()
}}});
Element.implement({getSelectedRange:function(){if(!Browser.Engine.trident){return{start:this.selectionStart,end:this.selectionEnd}
}var e={start:0,end:0};
var a=this.getDocument().selection.createRange();
if(!a||a.parentElement()!=this){return e
}var c=a.duplicate();
if(this.type=="text"){e.start=0-c.moveStart("character",-100000);
e.end=e.start+a.text.length
}else{var b=this.value;
var d=b.length-b.match(/[\n\r]*$/)[0].length;
c.moveToElementText(this);
c.setEndPoint("StartToEnd",a);
e.end=d-c.text.length;
c.setEndPoint("StartToStart",a);
e.start=d-c.text.length
}return e
},selectRange:function(d,a){if(Browser.Engine.trident){var c=this.value.substr(d,a-d).replace(/\r/g,"").length;
d=this.value.substr(0,d).replace(/\r/g,"").length;
var b=this.createTextRange();
b.collapse(true);
b.moveEnd("character",d+c);
b.moveStart("character",d);
b.select()
}else{this.focus();
this.setSelectionRange(d,a)
}return this
}});
Autocompleter.Base=Autocompleter;
Autocompleter.Local=new Class({Extends:Autocompleter,options:{minLength:0,delay:200},initialize:function(b,c,a){this.parent(b,a);
this.tokens=c
},query:function(){this.update(this.filter())
}});
var swfobject=function(){var aq="undefined",aD="object",ab="Shockwave Flash",X="ShockwaveFlash.ShockwaveFlash",aE="application/x-shockwave-flash",ac="SWFObjectExprInst",ax="onreadystatechange",af=window,aL=document,aB=navigator,aa=false,Z=[aN],aG=[],ag=[],al=[],aJ,ad,ap,at,ak=false,aU=false,aH,an,aI=true,ah=function(){var a=typeof aL.getElementById!=aq&&typeof aL.getElementsByTagName!=aq&&typeof aL.createElement!=aq,e=aB.userAgent.toLowerCase(),c=aB.platform.toLowerCase(),h=c?/win/.test(c):/win/.test(e),j=c?/mac/.test(c):/mac/.test(e),g=/webkit/.test(e)?parseFloat(e.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,d=!+"\v1",f=[0,0,0],k=null;
if(typeof aB.plugins!=aq&&typeof aB.plugins[ab]==aD){k=aB.plugins[ab].description;
if(k&&!(typeof aB.mimeTypes!=aq&&aB.mimeTypes[aE]&&!aB.mimeTypes[aE].enabledPlugin)){aa=true;
d=false;
k=k.replace(/^.*\s+(\S+\s+\S+$)/,"$1");
f[0]=parseInt(k.replace(/^(.*)\..*$/,"$1"),10);
f[1]=parseInt(k.replace(/^.*\.(.*)\s.*$/,"$1"),10);
f[2]=/[a-zA-Z]/.test(k)?parseInt(k.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0
}}else{if(typeof af.ActiveXObject!=aq){try{var i=new ActiveXObject(X);
if(i){k=i.GetVariable("$version");
if(k){d=true;
k=k.split(" ")[1].split(",");
f=[parseInt(k[0],10),parseInt(k[1],10),parseInt(k[2],10)]
}}}catch(b){}}}return{w3:a,pv:f,wk:g,ie:d,win:h,mac:j}
}(),aK=function(){if(!ah.w3){return
}if((typeof aL.readyState!=aq&&aL.readyState=="complete")||(typeof aL.readyState==aq&&(aL.getElementsByTagName("body")[0]||aL.body))){aP()
}if(!ak){if(typeof aL.addEventListener!=aq){aL.addEventListener("DOMContentLoaded",aP,false)
}if(ah.ie&&ah.win){aL.attachEvent(ax,function(){if(aL.readyState=="complete"){aL.detachEvent(ax,arguments.callee);
aP()
}});
if(af==top){(function(){if(ak){return
}try{aL.documentElement.doScroll("left")
}catch(a){setTimeout(arguments.callee,0);
return
}aP()
})()
}}if(ah.wk){(function(){if(ak){return
}if(!/loaded|complete/.test(aL.readyState)){setTimeout(arguments.callee,0);
return
}aP()
})()
}aC(aP)
}}();
function aP(){if(ak){return
}try{var b=aL.getElementsByTagName("body")[0].appendChild(ar("span"));
b.parentNode.removeChild(b)
}catch(a){return
}ak=true;
var d=Z.length;
for(var c=0;
c<d;
c++){Z[c]()
}}function aj(a){if(ak){a()
}else{Z[Z.length]=a
}}function aC(a){if(typeof af.addEventListener!=aq){af.addEventListener("load",a,false)
}else{if(typeof aL.addEventListener!=aq){aL.addEventListener("load",a,false)
}else{if(typeof af.attachEvent!=aq){aM(af,"onload",a)
}else{if(typeof af.onload=="function"){var b=af.onload;
af.onload=function(){b();
a()
}
}else{af.onload=a
}}}}}function aN(){if(aa){Y()
}else{am()
}}function Y(){var d=aL.getElementsByTagName("body")[0];
var b=ar(aD);
b.setAttribute("type",aE);
var a=d.appendChild(b);
if(a){var c=0;
(function(){if(typeof a.GetVariable!=aq){var e=a.GetVariable("$version");
if(e){e=e.split(" ")[1].split(",");
ah.pv=[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10)]
}}else{if(c<10){c++;
setTimeout(arguments.callee,10);
return
}}d.removeChild(b);
a=null;
am()
})()
}else{am()
}}function am(){var g=aG.length;
if(g>0){for(var h=0;
h<g;
h++){var c=aG[h].id;
var l=aG[h].callbackFn;
var a={success:false,id:c};
if(ah.pv[0]>0){var i=aS(c);
if(i){if(ao(aG[h].swfVersion)&&!(ah.wk&&ah.wk<312)){ay(c,true);
if(l){a.success=true;
a.ref=av(c);
l(a)
}}else{if(aG[h].expressInstall&&au()){var e={};
e.data=aG[h].expressInstall;
e.width=i.getAttribute("width")||"0";
e.height=i.getAttribute("height")||"0";
if(i.getAttribute("class")){e.styleclass=i.getAttribute("class")
}if(i.getAttribute("align")){e.align=i.getAttribute("align")
}var f={};
var d=i.getElementsByTagName("param");
var k=d.length;
for(var j=0;
j<k;
j++){if(d[j].getAttribute("name").toLowerCase()!="movie"){f[d[j].getAttribute("name")]=d[j].getAttribute("value")
}}ae(e,f,c,l)
}else{aF(i);
if(l){l(a)
}}}}}else{ay(c,true);
if(l){var b=av(c);
if(b&&typeof b.SetVariable!=aq){a.success=true;
a.ref=b
}l(a)
}}}}}function av(b){var d=null;
var c=aS(b);
if(c&&c.nodeName=="OBJECT"){if(typeof c.SetVariable!=aq){d=c
}else{var a=c.getElementsByTagName(aD)[0];
if(a){d=a
}}}return d
}function au(){return !aU&&ao("6.0.65")&&(ah.win||ah.mac)&&!(ah.wk&&ah.wk<312)
}function ae(f,d,h,e){aU=true;
ap=e||null;
at={success:false,id:h};
var a=aS(h);
if(a){if(a.nodeName=="OBJECT"){aJ=aO(a);
ad=null
}else{aJ=a;
ad=h
}f.id=ac;
if(typeof f.width==aq||(!/%$/.test(f.width)&&parseInt(f.width,10)<310)){f.width="310"
}if(typeof f.height==aq||(!/%$/.test(f.height)&&parseInt(f.height,10)<137)){f.height="137"
}aL.title=aL.title.slice(0,47)+" - Flash Player Installation";
var b=ah.ie&&ah.win?"ActiveX":"PlugIn",c="MMredirectURL="+af.location.toString().replace(/&/g,"%26")+"&MMplayerType="+b+"&MMdoctitle="+aL.title;
if(typeof d.flashvars!=aq){d.flashvars+="&"+c
}else{d.flashvars=c
}if(ah.ie&&ah.win&&a.readyState!=4){var g=ar("div");
h+="SWFObjectNew";
g.setAttribute("id",h);
a.parentNode.insertBefore(g,a);
a.style.display="none";
(function(){if(a.readyState==4){a.parentNode.removeChild(a)
}else{setTimeout(arguments.callee,10)
}})()
}aA(f,d,h)
}}function aF(a){if(ah.ie&&ah.win&&a.readyState!=4){var b=ar("div");
a.parentNode.insertBefore(b,a);
b.parentNode.replaceChild(aO(a),b);
a.style.display="none";
(function(){if(a.readyState==4){a.parentNode.removeChild(a)
}else{setTimeout(arguments.callee,10)
}})()
}else{a.parentNode.replaceChild(aO(a),a)
}}function aO(b){var d=ar("div");
if(ah.win&&ah.ie){d.innerHTML=b.innerHTML
}else{var e=b.getElementsByTagName(aD)[0];
if(e){var a=e.childNodes;
if(a){var f=a.length;
for(var c=0;
c<f;
c++){if(!(a[c].nodeType==1&&a[c].nodeName=="PARAM")&&!(a[c].nodeType==8)){d.appendChild(a[c].cloneNode(true))
}}}}}return d
}function aA(e,g,c){var d,a=aS(c);
if(ah.wk&&ah.wk<312){return d
}if(a){if(typeof e.id==aq){e.id=c
}if(ah.ie&&ah.win){var f="";
for(var i in e){if(e[i]!=Object.prototype[i]){if(i.toLowerCase()=="data"){g.movie=e[i]
}else{if(i.toLowerCase()=="styleclass"){f+=' class="'+e[i]+'"'
}else{if(i.toLowerCase()!="classid"){f+=" "+i+'="'+e[i]+'"'
}}}}}var h="";
for(var j in g){if(g[j]!=Object.prototype[j]){h+='<param name="'+j+'" value="'+g[j]+'" />'
}}a.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+f+">"+h+"</object>";
ag[ag.length]=e.id;
d=aS(e.id)
}else{var b=ar(aD);
b.setAttribute("type",aE);
for(var k in e){if(e[k]!=Object.prototype[k]){if(k.toLowerCase()=="styleclass"){b.setAttribute("class",e[k])
}else{if(k.toLowerCase()!="classid"){b.setAttribute(k,e[k])
}}}}for(var l in g){if(g[l]!=Object.prototype[l]&&l.toLowerCase()!="movie"){aQ(b,l,g[l])
}}a.parentNode.replaceChild(b,a);
d=b
}}return d
}function aQ(b,d,c){var a=ar("param");
a.setAttribute("name",d);
a.setAttribute("value",c);
b.appendChild(a)
}function aw(a){var b=aS(a);
if(b&&b.nodeName=="OBJECT"){if(ah.ie&&ah.win){b.style.display="none";
(function(){if(b.readyState==4){aT(a)
}else{setTimeout(arguments.callee,10)
}})()
}else{b.parentNode.removeChild(b)
}}}function aT(a){var b=aS(a);
if(b){for(var c in b){if(typeof b[c]=="function"){b[c]=null
}}b.parentNode.removeChild(b)
}}function aS(a){var c=null;
try{c=aL.getElementById(a)
}catch(b){}return c
}function ar(a){return aL.createElement(a)
}function aM(a,c,b){a.attachEvent(c,b);
al[al.length]=[a,c,b]
}function ao(a){var b=ah.pv,c=a.split(".");
c[0]=parseInt(c[0],10);
c[1]=parseInt(c[1],10)||0;
c[2]=parseInt(c[2],10)||0;
return(b[0]>c[0]||(b[0]==c[0]&&b[1]>c[1])||(b[0]==c[0]&&b[1]==c[1]&&b[2]>=c[2]))?true:false
}function az(b,f,a,c){if(ah.ie&&ah.mac){return
}var e=aL.getElementsByTagName("head")[0];
if(!e){return
}var g=(a&&typeof a=="string")?a:"screen";
if(c){aH=null;
an=null
}if(!aH||an!=g){var d=ar("style");
d.setAttribute("type","text/css");
d.setAttribute("media",g);
aH=e.appendChild(d);
if(ah.ie&&ah.win&&typeof aL.styleSheets!=aq&&aL.styleSheets.length>0){aH=aL.styleSheets[aL.styleSheets.length-1]
}an=g
}if(ah.ie&&ah.win){if(aH&&typeof aH.addRule==aD){aH.addRule(b,f)
}}else{if(aH&&typeof aL.createTextNode!=aq){aH.appendChild(aL.createTextNode(b+" {"+f+"}"))
}}}function ay(a,c){if(!aI){return
}var b=c?"visible":"hidden";
if(ak&&aS(a)){aS(a).style.visibility=b
}else{az("#"+a,"visibility:"+b)
}}function ai(b){var a=/[\\\"<>\.;]/;
var c=a.exec(b)!=null;
return c&&typeof encodeURIComponent!=aq?encodeURIComponent(b):b
}var aR=function(){if(ah.ie&&ah.win){window.attachEvent("onunload",function(){var a=al.length;
for(var b=0;
b<a;
b++){al[b][0].detachEvent(al[b][1],al[b][2])
}var d=ag.length;
for(var c=0;
c<d;
c++){aw(ag[c])
}for(var e in ah){ah[e]=null
}ah=null;
for(var f in swfobject){swfobject[f]=null
}swfobject=null
})
}}();
return{registerObject:function(a,e,c,b){if(ah.w3&&a&&e){var d={};
d.id=a;
d.swfVersion=e;
d.expressInstall=c;
d.callbackFn=b;
aG[aG.length]=d;
ay(a,false)
}else{if(b){b({success:false,id:a})
}}},getObjectById:function(a){if(ah.w3){return av(a)
}},embedSWF:function(k,e,h,f,c,a,b,i,g,j){var d={success:false,id:e};
if(ah.w3&&!(ah.wk&&ah.wk<312)&&k&&e&&h&&f&&c){ay(e,false);
aj(function(){h+="";
f+="";
var q={};
if(g&&typeof g===aD){for(var o in g){q[o]=g[o]
}}q.data=k;
q.width=h;
q.height=f;
var n={};
if(i&&typeof i===aD){for(var p in i){n[p]=i[p]
}}if(b&&typeof b===aD){for(var l in b){if(typeof n.flashvars!=aq){n.flashvars+="&"+l+"="+b[l]
}else{n.flashvars=l+"="+b[l]
}}}if(ao(c)){var m=aA(q,n,e);
if(q.id==e){ay(e,true)
}d.success=true;
d.ref=m
}else{if(a&&au()){q.data=a;
ae(q,n,e,j);
return
}else{ay(e,true)
}}if(j){j(d)
}})
}else{if(j){j(d)
}}},switchOffAutoHideShow:function(){aI=false
},ua:ah,getFlashPlayerVersion:function(){return{major:ah.pv[0],minor:ah.pv[1],release:ah.pv[2]}
},hasFlashPlayerVersion:ao,createSWF:function(a,b,c){if(ah.w3){return aA(a,b,c)
}else{return undefined
}},showExpressInstall:function(b,a,d,c){if(ah.w3&&au()){ae(b,a,d,c)
}},removeSWF:function(a){if(ah.w3){aw(a)
}},createCSS:function(b,a,c,d){if(ah.w3){az(b,a,c,d)
}},addDomLoadEvent:aj,addLoadEvent:aC,getQueryParamValue:function(b){var a=aL.location.search||aL.location.hash;
if(a){if(/\?/.test(a)){a=a.split("?")[1]
}if(b==null){return ai(a)
}var c=a.split("&");
for(var d=0;
d<c.length;
d++){if(c[d].substring(0,c[d].indexOf("="))==b){return ai(c[d].substring((c[d].indexOf("=")+1)))
}}}return""
},expressInstallCallback:function(){if(aU){var a=aS(ac);
if(a&&aJ){a.parentNode.replaceChild(aJ,a);
if(ad){ay(ad,true);
if(ah.ie&&ah.win){aJ.style.display="block"
}}if(ap){ap(at)
}}aU=false
}}}
}();