AJS={BASE_URL:"",drag_obj:null,drag_elm:null,_drop_zones:[],_cur_pos:null,join:function(_1,_2){
try{
return _2.join(_1);
}
catch(e){
var r=_2[0]||"";
AJS.map(_2,function(_4){
r+=_1+_4;
},1);
return r+"";
}
},getScrollTop:function(){
var t;
if(document.documentElement&&document.documentElement.scrollTop){
t=document.documentElement.scrollTop;
}else{
if(document.body){
t=document.body.scrollTop;
}
}
return t;
},addClass:function(){
var _6=AJS.forceArray(arguments);
var _7=_6.pop();
var _8=function(o){
if(!new RegExp("(^|\\s)"+_7+"(\\s|$)").test(o.className)){
o.className+=(o.className?" ":"")+_7;
}
};
AJS.map(_6,function(_a){
_8(_a);
});
},setStyle:function(){
var _b=AJS.forceArray(arguments);
var _c=_b.pop();
var _d=_b.pop();
AJS.map(_b,function(_e){
_e.style[_d]=AJS.getCssDim(_c);
});
},_getRealScope:function(fn,_10,_11,_12){
var _13=window;
_10=AJS.$A(_10);
if(fn._cscope){
_13=fn._cscope;
}
return function(){
var _14=[];
var i=0;
if(_11){
i=1;
}
AJS.map(arguments,function(arg){
_14.push(arg);
},i);
_14=_14.concat(_10);
if(_12){
_14=_14.reverse();
}
return fn.apply(_13,_14);
};
},preloadImages:function(){
AJS.AEV(window,"load",AJS.$p(function(_17){
AJS.map(_17,function(src){
var pic=new Image();
pic.src=src;
});
},arguments));
},_createDomShortcuts:function(){
var _1a=["ul","li","td","tr","th","tbody","table","input","span","b","a","div","img","button","h1","h2","h3","br","textarea","form","p","select","option","iframe","script","center","dl","dt","dd","small","pre"];
var _1b=function(elm){
var _1d="return AJS.createDOM.apply(null, ['"+elm+"', arguments]);";
var _1e="function() { "+_1d+"    }";
eval("AJS."+elm.toUpperCase()+"="+_1e);
};
AJS.map(_1a,_1b);
AJS.TN=function(_1f){
return document.createTextNode(_1f);
};
},documentInsert:function(elm){
if(typeof (elm)=="string"){
elm=AJS.HTML2DOM(elm);
}
document.write("<span id=\"dummy_holder\"></span>");
AJS.swapDOM(AJS.$("dummy_holder"),elm);
},getWindowSize:function(doc){
doc=doc||document;
var _22,_23;
if(self.innerHeight){
_22=self.innerWidth;
_23=self.innerHeight;
}else{
if(doc.documentElement&&doc.documentElement.clientHeight){
_22=doc.documentElement.clientWidth;
_23=doc.documentElement.clientHeight;
}else{
if(doc.body){
_22=doc.body.clientWidth;
_23=doc.body.clientHeight;
}
}
}
return {"w":_22,"h":_23};
},flattenList:function(_24){
var r=[];
var _26=function(r,l){
AJS.map(l,function(o){
if(o==null){
}else{
if(AJS.isArray(o)){
_26(r,o);
}else{
r.push(o);
}
}
});
};
_26(r,_24);
return r;
},setEventKey:function(e){
e.key=e.keyCode?e.keyCode:e.charCode;
if(window.event){
e.ctrl=window.event.ctrlKey;
e.shift=window.event.shiftKey;
}else{
e.ctrl=e.ctrlKey;
e.shift=e.shiftKey;
}
switch(e.key){
case 63232:
e.key=38;
break;
case 63233:
e.key=40;
break;
case 63235:
e.key=39;
break;
case 63234:
e.key=37;
break;
}
},removeElement:function(){
var _2b=AJS.forceArray(arguments);
AJS.map(_2b,function(elm){
AJS.swapDOM(elm,null);
});
},_unloadListeners:function(){
if(AJS.listeners){
AJS.map(AJS.listeners,function(elm,_2e,fn){
AJS.REV(elm,_2e,fn);
});
}
AJS.listeners=[];
},partial:function(fn){
var _31=AJS.forceArray(arguments);
return AJS.$b(fn,null,_31.slice(1,_31.length).reverse(),false,true);
},getIndex:function(elm,_33,_34){
for(var i=0;i<_33.length;i++){
if(_34&&_34(_33[i])||elm==_33[i]){
return i;
}
}
return -1;
},isDefined:function(o){
return (o!="undefined"&&o!=null);
},isArray:function(obj){
return obj instanceof Array;
},setLeft:function(){
var _38=AJS.forceArray(arguments);
_38.splice(_38.length-1,0,"left");
AJS.setStyle.apply(null,_38);
},appendChildNodes:function(elm){
if(arguments.length>=2){
AJS.map(arguments,function(n){
if(AJS.isString(n)){
n=AJS.TN(n);
}
if(AJS.isDefined(n)){
elm.appendChild(n);
}
},1);
}
return elm;
},isOpera:function(){
return (navigator.userAgent.toLowerCase().indexOf("opera")!=-1);
},isString:function(obj){
return (typeof obj=="string");
},hideElement:function(elm){
var _3d=AJS.forceArray(arguments);
AJS.map(_3d,function(elm){
elm.style.display="none";
});
},setOpacity:function(elm,p){
elm.style.opacity=p;
elm.style.filter="alpha(opacity="+p*100+")";
},setHeight:function(){
var _41=AJS.forceArray(arguments);
_41.splice(_41.length-1,0,"height");
AJS.setStyle.apply(null,_41);
},setWidth:function(){
var _42=AJS.forceArray(arguments);
_42.splice(_42.length-1,0,"width");
AJS.setStyle.apply(null,_42);
},createArray:function(v){
if(AJS.isArray(v)&&!AJS.isString(v)){
return v;
}else{
if(!v){
return [];
}else{
return [v];
}
}
},isDict:function(o){
var _45=String(o);
return _45.indexOf(" Object")!=-1;
},isMozilla:function(){
return (navigator.userAgent.toLowerCase().indexOf("gecko")!=-1&&navigator.productSub>=20030210);
},_listenOnce:function(elm,_47,fn){
var _49=function(){
AJS.removeEventListener(elm,_47,_49);
fn(arguments);
};
return _49;
},addEventListener:function(elm,_4b,fn,_4d,_4e){
if(!_4e){
_4e=false;
}
var _4f=AJS.$A(elm);
AJS.map(_4f,function(_50){
if(_4d){
fn=AJS._listenOnce(_50,_4b,fn);
}
if(AJS.isIn(_4b,["submit","load","scroll","resize"])){
var old=elm["on"+_4b];
elm["on"+_4b]=function(){
if(old){
fn(arguments);
return old(arguments);
}else{
return fn(arguments);
}
};
return;
}
if(AJS.isIn(_4b,["keypress","keydown","keyup","click"])){
var _52=fn;
fn=function(e){
AJS.setEventKey(e);
return _52.apply(null,arguments);
};
}
if(_50.attachEvent){
_50.attachEvent("on"+_4b,fn);
}else{
if(_50.addEventListener){
_50.addEventListener(_4b,fn,_4e);
}
}
AJS.listeners=AJS.$A(AJS.listeners);
AJS.listeners.push([_50,_4b,fn]);
});
},createDOM:function(_54,_55){
var i=0,_57;
elm=document.createElement(_54);
if(AJS.isDict(_55[i])){
for(k in _55[0]){
_57=_55[0][k];
if(k=="style"){
elm.style.cssText=_57;
}else{
if(k=="class"||k=="className"){
elm.className=_57;
}else{
elm.setAttribute(k,_57);
}
}
}
i++;
}
if(_55[0]==null){
i=1;
}
AJS.map(_55,function(n){
if(n){
if(AJS.isString(n)||AJS.isNumber(n)){
n=AJS.TN(n);
}
elm.appendChild(n);
}
},i);
return elm;
},setTop:function(){
var _59=AJS.forceArray(arguments);
_59.splice(_59.length-1,0,"top");
AJS.setStyle.apply(null,_59);
},getElementsByTagAndClassName:function(_5a,_5b,_5c){
var _5d=[];
if(!AJS.isDefined(_5c)){
_5c=document;
}
if(!AJS.isDefined(_5a)){
_5a="*";
}
var els=_5c.getElementsByTagName(_5a);
var _5f=els.length;
var _60=new RegExp("(^|\\s)"+_5b+"(\\s|$)");
for(i=0,j=0;i<_5f;i++){
if(_60.test(els[i].className)||_5b==null){
_5d[j]=els[i];
j++;
}
}
return _5d;
},removeClass:function(){
var _61=AJS.forceArray(arguments);
var cls=_61.pop();
var _63=function(o){
o.className=o.className.replace(new RegExp("\\s?"+cls,"g"),"");
};
AJS.map(_61,function(elm){
_63(elm);
});
},bindMethods:function(_66){
for(var k in _66){
var _68=_66[k];
if(typeof (_68)=="function"){
_66[k]=AJS.$b(_68,_66);
}
}
},log:function(o){
if(AJS.isMozilla()){
console.log(o);
}else{
var div=AJS.DIV({"style":"color: green"});
AJS.ACN(AJS.getBody(),AJS.setHTML(div,""+o));
}
},isNumber:function(obj){
return (typeof obj=="number");
},map:function(_6c,fn,_6e,_6f){
var i=0,l=_6c.length;
if(_6e){
i=_6e;
}
if(_6f){
l=_6f;
}
for(i;i<l;i++){
fn.apply(null,[_6c[i],i]);
}
},removeEventListener:function(elm,_73,fn,_75){
if(!_75){
_75=false;
}
if(elm.removeEventListener){
elm.removeEventListener(_73,fn,_75);
if(AJS.isOpera()){
elm.removeEventListener(_73,fn,!_75);
}
}else{
if(elm.detachEvent){
elm.detachEvent("on"+_73,fn);
}
}
},getCssDim:function(dim){
if(AJS.isString(dim)){
return dim;
}else{
return dim+"px";
}
},setHTML:function(elm,_78){
elm.innerHTML=_78;
return elm;
},bind:function(fn,_7a,_7b,_7c,_7d){
fn._cscope=_7a;
return AJS._getRealScope(fn,_7b,_7c,_7d);
},forceArray:function(_7e){
var r=[];
AJS.map(_7e,function(elm){
r.push(elm);
});
return r;
},update:function(l1,l2){
for(var i in l2){
l1[i]=l2[i];
}
return l1;
},getBody:function(){
return AJS.$bytc("body")[0];
},HTML2DOM:function(_84,_85){
var d=AJS.DIV();
d.innerHTML=_84;
if(_85){
return d.childNodes[0];
}else{
return d;
}
},getElement:function(id){
if(AJS.isString(id)||AJS.isNumber(id)){
return document.getElementById(id);
}else{
return id;
}
},showElement:function(){
var _88=AJS.forceArray(arguments);
AJS.map(_88,function(elm){
elm.style.display="";
});
},swapDOM:function(_8a,src){
_8a=AJS.getElement(_8a);
var _8c=_8a.parentNode;
if(src){
src=AJS.getElement(src);
_8c.replaceChild(src,_8a);
}else{
_8c.removeChild(_8a);
}
return src;
},isIn:function(elm,_8e){
var i=AJS.getIndex(elm,_8e);
if(i!=-1){
return true;
}else{
return false;
}
}};
AJS.$=AJS.getElement;
AJS.$$=AJS.getElements;
AJS.$f=AJS.getFormElement;
AJS.$p=AJS.partial;
AJS.$b=AJS.bind;
AJS.$A=AJS.createArray;
AJS.DI=AJS.documentInsert;
AJS.ACN=AJS.appendChildNodes;
AJS.RCN=AJS.replaceChildNodes;
AJS.AEV=AJS.addEventListener;
AJS.REV=AJS.removeEventListener;
AJS.$bytc=AJS.getElementsByTagAndClassName;
AJS.addEventListener(window,"unload",AJS._unloadListeners);
AJS._createDomShortcuts();
AJS.Class=function(_90){
var fn=function(){
if(arguments[0]!="no_init"){
return this.init.apply(this,arguments);
}
};
fn.prototype=_90;
AJS.update(fn,AJS.Class.prototype);
return fn;
};
AJS.Class.prototype={extend:function(_92){
var _93=new this("no_init");
for(k in _92){
var _94=_93[k];
var cur=_92[k];
if(_94&&_94!=cur&&typeof cur=="function"){
cur=this._parentize(cur,_94);
}
_93[k]=cur;
}
return new AJS.Class(_93);
},implement:function(_96){
AJS.update(this.prototype,_96);
},_parentize:function(cur,_98){
return function(){
this.parent=_98;
return cur.apply(this,arguments);
};
}};
AJS.$=AJS.getElement;
AJS.$$=AJS.getElements;
AJS.$f=AJS.getFormElement;
AJS.$b=AJS.bind;
AJS.$p=AJS.partial;
AJS.$FA=AJS.forceArray;
AJS.$A=AJS.createArray;
AJS.DI=AJS.documentInsert;
AJS.ACN=AJS.appendChildNodes;
AJS.RCN=AJS.replaceChildNodes;
AJS.AEV=AJS.addEventListener;
AJS.REV=AJS.removeEventListener;
AJS.$bytc=AJS.getElementsByTagAndClassName;
AJSDeferred=function(req){
this.callbacks=[];
this.errbacks=[];
this.req=req;
};
AJSDeferred.prototype={excCallbackSeq:function(req,_9b){
var _9c=req.responseText;
while(_9b.length>0){
var fn=_9b.pop();
var _9e=fn(_9c,req);
if(_9e){
_9c=_9e;
}
}
},callback:function(){
this.excCallbackSeq(this.req,this.callbacks);
},errback:function(){
if(this.errbacks.length==0){
alert("Error encountered:\n"+this.req.responseText);
}
this.excCallbackSeq(this.req,this.errbacks);
},addErrback:function(fn){
this.errbacks.unshift(fn);
},addCallback:function(fn){
this.callbacks.unshift(fn);
},addCallbacks:function(fn1,fn2){
this.addCallback(fn1);
this.addErrback(fn2);
},sendReq:function(_a3){
if(AJS.isObject(_a3)){
this.req.send(AJS.queryArguments(_a3));
}else{
if(AJS.isDefined(_a3)){
this.req.send(_a3);
}else{
this.req.send("");
}
}
}};
script_loaded=true;
script_loaded=true;
AJS.fx={_shades:{0:"ffffff",1:"ffffee",2:"ffffdd",3:"ffffcc",4:"ffffbb",5:"ffffaa",6:"ffff99"},highlight:function(_1,_2){
var _3=new AJS.fx.Base();
_3.elm=AJS.$(_1);
_3.setOptions(_2);
_3.options.duration=600;
AJS.update(_3,{increase:function(){
if(this.now==7){
_1.style.backgroundColor="transparent";
}else{
_1.style.backgroundColor="#"+AJS.fx._shades[Math.floor(this.now)];
}
}});
return _3.custom(6,0);
},fadeIn:function(_4,_5){
_5=_5||{};
if(!_5.from){
_5.from=0;
AJS.setOpacity(_4,0);
}
if(!_5.to){
_5.to=1;
}
var s=new AJS.fx.Style(_4,"opacity",_5);
return s.custom(_5.from,_5.to);
},fadeOut:function(_7,_8){
_8=_8||{};
if(!_8.from){
_8.from=1;
}
if(!_8.to){
_8.to=0;
}
_8.duration=300;
var s=new AJS.fx.Style(_7,"opacity",_8);
return s.custom(_8.from,_8.to);
},setWidth:function(_a,_b){
var s=new AJS.fx.Style(_a,"width",_b);
return s.custom(_b.from,_b.to);
},setHeight:function(_d,_e){
var s=new AJS.fx.Style(_d,"height",_e);
return s.custom(_e.from,_e.to);
}};
AJS.fx.Base=new AJS.Class({init:function(){
AJS.bindMethods(this);
},setOptions:function(_10){
this.options=AJS.update({onStart:function(){
},onComplete:function(){
},transition:AJS.fx.Transitions.sineInOut,duration:500,wait:true,fps:50},_10||{});
},step:function(){
var _11=new Date().getTime();
if(_11<this.time+this.options.duration){
this.cTime=_11-this.time;
this.setNow();
}else{
setTimeout(AJS.$b(this.options.onComplete,this,[this.elm]),10);
this.clearTimer();
this.now=this.to;
}
this.increase();
},setNow:function(){
this.now=this.compute(this.from,this.to);
},compute:function(_12,to){
var _14=to-_12;
return this.options.transition(this.cTime,_12,_14,this.options.duration);
},clearTimer:function(){
clearInterval(this.timer);
this.timer=null;
return this;
},_start:function(_15,to){
if(!this.options.wait){
this.clearTimer();
}
if(this.timer){
return;
}
setTimeout(AJS.$p(this.options.onStart,this.elm),10);
this.from=_15;
this.to=to;
this.time=new Date().getTime();
this.timer=setInterval(this.step,Math.round(1000/this.options.fps));
return this;
},custom:function(_17,to){
return this._start(_17,to);
},set:function(to){
this.now=to;
this.increase();
return this;
},setStyle:function(elm,_1b,val){
if(this.property=="opacity"){
AJS.setOpacity(elm,val);
}else{
AJS.setStyle(elm,_1b,val);
}
}});
AJS.fx.Style=AJS.fx.Base.extend({init:function(elm,_1e,_1f){
this.parent();
this.elm=elm;
this.setOptions(_1f);
this.property=_1e;
},increase:function(){
this.setStyle(this.elm,this.property,this.now);
}});
AJS.fx.Styles=AJS.fx.Base.extend({init:function(elm,_21){
this.parent();
this.elm=AJS.$(elm);
this.setOptions(_21);
this.now={};
},setNow:function(){
for(p in this.from){
this.now[p]=this.compute(this.from[p],this.to[p]);
}
},custom:function(obj){
if(this.timer&&this.options.wait){
return;
}
var _23={};
var to={};
for(p in obj){
_23[p]=obj[p][0];
to[p]=obj[p][1];
}
return this._start(_23,to);
},increase:function(){
for(var p in this.now){
this.setStyle(this.elm,p,this.now[p]);
}
}});
AJS.fx.Transitions={linear:function(t,b,c,d){
return c*t/d+b;
},sineInOut:function(t,b,c,d){
return -c/2*(Math.cos(Math.PI*t/d)-1)+b;
}};
script_loaded=true;
script_loaded=true;
var GB_CURRENT=null;
GB_hide=function(){
GB_CURRENT.hide();
};
GreyBox=new AJS.Class({init:function(_1){
this.use_fx=AJS.fx;
this.type="page";
this.overlay_click_close=true;
this.salt=0;
this.root_dir=GB_ROOT_DIR;
this.callback_fns=[];
this.reload_on_close=false;
this.src_loader=this.root_dir+"loader_frame.html";
var _2=window.location.hostname.indexOf("www");
var _3=this.src_loader.indexOf("www");
if(_2!=-1&&_3==-1){
this.src_loader=this.src_loader.replace("://","://www.");
}
if(_2==-1&&_3!=-1){
this.src_loader=this.src_loader.replace("://www.","://");
}
this.show_loading=true;
AJS.update(this,_1);
},addCallback:function(fn){
if(fn){
this.callback_fns.push(fn);
}
},show:function(_5){
GB_CURRENT=this;
this.url=_5;
var _6=[AJS.$bytc("object"),AJS.$bytc("select")];
AJS.map(AJS.flattenList(_6),function(_7){
_7.style.visibility="hidden";
});
this.createElements();
return false;
},hide:function(){
var _8=this.callback_fns;
if(_8!=[]){
AJS.map(_8,function(fn){
fn();
});
}
this.onHide();
if(this.use_fx){
var _a=this.overlay;
AJS.fx.fadeOut(this.overlay,{onComplete:function(){
AJS.removeElement(_a);
_a=null;
},duration:300});
AJS.removeElement(this.g_window);
}else{
AJS.removeElement(this.g_window,this.overlay);
}
this.removeFrame();
AJS.REV(window,"scroll",_GB_setOverlayDimension);
AJS.REV(window,"resize",_GB_update);
var _b=[AJS.$bytc("object"),AJS.$bytc("select")];
AJS.map(AJS.flattenList(_b),function(_c){
_c.style.visibility="visible";
});
GB_CURRENT=null;
if(this.reload_on_close){
window.location.reload();
}
},update:function(){
this.setOverlayDimension();
this.setFrameSize();
this.setWindowPosition();
},createElements:function(){
this.initOverlay();
this.g_window=AJS.DIV({"id":"GB_window"});
AJS.hideElement(this.g_window);
AJS.getBody().insertBefore(this.g_window,this.overlay.nextSibling);
this.initFrame();
this.initHook();
this.update();
var me=this;
if(this.use_fx){
AJS.fx.fadeIn(this.overlay,{duration:300,to:0.7,onComplete:function(){
me.onShow();
AJS.showElement(me.g_window);
me.startLoading();
}});
}else{
AJS.setOpacity(this.overlay,0.7);
AJS.showElement(this.g_window);
this.onShow();
this.startLoading();
}
AJS.AEV(window,"scroll",_GB_setOverlayDimension);
AJS.AEV(window,"resize",_GB_update);
},removeFrame:function(){
try{
AJS.removeElement(this.iframe);
}
catch(e){
}
this.iframe=null;
},startLoading:function(){
this.iframe.src=this.src_loader+"?s="+this.salt++;
AJS.showElement(this.iframe);
},setOverlayDimension:function(){
var _e=AJS.getWindowSize();
if(AJS.isMozilla()||AJS.isOpera()){
AJS.setWidth(this.overlay,"100%");
}else{
AJS.setWidth(this.overlay,_e.w);
}
var _f=Math.max(AJS.getScrollTop()+_e.h,AJS.getScrollTop()+this.height);
if(_f<AJS.getScrollTop()){
AJS.setHeight(this.overlay,_f);
}else{
AJS.setHeight(this.overlay,AJS.getScrollTop()+_e.h);
}
},initOverlay:function(){
this.overlay=AJS.DIV({"id":"GB_overlay"});
if(this.overlay_click_close){
AJS.AEV(this.overlay,"click",GB_hide);
}
AJS.setOpacity(this.overlay,0);
AJS.getBody().insertBefore(this.overlay,AJS.getBody().firstChild);
},initFrame:function(){
if(!this.iframe){
var d={"name":"GB_frame","class":"GB_frame","frameBorder":0};
this.iframe=AJS.IFRAME(d);
this.middle_cnt=AJS.DIV({"class":"content"},this.iframe);
this.top_cnt=AJS.DIV();
this.bottom_cnt=AJS.DIV();
AJS.ACN(this.g_window,this.top_cnt,this.middle_cnt,this.bottom_cnt);
}
},onHide:function(){
},onShow:function(){
},setFrameSize:function(){
},setWindowPosition:function(){
},initHook:function(){
}});
_GB_update=function(){
if(GB_CURRENT){
GB_CURRENT.update();
}
};
_GB_setOverlayDimension=function(){
if(GB_CURRENT){
GB_CURRENT.setOverlayDimension();
}
};
AJS.preloadImages(GB_ROOT_DIR+"indicator.gif");
script_loaded=true;
var GB_SETS={};
function decoGreyboxLinks(){
var as=AJS.$bytc("a");
AJS.map(as,function(a){
if(a.getAttribute("href")&&a.getAttribute("rel")){
var rel=a.getAttribute("rel");
if(rel.indexOf("gb_")==0){
var _14=rel.match(/\w+/)[0];
var _15=rel.match(/\[(.*)\]/)[1];
var _16=0;
var _17={"caption":a.title||"","url":a.href};
if(_14=="gb_pageset"||_14=="gb_imageset"){
if(!GB_SETS[_15]){
GB_SETS[_15]=[];
}
GB_SETS[_15].push(_17);
_16=GB_SETS[_15].length;
}
if(_14=="gb_pageset"){
a.onclick=function(){
GB_showFullScreenSet(GB_SETS[_15],_16);
return false;
};
}
if(_14=="gb_imageset"){
a.onclick=function(){
GB_showImageSet(GB_SETS[_15],_16);
return false;
};
}
if(_14=="gb_image"){
a.onclick=function(){
GB_showImage(_17.caption,_17.url);
return false;
};
}
if(_14=="gb_page"){
a.onclick=function(){
var sp=_15.split(/, ?/);
GB_show(_17.caption,_17.url,parseInt(sp[1]),parseInt(sp[0]));
return false;
};
}
if(_14=="gb_page_fs"){
a.onclick=function(){
GB_showFullScreen(_17.caption,_17.url);
return false;
};
}
if(_14=="gb_page_center"){
a.onclick=function(){
var sp=_15.split(/, ?/);
GB_showCenter(_17.caption,_17.url,parseInt(sp[1]),parseInt(sp[0]));
return false;
};
}
}
}
});
}
AJS.AEV(window,"load",decoGreyboxLinks);
GB_showImage=function(_1a,url,_1c){
var _1d={width:300,height:300,type:"image",fullscreen:false,center_win:true,caption:_1a,callback_fn:_1c};
var win=new GB_Gallery(_1d);
return win.show(url);
};
GB_showPage=function(_1f,url,_21){
var _22={type:"page",caption:_1f,callback_fn:_21,fullscreen:true,center_win:false};
var win=new GB_Gallery(_22);
return win.show(url);
};
GB_Gallery=GreyBox.extend({init:function(_24){
this.parent({});
this.img_close=this.root_dir+"g_close.gif";
AJS.update(this,_24);
this.addCallback(this.callback_fn);
},initHook:function(){
AJS.addClass(this.g_window,"GB_Gallery");
var _25=AJS.DIV({"class":"inner"});
this.header=AJS.DIV({"class":"GB_header"},_25);
AJS.setOpacity(this.header,0);
AJS.getBody().insertBefore(this.header,this.overlay.nextSibling);
var _26=AJS.TD({"id":"GB_caption","class":"caption","width":"40%"},this.caption);
var _27=AJS.TD({"id":"GB_middle","class":"middle","width":"20%"});
var _28=AJS.IMG({"src":this.img_close});
AJS.AEV(_28,"click",GB_hide);
var _29=AJS.TD({"class":"close","width":"40%"},_28);
var _2a=AJS.TBODY(AJS.TR(_26,_27,_29));
var _2b=AJS.TABLE({"cellspacing":"0","cellpadding":0,"border":0},_2a);
AJS.ACN(_25,_2b);
if(this.fullscreen){
AJS.AEV(window,"scroll",AJS.$b(this.setWindowPosition,this));
}else{
AJS.AEV(window,"scroll",AJS.$b(this._setHeaderPos,this));
}
},setFrameSize:function(){
var _2c=this.overlay.offsetWidth;
var _2d=AJS.getWindowSize();
if(this.fullscreen){
this.width=_2c-40;
this.height=_2d.h-80;
}
AJS.setWidth(this.iframe,this.width);
AJS.setHeight(this.iframe,this.height);
AJS.setWidth(this.header,_2c);
},_setHeaderPos:function(){
AJS.setTop(this.header,AJS.getScrollTop()+10);
},setWindowPosition:function(){
var _2e=this.overlay.offsetWidth;
var _2f=AJS.getWindowSize();
AJS.setLeft(this.g_window,((_2e-50-this.width)/2));
var _30=AJS.getScrollTop()+55;
if(!this.center_win){
AJS.setTop(this.g_window,_30);
}else{
var fl=((_2f.h-this.height)/2)+20+AJS.getScrollTop();
if(fl<0){
fl=0;
}
if(_30>fl){
fl=_30;
}
AJS.setTop(this.g_window,fl);
}
this._setHeaderPos();
},onHide:function(){
AJS.removeElement(this.header);
AJS.removeClass(this.g_window,"GB_Gallery");
},onShow:function(){
if(this.use_fx){
AJS.fx.fadeIn(this.header,{to:1});
}else{
AJS.setOpacity(this.header,1);
}
}});
AJS.preloadImages(GB_ROOT_DIR+"g_close.gif");
GB_showFullScreenSet=function(set,_33,_34){
var _35={type:"page",fullscreen:true,center_win:false};
var _36=new GB_Sets(_35,set);
_36.addCallback(_34);
_36.showSet(_33-1);
return false;
};
GB_showImageSet=function(set,_38,_39){
var _3a={type:"image",fullscreen:false,center_win:true,width:300,height:300};
var _3b=new GB_Sets(_3a,set);
_3b.addCallback(_39);
_3b.showSet(_38-1);
return false;
};
GB_Sets=GB_Gallery.extend({init:function(_3c,set){
this.parent(_3c);
if(!this.img_next){
this.img_next=this.root_dir+"next.gif";
}
if(!this.img_prev){
this.img_prev=this.root_dir+"prev.gif";
}
this.current_set=set;
},showSet:function(_3e){
this.current_index=_3e;
var _3f=this.current_set[this.current_index];
this.show(_3f.url);
this._setCaption(_3f.caption);
this.btn_prev=AJS.IMG({"class":"left",src:this.img_prev});
this.btn_next=AJS.IMG({"class":"right",src:this.img_next});
AJS.AEV(this.btn_prev,"click",AJS.$b(this.switchPrev,this));
AJS.AEV(this.btn_next,"click",AJS.$b(this.switchNext,this));
GB_STATUS=AJS.SPAN({"class":"GB_navStatus"});
AJS.ACN(AJS.$("GB_middle"),this.btn_prev,GB_STATUS,this.btn_next);
this.updateStatus();
},updateStatus:function(){
AJS.setHTML(GB_STATUS,(this.current_index+1)+" / "+this.current_set.length);
if(this.current_index==0){
AJS.addClass(this.btn_prev,"disabled");
}else{
AJS.removeClass(this.btn_prev,"disabled");
}
if(this.current_index==this.current_set.length-1){
AJS.addClass(this.btn_next,"disabled");
}else{
AJS.removeClass(this.btn_next,"disabled");
}
},_setCaption:function(_40){
AJS.setHTML(AJS.$("GB_caption"),_40);
},updateFrame:function(){
var _41=this.current_set[this.current_index];
this._setCaption(_41.caption);
this.url=_41.url;
this.startLoading();
},switchPrev:function(){
if(this.current_index!=0){
this.current_index--;
this.updateFrame();
this.updateStatus();
}
},switchNext:function(){
if(this.current_index!=this.current_set.length-1){
this.current_index++;
this.updateFrame();
this.updateStatus();
}
}});
AJS.AEV(window,"load",function(){
AJS.preloadImages(GB_ROOT_DIR+"next.gif",GB_ROOT_DIR+"prev.gif");
});
GB_show=function(_42,url,_44,_45,_46){
var _47={caption:_42,height:_44||500,width:_45||500,fullscreen:false,callback_fn:_46};
var win=new GB_Window(_47);
return win.show(url);
};
GB_showCenter=function(_49,url,_4b,_4c,_4d){
var _4e={caption:_49,center_win:true,height:_4b||500,width:_4c||500,fullscreen:false,callback_fn:_4d};
var win=new GB_Window(_4e);
return win.show(url);
};
GB_showFullScreen=function(_50,url,_52){
var _53={caption:_50,fullscreen:true,callback_fn:_52};
var win=new GB_Window(_53);
return win.show(url);
};
GB_Window=GreyBox.extend({init:function(_55){
this.parent({});
this.img_header=this.root_dir+"header_bg.gif";
this.img_close=this.root_dir+"w_close.gif";
this.show_close_img=true;
AJS.update(this,_55);
this.addCallback(this.callback_fn);
},initHook:function(){
AJS.addClass(this.g_window,"GB_Window");
this.header=AJS.TABLE({"class":"header"});
this.header.style.backgroundImage="url("+this.img_header+")";
var _56=AJS.TD({"class":"caption"},this.caption);
var _57=AJS.TD({"class":"close"});
if(this.show_close_img){
var _58=AJS.IMG({"src":this.img_close});
var _59=AJS.SPAN("Close");
var btn=AJS.DIV(_58,_59);
AJS.AEV([_58,_59],"mouseover",function(){
AJS.addClass(_59,"on");
});
AJS.AEV([_58,_59],"mouseout",function(){
AJS.removeClass(_59,"on");
});
AJS.AEV([_58,_59],"mousedown",function(){
AJS.addClass(_59,"click");
});
AJS.AEV([_58,_59],"mouseup",function(){
AJS.removeClass(_59,"click");
});
AJS.AEV([_58,_59],"click",GB_hide);
AJS.ACN(_57,btn);
}
tbody_header=AJS.TBODY();
AJS.ACN(tbody_header,AJS.TR(_56,_57));
AJS.ACN(this.header,tbody_header);
AJS.ACN(this.top_cnt,this.header);
if(this.fullscreen){
AJS.AEV(window,"scroll",AJS.$b(this.setWindowPosition,this));
}
},setFrameSize:function(){
if(this.fullscreen){
var _5b=AJS.getWindowSize();
overlay_h=_5b.h;
this.width=Math.round(this.overlay.offsetWidth-(this.overlay.offsetWidth/100)*10);
this.height=Math.round(overlay_h-(overlay_h/100)*10);
}
AJS.setWidth(this.header,this.width+6);
AJS.setWidth(this.iframe,this.width);
AJS.setHeight(this.iframe,this.height);
},setWindowPosition:function(){
var _5c=AJS.getWindowSize();
AJS.setLeft(this.g_window,((_5c.w-this.width)/2)-13);
if(!this.center_win){
AJS.setTop(this.g_window,AJS.getScrollTop());
}else{
var fl=((_5c.h-this.height)/2)-20+AJS.getScrollTop();
if(fl<0){
fl=0;
}
AJS.setTop(this.g_window,fl);
}
}});
AJS.preloadImages(GB_ROOT_DIR+"w_close.gif",GB_ROOT_DIR+"header_bg.gif");
script_loaded=true;
var Prototype={Version:"1.5.0",BrowserFeatures:{XPath:!!document.evaluate},ScriptFragment:"(?:<script.*?>)((\n|\r|.)*?)(?:</script>)",emptyFunction:function(){
},K:function(x){
return x;
}};
var Class={create:function(){
return function(){
this.initialize.apply(this,arguments);
};
}};
var Abstract=new Object();
Object.extend=function(_12f,_130){
for(var _131 in _130){
_12f[_131]=_130[_131];
}
return _12f;
};
Object.extend(Object,{inspect:function(_132){
try{
if(_132===undefined){
return "undefined";
}
if(_132===null){
return "null";
}
return _132.inspect?_132.inspect():_132.toString();
}
catch(e){
if(e instanceof RangeError){
return "...";
}
throw e;
}
},keys:function(_133){
var keys=[];
for(var _135 in _133){
keys.push(_135);
}
return keys;
},values:function(_136){
var _137=[];
for(var _138 in _136){
_137.push(_136[_138]);
}
return _137;
},clone:function(_139){
return Object.extend({},_139);
}});
Function.prototype.bind=function(){
var _13a=this,args=$A(arguments),_13c=args.shift();
return function(){
return _13a.apply(_13c,args.concat($A(arguments)));
};
};
Function.prototype.bindAsEventListener=function(_13d){
var _13e=this,args=$A(arguments),_13d=args.shift();
return function(_140){
return _13e.apply(_13d,[(_140||window.event)].concat(args).concat($A(arguments)));
};
};
Object.extend(Number.prototype,{toColorPart:function(){
var _141=this.toString(16);
if(this<16){
return "0"+_141;
}
return _141;
},succ:function(){
return this+1;
},times:function(_142){
$R(0,this,true).each(_142);
return this;
}});
var Try={these:function(){
var _143;
for(var i=0,_145=arguments.length;i<_145;i++){
var _146=arguments[i];
try{
_143=_146();
break;
}
catch(e){
}
}
return _143;
}};
var PeriodicalExecuter=Class.create();
PeriodicalExecuter.prototype={initialize:function(_147,_148){
this.callback=_147;
this.frequency=_148;
this.currentlyExecuting=false;
this.registerCallback();
},registerCallback:function(){
this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},stop:function(){
if(!this.timer){
return;
}
clearInterval(this.timer);
this.timer=null;
},onTimerEvent:function(){
if(!this.currentlyExecuting){
try{
this.currentlyExecuting=true;
this.callback(this);
}
finally{
this.currentlyExecuting=false;
}
}
}};
String.interpret=function(_149){
return _149==null?"":String(_149);
};
Object.extend(String.prototype,{gsub:function(_14a,_14b){
var _14c="",_14d=this,_14e;
_14b=arguments.callee.prepareReplacement(_14b);
while(_14d.length>0){
if(_14e=_14d.match(_14a)){
_14c+=_14d.slice(0,_14e.index);
_14c+=String.interpret(_14b(_14e));
_14d=_14d.slice(_14e.index+_14e[0].length);
}else{
_14c+=_14d,_14d="";
}
}
return _14c;
},sub:function(_14f,_150,_151){
_150=this.gsub.prepareReplacement(_150);
_151=_151===undefined?1:_151;
return this.gsub(_14f,function(_152){
if(--_151<0){
return _152[0];
}
return _150(_152);
});
},scan:function(_153,_154){
this.gsub(_153,_154);
return this;
},truncate:function(_155,_156){
_155=_155||30;
_156=_156===undefined?"...":_156;
return this.length>_155?this.slice(0,_155-_156.length)+_156:this;
},strip:function(){
return this.replace(/^\s+/,"").replace(/\s+$/,"");
},stripTags:function(){
return this.replace(/<\/?[^>]+>/gi,"");
},stripScripts:function(){
return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"");
},extractScripts:function(){
var _157=new RegExp(Prototype.ScriptFragment,"img");
var _158=new RegExp(Prototype.ScriptFragment,"im");
return (this.match(_157)||[]).map(function(_159){
return (_159.match(_158)||["",""])[1];
});
},evalScripts:function(){
return this.extractScripts().map(function(_15a){
return eval(_15a);
});
},escapeHTML:function(){
var div=document.createElement("div");
var text=document.createTextNode(this);
div.appendChild(text);
return div.innerHTML;
},unescapeHTML:function(){
var div=document.createElement("div");
div.innerHTML=this.stripTags();
return div.childNodes[0]?(div.childNodes.length>1?$A(div.childNodes).inject("",function(memo,node){
return memo+node.nodeValue;
}):div.childNodes[0].nodeValue):"";
},toQueryParams:function(_160){
var _161=this.strip().match(/([^?#]*)(#.*)?$/);
if(!_161){
return {};
}
return _161[1].split(_160||"&").inject({},function(hash,pair){
if((pair=pair.split("="))[0]){
var name=decodeURIComponent(pair[0]);
var _165=pair[1]?decodeURIComponent(pair[1]):undefined;
if(hash[name]!==undefined){
if(hash[name].constructor!=Array){
hash[name]=[hash[name]];
}
if(_165){
hash[name].push(_165);
}
}else{
hash[name]=_165;
}
}
return hash;
});
},toArray:function(){
return this.split("");
},succ:function(){
return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1);
},camelize:function(){
var _166=this.split("-"),len=_166.length;
if(len==1){
return _166[0];
}
var _168=this.charAt(0)=="-"?_166[0].charAt(0).toUpperCase()+_166[0].substring(1):_166[0];
for(var i=1;i<len;i++){
_168+=_166[i].charAt(0).toUpperCase()+_166[i].substring(1);
}
return _168;
},capitalize:function(){
return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase();
},underscore:function(){
return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase();
},dasherize:function(){
return this.gsub(/_/,"-");
},inspect:function(_16a){
var _16b=this.replace(/\\/g,"\\\\");
if(_16a){
return "\""+_16b.replace(/"/g,"\\\"")+"\"";
}else{
return "'"+_16b.replace(/'/g,"\\'")+"'";
}
}});
String.prototype.gsub.prepareReplacement=function(_16c){
if(typeof _16c=="function"){
return _16c;
}
var _16d=new Template(_16c);
return function(_16e){
return _16d.evaluate(_16e);
};
};
String.prototype.parseQuery=String.prototype.toQueryParams;
var Template=Class.create();
Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;
Template.prototype={initialize:function(_16f,_170){
this.template=_16f.toString();
this.pattern=_170||Template.Pattern;
},evaluate:function(_171){
return this.template.gsub(this.pattern,function(_172){
var _173=_172[1];
if(_173=="\\"){
return _172[2];
}
return _173+String.interpret(_171[_172[3]]);
});
}};
var $break=new Object();
var $continue=new Object();
var Enumerable={each:function(_174){
var _175=0;
try{
this._each(function(_176){
try{
_174(_176,_175++);
}
catch(e){
if(e!=$continue){
throw e;
}
}
});
}
catch(e){
if(e!=$break){
throw e;
}
}
return this;
},eachSlice:function(_177,_178){
var _179=-_177,_17a=[],_17b=this.toArray();
while((_179+=_177)<_17b.length){
_17a.push(_17b.slice(_179,_179+_177));
}
return _17a.map(_178);
},all:function(_17c){
var _17d=true;
this.each(function(_17e,_17f){
_17d=_17d&&!!(_17c||Prototype.K)(_17e,_17f);
if(!_17d){
throw $break;
}
});
return _17d;
},any:function(_180){
var _181=false;
this.each(function(_182,_183){
if(_181=!!(_180||Prototype.K)(_182,_183)){
throw $break;
}
});
return _181;
},collect:function(_184){
var _185=[];
this.each(function(_186,_187){
_185.push((_184||Prototype.K)(_186,_187));
});
return _185;
},detect:function(_188){
var _189;
this.each(function(_18a,_18b){
if(_188(_18a,_18b)){
_189=_18a;
throw $break;
}
});
return _189;
},findAll:function(_18c){
var _18d=[];
this.each(function(_18e,_18f){
if(_18c(_18e,_18f)){
_18d.push(_18e);
}
});
return _18d;
},grep:function(_190,_191){
var _192=[];
this.each(function(_193,_194){
var _195=_193.toString();
if(_195.match(_190)){
_192.push((_191||Prototype.K)(_193,_194));
}
});
return _192;
},include:function(_196){
var _197=false;
this.each(function(_198){
if(_198==_196){
_197=true;
throw $break;
}
});
return _197;
},inGroupsOf:function(_199,_19a){
_19a=_19a===undefined?null:_19a;
return this.eachSlice(_199,function(_19b){
while(_19b.length<_199){
_19b.push(_19a);
}
return _19b;
});
},inject:function(memo,_19d){
this.each(function(_19e,_19f){
memo=_19d(memo,_19e,_19f);
});
return memo;
},invoke:function(_1a0){
var args=$A(arguments).slice(1);
return this.map(function(_1a2){
return _1a2[_1a0].apply(_1a2,args);
});
},max:function(_1a3){
var _1a4;
this.each(function(_1a5,_1a6){
_1a5=(_1a3||Prototype.K)(_1a5,_1a6);
if(_1a4==undefined||_1a5>=_1a4){
_1a4=_1a5;
}
});
return _1a4;
},min:function(_1a7){
var _1a8;
this.each(function(_1a9,_1aa){
_1a9=(_1a7||Prototype.K)(_1a9,_1aa);
if(_1a8==undefined||_1a9<_1a8){
_1a8=_1a9;
}
});
return _1a8;
},partition:function(_1ab){
var _1ac=[],_1ad=[];
this.each(function(_1ae,_1af){
((_1ab||Prototype.K)(_1ae,_1af)?_1ac:_1ad).push(_1ae);
});
return [_1ac,_1ad];
},pluck:function(_1b0){
var _1b1=[];
this.each(function(_1b2,_1b3){
_1b1.push(_1b2[_1b0]);
});
return _1b1;
},reject:function(_1b4){
var _1b5=[];
this.each(function(_1b6,_1b7){
if(!_1b4(_1b6,_1b7)){
_1b5.push(_1b6);
}
});
return _1b5;
},sortBy:function(_1b8){
return this.map(function(_1b9,_1ba){
return {value:_1b9,criteria:_1b8(_1b9,_1ba)};
}).sort(function(left,_1bc){
var a=left.criteria,b=_1bc.criteria;
return a<b?-1:a>b?1:0;
}).pluck("value");
},toArray:function(){
return this.map();
},zip:function(){
var _1bf=Prototype.K,args=$A(arguments);
if(typeof args.last()=="function"){
_1bf=args.pop();
}
var _1c1=[this].concat(args).map($A);
return this.map(function(_1c2,_1c3){
return _1bf(_1c1.pluck(_1c3));
});
},size:function(){
return this.toArray().length;
},inspect:function(){
return "#<Enumerable:"+this.toArray().inspect()+">";
}};
Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});
var $A=Array.from=function(_1c4){
if(!_1c4){
return [];
}
if(_1c4.toArray){
return _1c4.toArray();
}else{
var _1c5=[];
for(var i=0,_1c7=_1c4.length;i<_1c7;i++){
_1c5.push(_1c4[i]);
}
return _1c5;
}
};
Object.extend(Array.prototype,Enumerable);
if(!Array.prototype._reverse){
Array.prototype._reverse=Array.prototype.reverse;
}
Object.extend(Array.prototype,{_each:function(_1c8){
for(var i=0,_1ca=this.length;i<_1ca;i++){
_1c8(this[i]);
}
},clear:function(){
this.length=0;
return this;
},first:function(){
return this[0];
},last:function(){
return this[this.length-1];
},compact:function(){
return this.select(function(_1cb){
return _1cb!=null;
});
},flatten:function(){
return this.inject([],function(_1cc,_1cd){
return _1cc.concat(_1cd&&_1cd.constructor==Array?_1cd.flatten():[_1cd]);
});
},without:function(){
var _1ce=$A(arguments);
return this.select(function(_1cf){
return !_1ce.include(_1cf);
});
},indexOf:function(_1d0){
for(var i=0,_1d2=this.length;i<_1d2;i++){
if(this[i]==_1d0){
return i;
}
}
return -1;
},reverse:function(_1d3){
return (_1d3!==false?this:this.toArray())._reverse();
},reduce:function(){
return this.length>1?this:this[0];
},uniq:function(){
return this.inject([],function(_1d4,_1d5){
return _1d4.include(_1d5)?_1d4:_1d4.concat([_1d5]);
});
},clone:function(){
return [].concat(this);
},size:function(){
return this.length;
},inspect:function(){
return "["+this.map(Object.inspect).join(", ")+"]";
}});
Array.prototype.toArray=Array.prototype.clone;
function $w(_1d6){
_1d6=_1d6.strip();
return _1d6?_1d6.split(/\s+/):[];
}
if(window.opera){
Array.prototype.concat=function(){
var _1d7=[];
for(var i=0,_1d9=this.length;i<_1d9;i++){
_1d7.push(this[i]);
}
for(var i=0,_1d9=arguments.length;i<_1d9;i++){
if(arguments[i].constructor==Array){
for(var j=0,_1db=arguments[i].length;j<_1db;j++){
_1d7.push(arguments[i][j]);
}
}else{
_1d7.push(arguments[i]);
}
}
return _1d7;
};
}
var Hash=function(obj){
Object.extend(this,obj||{});
};
Object.extend(Hash,{toQueryString:function(obj){
var _1de=[];
this.prototype._each.call(obj,function(pair){
if(!pair.key){
return;
}
if(pair.value&&pair.value.constructor==Array){
var _1e0=pair.value.compact();
if(_1e0.length<2){
pair.value=_1e0.reduce();
}else{
key=encodeURIComponent(pair.key);
_1e0.each(function(_1e1){
_1e1=_1e1!=undefined?encodeURIComponent(_1e1):"";
_1de.push(key+"="+encodeURIComponent(_1e1));
});
return;
}
}
if(pair.value==undefined){
pair[1]="";
}
_1de.push(pair.map(encodeURIComponent).join("="));
});
return _1de.join("&");
}});
Object.extend(Hash.prototype,Enumerable);
Object.extend(Hash.prototype,{_each:function(_1e2){
for(var key in this){
var _1e4=this[key];
if(_1e4&&_1e4==Hash.prototype[key]){
continue;
}
var pair=[key,_1e4];
pair.key=key;
pair.value=_1e4;
_1e2(pair);
}
},keys:function(){
return this.pluck("key");
},values:function(){
return this.pluck("value");
},merge:function(hash){
return $H(hash).inject(this,function(_1e7,pair){
_1e7[pair.key]=pair.value;
return _1e7;
});
},remove:function(){
var _1e9;
for(var i=0,_1eb=arguments.length;i<_1eb;i++){
var _1ec=this[arguments[i]];
if(_1ec!==undefined){
if(_1e9===undefined){
_1e9=_1ec;
}else{
if(_1e9.constructor!=Array){
_1e9=[_1e9];
}
_1e9.push(_1ec);
}
}
delete this[arguments[i]];
}
return _1e9;
},toQueryString:function(){
return Hash.toQueryString(this);
},inspect:function(){
return "#<Hash:{"+this.map(function(pair){
return pair.map(Object.inspect).join(": ");
}).join(", ")+"}>";
}});
function $H(_1ee){
if(_1ee&&_1ee.constructor==Hash){
return _1ee;
}
return new Hash(_1ee);
}
ObjectRange=Class.create();
Object.extend(ObjectRange.prototype,Enumerable);
Object.extend(ObjectRange.prototype,{initialize:function(_1ef,end,_1f1){
this.start=_1ef;
this.end=end;
this.exclusive=_1f1;
},_each:function(_1f2){
var _1f3=this.start;
while(this.include(_1f3)){
_1f2(_1f3);
_1f3=_1f3.succ();
}
},include:function(_1f4){
if(_1f4<this.start){
return false;
}
if(this.exclusive){
return _1f4<this.end;
}
return _1f4<=this.end;
}});
var $R=function(_1f5,end,_1f7){
return new ObjectRange(_1f5,end,_1f7);
};
var Ajax={getTransport:function(){
return Try.these(function(){
return new XMLHttpRequest();
},function(){
return new ActiveXObject("Msxml2.XMLHTTP");
},function(){
return new ActiveXObject("Microsoft.XMLHTTP");
})||false;
},activeRequestCount:0};
Ajax.Responders={responders:[],_each:function(_1f8){
this.responders._each(_1f8);
},register:function(_1f9){
if(!this.include(_1f9)){
this.responders.push(_1f9);
}
},unregister:function(_1fa){
this.responders=this.responders.without(_1fa);
},dispatch:function(_1fb,_1fc,_1fd,json){
this.each(function(_1ff){
if(typeof _1ff[_1fb]=="function"){
try{
_1ff[_1fb].apply(_1ff,[_1fc,_1fd,json]);
}
catch(e){
}
}
});
}};
Object.extend(Ajax.Responders,Enumerable);
Ajax.Responders.register({onCreate:function(){
Ajax.activeRequestCount++;
},onComplete:function(){
Ajax.activeRequestCount--;
}});
Ajax.Base=function(){
};
Ajax.Base.prototype={setOptions:function(_200){
this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:""};
Object.extend(this.options,_200||{});
this.options.method=this.options.method.toLowerCase();
if(typeof this.options.parameters=="string"){
this.options.parameters=this.options.parameters.toQueryParams();
}
}};
Ajax.Request=Class.create();
Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
Ajax.Request.prototype=Object.extend(new Ajax.Base(),{_complete:false,initialize:function(url,_202){
this.transport=Ajax.getTransport();
this.setOptions(_202);
this.request(url);
},request:function(url){
this.url=url;
this.method=this.options.method;
var _204=this.options.parameters;
if(!["get","post"].include(this.method)){
_204["_method"]=this.method;
this.method="post";
}
_204=Hash.toQueryString(_204);
if(_204&&/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
_204+="&_=";
}
if(this.method=="get"&&_204){
this.url+=(this.url.indexOf("?")>-1?"&":"?")+_204;
}
try{
Ajax.Responders.dispatch("onCreate",this,this.transport);
this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);
if(this.options.asynchronous){
setTimeout(function(){
this.respondToReadyState(1);
}.bind(this),10);
}
this.transport.onreadystatechange=this.onStateChange.bind(this);
this.setRequestHeaders();
var body=this.method=="post"?(this.options.postBody||_204):null;
this.transport.send(body);
if(!this.options.asynchronous&&this.transport.overrideMimeType){
this.onStateChange();
}
}
catch(e){
this.dispatchException(e);
}
},onStateChange:function(){
var _206=this.transport.readyState;
if(_206>1&&!((_206==4)&&this._complete)){
this.respondToReadyState(this.transport.readyState);
}
},setRequestHeaders:function(){
var _207={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,"Accept":"text/javascript, text/html, application/xml, text/xml, */*"};
if(this.method=="post"){
_207["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");
if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){
_207["Connection"]="close";
}
}
if(typeof this.options.requestHeaders=="object"){
var _208=this.options.requestHeaders;
if(typeof _208.push=="function"){
for(var i=0,_20a=_208.length;i<_20a;i+=2){
_207[_208[i]]=_208[i+1];
}
}else{
$H(_208).each(function(pair){
_207[pair.key]=pair.value;
});
}
}
for(var name in _207){
this.transport.setRequestHeader(name,_207[name]);
}
},success:function(){
return !this.transport.status||(this.transport.status>=200&&this.transport.status<300);
},respondToReadyState:function(_20d){
var _20e=Ajax.Request.Events[_20d];
var _20f=this.transport,json=this.evalJSON();
if(_20e=="Complete"){
try{
this._complete=true;
(this.options["on"+this.transport.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(_20f,json);
}
catch(e){
this.dispatchException(e);
}
if((this.getHeader("Content-type")||"text/javascript").strip().match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i)){
this.evalResponse();
}
}
try{
(this.options["on"+_20e]||Prototype.emptyFunction)(_20f,json);
Ajax.Responders.dispatch("on"+_20e,this,_20f,json);
}
catch(e){
this.dispatchException(e);
}
if(_20e=="Complete"){
this.transport.onreadystatechange=Prototype.emptyFunction;
}
},getHeader:function(name){
try{
return this.transport.getResponseHeader(name);
}
catch(e){
return null;
}
},evalJSON:function(){
try{
var json=this.getHeader("X-JSON");
return json?eval("("+json+")"):null;
}
catch(e){
return null;
}
},evalResponse:function(){
try{
return eval(this.transport.responseText);
}
catch(e){
this.dispatchException(e);
}
},dispatchException:function(_213){
(this.options.onException||Prototype.emptyFunction)(this,_213);
Ajax.Responders.dispatch("onException",this,_213);
}});
Ajax.Updater=Class.create();
Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(_214,url,_216){
this.container={success:(_214.success||_214),failure:(_214.failure||(_214.success?null:_214))};
this.transport=Ajax.getTransport();
this.setOptions(_216);
var _217=this.options.onComplete||Prototype.emptyFunction;
this.options.onComplete=(function(_218,_219){
this.updateContent();
_217(_218,_219);
}).bind(this);
this.request(url);
},updateContent:function(){
var _21a=this.container[this.success()?"success":"failure"];
var _21b=this.transport.responseText;
if(!this.options.evalScripts){
_21b=_21b.stripScripts();
}
if(_21a=$(_21a)){
if(this.options.insertion){
new this.options.insertion(_21a,_21b);
}else{
_21a.update(_21b);
}
}
if(this.success()){
if(this.onComplete){
setTimeout(this.onComplete.bind(this),10);
}
}
}});
Ajax.PeriodicalUpdater=Class.create();
Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(_21c,url,_21e){
this.setOptions(_21e);
this.onComplete=this.options.onComplete;
this.frequency=(this.options.frequency||2);
this.decay=(this.options.decay||1);
this.updater={};
this.container=_21c;
this.url=url;
this.start();
},start:function(){
this.options.onComplete=this.updateComplete.bind(this);
this.onTimerEvent();
},stop:function(){
this.updater.options.onComplete=undefined;
clearTimeout(this.timer);
(this.onComplete||Prototype.emptyFunction).apply(this,arguments);
},updateComplete:function(_21f){
if(this.options.decay){
this.decay=(_21f.responseText==this.lastText?this.decay*this.options.decay:1);
this.lastText=_21f.responseText;
}
this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000);
},onTimerEvent:function(){
this.updater=new Ajax.Updater(this.container,this.url,this.options);
}});
function $(_220){
if(arguments.length>1){
for(var i=0,_222=[],_223=arguments.length;i<_223;i++){
_222.push($(arguments[i]));
}
return _222;
}
if(typeof _220=="string"){
_220=document.getElementById(_220);
}
return Element.extend(_220);
}
if(Prototype.BrowserFeatures.XPath){
document._getElementsByXPath=function(_224,_225){
var _226=[];
var _227=document.evaluate(_224,$(_225)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for(var i=0,_229=_227.snapshotLength;i<_229;i++){
_226.push(_227.snapshotItem(i));
}
return _226;
};
}
document.getElementsByClassName=function(_22a,_22b){
if(Prototype.BrowserFeatures.XPath){
var q=".//*[contains(concat(' ', @class, ' '), ' "+_22a+" ')]";
return document._getElementsByXPath(q,_22b);
}else{
var _22d=($(_22b)||document.body).getElementsByTagName("*");
var _22e=[],_22f;
for(var i=0,_231=_22d.length;i<_231;i++){
_22f=_22d[i];
if(Element.hasClassName(_22f,_22a)){
_22e.push(Element.extend(_22f));
}
}
return _22e;
}
};
if(!window.Element){
var Element=new Object();
}
Element.extend=function(_232){
if(!_232||_nativeExtensions||_232.nodeType==3){
return _232;
}
if(!_232._extended&&_232.tagName&&_232!=window){
var _233=Object.clone(Element.Methods),_234=Element.extend.cache;
if(_232.tagName=="FORM"){
Object.extend(_233,Form.Methods);
}
if(["INPUT","TEXTAREA","SELECT"].include(_232.tagName)){
Object.extend(_233,Form.Element.Methods);
}
Object.extend(_233,Element.Methods.Simulated);
for(var _235 in _233){
var _236=_233[_235];
if(typeof _236=="function"&&!(_235 in _232)){
_232[_235]=_234.findOrStore(_236);
}
}
}
_232._extended=true;
return _232;
};
Element.extend.cache={findOrStore:function(_237){
return this[_237]=this[_237]||function(){
return _237.apply(null,[this].concat($A(arguments)));
};
}};
Element.Methods={visible:function(_238){
return $(_238).style.display!="none";
},toggle:function(_239){
_239=$(_239);
Element[Element.visible(_239)?"hide":"show"](_239);
return _239;
},hide:function(_23a){
$(_23a).style.display="none";
return _23a;
},show:function(_23b){
$(_23b).style.display="";
return _23b;
},remove:function(_23c){
_23c=$(_23c);
_23c.parentNode.removeChild(_23c);
return _23c;
},update:function(_23d,html){
html=typeof html=="undefined"?"":html.toString();
$(_23d).innerHTML=html.stripScripts();
setTimeout(function(){
html.evalScripts();
},10);
return _23d;
},replace:function(_23f,html){
_23f=$(_23f);
html=typeof html=="undefined"?"":html.toString();
if(_23f.outerHTML){
_23f.outerHTML=html.stripScripts();
}else{
var _241=_23f.ownerDocument.createRange();
_241.selectNodeContents(_23f);
_23f.parentNode.replaceChild(_241.createContextualFragment(html.stripScripts()),_23f);
}
setTimeout(function(){
html.evalScripts();
},10);
return _23f;
},inspect:function(_242){
_242=$(_242);
var _243="<"+_242.tagName.toLowerCase();
$H({"id":"id","className":"class"}).each(function(pair){
var _245=pair.first(),_246=pair.last();
var _247=(_242[_245]||"").toString();
if(_247){
_243+=" "+_246+"="+_247.inspect(true);
}
});
return _243+">";
},recursivelyCollect:function(_248,_249){
_248=$(_248);
var _24a=[];
while(_248=_248[_249]){
if(_248.nodeType==1){
_24a.push(Element.extend(_248));
}
}
return _24a;
},ancestors:function(_24b){
return $(_24b).recursivelyCollect("parentNode");
},descendants:function(_24c){
return $A($(_24c).getElementsByTagName("*"));
},immediateDescendants:function(_24d){
if(!(_24d=$(_24d).firstChild)){
return [];
}
while(_24d&&_24d.nodeType!=1){
_24d=_24d.nextSibling;
}
if(_24d){
return [_24d].concat($(_24d).nextSiblings());
}
return [];
},previousSiblings:function(_24e){
return $(_24e).recursivelyCollect("previousSibling");
},nextSiblings:function(_24f){
return $(_24f).recursivelyCollect("nextSibling");
},siblings:function(_250){
_250=$(_250);
return _250.previousSiblings().reverse().concat(_250.nextSiblings());
},match:function(_251,_252){
if(typeof _252=="string"){
_252=new Selector(_252);
}
return _252.match($(_251));
},up:function(_253,_254,_255){
return Selector.findElement($(_253).ancestors(),_254,_255);
},down:function(_256,_257,_258){
return Selector.findElement($(_256).descendants(),_257,_258);
},previous:function(_259,_25a,_25b){
return Selector.findElement($(_259).previousSiblings(),_25a,_25b);
},next:function(_25c,_25d,_25e){
return Selector.findElement($(_25c).nextSiblings(),_25d,_25e);
},getElementsBySelector:function(){
var args=$A(arguments),_260=$(args.shift());
return Selector.findChildElements(_260,args);
},getElementsByClassName:function(_261,_262){
return document.getElementsByClassName(_262,_261);
},readAttribute:function(_263,name){
_263=$(_263);
if(document.all&&!window.opera){
var t=Element._attributeTranslations;
if(t.values[name]){
return t.values[name](_263,name);
}
if(t.names[name]){
name=t.names[name];
}
var _266=_263.attributes[name];
if(_266){
return _266.nodeValue;
}
}
return _263.getAttribute(name);
},getHeight:function(_267){
return $(_267).getDimensions().height;
},getWidth:function(_268){
return $(_268).getDimensions().width;
},classNames:function(_269){
return new Element.ClassNames(_269);
},hasClassName:function(_26a,_26b){
if(!(_26a=$(_26a))){
return;
}
var _26c=_26a.className;
if(_26c.length==0){
return false;
}
if(_26c==_26b||_26c.match(new RegExp("(^|\\s)"+_26b+"(\\s|$)"))){
return true;
}
return false;
},addClassName:function(_26d,_26e){
if(!(_26d=$(_26d))){
return;
}
Element.classNames(_26d).add(_26e);
return _26d;
},removeClassName:function(_26f,_270){
if(!(_26f=$(_26f))){
return;
}
Element.classNames(_26f).remove(_270);
return _26f;
},toggleClassName:function(_271,_272){
if(!(_271=$(_271))){
return;
}
Element.classNames(_271)[_271.hasClassName(_272)?"remove":"add"](_272);
return _271;
},observe:function(){
Event.observe.apply(Event,arguments);
return $A(arguments).first();
},stopObserving:function(){
Event.stopObserving.apply(Event,arguments);
return $A(arguments).first();
},cleanWhitespace:function(_273){
_273=$(_273);
var node=_273.firstChild;
while(node){
var _275=node.nextSibling;
if(node.nodeType==3&&!/\S/.test(node.nodeValue)){
_273.removeChild(node);
}
node=_275;
}
return _273;
},empty:function(_276){
return $(_276).innerHTML.match(/^\s*$/);
},descendantOf:function(_277,_278){
_277=$(_277),_278=$(_278);
while(_277=_277.parentNode){
if(_277==_278){
return true;
}
}
return false;
},scrollTo:function(_279){
_279=$(_279);
var pos=Position.cumulativeOffset(_279);
window.scrollTo(pos[0],pos[1]);
return _279;
},getStyle:function(_27b,_27c){
_27b=$(_27b);
if(["float","cssFloat"].include(_27c)){
_27c=(typeof _27b.style.styleFloat!="undefined"?"styleFloat":"cssFloat");
}
_27c=_27c.camelize();
var _27d=_27b.style[_27c];
if(!_27d){
if(document.defaultView&&document.defaultView.getComputedStyle){
var css=document.defaultView.getComputedStyle(_27b,null);
_27d=css?css[_27c]:null;
}else{
if(_27b.currentStyle){
_27d=_27b.currentStyle[_27c];
}
}
}
if((_27d=="auto")&&["width","height"].include(_27c)&&(_27b.getStyle("display")!="none")){
_27d=_27b["offset"+_27c.capitalize()]+"px";
}
if(window.opera&&["left","top","right","bottom"].include(_27c)){
if(Element.getStyle(_27b,"position")=="static"){
_27d="auto";
}
}
if(_27c=="opacity"){
if(_27d){
return parseFloat(_27d);
}
if(_27d=(_27b.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){
if(_27d[1]){
return parseFloat(_27d[1])/100;
}
}
return 1;
}
return _27d=="auto"?null:_27d;
},setStyle:function(_27f,_280){
_27f=$(_27f);
for(var name in _280){
var _282=_280[name];
if(name=="opacity"){
if(_282==1){
_282=(/Gecko/.test(navigator.userAgent)&&!/Konqueror|Safari|KHTML/.test(navigator.userAgent))?0.999999:1;
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_27f.style.filter=_27f.getStyle("filter").replace(/alpha\([^\)]*\)/gi,"");
}
}else{
if(_282===""){
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_27f.style.filter=_27f.getStyle("filter").replace(/alpha\([^\)]*\)/gi,"");
}
}else{
if(_282<0.00001){
_282=0;
}
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_27f.style.filter=_27f.getStyle("filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+_282*100+")";
}
}
}
}else{
if(["float","cssFloat"].include(name)){
name=(typeof _27f.style.styleFloat!="undefined")?"styleFloat":"cssFloat";
}
}
_27f.style[name.camelize()]=_282;
}
return _27f;
},getDimensions:function(_283){
_283=$(_283);
var _284=$(_283).getStyle("display");
if(_284!="none"&&_284!=null){
return {width:_283.offsetWidth,height:_283.offsetHeight};
}
var els=_283.style;
var _286=els.visibility;
var _287=els.position;
var _288=els.display;
els.visibility="hidden";
els.position="absolute";
els.display="block";
var _289=_283.clientWidth;
var _28a=_283.clientHeight;
els.display=_288;
els.position=_287;
els.visibility=_286;
return {width:_289,height:_28a};
},makePositioned:function(_28b){
_28b=$(_28b);
var pos=Element.getStyle(_28b,"position");
if(pos=="static"||!pos){
_28b._madePositioned=true;
_28b.style.position="relative";
if(window.opera){
_28b.style.top=0;
_28b.style.left=0;
}
}
return _28b;
},undoPositioned:function(_28d){
_28d=$(_28d);
if(_28d._madePositioned){
_28d._madePositioned=undefined;
_28d.style.position=_28d.style.top=_28d.style.left=_28d.style.bottom=_28d.style.right="";
}
return _28d;
},makeClipping:function(_28e){
_28e=$(_28e);
if(_28e._overflow){
return _28e;
}
_28e._overflow=_28e.style.overflow||"auto";
if((Element.getStyle(_28e,"overflow")||"visible")!="hidden"){
_28e.style.overflow="hidden";
}
return _28e;
},undoClipping:function(_28f){
_28f=$(_28f);
if(!_28f._overflow){
return _28f;
}
_28f.style.overflow=_28f._overflow=="auto"?"":_28f._overflow;
_28f._overflow=null;
return _28f;
}};
Object.extend(Element.Methods,{childOf:Element.Methods.descendantOf});
Element._attributeTranslations={};
Element._attributeTranslations.names={colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",datetime:"dateTime",accesskey:"accessKey",tabindex:"tabIndex",enctype:"encType",maxlength:"maxLength",readonly:"readOnly",longdesc:"longDesc"};
Element._attributeTranslations.values={_getAttr:function(_290,_291){
return _290.getAttribute(_291,2);
},_flag:function(_292,_293){
return $(_292).hasAttribute(_293)?_293:null;
},style:function(_294){
return _294.style.cssText.toLowerCase();
},title:function(_295){
var node=_295.getAttributeNode("title");
return node.specified?node.nodeValue:null;
}};
Object.extend(Element._attributeTranslations.values,{href:Element._attributeTranslations.values._getAttr,src:Element._attributeTranslations.values._getAttr,disabled:Element._attributeTranslations.values._flag,checked:Element._attributeTranslations.values._flag,readonly:Element._attributeTranslations.values._flag,multiple:Element._attributeTranslations.values._flag});
Element.Methods.Simulated={hasAttribute:function(_297,_298){
var t=Element._attributeTranslations;
_298=t.names[_298]||_298;
return $(_297).getAttributeNode(_298).specified;
}};
if(document.all&&!window.opera){
Element.Methods.update=function(_29a,html){
_29a=$(_29a);
html=typeof html=="undefined"?"":html.toString();
var _29c=_29a.tagName.toUpperCase();
if(["THEAD","TBODY","TR","TD"].include(_29c)){
var div=document.createElement("div");
switch(_29c){
case "THEAD":
case "TBODY":
div.innerHTML="<table><tbody>"+html.stripScripts()+"</tbody></table>";
depth=2;
break;
case "TR":
div.innerHTML="<table><tbody><tr>"+html.stripScripts()+"</tr></tbody></table>";
depth=3;
break;
case "TD":
div.innerHTML="<table><tbody><tr><td>"+html.stripScripts()+"</td></tr></tbody></table>";
depth=4;
}
$A(_29a.childNodes).each(function(node){
_29a.removeChild(node);
});
depth.times(function(){
div=div.firstChild;
});
$A(div.childNodes).each(function(node){
_29a.appendChild(node);
});
}else{
_29a.innerHTML=html.stripScripts();
}
setTimeout(function(){
html.evalScripts();
},10);
return _29a;
};
}
Object.extend(Element,Element.Methods);
var _nativeExtensions=false;
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
["","Form","Input","TextArea","Select"].each(function(tag){
var _2a1="HTML"+tag+"Element";
if(window[_2a1]){
return;
}
var _2a2=window[_2a1]={};
_2a2.prototype=document.createElement(tag?tag.toLowerCase():"div").__proto__;
});
}
Element.addMethods=function(_2a3){
Object.extend(Element.Methods,_2a3||{});
function copy(_2a4,_2a5,_2a6){
_2a6=_2a6||false;
var _2a7=Element.extend.cache;
for(var _2a8 in _2a4){
var _2a9=_2a4[_2a8];
if(!_2a6||!(_2a8 in _2a5)){
_2a5[_2a8]=_2a7.findOrStore(_2a9);
}
}
}
if(typeof HTMLElement!="undefined"){
copy(Element.Methods,HTMLElement.prototype);
copy(Element.Methods.Simulated,HTMLElement.prototype,true);
copy(Form.Methods,HTMLFormElement.prototype);
[HTMLInputElement,HTMLTextAreaElement,HTMLSelectElement].each(function(_2aa){
copy(Form.Element.Methods,_2aa.prototype);
});
_nativeExtensions=true;
}
};
var Toggle=new Object();
Toggle.display=Element.toggle;
Abstract.Insertion=function(_2ab){
this.adjacency=_2ab;
};
Abstract.Insertion.prototype={initialize:function(_2ac,_2ad){
this.element=$(_2ac);
this.content=_2ad.stripScripts();
if(this.adjacency&&this.element.insertAdjacentHTML){
try{
this.element.insertAdjacentHTML(this.adjacency,this.content);
}
catch(e){
var _2ae=this.element.tagName.toUpperCase();
if(["TBODY","TR"].include(_2ae)){
this.insertContent(this.contentFromAnonymousTable());
}else{
throw e;
}
}
}else{
this.range=this.element.ownerDocument.createRange();
if(this.initializeRange){
this.initializeRange();
}
this.insertContent([this.range.createContextualFragment(this.content)]);
}
setTimeout(function(){
_2ad.evalScripts();
},10);
},contentFromAnonymousTable:function(){
var div=document.createElement("div");
div.innerHTML="<table><tbody>"+this.content+"</tbody></table>";
return $A(div.childNodes[0].childNodes[0].childNodes);
}};
var Insertion=new Object();
Insertion.Before=Class.create();
Insertion.Before.prototype=Object.extend(new Abstract.Insertion("beforeBegin"),{initializeRange:function(){
this.range.setStartBefore(this.element);
},insertContent:function(_2b0){
_2b0.each((function(_2b1){
this.element.parentNode.insertBefore(_2b1,this.element);
}).bind(this));
}});
Insertion.Top=Class.create();
Insertion.Top.prototype=Object.extend(new Abstract.Insertion("afterBegin"),{initializeRange:function(){
this.range.selectNodeContents(this.element);
this.range.collapse(true);
},insertContent:function(_2b2){
_2b2.reverse(false).each((function(_2b3){
this.element.insertBefore(_2b3,this.element.firstChild);
}).bind(this));
}});
Insertion.Bottom=Class.create();
Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion("beforeEnd"),{initializeRange:function(){
this.range.selectNodeContents(this.element);
this.range.collapse(this.element);
},insertContent:function(_2b4){
_2b4.each((function(_2b5){
this.element.appendChild(_2b5);
}).bind(this));
}});
Insertion.After=Class.create();
Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){
this.range.setStartAfter(this.element);
},insertContent:function(_2b6){
_2b6.each((function(_2b7){
this.element.parentNode.insertBefore(_2b7,this.element.nextSibling);
}).bind(this));
}});
Element.ClassNames=Class.create();
Element.ClassNames.prototype={initialize:function(_2b8){
this.element=$(_2b8);
},_each:function(_2b9){
this.element.className.split(/\s+/).select(function(name){
return name.length>0;
})._each(_2b9);
},set:function(_2bb){
this.element.className=_2bb;
},add:function(_2bc){
if(this.include(_2bc)){
return;
}
this.set($A(this).concat(_2bc).join(" "));
},remove:function(_2bd){
if(!this.include(_2bd)){
return;
}
this.set($A(this).without(_2bd).join(" "));
},toString:function(){
return $A(this).join(" ");
}};
Object.extend(Element.ClassNames.prototype,Enumerable);
var Selector=Class.create();
Selector.prototype={initialize:function(_2be){
this.params={classNames:[]};
this.expression=_2be.toString().strip();
this.parseExpression();
this.compileMatcher();
},parseExpression:function(){
function abort(_2bf){
throw "Parse error in selector: "+_2bf;
}
if(this.expression==""){
abort("empty expression");
}
var _2c0=this.params,expr=this.expression,_2c2,_2c3,_2c4,rest;
while(_2c2=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){
_2c0.attributes=_2c0.attributes||[];
_2c0.attributes.push({name:_2c2[2],operator:_2c2[3],value:_2c2[4]||_2c2[5]||""});
expr=_2c2[1];
}
if(expr=="*"){
return this.params.wildcard=true;
}
while(_2c2=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)){
_2c3=_2c2[1],_2c4=_2c2[2],rest=_2c2[3];
switch(_2c3){
case "#":
_2c0.id=_2c4;
break;
case ".":
_2c0.classNames.push(_2c4);
break;
case "":
case undefined:
_2c0.tagName=_2c4.toUpperCase();
break;
default:
abort(expr.inspect());
}
expr=rest;
}
if(expr.length>0){
abort(expr.inspect());
}
},buildMatchExpression:function(){
var _2c6=this.params,_2c7=[],_2c8;
if(_2c6.wildcard){
_2c7.push("true");
}
if(_2c8=_2c6.id){
_2c7.push("element.readAttribute(\"id\") == "+_2c8.inspect());
}
if(_2c8=_2c6.tagName){
_2c7.push("element.tagName.toUpperCase() == "+_2c8.inspect());
}
if((_2c8=_2c6.classNames).length>0){
for(var i=0,_2ca=_2c8.length;i<_2ca;i++){
_2c7.push("element.hasClassName("+_2c8[i].inspect()+")");
}
}
if(_2c8=_2c6.attributes){
_2c8.each(function(_2cb){
var _2cc="element.readAttribute("+_2cb.name.inspect()+")";
var _2cd=function(_2ce){
return _2cc+" && "+_2cc+".split("+_2ce.inspect()+")";
};
switch(_2cb.operator){
case "=":
_2c7.push(_2cc+" == "+_2cb.value.inspect());
break;
case "~=":
_2c7.push(_2cd(" ")+".include("+_2cb.value.inspect()+")");
break;
case "|=":
_2c7.push(_2cd("-")+".first().toUpperCase() == "+_2cb.value.toUpperCase().inspect());
break;
case "!=":
_2c7.push(_2cc+" != "+_2cb.value.inspect());
break;
case "":
case undefined:
_2c7.push("element.hasAttribute("+_2cb.name.inspect()+")");
break;
default:
throw "Unknown operator "+_2cb.operator+" in selector";
}
});
}
return _2c7.join(" && ");
},compileMatcher:function(){
this.match=new Function("element","if (!element.tagName) return false;       element = $(element);       return "+this.buildMatchExpression());
},findElements:function(_2cf){
var _2d0;
if(_2d0=$(this.params.id)){
if(this.match(_2d0)){
if(!_2cf||Element.childOf(_2d0,_2cf)){
return [_2d0];
}
}
}
_2cf=(_2cf||document).getElementsByTagName(this.params.tagName||"*");
var _2d1=[];
for(var i=0,_2d3=_2cf.length;i<_2d3;i++){
if(this.match(_2d0=_2cf[i])){
_2d1.push(Element.extend(_2d0));
}
}
return _2d1;
},toString:function(){
return this.expression;
}};
Object.extend(Selector,{matchElements:function(_2d4,_2d5){
var _2d6=new Selector(_2d5);
return _2d4.select(_2d6.match.bind(_2d6)).map(Element.extend);
},findElement:function(_2d7,_2d8,_2d9){
if(typeof _2d8=="number"){
_2d9=_2d8,_2d8=false;
}
return Selector.matchElements(_2d7,_2d8||"*")[_2d9||0];
},findChildElements:function(_2da,_2db){
return _2db.map(function(_2dc){
return _2dc.match(/[^\s"]+(?:"[^"]*"[^\s"]+)*/g).inject([null],function(_2dd,expr){
var _2df=new Selector(expr);
return _2dd.inject([],function(_2e0,_2e1){
return _2e0.concat(_2df.findElements(_2e1||_2da));
});
});
}).flatten();
}});
function $$(){
return Selector.findChildElements(document,$A(arguments));
}
var Form={reset:function(form){
$(form).reset();
return form;
},serializeElements:function(_2e3,_2e4){
var data=_2e3.inject({},function(_2e6,_2e7){
if(!_2e7.disabled&&_2e7.name){
var key=_2e7.name,_2e9=$(_2e7).getValue();
if(_2e9!=undefined){
if(_2e6[key]){
if(_2e6[key].constructor!=Array){
_2e6[key]=[_2e6[key]];
}
_2e6[key].push(_2e9);
}else{
_2e6[key]=_2e9;
}
}
}
return _2e6;
});
return _2e4?data:Hash.toQueryString(data);
}};
Form.Methods={serialize:function(form,_2eb){
return Form.serializeElements(Form.getElements(form),_2eb);
},getElements:function(form){
return $A($(form).getElementsByTagName("*")).inject([],function(_2ed,_2ee){
if(Form.Element.Serializers[_2ee.tagName.toLowerCase()]){
_2ed.push(Element.extend(_2ee));
}
return _2ed;
});
},getInputs:function(form,_2f0,name){
form=$(form);
var _2f2=form.getElementsByTagName("input");
if(!_2f0&&!name){
return $A(_2f2).map(Element.extend);
}
for(var i=0,_2f4=[],_2f5=_2f2.length;i<_2f5;i++){
var _2f6=_2f2[i];
if((_2f0&&_2f6.type!=_2f0)||(name&&_2f6.name!=name)){
continue;
}
_2f4.push(Element.extend(_2f6));
}
return _2f4;
},disable:function(form){
form=$(form);
form.getElements().each(function(_2f8){
_2f8.blur();
_2f8.disabled="true";
});
return form;
},enable:function(form){
form=$(form);
form.getElements().each(function(_2fa){
_2fa.disabled="";
});
return form;
},findFirstElement:function(form){
return $(form).getElements().find(function(_2fc){
return _2fc.type!="hidden"&&!_2fc.disabled&&["input","select","textarea"].include(_2fc.tagName.toLowerCase());
});
},focusFirstElement:function(form){
form=$(form);
form.findFirstElement().activate();
return form;
}};
Object.extend(Form,Form.Methods);
Form.Element={focus:function(_2fe){
$(_2fe).focus();
return _2fe;
},select:function(_2ff){
$(_2ff).select();
return _2ff;
}};
Form.Element.Methods={serialize:function(_300){
_300=$(_300);
if(!_300.disabled&&_300.name){
var _301=_300.getValue();
if(_301!=undefined){
var pair={};
pair[_300.name]=_301;
return Hash.toQueryString(pair);
}
}
return "";
},getValue:function(_303){
_303=$(_303);
var _304=_303.tagName.toLowerCase();
return Form.Element.Serializers[_304](_303);
},clear:function(_305){
$(_305).value="";
return _305;
},present:function(_306){
return $(_306).value!="";
},activate:function(_307){
_307=$(_307);
_307.focus();
if(_307.select&&(_307.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(_307.type))){
_307.select();
}
return _307;
},disable:function(_308){
_308=$(_308);
_308.disabled=true;
return _308;
},enable:function(_309){
_309=$(_309);
_309.blur();
_309.disabled=false;
return _309;
}};
Object.extend(Form.Element,Form.Element.Methods);
var Field=Form.Element;
var $F=Form.Element.getValue;
Form.Element.Serializers={input:function(_30a){
switch(_30a.type.toLowerCase()){
case "checkbox":
case "radio":
return Form.Element.Serializers.inputSelector(_30a);
default:
return Form.Element.Serializers.textarea(_30a);
}
},inputSelector:function(_30b){
return _30b.checked?_30b.value:null;
},textarea:function(_30c){
return _30c.value;
},select:function(_30d){
return this[_30d.type=="select-one"?"selectOne":"selectMany"](_30d);
},selectOne:function(_30e){
var _30f=_30e.selectedIndex;
return _30f>=0?this.optionValue(_30e.options[_30f]):null;
},selectMany:function(_310){
var _311,_312=_310.length;
if(!_312){
return null;
}
for(var i=0,_311=[];i<_312;i++){
var opt=_310.options[i];
if(opt.selected){
_311.push(this.optionValue(opt));
}
}
return _311;
},optionValue:function(opt){
return Element.extend(opt).hasAttribute("value")?opt.value:opt.text;
}};
Abstract.TimedObserver=function(){
};
Abstract.TimedObserver.prototype={initialize:function(_316,_317,_318){
this.frequency=_317;
this.element=$(_316);
this.callback=_318;
this.lastValue=this.getValue();
this.registerCallback();
},registerCallback:function(){
setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},onTimerEvent:function(){
var _319=this.getValue();
var _31a=("string"==typeof this.lastValue&&"string"==typeof _319?this.lastValue!=_319:String(this.lastValue)!=String(_319));
if(_31a){
this.callback(this.element,_319);
this.lastValue=_319;
}
}};
Form.Element.Observer=Class.create();
Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){
return Form.Element.getValue(this.element);
}});
Form.Observer=Class.create();
Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){
return Form.serialize(this.element);
}});
Abstract.EventObserver=function(){
};
Abstract.EventObserver.prototype={initialize:function(_31b,_31c){
this.element=$(_31b);
this.callback=_31c;
this.lastValue=this.getValue();
if(this.element.tagName.toLowerCase()=="form"){
this.registerFormCallbacks();
}else{
this.registerCallback(this.element);
}
},onElementEvent:function(){
var _31d=this.getValue();
if(this.lastValue!=_31d){
this.callback(this.element,_31d);
this.lastValue=_31d;
}
},registerFormCallbacks:function(){
Form.getElements(this.element).each(this.registerCallback.bind(this));
},registerCallback:function(_31e){
if(_31e.type){
switch(_31e.type.toLowerCase()){
case "checkbox":
case "radio":
Event.observe(_31e,"click",this.onElementEvent.bind(this));
break;
default:
Event.observe(_31e,"change",this.onElementEvent.bind(this));
break;
}
}
}};
Form.Element.EventObserver=Class.create();
Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){
return Form.Element.getValue(this.element);
}});
Form.EventObserver=Class.create();
Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){
return Form.serialize(this.element);
}});
if(!window.Event){
var Event=new Object();
}
Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,element:function(_31f){
return _31f.target||_31f.srcElement;
},isLeftClick:function(_320){
return (((_320.which)&&(_320.which==1))||((_320.button)&&(_320.button==1)));
},pointerX:function(_321){
return _321.pageX||(_321.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
},pointerY:function(_322){
return _322.pageY||(_322.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
},stop:function(_323){
if(_323.preventDefault){
_323.preventDefault();
_323.stopPropagation();
}else{
_323.returnValue=false;
_323.cancelBubble=true;
}
},findElement:function(_324,_325){
var _326=Event.element(_324);
while(_326.parentNode&&(!_326.tagName||(_326.tagName.toUpperCase()!=_325.toUpperCase()))){
_326=_326.parentNode;
}
return _326;
},observers:false,_observeAndCache:function(_327,name,_329,_32a){
if(!this.observers){
this.observers=[];
}
if(_327.addEventListener){
this.observers.push([_327,name,_329,_32a]);
_327.addEventListener(name,_329,_32a);
}else{
if(_327.attachEvent){
this.observers.push([_327,name,_329,_32a]);
_327.attachEvent("on"+name,_329);
}
}
},unloadCache:function(){
if(!Event.observers){
return;
}
for(var i=0,_32c=Event.observers.length;i<_32c;i++){
Event.stopObserving.apply(this,Event.observers[i]);
Event.observers[i][0]=null;
}
Event.observers=false;
},observe:function(_32d,name,_32f,_330){
_32d=$(_32d);
_330=_330||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_32d.attachEvent)){
name="keydown";
}
Event._observeAndCache(_32d,name,_32f,_330);
},stopObserving:function(_331,name,_333,_334){
_331=$(_331);
_334=_334||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_331.detachEvent)){
name="keydown";
}
if(_331.removeEventListener){
_331.removeEventListener(name,_333,_334);
}else{
if(_331.detachEvent){
try{
_331.detachEvent("on"+name,_333);
}
catch(e){
}
}
}
}});
if(navigator.appVersion.match(/\bMSIE\b/)){
Event.observe(window,"unload",Event.unloadCache,false);
}
var Position={includeScrollOffsets:false,prepare:function(){
this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;
this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;
},realOffset:function(_335){
var _336=0,_337=0;
do{
_336+=_335.scrollTop||0;
_337+=_335.scrollLeft||0;
_335=_335.parentNode;
}while(_335);
return [_337,_336];
},cumulativeOffset:function(_338){
var _339=0,_33a=0;
do{
_339+=_338.offsetTop||0;
_33a+=_338.offsetLeft||0;
_338=_338.offsetParent;
}while(_338);
return [_33a,_339];
},positionedOffset:function(_33b){
var _33c=0,_33d=0;
do{
_33c+=_33b.offsetTop||0;
_33d+=_33b.offsetLeft||0;
_33b=_33b.offsetParent;
if(_33b){
if(_33b.tagName=="BODY"){
break;
}
var p=Element.getStyle(_33b,"position");
if(p=="relative"||p=="absolute"){
break;
}
}
}while(_33b);
return [_33d,_33c];
},offsetParent:function(_33f){
if(_33f.offsetParent){
return _33f.offsetParent;
}
if(_33f==document.body){
return _33f;
}
while((_33f=_33f.parentNode)&&_33f!=document.body){
if(Element.getStyle(_33f,"position")!="static"){
return _33f;
}
}
return document.body;
},within:function(_340,x,y){
if(this.includeScrollOffsets){
return this.withinIncludingScrolloffsets(_340,x,y);
}
this.xcomp=x;
this.ycomp=y;
this.offset=this.cumulativeOffset(_340);
return (y>=this.offset[1]&&y<this.offset[1]+_340.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+_340.offsetWidth);
},withinIncludingScrolloffsets:function(_343,x,y){
var _346=this.realOffset(_343);
this.xcomp=x+_346[0]-this.deltaX;
this.ycomp=y+_346[1]-this.deltaY;
this.offset=this.cumulativeOffset(_343);
return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+_343.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+_343.offsetWidth);
},overlap:function(mode,_348){
if(!mode){
return 0;
}
if(mode=="vertical"){
return ((this.offset[1]+_348.offsetHeight)-this.ycomp)/_348.offsetHeight;
}
if(mode=="horizontal"){
return ((this.offset[0]+_348.offsetWidth)-this.xcomp)/_348.offsetWidth;
}
},page:function(_349){
var _34a=0,_34b=0;
var _34c=_349;
do{
_34a+=_34c.offsetTop||0;
_34b+=_34c.offsetLeft||0;
if(_34c.offsetParent==document.body){
if(Element.getStyle(_34c,"position")=="absolute"){
break;
}
}
}while(_34c=_34c.offsetParent);
_34c=_349;
do{
if(!window.opera||_34c.tagName=="BODY"){
_34a-=_34c.scrollTop||0;
_34b-=_34c.scrollLeft||0;
}
}while(_34c=_34c.parentNode);
return [_34b,_34a];
},clone:function(_34d,_34e){
var _34f=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});
_34d=$(_34d);
var p=Position.page(_34d);
_34e=$(_34e);
var _351=[0,0];
var _352=null;
if(Element.getStyle(_34e,"position")=="absolute"){
_352=Position.offsetParent(_34e);
_351=Position.page(_352);
}
if(_352==document.body){
_351[0]-=document.body.offsetLeft;
_351[1]-=document.body.offsetTop;
}
if(_34f.setLeft){
_34e.style.left=(p[0]-_351[0]+_34f.offsetLeft)+"px";
}
if(_34f.setTop){
_34e.style.top=(p[1]-_351[1]+_34f.offsetTop)+"px";
}
if(_34f.setWidth){
_34e.style.width=_34d.offsetWidth+"px";
}
if(_34f.setHeight){
_34e.style.height=_34d.offsetHeight+"px";
}
},absolutize:function(_353){
_353=$(_353);
if(_353.style.position=="absolute"){
return;
}
Position.prepare();
var _354=Position.positionedOffset(_353);
var top=_354[1];
var left=_354[0];
var _357=_353.clientWidth;
var _358=_353.clientHeight;
_353._originalLeft=left-parseFloat(_353.style.left||0);
_353._originalTop=top-parseFloat(_353.style.top||0);
_353._originalWidth=_353.style.width;
_353._originalHeight=_353.style.height;
_353.style.position="absolute";
_353.style.top=top+"px";
_353.style.left=left+"px";
_353.style.width=_357+"px";
_353.style.height=_358+"px";
},relativize:function(_359){
_359=$(_359);
if(_359.style.position=="relative"){
return;
}
Position.prepare();
_359.style.position="relative";
var top=parseFloat(_359.style.top||0)-(_359._originalTop||0);
var left=parseFloat(_359.style.left||0)-(_359._originalLeft||0);
_359.style.top=top+"px";
_359.style.left=left+"px";
_359.style.height=_359._originalHeight;
_359.style.width=_359._originalWidth;
}};
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
Position.cumulativeOffset=function(_35c){
var _35d=0,_35e=0;
do{
_35d+=_35c.offsetTop||0;
_35e+=_35c.offsetLeft||0;
if(_35c.offsetParent==document.body){
if(Element.getStyle(_35c,"position")=="absolute"){
break;
}
}
_35c=_35c.offsetParent;
}while(_35c);
return [_35e,_35d];
};
}
Element.addMethods();
var detect=navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;
function getBrowserInfo(){
if(checkIt("konqueror")){
browser="Konqueror";
OS="Linux";
}else{
if(checkIt("safari")){
browser="Safari";
}else{
if(checkIt("omniweb")){
browser="OmniWeb";
}else{
if(checkIt("opera")){
browser="Opera";
}else{
if(checkIt("webtv")){
browser="WebTV";
}else{
if(checkIt("icab")){
browser="iCab";
}else{
if(checkIt("msie")){
browser="Internet Explorer";
}else{
if(!checkIt("compatible")){
browser="Netscape Navigator";
version=detect.charAt(8);
}else{
browser="An unknown browser";
}
}
}
}
}
}
}
}
if(!version){
version=detect.charAt(place+thestring.length);
}
if(!OS){
if(checkIt("linux")){
OS="Linux";
}else{
if(checkIt("x11")){
OS="Unix";
}else{
if(checkIt("mac")){
OS="Mac";
}else{
if(checkIt("win")){
OS="Windows";
}else{
OS="an unknown operating system";
}
}
}
}
}
}
function checkIt(_35f){
place=detect.indexOf(_35f)+1;
thestring=_35f;
return place;
}
Event.observe(window,"load",initialize,false);
Event.observe(window,"load",getBrowserInfo,false);
Event.observe(window,"unload",Event.unloadCache,false);
var lightbox=Class.create();
lightbox.prototype={yPos:0,xPos:0,

initialize: function(ctrl) {
	if ($('lbOnAuto')) {
		var lbOnAuto = $('lbOnAuto').value; 
		if (lbOnAuto) {
			this.content = lbOnAuto;
			if (browser == 'Internet Explorer'){
				this.getScroll();
				this.prepareIE('2600px', 'scroll');
				this.setScroll(0,0);
				this.hideSelects('hidden');
			}
			this.displayLightbox("block");
			$('lbOnAuto').value = '';
		} 
	}

	this.atag = ctrl;
	this.content = ctrl.href;
	Event.observe(ctrl, 'click', this.activate.bindAsEventListener(this), false);
	ctrl.onclick = function(){
		return false;
	};
},
activate:function(){
if(browser=="Internet Explorer"){
this.getScroll();
this.prepareIE("100%","hidden");
this.setScroll(0,0);
this.hideSelects("hidden");
}
this.displayLightbox("block");
},prepareIE:function(_361,_362){
bod=document.getElementsByTagName("body")[0];
bod.style.height=_361;
bod.style.overflow=_362;
htm=document.getElementsByTagName("html")[0];
htm.style.height=_361;
htm.style.overflow=_362;
},hideSelects:function(_363){
selects=document.getElementsByTagName("select");
for(i=0;i<selects.length;i++){
selects[i].style.visibility=_363;
}
},getScroll:function(){
if(self.pageYOffset){
this.yPos=self.pageYOffset;
}else{
if(document.documentElement&&document.documentElement.scrollTop){
this.yPos=document.documentElement.scrollTop;
}else{
if(document.body){
this.yPos=document.body.scrollTop;
}
}
}
},setScroll:function(x,y){
window.scrollTo(x,y);
},displayLightbox:function(_366){
$("overlay").style.display=_366;
$("lightbox").style.display=_366;
if(_366!="none"){
this.loadInfo();
}
},loadInfo:function(){
var _367=new Ajax.Request(this.content,{method:"post",parameters:"",onComplete:this.processInfo.bindAsEventListener(this)});
},processInfo:function(_368){
info="<div id='lbContent'>"+_368.responseText+"</div>";
new Insertion.Before($("lbLoadMessage"),info);
$("lightbox").className="done";
this.actions();
},actions:function(){
lbActions=document.getElementsByClassName("lbAction");
for(i=0;i<lbActions.length;i++){
Event.observe(lbActions[i],"click",this[lbActions[i].rel].bindAsEventListener(this),false);
lbActions[i].onclick=function(){
return false;
};
}
},insert:function(e){
link=Event.element(e).parentNode;
Element.remove($("lbContent"));
var _36a=new Ajax.Request(link.href,{method:"post",parameters:"",onComplete:this.processInfo.bindAsEventListener(this)});
},deactivate:function(){
Element.remove($("lbContent"));
if(browser=="Internet Explorer"){
this.setScroll(0,this.yPos);
this.prepareIE("auto","auto");
this.hideSelects("visible");
}
this.displayLightbox("none");
}};
function initialize(){
addLightboxMarkup();
lbox=document.getElementsByClassName("lbOn");
for(i=0;i<lbox.length;i++){
valid=new lightbox(lbox[i]);
}
}
function addLightboxMarkup(){
bod=document.getElementsByTagName("body")[0];
overlay=document.createElement("div");
overlay.id="overlay";
lb=document.createElement("div");
lb.id="lightbox";
lb.className="loading";
lb.innerHTML="<div id=\"lbLoadMessage\">"+"<p>Loading</p>"+"</div>";
bod.appendChild(overlay);
bod.appendChild(lb);
}
var Scriptaculous={Version:"1.7.0",require:function(_36b){
document.write("<script type=\"text/javascript\" src=\""+_36b+"\"></script>");
},load:function(){
if((typeof Prototype=="undefined")||(typeof Element=="undefined")||(typeof Element.Methods=="undefined")||parseFloat(Prototype.Version.split(".")[0]+"."+Prototype.Version.split(".")[1])<1.5){
throw ("script.aculo.us requires the Prototype JavaScript framework >= 1.5.0");
}
$A(document.getElementsByTagName("script")).findAll(function(s){
return (s.src&&s.src.match(/scriptaculous\.js(\?.*)?$/));
}).each(function(s){
var path=s.src.replace(/scriptaculous\.js(\?.*)?$/,"");
var _36f=s.src.match(/\?.*load=([a-z,]*)/);
(_36f?_36f[1]:"builder,effects,dragdrop,controls,slider").split(",").each(function(_370){
Scriptaculous.require(path+_370+".js");
});
});
}};
Scriptaculous.load();
function show(id){
new Effect.BlindDown(id,{queue:"end",duration:0.3});
}
function hide(id){
new Effect.BlindUp(id,{queue:"end",duration:0.3});
}
function show_login(){
new Effect.BlindUp("mini-register",{queue:"front",duration:0.3});
new Effect.BlindDown("mini-login",{queue:"end",duration:0.3});
document.getElementById("click-register").style.display="block";
document.getElementById("click-login").style.display="none";
}
function show_register(){
new Effect.BlindUp("mini-login",{queue:"front",duration:0.3});
new Effect.BlindDown("mini-register",{queue:"end",duration:0.3});
document.getElementById("click-login").style.display="block";
document.getElementById("click-register").style.display="none";
}
function toggleList(b,a){
if(document.getElementById("t-"+b).value==1){
new Effect.toggle("subcat-"+b,"appear",{queue:"front",duration:0.3});
document.getElementById("t-"+b).value=0;
if(a!==1){
document.getElementById("a-"+b).style.display="block";
document.getElementById("ad-"+b).style.display="none";
}else{
document.getElementById("o-"+b).style.display="block";
document.getElementById("od-"+b).style.display="none";
}
}else{
new Effect.toggle("subcat-"+b,"blind",{queue:"front",duration:0.3});
document.getElementById("t-"+b).value=1;
if(a!==1){
document.getElementById("a-"+b).style.display="none";
document.getElementById("ad-"+b).style.display="block";
}else{
document.getElementById("o-"+b).style.display="none";
document.getElementById("od-"+b).style.display="block";
}
}
}
function makehtml(text){
var _376=text.replace(/&/g,"amp;");
return (_376);
}
function urlencode(id){
var _378="0123456789"+"ABCDEFGHIJKLMNOPQRSTUVWXYZ"+"abcdefghijklmnopqrstuvwxyz"+"-_.!~*()%+";
var HEX="0123456789ABCDEF";
var _37a=document.getElementById(id).value;
var _37b="";
for(var i=0;i<_37a.length;i++){
var ch=_37a.charAt(i);
if(ch==" "){
_37b+="+";
}else{
if(_378.indexOf(ch)!=-1){
_37b+=ch;
}else{
var _37e=ch.charCodeAt(0);
if(_37e>255){
_37b+="+";
}else{
_37b+="%";
_37b+=HEX.charAt((_37e>>4)&15);
_37b+=HEX.charAt(_37e&15);
}
}
}
}
return _37b;
}
function ajax(page,_380,_381,_382,str){
var _384=false;
try{
_384=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
try{
_384=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(E){
_384=false;
}
}
if(!_384&&typeof XMLHttpRequest!="undefined"){
_384=new XMLHttpRequest();
}
obj=document.getElementById(_380);
if(_381!=="0"){
obj.innerHTML="<div id=\""+_381+"\"></div>";
}
var file="/assets/php/"+page;
if(_382=="get"){
_384.open("GET",file+str,true);
_384.onreadystatechange=function(){
if(_384.readyState==4&&_384.status==200){
var _386=_384.responseText;
if(_386){
obj.innerHTML=_386;
}
}
};
_384.send(null);
}else{
_384.open("POST",file,true);
_384.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
_384.onreadystatechange=function(){
if(_384.readyState==4&&_384.status==200){
var _387=_384.responseText;
if(_387){
obj.innerHTML=_387;
}
}
};
_384.send(str);
}
}
function getformvalues(fobj){
var str="";
aok=true;
var val;
for(var i=0;i<fobj.elements.length;i++){
if(fobj.elements[i].name=="remove_cat[]"){
if(fobj.elements[i].checked==true){
str+=fobj.elements[i].name+"="+escape(fobj.elements[i].value)+"&";
continue;
}
}else{
str+=fobj.elements[i].name+"="+escape(fobj.elements[i].value)+"&";
}
}
return str;
}
function submitform(_38c,page,_38e,obj){
var file=page;
var str=getformvalues(_38c);
ajax(page,obj,_38e,"post",str);
}
function fail(obj){
var t=document.getElementById(obj);
t.style.display="none";
}
function ok(obj){
var t=document.getElementById(obj);
t.style.display="block";
}
function check(id){
if(id=="r-email"){
str=document.getElementById(id).value;
var at="@";
var dot=".";
var lat=str.indexOf(at);
var lstr=str.length;
var ldot=str.indexOf(dot);
if(str.indexOf(at)==-1){
fail("r-email-ok");
return false;
}
if(str.indexOf(at)==-1||str.indexOf(at)==0||str.indexOf(at)==lstr){
fail("email");
return false;
}
if(str.indexOf(dot)==-1||str.indexOf(dot)==0||str.indexOf(dot)==lstr){
fail("email");
return false;
}
if(str.indexOf(at,(lat+1))!=-1){
fail("email");
return false;
}
if(str.substring(lat-1,lat)==dot||str.substring(lat+1,lat+2)==dot){
fail("email");
return false;
}
if(str.indexOf(dot,(lat+2))==-1){
fail("email");
return false;
}
if(str.indexOf(" ")!=-1){
fail("email");
return false;
}
ok("r-email-ok");
return true;
}
if(id=="r-login_id"){
var ID=document.getElementById("r-login_id");
var _39d="!@#$%^&*()+=-[]\\';,./{}|\":<>?";
for(var i=0;i<ID.value.length;i++){
if(_39d.indexOf(ID.value.charAt(i))!=-1){
alert("Your login ID has special characters. \nThese are not allowed.\n Please remove them and try again.");
return false;
}
}
var _39d=" ";
for(var i=0;i<ID.value.length;i++){
if(_39d.indexOf(ID.value.charAt(i))!=-1){
alert("Sorry, no spaces are allowed in your login ID. \nPlease use an underscore \"_\" instead.");
return false;
}
}
if((ID.value==null)||(ID.value=="")){
fail("r-login_id-ok");
return false;
}
return true;
}
if(id=="sex"){
var ID=document.getElementById("sex");
if((ID.value==null)||(ID.value=="")){
fail("sex-ok");
return false;
}
ok("sex-ok");
return true;
}
if(id=="byear"){
var ID=document.getElementById("byear");
if((ID.value==null)||(ID.value=="")){
fail("byear-ok");
return false;
}
ok("byear-ok");
return true;
}
if(id=="r-pass"){
var ID=document.getElementById("r-pass");
if((ID.value==null)||(ID.value=="")||(ID.value.length<4)){
fail("r-pass-ok");
return false;
}
ok("r-pass-ok");
return true;
}
if(id=="r-pass2"){
var ID=document.getElementById("r-pass");
var ID2=document.getElementById("r-pass2");
if((ID.value!==ID2.value)){
fail("r-pass2-ok");
return false;
}
ok("r-pass2-ok");
return true;
}
if(id=="l-login_id"){
var ID=document.getElementById("l-login_id");
if((ID.value==null)||(ID.value=="")){
fail("l-login_id-ok");
return false;
}
ok("l-login_id-ok");
return true;
}
if(id=="l-pass"){
var ID=document.getElementById("l-pass");
if((ID.value==null)||(ID.value=="")){
fail("l-pass-ok");
return false;
}
ok("l-pass-ok");
return true;
}
if(id=="description"){
var ID=document.getElementById("description");
if((ID.value==null)||(ID.value=="")){
fail("description-ok");
return false;
}
ok("description-ok");
return true;
}
if(id=="link"){
var ID=document.getElementById("link");
if((ID.value==null)||(ID.value=="")||(ID.value.length<4)){
fail("link-ok");
return false;
}
ok("link-ok");
return true;
}
if(id=="form-register"){
var ID=document.getElementById("r-email");
if((ID.value==null)||(ID.value=="")||(ID.value=="Email")){
alert("Please enter a valid Email Address.");
ID.focus();
fail("r-email-ok");
return false;
}
if(check("r-email")==false){
alert("Please enter a valid Email Address.");
ID.value="";
ID.focus();
fail("r-email-ok");
return false;
}
var ID=document.getElementById("r-login_id");
if((ID.value==null)||(ID.value=="")||(ID.value=="Login ID")){
alert("Please enter a Login ID.");
ID.focus();
fail("r-login_id-ok");
return false;
}
var _39d="!@#$%^&*()+=-[]\\';,./{}|\":<>?";
for(var i=0;i<ID.value.length;i++){
if(_39d.indexOf(ID.value.charAt(i))!=-1){
alert("Your username has special characters. \nThese are not allowed. \nPlease remove them and try again.");
return false;
}
}
var _39d=" ";
for(var i=0;i<ID.value.length;i++){
if(_39d.indexOf(ID.value.charAt(i))!=-1){
alert("Sorry, no spaces are allowed in your login ID. \nPlease use an underscore \"_\" instead.");
return false;
}
}
var ID=document.getElementById("byear");
if((ID.value==null)||(ID.value=="")){
alert("Please specify your birth year.");
ID.focus();
fail("byear-ok");
return false;
}
var ID=document.getElementById("sex");
if((ID.value==null)||(ID.value=="")){
alert("Please specify your sex.");
ID.focus();
fail("sex-ok");
return false;
}
var ID=document.getElementById("r-pass");
var ID2=document.getElementById("r-pass2");
if((ID.value==null)||(ID.value=="")||(ID.value=="Password")){
alert("Please enter a Password. Your Password must be at least 4 characters in length.");
ID.focus();
fail("r-pass-ok");
return false;
}
if((ID2.value==null)||(ID2.value=="")||(ID2.value=="Password")){
alert("Please Verify your Password. Password and Verify fields must match.");
ID.focus();
fail("r-pass2-ok");
return false;
}
if(ID.value.length<4){
alert("Your Password must be at least 4 characters in length.");
ID.focus();
fail("r-pass-ok");
return false;
}
if(ID.value!==ID2.value){
alert("Password and Verify fields must match.");
ID.value="";
ID2.value="";
ID.focus();
fail("r-pass-ok");
fail("r-pass2-ok");
return false;
}
var ID=document.getElementById("terms");
if(ID.checked==false){
alert("You must agree to the Terms & Privacy Policy before continuing.");
return false;
}
return true;
}
if(id=="form-login"){
var ID=document.getElementById("l-login_id");
if((ID.value==null)||(ID.value=="")||(ID.value=="Login ID")){
alert("Please enter a Login ID.");
ID.focus();
fail("l-login_id-ok");
return false;
}
var ID=document.getElementById("l-pass");
if((ID.value==null)||(ID.value=="")||(ID.value=="Password")){
alert("Please enter a Password.");
ID.focus();
fail("l-pass-ok");
return false;
}
document.getElementById("wait").style.display="";
return true;
}
if(id=="form-login"){
var ID=document.getElementById("l-login_id");
if((ID.value==null)||(ID.value=="")||(ID.value=="Login ID")){
alert("Please enter a Login ID.");
ID.focus();
fail("l-login_id-ok");
return false;
}
var ID=document.getElementById("l-pass");
if((ID.value==null)||(ID.value=="")||(ID.value=="Password")){
alert("Please enter a Password.");
ID.focus();
fail("l-pass-ok");
return false;
}
document.getElementById("wait").style.display="";
return true;
}
if(id=="form-submit"){
var ID=document.getElementById("description");
if((ID.value==null)||(ID.value=="")||(ID.value=="Description")){
alert("Please enter a short Description for your Link submission or request.");
ID.focus();
fail("description-ok");
return false;
}
var ID=document.getElementById("link");
if((ID.value==null)||(ID.value=="")){
alert("Please enter a Show Link to submit.");
ID.focus();
fail("link-ok");
return false;
}
document.getElementById("wait").style.display="";
return true;
}
}
var formblock;
var forminputs;
function prepare(){
formblock=document.getElementById("form_id");
forminputs=formblock.getElementsByTagName("input");
}
function select_all(name,_3a1){
for(i=0;i<forminputs.length;i++){
var _3a2=new RegExp(name,"i");
if(_3a2.test(forminputs[i].getAttribute("name"))){
if(_3a1=="1"){
forminputs[i].checked=true;
}else{
forminputs[i].checked=false;
}
}
var _3a3=new RegExp("-bool","i");
if(_3a3.test(forminputs[i].getAttribute("name"))){
if(_3a1=="1"){
forminputs[i].value=1;
}else{
forminputs[i].value=0;
}
}
}
}
if(window.addEventListener){
window.addEventListener("load",prepare,false);
}else{
if(window.attachEvent){
window.attachEvent("onload",prepare);
}else{
if(document.getElementById){
window.onload=prepare;
}
}
}
var _Padding=0,_scrollMax,_bnr,_bnrTop,_prevPos=0;
function Scrollinit(){
_bnr=document.getElementById("bnr3");
if(screen.width>600){
_bnrTop=_bnr.offsetTop;
_scrollMax=document.getElementById("fslispc3").offsetHeight+_bnrTop-_bnr.offsetHeight-_Padding;
scrollBnr();
}
}
function scrollBnr(){
if(screen.width>600){
if(_scrollMax>_bnrTop&&_prevPos!=pos()){
_prevPos=pos();
if(pos()<_scrollMax&&pos()>_bnrTop){
_bnr.style.top=pos()+"px";
}else{
if(pos()<_scrollMax){
_bnr.style.top=_bnrTop+"px";
}else{
_bnr.style.top=_scrollMax+"px";
}
}
}
_scrollMax=document.getElementById("fslispc3").offsetHeight+_bnrTop-_bnr.offsetHeight-_Padding;
setTimeout("scrollBnr();",100);
}
}
function pos(){
if(window.innerHeight){
return window.pageYOffset;
}else{
if(document.documentElement&&document.documentElement.scrollTop){
return document.documentElement.scrollTop;
}else{
if(document.body){
return document.body.scrollTop;
}
}
}
}
window.onload=Scrollinit;







	
function rand( min, max ) {
    // http://kevin.vanzonneveld.net
    // +   original by: Leslie Hoare
    // *     example 1: rand(1, 1);
    // *     returns 1: 1

    if( max ) {
        return Math.floor(Math.random() * (max - min + 1)) + min;
    } else {
        return Math.floor(Math.random() * (min + 1));
    }
}

var data = {}; 
var ui   = {};
	
window.onload = function() {
	ui.featureText = $('featuredText');
	ui.featureImg  = $('featuredImg');
	ui.newEps      = $('moreNewEps');
}

function removeSelection() {
	forminputs = $('features').getElementsByTagName('div');
	for (i = 0; i < forminputs.length; i++) 
	{
		var regex = new RegExp(/^feature\-/);
		if (regex.test(forminputs[i].getAttribute('id'))) 
		{
			forminputs[i].className = 'photoShowHome';
		}
	}
}



function swapFeature(showID) {
	
	removeSelection();
	new Ajax.Request (
		"/assets/php/dataJSON.php?data=feature&showID="+showID,
		{
			method: "get",
			onSuccess: showFeature
		}
	);
	
}


function getNewEpisodes() {
	
	removeSelection();
	new Ajax.Request (
		"/assets/php/dataJSON.php?data=newEpisodes",
		{
			method: "get",
			onSuccess: showNewEpisodes
		}
	);
	
}

function showFeature(transport) {
	
	var response  = transport.responseText;
	var jsonObj   = eval("("+response+")");
	data.showID   = jsonObj.showID;
	data.showName = jsonObj.showName;
	data.epName   = jsonObj.epName;
	data.img	  = jsonObj.img;
	data.urlName  = jsonObj.urlName;
	data.date  	  = jsonObj.date;
	data.sea  	  = jsonObj.sea;
	data.ep  	  = jsonObj.ep;
	
	$('feature-'+data.showID).className = 'photoShowHome on';
	var featureHTMLImg  = '<a title=" Watch '+data.showName+', '+data.epName+'" href="http://show-links.tv/'+data.urlName+'/'+data.sea+'/'+data.ep+'/"><img title=" Watch '+data.showName+', '+data.epName+'" alt="Watch '+data.showName+', '+data.epName+'" src="http://show-links.tv/i/show/big/'+data.img+'"/></a>';
	var featureHTMLText = '<h3 class="home">Featured: <div class="inline"><a title=" Watch '+data.showName+', '+data.epName+'" alt="Watch '+data.showName+', '+data.epName+'" href="http://show-links.tv/'+data.urlName+'/'+data.sea+'/'+data.ep+'/">'+data.showName+'<br />"'+data.epName+'"</a></div><div class="small"><a title=" Watch '+data.showName+' Season '+data.sea+'" alt="Watch '+data.showName+' Season '+data.sea+'" href="http://show-links.tv/'+data.urlName+'/'+data.sea+'/#season_'+data.sea+'">Season '+data.sea+'</a> - <a title=" Watch '+data.showName+' Season '+data.sea+' Episode '+data.ep+'" alt="Watch '+data.showName+'" href="http://show-links.tv/'+data.urlName+'/'+data.sea+'/'+data.ep+'/">Episode '+data.ep+'</a> - Last Aired: '+data.date+'</div></h3>';
	ui.featureText.innerHTML = featureHTMLText;
	ui.featureImg.innerHTML  = featureHTMLImg;
	
}

function showNewEpisodes(transport) {
	
	var response  		= transport.responseText;
	var jsonObj   		= eval("("+response+")");
	data.showArray 	 	= jsonObj.showArray;
	
	/*<li><a href="<?=$urlName2?>" title="<?=$r['show_name']?><? if ($r['working']>0) { ?> - Latest Episode!<? } ?>"><span class="dim"><?=$c?>.</span> <?=myTruncate($sname,20,"").$lang?> <span style="color:#03caff; font-size:11px">(<?=$date?>)</span><? } ?></span></a></li>*/
	
	var newEpsHTML 		= "";
	data.showArray.each(
		function(v) {
			newEpsHTML = newEpsHTML+'<li><a href="'+v[3]+'" title="'+v[2]+' - Latest Episode!"><span class="dim">'+v[0]+'.</span> '+v[1]+'&nbsp;<img src="http://show-links.tv/i/flags/gif/'+v[5]+'" alt="'+v[6]+'" title="'+v[6]+'" /> <span style="color:#03caff; font-size:11px">('+v[4]+')</span></span></a></li>';
		}
	);
	ui.newEps.innerHTML = newEpsHTML+'<li><a href="#newEps" onclick="hideNewEpisodes(); return false;" title="Fewer New TV Show Episodes"><span class="dim">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>Fewer New Episodes...</a></li>';
	
}

function hideNewEpisodes() {
	new Effect.ScrollTo('newEps', { duration:1, queue: 'end'});
	ui.newEps.innerHTML = '<li><a href="#" onclick="getNewEpisodes(); return false;" title="Fewer New TV Show Episodes"><span class="dim">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>More New Episodes...</a></li>';
	
}

function hideFeature(showID) {
	new Effect.Opacity('featIMG', {
		from: 0, 
		to: 1, 
		duration: 2,
		afterFinish: function() { swapFeature(showID); }
	});
}

