var Prototype={Version:"1.5.0_rc1",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(_140,_141){
for(var _142 in _141){
_140[_142]=_141[_142];
}
return _140;
};
Object.extend(Object,{inspect:function(_143){
try{
if(_143==undefined){
return "undefined";
}
if(_143==null){
return "null";
}
return _143.inspect?_143.inspect():_143.toString();
}
catch(e){
if(e instanceof RangeError){
return "...";
}
throw e;
}
},keys:function(_144){
var keys=[];
for(var _146 in _144){
keys.push(_146);
}
return keys;
},values:function(_147){
var _148=[];
for(var _149 in _147){
_148.push(_147[_149]);
}
return _148;
},clone:function(_14a){
return Object.extend({},_14a);
}});
Function.prototype.bind=function(){
var _14b=this,args=$A(arguments),object=args.shift();
return function(){
return _14b.apply(object,args.concat($A(arguments)));
};
};
Function.prototype.bindAsEventListener=function(_14c){
var _14d=this,args=$A(arguments),_14c=args.shift();
return function(_14e){
return _14d.apply(_14c,[(_14e||window.event)].concat(args).concat($A(arguments)));
};
};
Object.extend(Number.prototype,{toColorPart:function(){
var _14f=this.toString(16);
if(this<16){
return "0"+_14f;
}
return _14f;
},succ:function(){
return this+1;
},times:function(_150){
$R(0,this,true).each(_150);
return this;
}});
var Try={these:function(){
var _151;
for(var i=0;i<arguments.length;i++){
var _153=arguments[i];
try{
_151=_153();
break;
}
catch(e){
}
}
return _151;
}};
var PeriodicalExecuter=Class.create();
PeriodicalExecuter.prototype={initialize:function(_154,_155){
this.callback=_154;
this.frequency=_155;
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(_156,_157){
var _158="",source=this,match;
_157=arguments.callee.prepareReplacement(_157);
while(source.length>0){
if(match=source.match(_156)){
_158+=source.slice(0,match.index);
_158+=(_157(match)||"").toString();
source=source.slice(match.index+match[0].length);
}else{
_158+=source,source="";
}
}
return _158;
},sub:function(_159,_15a,_15b){
_15a=this.gsub.prepareReplacement(_15a);
_15b=_15b===undefined?1:_15b;
return this.gsub(_159,function(_15c){
if(--_15b<0){
return _15c[0];
}
return _15a(_15c);
});
},scan:function(_15d,_15e){
this.gsub(_15d,_15e);
return this;
},truncate:function(_15f,_160){
_15f=_15f||30;
_160=_160===undefined?"...":_160;
return this.length>_15f?this.slice(0,_15f-_160.length)+_160: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 _161=new RegExp(Prototype.ScriptFragment,"img");
var _162=new RegExp(Prototype.ScriptFragment,"im");
return (this.match(_161)||[]).map(function(_163){
return (_163.match(_162)||["",""])[1];
});
},evalScripts:function(){
return this.extractScripts().map(function(_164){
return eval(_164);
});
},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[0].nodeValue:"";
},toQueryParams:function(){
var _168=this.match(/^\??(.*)$/)[1].split("&");
return _168.inject({},function(_169,_16a){
var pair=_16a.split("=");
var _16c=pair[1]?decodeURIComponent(pair[1]):undefined;
_169[decodeURIComponent(pair[0])]=_16c;
return _169;
});
},toArray:function(){
return this.split("");
},camelize:function(){
var _16d=this.split("-");
if(_16d.length==1){
return _16d[0];
}
var _16e=this.indexOf("-")==0?_16d[0].charAt(0).toUpperCase()+_16d[0].substring(1):_16d[0];
for(var i=1,len=_16d.length;i<len;i++){
var s=_16d[i];
_16e+=s.charAt(0).toUpperCase()+s.substring(1);
}
return _16e;
},inspect:function(_171){
var _172=this.replace(/\\/g,"\\\\");
if(_171){
return "\""+_172.replace(/"/g,"\\\"")+"\"";
}else{
return "'"+_172.replace(/'/g,"\\'")+"'";
}
}});
String.prototype.gsub.prepareReplacement=function(_173){
if(typeof _173=="function"){
return _173;
}
var _174=new Template(_173);
return function(_175){
return _174.evaluate(_175);
};
};
String.prototype.parseQuery=String.prototype.toQueryParams;
var Template=Class.create();
Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;
Template.prototype={initialize:function(_176,_177){
this.template=_176.toString();
this.pattern=_177||Template.Pattern;
},evaluate:function(_178){
return this.template.gsub(this.pattern,function(_179){
var _17a=_179[1];
if(_17a=="\\"){
return _179[2];
}
return _17a+(_178[_179[3]]||"").toString();
});
}};
var $break=new Object();
var $continue=new Object();
var Enumerable={each:function(_17b){
var _17c=0;
try{
this._each(function(_17d){
try{
_17b(_17d,_17c++);
}
catch(e){
if(e!=$continue){
throw e;
}
}
});
}
catch(e){
if(e!=$break){
throw e;
}
}
},all:function(_17e){
var _17f=true;
this.each(function(_180,_181){
_17f=_17f&&!!(_17e||Prototype.K)(_180,_181);
if(!_17f){
throw $break;
}
});
return _17f;
},any:function(_182){
var _183=false;
this.each(function(_184,_185){
if(_183=!!(_182||Prototype.K)(_184,_185)){
throw $break;
}
});
return _183;
},collect:function(_186){
var _187=[];
this.each(function(_188,_189){
_187.push(_186(_188,_189));
});
return _187;
},detect:function(_18a){
var _18b;
this.each(function(_18c,_18d){
if(_18a(_18c,_18d)){
_18b=_18c;
throw $break;
}
});
return _18b;
},findAll:function(_18e){
var _18f=[];
this.each(function(_190,_191){
if(_18e(_190,_191)){
_18f.push(_190);
}
});
return _18f;
},grep:function(_192,_193){
var _194=[];
this.each(function(_195,_196){
var _197=_195.toString();
if(_197.match(_192)){
_194.push((_193||Prototype.K)(_195,_196));
}
});
return _194;
},include:function(_198){
var _199=false;
this.each(function(_19a){
if(_19a==_198){
_199=true;
throw $break;
}
});
return _199;
},inject:function(memo,_19c){
this.each(function(_19d,_19e){
memo=_19c(memo,_19d,_19e);
});
return memo;
},invoke:function(_19f){
var args=$A(arguments).slice(1);
return this.collect(function(_1a1){
return _1a1[_19f].apply(_1a1,args);
});
},max:function(_1a2){
var _1a3;
this.each(function(_1a4,_1a5){
_1a4=(_1a2||Prototype.K)(_1a4,_1a5);
if(_1a3==undefined||_1a4>=_1a3){
_1a3=_1a4;
}
});
return _1a3;
},min:function(_1a6){
var _1a7;
this.each(function(_1a8,_1a9){
_1a8=(_1a6||Prototype.K)(_1a8,_1a9);
if(_1a7==undefined||_1a8<_1a7){
_1a7=_1a8;
}
});
return _1a7;
},partition:function(_1aa){
var _1ab=[],falses=[];
this.each(function(_1ac,_1ad){
((_1aa||Prototype.K)(_1ac,_1ad)?_1ab:falses).push(_1ac);
});
return [_1ab,falses];
},pluck:function(_1ae){
var _1af=[];
this.each(function(_1b0,_1b1){
_1af.push(_1b0[_1ae]);
});
return _1af;
},reject:function(_1b2){
var _1b3=[];
this.each(function(_1b4,_1b5){
if(!_1b2(_1b4,_1b5)){
_1b3.push(_1b4);
}
});
return _1b3;
},sortBy:function(_1b6){
return this.collect(function(_1b7,_1b8){
return {value:_1b7,criteria:_1b6(_1b7,_1b8)};
}).sort(function(left,_1ba){
var a=left.criteria,b=_1ba.criteria;
return a<b?-1:a>b?1:0;
}).pluck("value");
},toArray:function(){
return this.collect(Prototype.K);
},zip:function(){
var _1bc=Prototype.K,args=$A(arguments);
if(typeof args.last()=="function"){
_1bc=args.pop();
}
var _1bd=[this].concat(args).map($A);
return this.map(function(_1be,_1bf){
return _1bc(_1bd.pluck(_1bf));
});
},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(_1c0){
if(!_1c0){
return [];
}
if(_1c0.toArray){
return _1c0.toArray();
}else{
var _1c1=[];
for(var i=0;i<_1c0.length;i++){
_1c1.push(_1c0[i]);
}
return _1c1;
}
};
Object.extend(Array.prototype,Enumerable);
if(!Array.prototype._reverse){
Array.prototype._reverse=Array.prototype.reverse;
}
Object.extend(Array.prototype,{_each:function(_1c3){
for(var i=0;i<this.length;i++){
_1c3(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(_1c5){
return _1c5!=undefined||_1c5!=null;
});
},flatten:function(){
return this.inject([],function(_1c6,_1c7){
return _1c6.concat(_1c7&&_1c7.constructor==Array?_1c7.flatten():[_1c7]);
});
},without:function(){
var _1c8=$A(arguments);
return this.select(function(_1c9){
return !_1c8.include(_1c9);
});
},indexOf:function(_1ca){
for(var i=0;i<this.length;i++){
if(this[i]==_1ca){
return i;
}
}
return -1;
},reverse:function(_1cc){
return (_1cc!==false?this:this.toArray())._reverse();
},reduce:function(){
return this.length>1?this:this[0];
},uniq:function(){
return this.inject([],function(_1cd,_1ce){
return _1cd.include(_1ce)?_1cd:_1cd.concat([_1ce]);
});
},inspect:function(){
return "["+this.map(Object.inspect).join(", ")+"]";
}});
var Hash={_each:function(_1cf){
for(var key in this){
var _1d1=this[key];
if(typeof _1d1=="function"){
continue;
}
var pair=[key,_1d1];
pair.key=key;
pair.value=_1d1;
_1cf(pair);
}
},keys:function(){
return this.pluck("key");
},values:function(){
return this.pluck("value");
},merge:function(hash){
return $H(hash).inject($H(this),function(_1d4,pair){
_1d4[pair.key]=pair.value;
return _1d4;
});
},toQueryString:function(){
return this.map(function(pair){
return pair.map(encodeURIComponent).join("=");
}).join("&");
},inspect:function(){
return "#<Hash:{"+this.map(function(pair){
return pair.map(Object.inspect).join(": ");
}).join(", ")+"}>";
}};
function $H(_1d8){
var hash=Object.extend({},_1d8||{});
Object.extend(hash,Enumerable);
Object.extend(hash,Hash);
return hash;
}
ObjectRange=Class.create();
Object.extend(ObjectRange.prototype,Enumerable);
Object.extend(ObjectRange.prototype,{initialize:function(_1da,end,_1dc){
this.start=_1da;
this.end=end;
this.exclusive=_1dc;
},_each:function(_1dd){
var _1de=this.start;
while(this.include(_1de)){
_1dd(_1de);
_1de=_1de.succ();
}
},include:function(_1df){
if(_1df<this.start){
return false;
}
if(this.exclusive){
return _1df<this.end;
}
return _1df<=this.end;
}});
var $R=function(_1e0,end,_1e2){
return new ObjectRange(_1e0,end,_1e2);
};
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(_1e3){
this.responders._each(_1e3);
},register:function(_1e4){
if(!this.include(_1e4)){
this.responders.push(_1e4);
}
},unregister:function(_1e5){
this.responders=this.responders.without(_1e5);
},dispatch:function(_1e6,_1e7,_1e8,json){
this.each(function(_1ea){
if(_1ea[_1e6]&&typeof _1ea[_1e6]=="function"){
try{
_1ea[_1e6].apply(_1ea,[_1e7,_1e8,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(_1eb){
this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",parameters:""};
Object.extend(this.options,_1eb||{});
},responseIsSuccess:function(){
return this.transport.status==undefined||this.transport.status==0||(this.transport.status>=200&&this.transport.status<300);
},responseIsFailure:function(){
return !this.responseIsSuccess();
}};
Ajax.Request=Class.create();
Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
Ajax.Request.prototype=Object.extend(new Ajax.Base(),{initialize:function(url,_1ed){
this.transport=Ajax.getTransport();
this.setOptions(_1ed);
this.request(url);
},request:function(url){
var _1ef=this.options.parameters||"";
if(_1ef.length>0){
_1ef+="&_=";
}
if(this.options.method!="get"&&this.options.method!="post"){
_1ef+=(_1ef.length>0?"&":"")+"_method="+this.options.method;
this.options.method="post";
}
try{
this.url=url;
if(this.options.method=="get"&&_1ef.length>0){
this.url+=(this.url.match(/\?/)?"&":"?")+_1ef;
}
Ajax.Responders.dispatch("onCreate",this,this.transport);
this.transport.open(this.options.method,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.options.postBody?this.options.postBody:_1ef;
this.transport.send(this.options.method=="post"?body:null);
if(!this.options.asynchronous&&this.transport.overrideMimeType){
this.onStateChange();
}
}
catch(e){
this.dispatchException(e);
}
},setRequestHeaders:function(){
var _1f1=["X-Requested-With","XMLHttpRequest","X-Prototype-Version",Prototype.Version,"Accept","text/javascript, text/html, application/xml, text/xml, */*"];
if(this.options.method=="post"){
_1f1.push("Content-type",this.options.contentType);
if(this.transport.overrideMimeType){
_1f1.push("Connection","close");
}
}
if(this.options.requestHeaders){
_1f1.push.apply(_1f1,this.options.requestHeaders);
}
for(var i=0;i<_1f1.length;i+=2){
this.transport.setRequestHeader(_1f1[i],_1f1[i+1]);
}
},onStateChange:function(){
var _1f3=this.transport.readyState;
if(_1f3!=1){
this.respondToReadyState(this.transport.readyState);
}
},header:function(name){
try{
return this.transport.getResponseHeader(name);
}
catch(e){
}
},evalJSON:function(){
try{
return eval("("+this.header("X-JSON")+")");
}
catch(e){
}
},evalResponse:function(){
try{
return eval(this.transport.responseText);
}
catch(e){
this.dispatchException(e);
}
},respondToReadyState:function(_1f5){
var _1f6=Ajax.Request.Events[_1f5];
var _1f7=this.transport,json=this.evalJSON();
if(_1f6=="Complete"){
try{
(this.options["on"+this.transport.status]||this.options["on"+(this.responseIsSuccess()?"Success":"Failure")]||Prototype.emptyFunction)(_1f7,json);
}
catch(e){
this.dispatchException(e);
}
if((this.header("Content-type")||"").match(/^text\/javascript/i)){
this.evalResponse();
}
}
try{
(this.options["on"+_1f6]||Prototype.emptyFunction)(_1f7,json);
Ajax.Responders.dispatch("on"+_1f6,this,_1f7,json);
}
catch(e){
this.dispatchException(e);
}
if(_1f6=="Complete"){
this.transport.onreadystatechange=Prototype.emptyFunction;
}
},dispatchException:function(_1f8){
(this.options.onException||Prototype.emptyFunction)(this,_1f8);
Ajax.Responders.dispatch("onException",this,_1f8);
}});
Ajax.Updater=Class.create();
Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(_1f9,url,_1fb){
this.containers={success:_1f9.success?$(_1f9.success):$(_1f9),failure:_1f9.failure?$(_1f9.failure):(_1f9.success?null:$(_1f9))};
this.transport=Ajax.getTransport();
this.setOptions(_1fb);
var _1fc=this.options.onComplete||Prototype.emptyFunction;
this.options.onComplete=(function(_1fd,_1fe){
this.updateContent();
_1fc(_1fd,_1fe);
}).bind(this);
this.request(url);
},updateContent:function(){
var _1ff=this.responseIsSuccess()?this.containers.success:this.containers.failure;
var _200=this.transport.responseText;
if(!this.options.evalScripts){
_200=_200.stripScripts();
}
if(_1ff){
if(this.options.insertion){
new this.options.insertion(_1ff,_200);
}else{
Element.update(_1ff,_200);
}
}
if(this.responseIsSuccess()){
if(this.onComplete){
setTimeout(this.onComplete.bind(this),10);
}
}
}});
Ajax.PeriodicalUpdater=Class.create();
Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(_201,url,_203){
this.setOptions(_203);
this.onComplete=this.options.onComplete;
this.frequency=(this.options.frequency||2);
this.decay=(this.options.decay||1);
this.updater={};
this.container=_201;
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(_204){
if(this.options.decay){
this.decay=(_204.responseText==this.lastText?this.decay*this.options.decay:1);
this.lastText=_204.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 $(){
var _205=[],element;
for(var i=0;i<arguments.length;i++){
element=arguments[i];
if(typeof element=="string"){
element=document.getElementById(element);
}
_205.push(Element.extend(element));
}
return _205.reduce();
}
document.getElementsByClassName=function(_207,_208){
var _209=($(_208)||document.body).getElementsByTagName("*");
return $A(_209).inject([],function(_20a,_20b){
if(_20b.className.match(new RegExp("(^|\\s)"+_207+"(\\s|$)"))){
_20a.push(Element.extend(_20b));
}
return _20a;
});
};
if(!window.Element){
var Element=new Object();
}
Element.extend=function(_20c){
if(!_20c){
return;
}
if(_nativeExtensions||_20c.nodeType==3){
return _20c;
}
if(!_20c._extended&&_20c.tagName&&_20c!=window){
var _20d=Object.clone(Element.Methods),cache=Element.extend.cache;
if(_20c.tagName=="FORM"){
Object.extend(_20d,Form.Methods);
}
if(["INPUT","TEXTAREA","SELECT"].include(_20c.tagName)){
Object.extend(_20d,Form.Element.Methods);
}
for(var _20e in _20d){
var _20f=_20d[_20e];
if(typeof _20f=="function"){
_20c[_20e]=cache.findOrStore(_20f);
}
}
}
_20c._extended=true;
return _20c;
};
Element.extend.cache={findOrStore:function(_210){
return this[_210]=this[_210]||function(){
return _210.apply(null,[this].concat($A(arguments)));
};
}};
Element.Methods={visible:function(_211){
return $(_211).style.display!="none";
},toggle:function(_212){
_212=$(_212);
Element[Element.visible(_212)?"hide":"show"](_212);
return _212;
},hide:function(_213){
$(_213).style.display="none";
return _213;
},show:function(_214){
$(_214).style.display="";
return _214;
},remove:function(_215){
_215=$(_215);
_215.parentNode.removeChild(_215);
return _215;
},update:function(_216,html){
$(_216).innerHTML=html.stripScripts();
setTimeout(function(){
html.evalScripts();
},10);
return _216;
},replace:function(_218,html){
_218=$(_218);
if(_218.outerHTML){
_218.outerHTML=html.stripScripts();
}else{
var _21a=_218.ownerDocument.createRange();
_21a.selectNodeContents(_218);
_218.parentNode.replaceChild(_21a.createContextualFragment(html.stripScripts()),_218);
}
setTimeout(function(){
html.evalScripts();
},10);
return _218;
},inspect:function(_21b){
_21b=$(_21b);
var _21c="<"+_21b.tagName.toLowerCase();
$H({"id":"id","className":"class"}).each(function(pair){
var _21e=pair.first(),attribute=pair.last();
var _21f=(_21b[_21e]||"").toString();
if(_21f){
_21c+=" "+attribute+"="+_21f.inspect(true);
}
});
return _21c+">";
},recursivelyCollect:function(_220,_221){
_220=$(_220);
var _222=[];
while(_220=_220[_221]){
if(_220.nodeType==1){
_222.push(Element.extend(_220));
}
}
return _222;
},ancestors:function(_223){
return $(_223).recursivelyCollect("parentNode");
},descendants:function(_224){
_224=$(_224);
return $A(_224.getElementsByTagName("*"));
},previousSiblings:function(_225){
return $(_225).recursivelyCollect("previousSibling");
},nextSiblings:function(_226){
return $(_226).recursivelyCollect("nextSibling");
},siblings:function(_227){
_227=$(_227);
return _227.previousSiblings().reverse().concat(_227.nextSiblings());
},match:function(_228,_229){
_228=$(_228);
if(typeof _229=="string"){
_229=new Selector(_229);
}
return _229.match(_228);
},up:function(_22a,_22b,_22c){
return Selector.findElement($(_22a).ancestors(),_22b,_22c);
},down:function(_22d,_22e,_22f){
return Selector.findElement($(_22d).descendants(),_22e,_22f);
},previous:function(_230,_231,_232){
return Selector.findElement($(_230).previousSiblings(),_231,_232);
},next:function(_233,_234,_235){
return Selector.findElement($(_233).nextSiblings(),_234,_235);
},getElementsBySelector:function(){
var args=$A(arguments),element=$(args.shift());
return Selector.findChildElements(element,args);
},getElementsByClassName:function(_237,_238){
_237=$(_237);
return document.getElementsByClassName(_238,_237);
},getHeight:function(_239){
_239=$(_239);
return _239.offsetHeight;
},classNames:function(_23a){
return new Element.ClassNames(_23a);
},hasClassName:function(_23b,_23c){
if(!(_23b=$(_23b))){
return;
}
return Element.classNames(_23b).include(_23c);
},addClassName:function(_23d,_23e){
if(!(_23d=$(_23d))){
return;
}
Element.classNames(_23d).add(_23e);
return _23d;
},removeClassName:function(_23f,_240){
if(!(_23f=$(_23f))){
return;
}
Element.classNames(_23f).remove(_240);
return _23f;
},observe:function(){
Event.observe.apply(Event,arguments);
return $A(arguments).first();
},stopObserving:function(){
Event.stopObserving.apply(Event,arguments);
return $A(arguments).first();
},cleanWhitespace:function(_241){
_241=$(_241);
var node=_241.firstChild;
while(node){
var _243=node.nextSibling;
if(node.nodeType==3&&!/\S/.test(node.nodeValue)){
_241.removeChild(node);
}
node=_243;
}
return _241;
},empty:function(_244){
return $(_244).innerHTML.match(/^\s*$/);
},childOf:function(_245,_246){
_245=$(_245),_246=$(_246);
while(_245=_245.parentNode){
if(_245==_246){
return true;
}
}
return false;
},scrollTo:function(_247){
_247=$(_247);
var x=_247.x?_247.x:_247.offsetLeft,y=_247.y?_247.y:_247.offsetTop;
window.scrollTo(x,y);
return _247;
},getStyle:function(_249,_24a){
_249=$(_249);
var _24b=_249.style[_24a.camelize()];
if(!_24b){
if(document.defaultView&&document.defaultView.getComputedStyle){
var css=document.defaultView.getComputedStyle(_249,null);
_24b=css?css.getPropertyValue(_24a):null;
}else{
if(_249.currentStyle){
_24b=_249.currentStyle[_24a.camelize()];
}
}
}
if(window.opera&&["left","top","right","bottom"].include(_24a)){
if(Element.getStyle(_249,"position")=="static"){
_24b="auto";
}
}
return _24b=="auto"?null:_24b;
},setStyle:function(_24d,_24e){
_24d=$(_24d);
for(var name in _24e){
_24d.style[name.camelize()]=_24e[name];
}
return _24d;
},getDimensions:function(_250){
_250=$(_250);
if(Element.getStyle(_250,"display")!="none"){
return {width:_250.offsetWidth,height:_250.offsetHeight};
}
var els=_250.style;
var _252=els.visibility;
var _253=els.position;
els.visibility="hidden";
els.position="absolute";
els.display="";
var _254=_250.clientWidth;
var _255=_250.clientHeight;
els.display="none";
els.position=_253;
els.visibility=_252;
return {width:_254,height:_255};
},makePositioned:function(_256){
_256=$(_256);
var pos=Element.getStyle(_256,"position");
if(pos=="static"||!pos){
_256._madePositioned=true;
_256.style.position="relative";
if(window.opera){
_256.style.top=0;
_256.style.left=0;
}
}
return _256;
},undoPositioned:function(_258){
_258=$(_258);
if(_258._madePositioned){
_258._madePositioned=undefined;
_258.style.position=_258.style.top=_258.style.left=_258.style.bottom=_258.style.right="";
}
return _258;
},makeClipping:function(_259){
_259=$(_259);
if(_259._overflow){
return;
}
_259._overflow=_259.style.overflow||"auto";
if((Element.getStyle(_259,"overflow")||"visible")!="hidden"){
_259.style.overflow="hidden";
}
return _259;
},undoClipping:function(_25a){
_25a=$(_25a);
if(!_25a._overflow){
return;
}
_25a.style.overflow=_25a._overflow=="auto"?"":_25a._overflow;
_25a._overflow=null;
return _25a;
}};
if(document.all){
Element.Methods.update=function(_25b,html){
_25b=$(_25b);
var _25d=_25b.tagName.toUpperCase();
if(["THEAD","TBODY","TR","TD"].indexOf(_25d)>-1){
var div=document.createElement("div");
switch(_25d){
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(_25b.childNodes).each(function(node){
_25b.removeChild(node);
});
depth.times(function(){
div=div.firstChild;
});
$A(div.childNodes).each(function(node){
_25b.appendChild(node);
});
}else{
_25b.innerHTML=html.stripScripts();
}
setTimeout(function(){
html.evalScripts();
},10);
return _25b;
};
}
Object.extend(Element,Element.Methods);
var _nativeExtensions=false;
if(!window.HTMLElement&&/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
["","Form","Input","TextArea","Select"].each(function(tag){
var _262=window["HTML"+tag+"Element"]={};
_262.prototype=document.createElement(tag?tag.toLowerCase():"div").__proto__;
});
}
Element.addMethods=function(_263){
Object.extend(Element.Methods,_263||{});
function copy(_264,_265){
var _266=Element.extend.cache;
for(var _267 in _264){
var _268=_264[_267];
_265[_267]=_266.findOrStore(_268);
}
}
if(typeof HTMLElement!="undefined"){
copy(Element.Methods,HTMLElement.prototype);
copy(Form.Methods,HTMLFormElement.prototype);
[HTMLInputElement,HTMLTextAreaElement,HTMLSelectElement].each(function(_269){
copy(Form.Element.Methods,_269.prototype);
});
_nativeExtensions=true;
}
};
var Toggle=new Object();
Toggle.display=Element.toggle;
Abstract.Insertion=function(_26a){
this.adjacency=_26a;
};
Abstract.Insertion.prototype={initialize:function(_26b,_26c){
this.element=$(_26b);
this.content=_26c.stripScripts();
if(this.adjacency&&this.element.insertAdjacentHTML){
try{
this.element.insertAdjacentHTML(this.adjacency,this.content);
}
catch(e){
var _26d=this.element.tagName.toLowerCase();
if(_26d=="tbody"||_26d=="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(){
_26c.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(_26f){
_26f.each((function(_270){
this.element.parentNode.insertBefore(_270,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(_271){
_271.reverse(false).each((function(_272){
this.element.insertBefore(_272,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(_273){
_273.each((function(_274){
this.element.appendChild(_274);
}).bind(this));
}});
Insertion.After=Class.create();
Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){
this.range.setStartAfter(this.element);
},insertContent:function(_275){
_275.each((function(_276){
this.element.parentNode.insertBefore(_276,this.element.nextSibling);
}).bind(this));
}});
Element.ClassNames=Class.create();
Element.ClassNames.prototype={initialize:function(_277){
this.element=$(_277);
},_each:function(_278){
this.element.className.split(/\s+/).select(function(name){
return name.length>0;
})._each(_278);
},set:function(_27a){
this.element.className=_27a;
},add:function(_27b){
if(this.include(_27b)){
return;
}
this.set(this.toArray().concat(_27b).join(" "));
},remove:function(_27c){
if(!this.include(_27c)){
return;
}
this.set(this.select(function(_27d){
return _27d!=_27c;
}).join(" "));
},toString:function(){
return this.toArray().join(" ");
}};
Object.extend(Element.ClassNames.prototype,Enumerable);
var Selector=Class.create();
Selector.prototype={initialize:function(_27e){
this.params={classNames:[]};
this.expression=_27e.toString().strip();
this.parseExpression();
this.compileMatcher();
},parseExpression:function(){
function abort(_27f){
throw "Parse error in selector: "+_27f;
}
if(this.expression==""){
abort("empty expression");
}
var _280=this.params,expr=this.expression,match,modifier,clause,rest;
while(match=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){
_280.attributes=_280.attributes||[];
_280.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 "#":
_280.id=clause;
break;
case ".":
_280.classNames.push(clause);
break;
case "":
case undefined:
_280.tagName=clause.toUpperCase();
break;
default:
abort(expr.inspect());
}
expr=rest;
}
if(expr.length>0){
abort(expr.inspect());
}
},buildMatchExpression:function(){
var _281=this.params,conditions=[],clause;
if(_281.wildcard){
conditions.push("true");
}
if(clause=_281.id){
conditions.push("element.id == "+clause.inspect());
}
if(clause=_281.tagName){
conditions.push("element.tagName.toUpperCase() == "+clause.inspect());
}
if((clause=_281.classNames).length>0){
for(var i=0;i<clause.length;i++){
conditions.push("Element.hasClassName(element, "+clause[i].inspect()+")");
}
}
if(clause=_281.attributes){
clause.each(function(_283){
var _284="element.getAttribute("+_283.name.inspect()+")";
var _285=function(_286){
return _284+" && "+_284+".split("+_286.inspect()+")";
};
switch(_283.operator){
case "=":
conditions.push(_284+" == "+_283.value.inspect());
break;
case "~=":
conditions.push(_285(" ")+".include("+_283.value.inspect()+")");
break;
case "|=":
conditions.push(_285("-")+".first().toUpperCase() == "+_283.value.toUpperCase().inspect());
break;
case "!=":
conditions.push(_284+" != "+_283.value.inspect());
break;
case "":
case undefined:
conditions.push(_284+" != null");
break;
default:
throw "Unknown operator "+_283.operator+" in selector";
}
});
}
return conditions.join(" && ");
},compileMatcher:function(){
this.match=new Function("element","if (!element.tagName) return false;       return "+this.buildMatchExpression());
},findElements:function(_287){
var _288;
if(_288=$(this.params.id)){
if(this.match(_288)){
if(!_287||Element.childOf(_288,_287)){
return [_288];
}
}
}
_287=(_287||document).getElementsByTagName(this.params.tagName||"*");
var _289=[];
for(var i=0;i<_287.length;i++){
if(this.match(_288=_287[i])){
_289.push(Element.extend(_288));
}
}
return _289;
},toString:function(){
return this.expression;
}};
Object.extend(Selector,{matchElements:function(_28b,_28c){
var _28d=new Selector(_28c);
return _28b.select(_28d.match.bind(_28d));
},findElement:function(_28e,_28f,_290){
if(typeof _28f=="number"){
_290=_28f,_28f=false;
}
return Selector.matchElements(_28e,_28f||"*")[_290||0];
},findChildElements:function(_291,_292){
return _292.map(function(_293){
return _293.strip().split(/\s+/).inject([null],function(_294,expr){
var _296=new Selector(expr);
return _294.inject([],function(_297,_298){
return _297.concat(_296.findElements(_298||_291));
});
});
}).flatten();
}});
function $$(){
return Selector.findChildElements(document,$A(arguments));
}
var Form={reset:function(form){
$(form).reset();
return form;
}};
Form.Methods={serialize:function(form){
var _29b=Form.getElements($(form));
var _29c=new Array();
for(var i=0;i<_29b.length;i++){
var _29e=Form.Element.serialize(_29b[i]);
if(_29e){
_29c.push(_29e);
}
}
return _29c.join("&");
},getElements:function(form){
form=$(form);
var _2a0=new Array();
for(var _2a1 in Form.Element.Serializers){
var _2a2=form.getElementsByTagName(_2a1);
for(var j=0;j<_2a2.length;j++){
_2a0.push(_2a2[j]);
}
}
return _2a0;
},getInputs:function(form,_2a5,name){
form=$(form);
var _2a7=form.getElementsByTagName("input");
if(!_2a5&&!name){
return _2a7;
}
var _2a8=new Array();
for(var i=0;i<_2a7.length;i++){
var _2aa=_2a7[i];
if((_2a5&&_2aa.type!=_2a5)||(name&&_2aa.name!=name)){
continue;
}
_2a8.push(_2aa);
}
return _2a8;
},disable:function(form){
form=$(form);
var _2ac=Form.getElements(form);
for(var i=0;i<_2ac.length;i++){
var _2ae=_2ac[i];
_2ae.blur();
_2ae.disabled="true";
}
return form;
},enable:function(form){
form=$(form);
var _2b0=Form.getElements(form);
for(var i=0;i<_2b0.length;i++){
var _2b2=_2b0[i];
_2b2.disabled="";
}
return form;
},findFirstElement:function(form){
return Form.getElements(form).find(function(_2b4){
return _2b4.type!="hidden"&&!_2b4.disabled&&["input","select","textarea"].include(_2b4.tagName.toLowerCase());
});
},focusFirstElement:function(form){
form=$(form);
Field.activate(Form.findFirstElement(form));
return form;
}};
Object.extend(Form,Form.Methods);
Form.Element={focus:function(_2b6){
$(_2b6).focus();
return _2b6;
},select:function(_2b7){
$(_2b7).select();
return _2b7;
}};
Form.Element.Methods={serialize:function(_2b8){
_2b8=$(_2b8);
var _2b9=_2b8.tagName.toLowerCase();
var _2ba=Form.Element.Serializers[_2b9](_2b8);
if(_2ba){
var key=encodeURIComponent(_2ba[0]);
if(key.length==0){
return;
}
if(_2ba[1].constructor!=Array){
_2ba[1]=[_2ba[1]];
}
return _2ba[1].map(function(_2bc){
return key+"="+encodeURIComponent(_2bc);
}).join("&");
}
},getValue:function(_2bd){
_2bd=$(_2bd);
var _2be=_2bd.tagName.toLowerCase();
var _2bf=Form.Element.Serializers[_2be](_2bd);
if(_2bf){
return _2bf[1];
}
},clear:function(_2c0){
$(_2c0).value="";
return _2c0;
},present:function(_2c1){
return $(_2c1).value!="";
},activate:function(_2c2){
_2c2=$(_2c2);
_2c2.focus();
if(_2c2.select){
_2c2.select();
}
return _2c2;
},disable:function(_2c3){
_2c3=$(_2c3);
_2c3.disabled="";
return _2c3;
},enable:function(_2c4){
_2c4=$(_2c4);
_2c4.blur();
_2c4.disabled="true";
return _2c4;
}};
Object.extend(Form.Element,Form.Element.Methods);
var Field=Form.Element;
Form.Element.Serializers={input:function(_2c5){
switch(_2c5.type.toLowerCase()){
case "checkbox":
case "radio":
return Form.Element.Serializers.inputSelector(_2c5);
default:
return Form.Element.Serializers.textarea(_2c5);
}
return false;
},inputSelector:function(_2c6){
if(_2c6.checked){
return [_2c6.name,_2c6.value];
}
},textarea:function(_2c7){
return [_2c7.name,_2c7.value];
},select:function(_2c8){
return Form.Element.Serializers[_2c8.type=="select-one"?"selectOne":"selectMany"](_2c8);
},selectOne:function(_2c9){
var _2ca="",opt,index=_2c9.selectedIndex;
if(index>=0){
opt=_2c9.options[index];
_2ca=opt.value||opt.text;
}
return [_2c9.name,_2ca];
},selectMany:function(_2cb){
var _2cc=[];
for(var i=0;i<_2cb.length;i++){
var opt=_2cb.options[i];
if(opt.selected){
_2cc.push(opt.value||opt.text);
}
}
return [_2cb.name,_2cc];
}};
var $F=Form.Element.getValue;
Abstract.TimedObserver=function(){
};
Abstract.TimedObserver.prototype={initialize:function(_2cf,_2d0,_2d1){
this.frequency=_2d0;
this.element=$(_2cf);
this.callback=_2d1;
this.lastValue=this.getValue();
this.registerCallback();
},registerCallback:function(){
setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},onTimerEvent:function(){
var _2d2=this.getValue();
if(this.lastValue!=_2d2){
this.callback(this.element,_2d2);
this.lastValue=_2d2;
}
}};
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(_2d3,_2d4){
this.element=$(_2d3);
this.callback=_2d4;
this.lastValue=this.getValue();
if(this.element.tagName.toLowerCase()=="form"){
this.registerFormCallbacks();
}else{
this.registerCallback(this.element);
}
},onElementEvent:function(){
var _2d5=this.getValue();
if(this.lastValue!=_2d5){
this.callback(this.element,_2d5);
this.lastValue=_2d5;
}
},registerFormCallbacks:function(){
var _2d6=Form.getElements(this.element);
for(var i=0;i<_2d6.length;i++){
this.registerCallback(_2d6[i]);
}
},registerCallback:function(_2d8){
if(_2d8.type){
switch(_2d8.type.toLowerCase()){
case "checkbox":
case "radio":
Event.observe(_2d8,"click",this.onElementEvent.bind(this));
break;
default:
Event.observe(_2d8,"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(_2d9){
return _2d9.target||_2d9.srcElement;
},isLeftClick:function(_2da){
return (((_2da.which)&&(_2da.which==1))||((_2da.button)&&(_2da.button==1)));
},pointerX:function(_2db){
return _2db.pageX||(_2db.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
},pointerY:function(_2dc){
return _2dc.pageY||(_2dc.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
},stop:function(_2dd){
if(_2dd.preventDefault){
_2dd.preventDefault();
_2dd.stopPropagation();
}else{
_2dd.returnValue=false;
_2dd.cancelBubble=true;
}
},findElement:function(_2de,_2df){
var _2e0=Event.element(_2de);
while(_2e0.parentNode&&(!_2e0.tagName||(_2e0.tagName.toUpperCase()!=_2df.toUpperCase()))){
_2e0=_2e0.parentNode;
}
return _2e0;
},observers:false,_observeAndCache:function(_2e1,name,_2e3,_2e4){
if(!this.observers){
this.observers=[];
}
if(_2e1.addEventListener){
this.observers.push([_2e1,name,_2e3,_2e4]);
_2e1.addEventListener(name,_2e3,_2e4);
}else{
if(_2e1.attachEvent){
this.observers.push([_2e1,name,_2e3,_2e4]);
_2e1.attachEvent("on"+name,_2e3);
}
}
},unloadCache:function(){
if(!Event.observers){
return;
}
for(var i=0;i<Event.observers.length;i++){
Event.stopObserving.apply(this,Event.observers[i]);
Event.observers[i][0]=null;
}
Event.observers=false;
},observe:function(_2e6,name,_2e8,_2e9){
_2e6=$(_2e6);
_2e9=_2e9||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_2e6.attachEvent)){
name="keydown";
}
Event._observeAndCache(_2e6,name,_2e8,_2e9);
},stopObserving:function(_2ea,name,_2ec,_2ed){
_2ea=$(_2ea);
_2ed=_2ed||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_2ea.detachEvent)){
name="keydown";
}
if(_2ea.removeEventListener){
_2ea.removeEventListener(name,_2ec,_2ed);
}else{
if(_2ea.detachEvent){
try{
_2ea.detachEvent("on"+name,_2ec);
}
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(_2ee){
var _2ef=0,valueL=0;
do{
_2ef+=_2ee.scrollTop||0;
valueL+=_2ee.scrollLeft||0;
_2ee=_2ee.parentNode;
}while(_2ee);
return [valueL,_2ef];
},cumulativeOffset:function(_2f0){
var _2f1=0,valueL=0;
do{
_2f1+=_2f0.offsetTop||0;
valueL+=_2f0.offsetLeft||0;
_2f0=_2f0.offsetParent;
}while(_2f0);
return [valueL,_2f1];
},positionedOffset:function(_2f2){
var _2f3=0,valueL=0;
do{
_2f3+=_2f2.offsetTop||0;
valueL+=_2f2.offsetLeft||0;
_2f2=_2f2.offsetParent;
if(_2f2){
p=Element.getStyle(_2f2,"position");
if(p=="relative"||p=="absolute"){
break;
}
}
}while(_2f2);
return [valueL,_2f3];
},offsetParent:function(_2f4){
if(_2f4.offsetParent){
return _2f4.offsetParent;
}
if(_2f4==document.body){
return _2f4;
}
while((_2f4=_2f4.parentNode)&&_2f4!=document.body){
if(Element.getStyle(_2f4,"position")!="static"){
return _2f4;
}
}
return document.body;
},within:function(_2f5,x,y){
if(this.includeScrollOffsets){
return this.withinIncludingScrolloffsets(_2f5,x,y);
}
this.xcomp=x;
this.ycomp=y;
this.offset=this.cumulativeOffset(_2f5);
return (y>=this.offset[1]&&y<this.offset[1]+_2f5.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+_2f5.offsetWidth);
},withinIncludingScrolloffsets:function(_2f8,x,y){
var _2fb=this.realOffset(_2f8);
this.xcomp=x+_2fb[0]-this.deltaX;
this.ycomp=y+_2fb[1]-this.deltaY;
this.offset=this.cumulativeOffset(_2f8);
return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+_2f8.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+_2f8.offsetWidth);
},overlap:function(mode,_2fd){
if(!mode){
return 0;
}
if(mode=="vertical"){
return ((this.offset[1]+_2fd.offsetHeight)-this.ycomp)/_2fd.offsetHeight;
}
if(mode=="horizontal"){
return ((this.offset[0]+_2fd.offsetWidth)-this.xcomp)/_2fd.offsetWidth;
}
},page:function(_2fe){
var _2ff=0,valueL=0;
var _300=_2fe;
do{
_2ff+=_300.offsetTop||0;
valueL+=_300.offsetLeft||0;
if(_300.offsetParent==document.body){
if(Element.getStyle(_300,"position")=="absolute"){
break;
}
}
}while(_300=_300.offsetParent);
_300=_2fe;
do{
if(!window.opera||_300.tagName=="BODY"){
_2ff-=_300.scrollTop||0;
valueL-=_300.scrollLeft||0;
}
}while(_300=_300.parentNode);
return [valueL,_2ff];
},clone:function(_301,_302){
var _303=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});
_301=$(_301);
var p=Position.page(_301);
_302=$(_302);
var _305=[0,0];
var _306=null;
if(Element.getStyle(_302,"position")=="absolute"){
_306=Position.offsetParent(_302);
_305=Position.page(_306);
}
if(_306==document.body){
_305[0]-=document.body.offsetLeft;
_305[1]-=document.body.offsetTop;
}
if(_303.setLeft){
_302.style.left=(p[0]-_305[0]+_303.offsetLeft)+"px";
}
if(_303.setTop){
_302.style.top=(p[1]-_305[1]+_303.offsetTop)+"px";
}
if(_303.setWidth){
_302.style.width=_301.offsetWidth+"px";
}
if(_303.setHeight){
_302.style.height=_301.offsetHeight+"px";
}
},absolutize:function(_307){
_307=$(_307);
if(_307.style.position=="absolute"){
return;
}
Position.prepare();
var _308=Position.positionedOffset(_307);
var top=_308[1];
var left=_308[0];
var _30b=_307.clientWidth;
var _30c=_307.clientHeight;
_307._originalLeft=left-parseFloat(_307.style.left||0);
_307._originalTop=top-parseFloat(_307.style.top||0);
_307._originalWidth=_307.style.width;
_307._originalHeight=_307.style.height;
_307.style.position="absolute";
_307.style.top=top+"px";
_307.style.left=left+"px";
_307.style.width=_30b+"px";
_307.style.height=_30c+"px";
},relativize:function(_30d){
_30d=$(_30d);
if(_30d.style.position=="relative"){
return;
}
Position.prepare();
_30d.style.position="relative";
var top=parseFloat(_30d.style.top||0)-(_30d._originalTop||0);
var left=parseFloat(_30d.style.left||0)-(_30d._originalLeft||0);
_30d.style.top=top+"px";
_30d.style.left=left+"px";
_30d.style.height=_30d._originalHeight;
_30d.style.width=_30d._originalWidth;
}};
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
Position.cumulativeOffset=function(_310){
var _311=0,valueL=0;
do{
_311+=_310.offsetTop||0;
valueL+=_310.offsetLeft||0;
if(_310.offsetParent==document.body){
if(Element.getStyle(_310,"position")=="absolute"){
break;
}
}
_310=_310.offsetParent;
}while(_310);
return [valueL,_311];
};
}
Element.addMethods();
