var Prototype={Version:"1.5.0_rc1",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(_2,_3){
for(var _4 in _3){
_2[_4]=_3[_4];
}
return _2;
};
Object.extend(Object,{inspect:function(_5){
try{
if(_5===undefined){
return "undefined";
}
if(_5===null){
return "null";
}
return _5.inspect?_5.inspect():_5.toString();
}
catch(e){
if(e instanceof RangeError){
return "...";
}
throw e;
}
},keys:function(_6){
var _7=[];
for(var _8 in _6){
_7.push(_8);
}
return _7;
},values:function(_9){
var _a=[];
for(var _b in _9){
_a.push(_9[_b]);
}
return _a;
},clone:function(_c){
return Object.extend({},_c);
}});
Function.prototype.bind=function(){
var _d=this,args=$A(arguments),object=args.shift();
return function(){
return _d.apply(object,args.concat($A(arguments)));
};
};
Function.prototype.bindAsEventListener=function(_e){
var _f=this,args=$A(arguments),_e=args.shift();
return function(_10){
return _f.apply(_e,[(_10||window.event)].concat(args).concat($A(arguments)));
};
};
Object.extend(Number.prototype,{toColorPart:function(){
var _11=this.toString(16);
if(this<16){
return "0"+_11;
}
return _11;
},succ:function(){
return this+1;
},times:function(_12){
$R(0,this,true).each(_12);
return this;
}});
var Try={these:function(){
var _13;
for(var i=0;i<arguments.length;i++){
var _15=arguments[i];
try{
_13=_15();
break;
}
catch(e){
}
}
return _13;
}};
var PeriodicalExecuter=Class.create();
PeriodicalExecuter.prototype={initialize:function(_16,_17){
this.callback=_16;
this.frequency=_17;
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;
}
}
}};
Object.extend(String.prototype,{gsub:function(_18,_19){
var _1a="",source=this,match;
_19=arguments.callee.prepareReplacement(_19);
while(source.length>0){
if(match=source.match(_18)){
_1a+=source.slice(0,match.index);
_1a+=(_19(match)||"").toString();
source=source.slice(match.index+match[0].length);
}else{
_1a+=source,source="";
}
}
return _1a;
},sub:function(_1b,_1c,_1d){
_1c=this.gsub.prepareReplacement(_1c);
_1d=_1d===undefined?1:_1d;
return this.gsub(_1b,function(_1e){
if(--_1d<0){
return _1e[0];
}
return _1c(_1e);
});
},scan:function(_1f,_20){
this.gsub(_1f,_20);
return this;
},truncate:function(_21,_22){
_21=_21||30;
_22=_22===undefined?"...":_22;
return this.length>_21?this.slice(0,_21-_22.length)+_22: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 _23=new RegExp(Prototype.ScriptFragment,"img");
var _24=new RegExp(Prototype.ScriptFragment,"im");
return (this.match(_23)||[]).map(function(_25){
return (_25.match(_24)||["",""])[1];
});
},evalScripts:function(){
return this.extractScripts().map(function(_26){
return eval(_26);
});
},escapeHTML:function(){
var div=document.createElement("div");
var _28=document.createTextNode(this);
div.appendChild(_28);
return div.innerHTML;
},unescapeHTML:function(){
var div=document.createElement("div");
div.innerHTML=this.stripTags();
return div.childNodes[0]?div.childNodes[0].nodeValue:"";
},toQueryParams:function(){
var _2a=this.strip().match(/[^?]*$/)[0];
if(!_2a){
return {};
}
var _2b=_2a.split("&");
return _2b.inject({},function(_2c,_2d){
var _2e=_2d.split("=");
var _2f=_2e[1]?decodeURIComponent(_2e[1]):undefined;
_2c[decodeURIComponent(_2e[0])]=_2f;
return _2c;
});
},toArray:function(){
return this.split("");
},camelize:function(){
var _30=this.split("-");
if(_30.length==1){
return _30[0];
}
var _31=this.indexOf("-")==0?_30[0].charAt(0).toUpperCase()+_30[0].substring(1):_30[0];
for(var i=1,length=_30.length;i<length;i++){
var s=_30[i];
_31+=s.charAt(0).toUpperCase()+s.substring(1);
}
return _31;
},inspect:function(_34){
var _35=this.replace(/\\/g,"\\\\");
if(_34){
return "\""+_35.replace(/"/g,"\\\"")+"\"";
}else{
return "'"+_35.replace(/'/g,"\\'")+"'";
}
}});
String.prototype.gsub.prepareReplacement=function(_36){
if(typeof _36=="function"){
return _36;
}
var _37=new Template(_36);
return function(_38){
return _37.evaluate(_38);
};
};
String.prototype.parseQuery=String.prototype.toQueryParams;
var Template=Class.create();
Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;
Template.prototype={initialize:function(_39,_3a){
this.template=_39.toString();
this.pattern=_3a||Template.Pattern;
},evaluate:function(_3b){
return this.template.gsub(this.pattern,function(_3c){
var _3d=_3c[1];
if(_3d=="\\"){
return _3c[2];
}
return _3d+(_3b[_3c[3]]||"").toString();
});
}};
var $break=new Object();
var $continue=new Object();
var Enumerable={each:function(_3e){
var _3f=0;
try{
this._each(function(_40){
try{
_3e(_40,_3f++);
}
catch(e){
if(e!=$continue){
throw e;
}
}
});
}
catch(e){
if(e!=$break){
throw e;
}
}
return this;
},eachSlice:function(_41,_42){
var _43=-_41,slices=[],array=this.toArray();
while((_43+=_41)<array.length){
slices.push(array.slice(_43,_43+_41));
}
return slices.collect(_42||Prototype.K);
},all:function(_44){
var _45=true;
this.each(function(_46,_47){
_45=_45&&!!(_44||Prototype.K)(_46,_47);
if(!_45){
throw $break;
}
});
return _45;
},any:function(_48){
var _49=false;
this.each(function(_4a,_4b){
if(_49=!!(_48||Prototype.K)(_4a,_4b)){
throw $break;
}
});
return _49;
},collect:function(_4c){
var _4d=[];
this.each(function(_4e,_4f){
_4d.push(_4c(_4e,_4f));
});
return _4d;
},detect:function(_50){
var _51;
this.each(function(_52,_53){
if(_50(_52,_53)){
_51=_52;
throw $break;
}
});
return _51;
},findAll:function(_54){
var _55=[];
this.each(function(_56,_57){
if(_54(_56,_57)){
_55.push(_56);
}
});
return _55;
},grep:function(_58,_59){
var _5a=[];
this.each(function(_5b,_5c){
var _5d=_5b.toString();
if(_5d.match(_58)){
_5a.push((_59||Prototype.K)(_5b,_5c));
}
});
return _5a;
},include:function(_5e){
var _5f=false;
this.each(function(_60){
if(_60==_5e){
_5f=true;
throw $break;
}
});
return _5f;
},inGroupsOf:function(_61,_62){
_62=_62||null;
var _63=this.eachSlice(_61);
if(_63.length>0){
(_61-_63.last().length).times(function(){
_63.last().push(_62);
});
}
return _63;
},inject:function(_64,_65){
this.each(function(_66,_67){
_64=_65(_64,_66,_67);
});
return _64;
},invoke:function(_68){
var _69=$A(arguments).slice(1);
return this.collect(function(_6a){
return _6a[_68].apply(_6a,_69);
});
},max:function(_6b){
var _6c;
this.each(function(_6d,_6e){
_6d=(_6b||Prototype.K)(_6d,_6e);
if(_6c==undefined||_6d>=_6c){
_6c=_6d;
}
});
return _6c;
},min:function(_6f){
var _70;
this.each(function(_71,_72){
_71=(_6f||Prototype.K)(_71,_72);
if(_70==undefined||_71<_70){
_70=_71;
}
});
return _70;
},partition:function(_73){
var _74=[],falses=[];
this.each(function(_75,_76){
((_73||Prototype.K)(_75,_76)?_74:falses).push(_75);
});
return [_74,falses];
},pluck:function(_77){
var _78=[];
this.each(function(_79,_7a){
_78.push(_79[_77]);
});
return _78;
},reject:function(_7b){
var _7c=[];
this.each(function(_7d,_7e){
if(!_7b(_7d,_7e)){
_7c.push(_7d);
}
});
return _7c;
},sortBy:function(_7f){
return this.collect(function(_80,_81){
return {value:_80,criteria:_7f(_80,_81)};
}).sort(function(_82,_83){
var a=_82.criteria,b=_83.criteria;
return a<b?-1:a>b?1:0;
}).pluck("value");
},toArray:function(){
return this.collect(Prototype.K);
},zip:function(){
var _85=Prototype.K,args=$A(arguments);
if(typeof args.last()=="function"){
_85=args.pop();
}
var _86=[this].concat(args).map($A);
return this.map(function(_87,_88){
return _85(_86.pluck(_88));
});
},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(_89){
if(!_89){
return [];
}
if(_89.toArray){
return _89.toArray();
}else{
var _8a=[];
for(var i=0,length=_89.length;i<length;i++){
_8a.push(_89[i]);
}
return _8a;
}
};
Object.extend(Array.prototype,Enumerable);
if(!Array.prototype._reverse){
Array.prototype._reverse=Array.prototype.reverse;
}
Object.extend(Array.prototype,{_each:function(_8c){
for(var i=0,length=this.length;i<length;i++){
_8c(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(_8e){
return _8e!=undefined||_8e!=null;
});
},flatten:function(){
return this.inject([],function(_8f,_90){
return _8f.concat(_90&&_90.constructor==Array?_90.flatten():[_90]);
});
},without:function(){
var _91=$A(arguments);
return this.select(function(_92){
return !_91.include(_92);
});
},indexOf:function(_93){
for(var i=0,length=this.length;i<length;i++){
if(this[i]==_93){
return i;
}
}
return -1;
},reverse:function(_95){
return (_95!==false?this:this.toArray())._reverse();
},reduce:function(){
return this.length>1?this:this[0];
},uniq:function(){
return this.inject([],function(_96,_97){
return _96.include(_97)?_96:_96.concat([_97]);
});
},clone:function(){
return [].concat(this);
},inspect:function(){
return "["+this.map(Object.inspect).join(", ")+"]";
}});
Array.prototype.toArray=Array.prototype.clone;
var Hash={_each:function(_98){
for(var key in this){
var _9a=this[key];
if(typeof _9a=="function"){
continue;
}
var _9b=[key,_9a];
_9b.key=key;
_9b.value=_9a;
_98(_9b);
}
},keys:function(){
return this.pluck("key");
},values:function(){
return this.pluck("value");
},merge:function(_9c){
return $H(_9c).inject(this,function(_9d,_9e){
_9d[_9e.key]=_9e.value;
return _9d;
});
},toQueryString:function(){
return this.map(function(_9f){
if(!_9f.value&&_9f.value!==0){
_9f[1]="";
}
if(!_9f.key){
return;
}
return _9f.map(encodeURIComponent).join("=");
}).join("&");
},inspect:function(){
return "#<Hash:{"+this.map(function(_a0){
return _a0.map(Object.inspect).join(": ");
}).join(", ")+"}>";
}};
function $H(_a1){
var _a2=Object.extend({},_a1||{});
Object.extend(_a2,Enumerable);
Object.extend(_a2,Hash);
return _a2;
}
ObjectRange=Class.create();
Object.extend(ObjectRange.prototype,Enumerable);
Object.extend(ObjectRange.prototype,{initialize:function(_a3,end,_a5){
this.start=_a3;
this.end=end;
this.exclusive=_a5;
},_each:function(_a6){
var _a7=this.start;
while(this.include(_a7)){
_a6(_a7);
_a7=_a7.succ();
}
},include:function(_a8){
if(_a8<this.start){
return false;
}
if(this.exclusive){
return _a8<this.end;
}
return _a8<=this.end;
}});
var $R=function(_a9,end,_ab){
return new ObjectRange(_a9,end,_ab);
};
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(_ac){
this.responders._each(_ac);
},register:function(_ad){
if(!this.include(_ad)){
this.responders.push(_ad);
}
},unregister:function(_ae){
this.responders=this.responders.without(_ae);
},dispatch:function(_af,_b0,_b1,_b2){
this.each(function(_b3){
if(typeof _b3[_af]=="function"){
try{
_b3[_af].apply(_b3,[_b0,_b1,_b2]);
}
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(_b4){
this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:""};
Object.extend(this.options,_b4||{});
this.options.method=this.options.method.toLowerCase();
this.options.parameters=$H(typeof this.options.parameters=="string"?this.options.parameters.toQueryParams():this.options.parameters);
}};
Ajax.Request=Class.create();
Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
Ajax.Request.prototype=Object.extend(new Ajax.Base(),{initialize:function(url,_b6){
this.transport=Ajax.getTransport();
this.setOptions(_b6);
this.request(url);
},request:function(url){
var _b8=this.options.parameters;
if(_b8.any()){
_b8["_"]="";
}
if(!["get","post"].include(this.options.method)){
_b8["_method"]=this.options.method;
this.options.method="post";
}
this.url=url;
if(this.options.method=="get"&&_b8.any()){
this.url+=(this.url.indexOf("?")>=0?"&":"?")+_b8.toQueryString();
}
try{
Ajax.Responders.dispatch("onCreate",this,this.transport);
this.transport.open(this.options.method.toUpperCase(),this.url,this.options.asynchronous,this.options.username,this.options.password);
if(this.options.asynchronous){
setTimeout(function(){
this.respondToReadyState(1);
}.bind(this),10);
}
this.transport.onreadystatechange=this.onStateChange.bind(this);
this.setRequestHeaders();
var _b9=this.options.method=="post"?(this.options.postBody||_b8.toQueryString()):null;
this.transport.send(_b9);
if(!this.options.asynchronous&&this.transport.overrideMimeType){
this.onStateChange();
}
}
catch(e){
this.dispatchException(e);
}
},onStateChange:function(){
var _ba=this.transport.readyState;
if(_ba>1){
this.respondToReadyState(this.transport.readyState);
}
},setRequestHeaders:function(){
var _bb={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,"Accept":"text/javascript, text/html, application/xml, text/xml, */*"};
if(this.options.method=="post"){
_bb["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){
_bb["Connection"]="close";
}
}
if(typeof this.options.requestHeaders=="object"){
var _bc=this.options.requestHeaders;
if(typeof _bc.push=="function"){
for(var i=0;i<_bc.length;i+=2){
_bb[_bc[i]]=_bc[i+1];
}
}else{
$H(_bc).each(function(_be){
_bb[_be.key]=_be.value;
});
}
}
for(var _bf in _bb){
this.transport.setRequestHeader(_bf,_bb[_bf]);
}
},success:function(){
return !this.transport.status||(this.transport.status>=200&&this.transport.status<300);
},respondToReadyState:function(_c0){
var _c1=Ajax.Request.Events[_c0];
var _c2=this.transport,json=this.evalJSON();
if(_c1=="Complete"){
try{
(this.options["on"+this.transport.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(_c2,json);
}
catch(e){
this.dispatchException(e);
}
}
try{
(this.options["on"+_c1]||Prototype.emptyFunction)(_c2,json);
Ajax.Responders.dispatch("on"+_c1,this,_c2,json);
}
catch(e){
this.dispatchException(e);
}
if(_c1=="Complete"){
if((this.getHeader("Content-type")||"").strip().match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i)){
this.evalResponse();
}
this.transport.onreadystatechange=Prototype.emptyFunction;
}
},getHeader:function(_c3){
try{
return this.transport.getResponseHeader(_c3);
}
catch(e){
return null;
}
},evalJSON:function(){
try{
var _c4=this.getHeader("X-JSON");
return _c4?eval("("+_c4+")"):null;
}
catch(e){
return null;
}
},evalResponse:function(){
try{
return eval(this.transport.responseText);
}
catch(e){
this.dispatchException(e);
}
},dispatchException:function(_c5){
(this.options.onException||Prototype.emptyFunction)(this,_c5);
Ajax.Responders.dispatch("onException",this,_c5);
}});
Ajax.Updater=Class.create();
Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(_c6,url,_c8){
this.container={success:(_c6.success||_c6),failure:(_c6.failure||(_c6.success?null:_c6))};
this.transport=Ajax.getTransport();
this.setOptions(_c8);
var _c9=this.options.onComplete||Prototype.emptyFunction;
this.options.onComplete=(function(_ca,_cb){
this.updateContent();
_c9(_ca,_cb);
}).bind(this);
this.request(url);
},updateContent:function(){
var _cc=this.container[this.success()?"success":"failure"];
var _cd=this.transport.responseText;
if(!this.options.evalScripts){
_cd=_cd.stripScripts();
}
if(_cc=$(_cc)){
if(this.options.insertion){
new this.options.insertion(_cc,_cd);
}else{
_cc.update(_cd);
}
}
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(_ce,url,_d0){
this.setOptions(_d0);
this.onComplete=this.options.onComplete;
this.frequency=(this.options.frequency||2);
this.decay=(this.options.decay||1);
this.updater={};
this.container=_ce;
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(_d1){
if(this.options.decay){
this.decay=(_d1.responseText==this.lastText?this.decay*this.options.decay:1);
this.lastText=_d1.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 $(_d2){
if(arguments.length>1){
for(var i=0,elements=[],length=arguments.length;i<length;i++){
elements.push($(arguments[i]));
}
return elements;
}
if(typeof _d2=="string"){
_d2=document.getElementById(_d2);
}
return Element.extend(_d2);
}
if(Prototype.BrowserFeatures.XPath){
document._getElementsByXPath=function(_d4,_d5){
var _d6=[];
var _d7=document.evaluate(_d4,$(_d5)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for(var i=0,len=_d7.snapshotLength;i<len;i++){
_d6.push(_d7.snapshotItem(i));
}
return _d6;
};
}
document.getElementsByClassName=function(_d9,_da){
if(Prototype.BrowserFeatures.XPath){
var q=".//*[contains(concat(' ', @class, ' '), ' "+_d9+" ')]";
return document._getElementsByXPath(q,_da);
}else{
var _dc=($(_da)||document.body).getElementsByTagName("*");
var _dd=[],child;
for(var i=0,length=_dc.length;i<length;i++){
child=_dc[i];
if(Element.hasClassName(child,_d9)){
_dd.push(Element.extend(child));
}
}
return _dd;
}
};
if(!window.Element){
var Element=new Object();
}
Element.extend=function(_df){
if(!_df){
return;
}
if(_nativeExtensions||_df.nodeType==3){
return _df;
}
if(!_df._extended&&_df.tagName&&_df!=window){
var _e0=Object.clone(Element.Methods),cache=Element.extend.cache;
if(_df.tagName=="FORM"){
Object.extend(_e0,Form.Methods);
}
if(["INPUT","TEXTAREA","SELECT"].include(_df.tagName)){
Object.extend(_e0,Form.Element.Methods);
}
for(var _e1 in _e0){
var _e2=_e0[_e1];
if(typeof _e2=="function"){
_df[_e1]=cache.findOrStore(_e2);
}
}
var _e0=Object.clone(Element.Methods.Simulated),cache=Element.extend.cache;
for(var _e1 in _e0){
var _e2=_e0[_e1];
if("function"==typeof _e2&&!(_e1 in _df)){
_df[_e1]=cache.findOrStore(_e2);
}
}
}
_df._extended=true;
return _df;
};
Element.extend.cache={findOrStore:function(_e3){
return this[_e3]=this[_e3]||function(){
return _e3.apply(null,[this].concat($A(arguments)));
};
}};
Element.Methods={visible:function(_e4){
return $(_e4).style.display!="none";
},toggle:function(_e5){
_e5=$(_e5);
Element[Element.visible(_e5)?"hide":"show"](_e5);
return _e5;
},hide:function(_e6){
$(_e6).style.display="none";
return _e6;
},show:function(_e7){
$(_e7).style.display="";
return _e7;
},remove:function(_e8){
_e8=$(_e8);
_e8.parentNode.removeChild(_e8);
return _e8;
},update:function(_e9,_ea){
_ea=typeof _ea=="undefined"?"":_ea.toString();
$(_e9).innerHTML=_ea.stripScripts();
setTimeout(function(){
_ea.evalScripts();
},10);
return _e9;
},replace:function(_eb,_ec){
_eb=$(_eb);
if(_eb.outerHTML){
_eb.outerHTML=_ec.stripScripts();
}else{
var _ed=_eb.ownerDocument.createRange();
_ed.selectNodeContents(_eb);
_eb.parentNode.replaceChild(_ed.createContextualFragment(_ec.stripScripts()),_eb);
}
setTimeout(function(){
_ec.evalScripts();
},10);
return _eb;
},inspect:function(_ee){
_ee=$(_ee);
var _ef="<"+_ee.tagName.toLowerCase();
$H({"id":"id","className":"class"}).each(function(_f0){
var _f1=_f0.first(),attribute=_f0.last();
var _f2=(_ee[_f1]||"").toString();
if(_f2){
_ef+=" "+attribute+"="+_f2.inspect(true);
}
});
return _ef+">";
},recursivelyCollect:function(_f3,_f4){
_f3=$(_f3);
var _f5=[];
while(_f3=_f3[_f4]){
if(_f3.nodeType==1){
_f5.push(Element.extend(_f3));
}
}
return _f5;
},ancestors:function(_f6){
return $(_f6).recursivelyCollect("parentNode");
},descendants:function(_f7){
_f7=$(_f7);
return $A(_f7.getElementsByTagName("*"));
},previousSiblings:function(_f8){
return $(_f8).recursivelyCollect("previousSibling");
},nextSiblings:function(_f9){
return $(_f9).recursivelyCollect("nextSibling");
},siblings:function(_fa){
_fa=$(_fa);
return _fa.previousSiblings().reverse().concat(_fa.nextSiblings());
},match:function(_fb,_fc){
_fb=$(_fb);
if(typeof _fc=="string"){
_fc=new Selector(_fc);
}
return _fc.match(_fb);
},up:function(_fd,_fe,_ff){
return Selector.findElement($(_fd).ancestors(),_fe,_ff);
},down:function(_100,_101,_102){
return Selector.findElement($(_100).descendants(),_101,_102);
},previous:function(_103,_104,_105){
return Selector.findElement($(_103).previousSiblings(),_104,_105);
},next:function(_106,_107,_108){
return Selector.findElement($(_106).nextSiblings(),_107,_108);
},getElementsBySelector:function(){
var args=$A(arguments),element=$(args.shift());
return Selector.findChildElements(element,args);
},getElementsByClassName:function(_10a,_10b){
_10a=$(_10a);
return document.getElementsByClassName(_10b,_10a);
},getHeight:function(_10c){
_10c=$(_10c);
return _10c.offsetHeight;
},classNames:function(_10d){
return new Element.ClassNames(_10d);
},hasClassName:function(_10e,_10f){
if(!(_10e=$(_10e))){
return;
}
var _110=_10e.className;
if(_110.length==0){
return false;
}
if(_110==_10f||_110.match(new RegExp("(^|\\s)"+_10f+"(\\s|$)"))){
return true;
}
return false;
},addClassName:function(_111,_112){
if(!(_111=$(_111))){
return;
}
Element.classNames(_111).add(_112);
return _111;
},removeClassName:function(_113,_114){
if(!(_113=$(_113))){
return;
}
Element.classNames(_113).remove(_114);
return _113;
},observe:function(){
Event.observe.apply(Event,arguments);
return $A(arguments).first();
},stopObserving:function(){
Event.stopObserving.apply(Event,arguments);
return $A(arguments).first();
},cleanWhitespace:function(_115){
_115=$(_115);
var node=_115.firstChild;
while(node){
var _117=node.nextSibling;
if(node.nodeType==3&&!/\S/.test(node.nodeValue)){
_115.removeChild(node);
}
node=_117;
}
return _115;
},empty:function(_118){
return $(_118).innerHTML.match(/^\s*$/);
},childOf:function(_119,_11a){
_119=$(_119),_11a=$(_11a);
while(_119=_119.parentNode){
if(_119==_11a){
return true;
}
}
return false;
},scrollTo:function(_11b){
_11b=$(_11b);
var x=_11b.x?_11b.x:_11b.offsetLeft,y=_11b.y?_11b.y:_11b.offsetTop;
window.scrollTo(x,y);
return _11b;
},getStyle:function(_11d,_11e){
_11d=$(_11d);
var _11f=_11d.style[_11e.camelize()];
if(!_11f){
if(document.defaultView&&document.defaultView.getComputedStyle){
var css=document.defaultView.getComputedStyle(_11d,null);
_11f=css?css.getPropertyValue(_11e):null;
}else{
if(_11d.currentStyle){
_11f=_11d.currentStyle[_11e.camelize()];
}
}
}
if(window.opera&&["left","top","right","bottom"].include(_11e)){
if(Element.getStyle(_11d,"position")=="static"){
_11f="auto";
}
}
return _11f=="auto"?null:_11f;
},setStyle:function(_121,_122){
_121=$(_121);
for(var name in _122){
_121.style[name.camelize()]=_122[name];
}
return _121;
},getDimensions:function(_124){
_124=$(_124);
if(Element.getStyle(_124,"display")!="none"){
return {width:_124.offsetWidth,height:_124.offsetHeight};
}
var els=_124.style;
var _126=els.visibility;
var _127=els.position;
els.visibility="hidden";
els.position="absolute";
els.display="";
var _128=_124.clientWidth;
var _129=_124.clientHeight;
els.display="none";
els.position=_127;
els.visibility=_126;
return {width:_128,height:_129};
},makePositioned:function(_12a){
_12a=$(_12a);
var pos=Element.getStyle(_12a,"position");
if(pos=="static"||!pos){
_12a._madePositioned=true;
_12a.style.position="relative";
if(window.opera){
_12a.style.top=0;
_12a.style.left=0;
}
}
return _12a;
},undoPositioned:function(_12c){
_12c=$(_12c);
if(_12c._madePositioned){
_12c._madePositioned=undefined;
_12c.style.position=_12c.style.top=_12c.style.left=_12c.style.bottom=_12c.style.right="";
}
return _12c;
},makeClipping:function(_12d){
_12d=$(_12d);
if(_12d._overflow){
return _12d;
}
_12d._overflow=_12d.style.overflow||"auto";
if((Element.getStyle(_12d,"overflow")||"visible")!="hidden"){
_12d.style.overflow="hidden";
}
return _12d;
},undoClipping:function(_12e){
_12e=$(_12e);
if(!_12e._overflow){
return _12e;
}
_12e.style.overflow=_12e._overflow=="auto"?"":_12e._overflow;
_12e._overflow=null;
return _12e;
}};
Element.Methods.Simulated={hasAttribute:function(_12f,_130){
return $(_12f).getAttributeNode(_130).specified;
}};
if(document.all){
Element.Methods.update=function(_131,html){
_131=$(_131);
html=typeof html=="undefined"?"":html.toString();
var _133=_131.tagName.toUpperCase();
if(["THEAD","TBODY","TR","TD"].indexOf(_133)>-1){
var div=document.createElement("div");
switch(_133){
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(_131.childNodes).each(function(node){
_131.removeChild(node);
});
depth.times(function(){
div=div.firstChild;
});
$A(div.childNodes).each(function(node){
_131.appendChild(node);
});
}else{
_131.innerHTML=html.stripScripts();
}
setTimeout(function(){
html.evalScripts();
},10);
return _131;
};
}
Object.extend(Element,Element.Methods);
var _nativeExtensions=false;
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
["","Form","Input","TextArea","Select"].each(function(tag){
var _138="HTML"+tag+"Element";
if(window[_138]){
return;
}
var _139=window[_138]={};
_139.prototype=document.createElement(tag?tag.toLowerCase():"div").__proto__;
});
}
Element.addMethods=function(_13a){
Object.extend(Element.Methods,_13a||{});
function copy(_13b,_13c,_13d){
_13d=_13d||false;
var _13e=Element.extend.cache;
for(var _13f in _13b){
var _140=_13b[_13f];
if(!_13d||!(_13f in _13c)){
_13c[_13f]=_13e.findOrStore(_140);
}
}
}
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(_141){
copy(Form.Element.Methods,_141.prototype);
});
_nativeExtensions=true;
}
};
var Toggle=new Object();
Toggle.display=Element.toggle;
Abstract.Insertion=function(_142){
this.adjacency=_142;
};
Abstract.Insertion.prototype={initialize:function(_143,_144){
this.element=$(_143);
this.content=_144.stripScripts();
if(this.adjacency&&this.element.insertAdjacentHTML){
try{
this.element.insertAdjacentHTML(this.adjacency,this.content);
}
catch(e){
var _145=this.element.tagName.toLowerCase();
if(_145=="tbody"||_145=="tr"){
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(){
_144.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(_147){
_147.each((function(_148){
this.element.parentNode.insertBefore(_148,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(_149){
_149.reverse(false).each((function(_14a){
this.element.insertBefore(_14a,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(_14b){
_14b.each((function(_14c){
this.element.appendChild(_14c);
}).bind(this));
}});
Insertion.After=Class.create();
Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){
this.range.setStartAfter(this.element);
},insertContent:function(_14d){
_14d.each((function(_14e){
this.element.parentNode.insertBefore(_14e,this.element.nextSibling);
}).bind(this));
}});
Element.ClassNames=Class.create();
Element.ClassNames.prototype={initialize:function(_14f){
this.element=$(_14f);
},_each:function(_150){
this.element.className.split(/\s+/).select(function(name){
return name.length>0;
})._each(_150);
},set:function(_152){
this.element.className=_152;
},add:function(_153){
if(this.include(_153)){
return;
}
this.set($A(this).concat(_153).join(" "));
},remove:function(_154){
if(!this.include(_154)){
return;
}
this.set($A(this).without(_154).join(" "));
},toString:function(){
return $A(this).join(" ");
}};
Object.extend(Element.ClassNames.prototype,Enumerable);
var Selector=Class.create();
Selector.prototype={initialize:function(_155){
this.params={classNames:[]};
this.expression=_155.toString().strip();
this.parseExpression();
this.compileMatcher();
},parseExpression:function(){
function abort(_156){
throw "Parse error in selector: "+_156;
}
if(this.expression==""){
abort("empty expression");
}
var _157=this.params,expr=this.expression,match,modifier,clause,rest;
while(match=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){
_157.attributes=_157.attributes||[];
_157.attributes.push({name:match[2],operator:match[3],value:match[4]||match[5]||""});
expr=match[1];
}
if(expr=="*"){
return this.params.wildcard=true;
}
while(match=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)){
modifier=match[1],clause=match[2],rest=match[3];
switch(modifier){
case "#":
_157.id=clause;
break;
case ".":
_157.classNames.push(clause);
break;
case "":
case undefined:
_157.tagName=clause.toUpperCase();
break;
default:
abort(expr.inspect());
}
expr=rest;
}
if(expr.length>0){
abort(expr.inspect());
}
},buildMatchExpression:function(){
var _158=this.params,conditions=[],clause;
if(_158.wildcard){
conditions.push("true");
}
if(clause=_158.id){
conditions.push("element.id == "+clause.inspect());
}
if(clause=_158.tagName){
conditions.push("element.tagName.toUpperCase() == "+clause.inspect());
}
if((clause=_158.classNames).length>0){
for(var i=0;i<clause.length;i++){
conditions.push("Element.hasClassName(element, "+clause[i].inspect()+")");
}
}
if(clause=_158.attributes){
clause.each(function(_15a){
var _15b="element.getAttribute("+_15a.name.inspect()+")";
var _15c=function(_15d){
return _15b+" && "+_15b+".split("+_15d.inspect()+")";
};
switch(_15a.operator){
case "=":
conditions.push(_15b+" == "+_15a.value.inspect());
break;
case "~=":
conditions.push(_15c(" ")+".include("+_15a.value.inspect()+")");
break;
case "|=":
conditions.push(_15c("-")+".first().toUpperCase() == "+_15a.value.toUpperCase().inspect());
break;
case "!=":
conditions.push(_15b+" != "+_15a.value.inspect());
break;
case "":
case undefined:
conditions.push(_15b+" != null");
break;
default:
throw "Unknown operator "+_15a.operator+" in selector";
}
});
}
return conditions.join(" && ");
},compileMatcher:function(){
this.match=new Function("element","if (!element.tagName) return false;       return "+this.buildMatchExpression());
},findElements:function(_15e){
var _15f;
if(_15f=$(this.params.id)){
if(this.match(_15f)){
if(!_15e||Element.childOf(_15f,_15e)){
return [_15f];
}
}
}
_15e=(_15e||document).getElementsByTagName(this.params.tagName||"*");
var _160=[];
for(var i=0,length=_15e.length;i<length;i++){
if(this.match(_15f=_15e[i])){
_160.push(Element.extend(_15f));
}
}
return _160;
},toString:function(){
return this.expression;
}};
Object.extend(Selector,{matchElements:function(_162,_163){
var _164=new Selector(_163);
return _162.select(_164.match.bind(_164)).collect(Element.extend);
},findElement:function(_165,_166,_167){
if(typeof _166=="number"){
_167=_166,_166=false;
}
return Selector.matchElements(_165,_166||"*")[_167||0];
},findChildElements:function(_168,_169){
return _169.map(function(_16a){
return _16a.strip().split(/\s+/).inject([null],function(_16b,expr){
var _16d=new Selector(expr);
return _16b.inject([],function(_16e,_16f){
return _16e.concat(_16d.findElements(_16f||_168));
});
});
}).flatten();
}});
function $$(){
return Selector.findChildElements(document,$A(arguments));
}
var Form={reset:function(form){
$(form).reset();
return form;
},serializeElements:function(_171){
return _171.inject([],function(_172,_173){
var _174=Form.Element.serialize(_173);
if(_174){
_172.push(_174);
}
return _172;
}).join("&");
}};
Form.Methods={serialize:function(form){
return Form.serializeElements($(form).getElements());
},getElements:function(form){
return $A($(form).getElementsByTagName("*")).inject([],function(_177,_178){
if(Form.Element.Serializers[_178.tagName.toLowerCase()]){
_177.push(Element.extend(_178));
}
return _177;
});
},getInputs:function(form,_17a,name){
form=$(form);
var _17c=form.getElementsByTagName("input");
if(!_17a&&!name){
return _17c;
}
var _17d=new Array();
for(var i=0,length=_17c.length;i<length;i++){
var _17f=_17c[i];
if((_17a&&_17f.type!=_17a)||(name&&_17f.name!=name)){
continue;
}
_17d.push(Element.extend(_17f));
}
return _17d;
},disable:function(form){
form=$(form);
form.getElements().each(function(_181){
_181.blur();
_181.disabled="true";
});
return form;
},enable:function(form){
form=$(form);
form.getElements().each(function(_183){
_183.disabled="";
});
return form;
},findFirstElement:function(form){
return $(form).getElements().find(function(_185){
return _185.type!="hidden"&&!_185.disabled&&["input","select","textarea"].include(_185.tagName.toLowerCase());
});
},focusFirstElement:function(form){
form=$(form);
form.findFirstElement().activate();
return form;
}};
Object.extend(Form,Form.Methods);
Form.Element={focus:function(_187){
$(_187).focus();
return _187;
},select:function(_188){
$(_188).select();
return _188;
}};
Form.Element.Methods={serialize:function(_189){
_189=$(_189);
if(_189.disabled){
return "";
}
var _18a=_189.tagName.toLowerCase();
var _18b=Form.Element.Serializers[_18a](_189);
if(_18b){
var key=encodeURIComponent(_18b[0]);
if(key.length==0){
return;
}
if(_18b[1].constructor!=Array){
_18b[1]=[_18b[1]];
}
return _18b[1].map(function(_18d){
return key+"="+encodeURIComponent(_18d);
}).join("&");
}
},getValue:function(_18e){
_18e=$(_18e);
var _18f=_18e.tagName.toLowerCase();
var _190=Form.Element.Serializers[_18f](_18e);
if(_190){
return _190[1];
}
},clear:function(_191){
$(_191).value="";
return _191;
},present:function(_192){
return $(_192).value!="";
},activate:function(_193){
_193=$(_193);
_193.focus();
if(_193.select){
_193.select();
}
return _193;
},disable:function(_194){
_194=$(_194);
_194.disabled=true;
return _194;
},enable:function(_195){
_195=$(_195);
_195.blur();
_195.disabled=false;
return _195;
}};
Object.extend(Form.Element,Form.Element.Methods);
var Field=Form.Element;
Form.Element.Serializers={input:function(_196){
switch(_196.type.toLowerCase()){
case "checkbox":
case "radio":
return Form.Element.Serializers.inputSelector(_196);
default:
return Form.Element.Serializers.textarea(_196);
}
return false;
},inputSelector:function(_197){
if(_197.checked){
return [_197.name,_197.value];
}
},textarea:function(_198){
return [_198.name,_198.value];
},select:function(_199){
return Form.Element.Serializers[_199.type=="select-one"?"selectOne":"selectMany"](_199);
},selectOne:function(_19a){
var _19b="",opt,index=_19a.selectedIndex;
if(index>=0){
opt=Element.extend(_19a.options[index]);
_19b=opt.hasAttribute("value")?opt.value:opt.text;
}
return [_19a.name,_19b];
},selectMany:function(_19c){
var _19d=[];
for(var i=0;i<_19c.length;i++){
var opt=Element.extend(_19c.options[i]);
if(opt.selected){
_19d.push(opt.hasAttribute("value")?opt.value:opt.text);
}
}
return [_19c.name,_19d];
}};
var $F=Form.Element.getValue;
Abstract.TimedObserver=function(){
};
Abstract.TimedObserver.prototype={initialize:function(_1a0,_1a1,_1a2){
this.frequency=_1a1;
this.element=$(_1a0);
this.callback=_1a2;
this.lastValue=this.getValue();
this.registerCallback();
},registerCallback:function(){
setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},onTimerEvent:function(){
var _1a3=this.getValue();
if(this.lastValue!=_1a3){
this.callback(this.element,_1a3);
this.lastValue=_1a3;
}
}};
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(_1a4,_1a5){
this.element=$(_1a4);
this.callback=_1a5;
this.lastValue=this.getValue();
if(this.element.tagName.toLowerCase()=="form"){
this.registerFormCallbacks();
}else{
this.registerCallback(this.element);
}
},onElementEvent:function(){
var _1a6=this.getValue();
if(this.lastValue!=_1a6){
this.callback(this.element,_1a6);
this.lastValue=_1a6;
}
},registerFormCallbacks:function(){
Form.getElements(this.element).each(this.registerCallback.bind(this));
},registerCallback:function(_1a7){
if(_1a7.type){
switch(_1a7.type.toLowerCase()){
case "checkbox":
case "radio":
Event.observe(_1a7,"click",this.onElementEvent.bind(this));
break;
default:
Event.observe(_1a7,"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(_1a8){
return _1a8.target||_1a8.srcElement;
},isLeftClick:function(_1a9){
return (((_1a9.which)&&(_1a9.which==1))||((_1a9.button)&&(_1a9.button==1)));
},pointerX:function(_1aa){
return _1aa.pageX||(_1aa.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
},pointerY:function(_1ab){
return _1ab.pageY||(_1ab.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
},stop:function(_1ac){
if(_1ac.preventDefault){
_1ac.preventDefault();
_1ac.stopPropagation();
}else{
_1ac.returnValue=false;
_1ac.cancelBubble=true;
}
},findElement:function(_1ad,_1ae){
var _1af=Event.element(_1ad);
while(_1af.parentNode&&(!_1af.tagName||(_1af.tagName.toUpperCase()!=_1ae.toUpperCase()))){
_1af=_1af.parentNode;
}
return _1af;
},observers:false,_observeAndCache:function(_1b0,name,_1b2,_1b3){
if(!this.observers){
this.observers=[];
}
if(_1b0.addEventListener){
this.observers.push([_1b0,name,_1b2,_1b3]);
_1b0.addEventListener(name,_1b2,_1b3);
}else{
if(_1b0.attachEvent){
this.observers.push([_1b0,name,_1b2,_1b3]);
_1b0.attachEvent("on"+name,_1b2);
}
}
},unloadCache:function(){
if(!Event.observers){
return;
}
for(var i=0,length=Event.observers.length;i<length;i++){
Event.stopObserving.apply(this,Event.observers[i]);
Event.observers[i][0]=null;
}
Event.observers=false;
},observe:function(_1b5,name,_1b7,_1b8){
_1b5=$(_1b5);
_1b8=_1b8||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_1b5.attachEvent)){
name="keydown";
}
Event._observeAndCache(_1b5,name,_1b7,_1b8);
},stopObserving:function(_1b9,name,_1bb,_1bc){
_1b9=$(_1b9);
_1bc=_1bc||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_1b9.detachEvent)){
name="keydown";
}
if(_1b9.removeEventListener){
_1b9.removeEventListener(name,_1bb,_1bc);
}else{
if(_1b9.detachEvent){
try{
_1b9.detachEvent("on"+name,_1bb);
}
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(_1bd){
var _1be=0,valueL=0;
do{
_1be+=_1bd.scrollTop||0;
valueL+=_1bd.scrollLeft||0;
_1bd=_1bd.parentNode;
}while(_1bd);
return [valueL,_1be];
},cumulativeOffset:function(_1bf){
var _1c0=0,valueL=0;
do{
_1c0+=_1bf.offsetTop||0;
valueL+=_1bf.offsetLeft||0;
_1bf=_1bf.offsetParent;
}while(_1bf);
return [valueL,_1c0];
},positionedOffset:function(_1c1){
var _1c2=0,valueL=0;
do{
_1c2+=_1c1.offsetTop||0;
valueL+=_1c1.offsetLeft||0;
_1c1=_1c1.offsetParent;
if(_1c1){
if(_1c1.tagName=="BODY"){
break;
}
var p=Element.getStyle(_1c1,"position");
if(p=="relative"||p=="absolute"){
break;
}
}
}while(_1c1);
return [valueL,_1c2];
},offsetParent:function(_1c4){
if(_1c4.offsetParent){
return _1c4.offsetParent;
}
if(_1c4==document.body){
return _1c4;
}
while((_1c4=_1c4.parentNode)&&_1c4!=document.body){
if(Element.getStyle(_1c4,"position")!="static"){
return _1c4;
}
}
return document.body;
},within:function(_1c5,x,y){
if(this.includeScrollOffsets){
return this.withinIncludingScrolloffsets(_1c5,x,y);
}
this.xcomp=x;
this.ycomp=y;
this.offset=this.cumulativeOffset(_1c5);
return (y>=this.offset[1]&&y<this.offset[1]+_1c5.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+_1c5.offsetWidth);
},withinIncludingScrolloffsets:function(_1c8,x,y){
var _1cb=this.realOffset(_1c8);
this.xcomp=x+_1cb[0]-this.deltaX;
this.ycomp=y+_1cb[1]-this.deltaY;
this.offset=this.cumulativeOffset(_1c8);
return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+_1c8.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+_1c8.offsetWidth);
},overlap:function(mode,_1cd){
if(!mode){
return 0;
}
if(mode=="vertical"){
return ((this.offset[1]+_1cd.offsetHeight)-this.ycomp)/_1cd.offsetHeight;
}
if(mode=="horizontal"){
return ((this.offset[0]+_1cd.offsetWidth)-this.xcomp)/_1cd.offsetWidth;
}
},page:function(_1ce){
var _1cf=0,valueL=0;
var _1d0=_1ce;
do{
_1cf+=_1d0.offsetTop||0;
valueL+=_1d0.offsetLeft||0;
if(_1d0.offsetParent==document.body){
if(Element.getStyle(_1d0,"position")=="absolute"){
break;
}
}
}while(_1d0=_1d0.offsetParent);
_1d0=_1ce;
do{
if(!window.opera||_1d0.tagName=="BODY"){
_1cf-=_1d0.scrollTop||0;
valueL-=_1d0.scrollLeft||0;
}
}while(_1d0=_1d0.parentNode);
return [valueL,_1cf];
},clone:function(_1d1,_1d2){
var _1d3=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});
_1d1=$(_1d1);
var p=Position.page(_1d1);
_1d2=$(_1d2);
var _1d5=[0,0];
var _1d6=null;
if(Element.getStyle(_1d2,"position")=="absolute"){
_1d6=Position.offsetParent(_1d2);
_1d5=Position.page(_1d6);
}
if(_1d6==document.body){
_1d5[0]-=document.body.offsetLeft;
_1d5[1]-=document.body.offsetTop;
}
if(_1d3.setLeft){
_1d2.style.left=(p[0]-_1d5[0]+_1d3.offsetLeft)+"px";
}
if(_1d3.setTop){
_1d2.style.top=(p[1]-_1d5[1]+_1d3.offsetTop)+"px";
}
if(_1d3.setWidth){
_1d2.style.width=_1d1.offsetWidth+"px";
}
if(_1d3.setHeight){
_1d2.style.height=_1d1.offsetHeight+"px";
}
},absolutize:function(_1d7){
_1d7=$(_1d7);
if(_1d7.style.position=="absolute"){
return;
}
Position.prepare();
var _1d8=Position.positionedOffset(_1d7);
var top=_1d8[1];
var left=_1d8[0];
var _1db=_1d7.clientWidth;
var _1dc=_1d7.clientHeight;
_1d7._originalLeft=left-parseFloat(_1d7.style.left||0);
_1d7._originalTop=top-parseFloat(_1d7.style.top||0);
_1d7._originalWidth=_1d7.style.width;
_1d7._originalHeight=_1d7.style.height;
_1d7.style.position="absolute";
_1d7.style.top=top+"px";
_1d7.style.left=left+"px";
_1d7.style.width=_1db+"px";
_1d7.style.height=_1dc+"px";
},relativize:function(_1dd){
_1dd=$(_1dd);
if(_1dd.style.position=="relative"){
return;
}
Position.prepare();
_1dd.style.position="relative";
var top=parseFloat(_1dd.style.top||0)-(_1dd._originalTop||0);
var left=parseFloat(_1dd.style.left||0)-(_1dd._originalLeft||0);
_1dd.style.top=top+"px";
_1dd.style.left=left+"px";
_1dd.style.height=_1dd._originalHeight;
_1dd.style.width=_1dd._originalWidth;
}};
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
Position.cumulativeOffset=function(_1e0){
var _1e1=0,valueL=0;
do{
_1e1+=_1e0.offsetTop||0;
valueL+=_1e0.offsetLeft||0;
if(_1e0.offsetParent==document.body){
if(Element.getStyle(_1e0,"position")=="absolute"){
break;
}
}
_1e0=_1e0.offsetParent;
}while(_1e0);
return [valueL,_1e1];
};
}
Element.addMethods();

