var Prototype={Version:"1.5.0_rc2",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,_e=$A(arguments),_f=_e.shift();
return function(){
return _d.apply(_f,_e.concat($A(arguments)));
};
};
Function.prototype.bindAsEventListener=function(_10){
var _11=this,_12=$A(arguments),_10=_12.shift();
return function(_13){
return _11.apply(_10,[(_13||window.event)].concat(_12).concat($A(arguments)));
};
};
Object.extend(Number.prototype,{toColorPart:function(){
var _14=this.toString(16);
if(this<16){
return "0"+_14;
}
return _14;
},succ:function(){
return this+1;
},times:function(_15){
$R(0,this,true).each(_15);
return this;
}});
var Try={these:function(){
var _16;
for(var i=0,_18=arguments.length;i<_18;i++){
var _19=arguments[i];
try{
_16=_19();
break;
}
catch(e){
}
}
return _16;
}};
var PeriodicalExecuter=Class.create();
PeriodicalExecuter.prototype={initialize:function(_1a,_1b){
this.callback=_1a;
this.frequency=_1b;
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(_1c){
return _1c==null?"":String(_1c);
};
Object.extend(String.prototype,{gsub:function(_1d,_1e){
var _1f="",_20=this,_21;
_1e=arguments.callee.prepareReplacement(_1e);
while(_20.length>0){
if(_21=_20.match(_1d)){
_1f+=_20.slice(0,_21.index);
_1f+=String.interpret(_1e(_21));
_20=_20.slice(_21.index+_21[0].length);
}else{
_1f+=_20,_20="";
}
}
return _1f;
},sub:function(_22,_23,_24){
_23=this.gsub.prepareReplacement(_23);
_24=_24===undefined?1:_24;
return this.gsub(_22,function(_25){
if(--_24<0){
return _25[0];
}
return _23(_25);
});
},scan:function(_26,_27){
this.gsub(_26,_27);
return this;
},truncate:function(_28,_29){
_28=_28||30;
_29=_29===undefined?"...":_29;
return this.length>_28?this.slice(0,_28-_29.length)+_29: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 _2a=new RegExp(Prototype.ScriptFragment,"img");
var _2b=new RegExp(Prototype.ScriptFragment,"im");
return (this.match(_2a)||[]).map(function(_2c){
return (_2c.match(_2b)||["",""])[1];
});
},evalScripts:function(){
return this.extractScripts().map(function(_2d){
return eval(_2d);
});
},escapeHTML:function(){
var div=document.createElement("div");
var _2f=document.createTextNode(this);
div.appendChild(_2f);
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(_31,_32){
return _31+_32.nodeValue;
}):div.childNodes[0].nodeValue):"";
},toQueryParams:function(_33){
var _34=this.strip().match(/([^?#]*)(#.*)?$/);
if(!_34){
return {};
}
return _34[1].split(_33||"&").inject({},function(_35,_36){
if((_36=_36.split("="))[0]){
var _37=decodeURIComponent(_36[0]);
var _38=_36[1]?decodeURIComponent(_36[1]):undefined;
if(_35[_37]!==undefined){
if(_35[_37].constructor!=Array){
_35[_37]=[_35[_37]];
}
if(_38){
_35[_37].push(_38);
}
}else{
_35[_37]=_38;
}
}
return _35;
});
},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 _39=this.split("-"),len=_39.length;
if(len==1){
return _39[0];
}
var _3b=this.charAt(0)=="-"?_39[0].charAt(0).toUpperCase()+_39[0].substring(1):_39[0];
for(var i=1;i<len;i++){
_3b+=_39[i].charAt(0).toUpperCase()+_39[i].substring(1);
}
return _3b;
},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(_3d){
var _3e=this.replace(/\\/g,"\\\\");
if(_3d){
return "\""+_3e.replace(/"/g,"\\\"")+"\"";
}else{
return "'"+_3e.replace(/'/g,"\\'")+"'";
}
}});
String.prototype.gsub.prepareReplacement=function(_3f){
if(typeof _3f=="function"){
return _3f;
}
var _40=new Template(_3f);
return function(_41){
return _40.evaluate(_41);
};
};
String.prototype.parseQuery=String.prototype.toQueryParams;
var Template=Class.create();
Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;
Template.prototype={initialize:function(_42,_43){
this.template=_42.toString();
this.pattern=_43||Template.Pattern;
},evaluate:function(_44){
return this.template.gsub(this.pattern,function(_45){
var _46=_45[1];
if(_46=="\\"){
return _45[2];
}
return _46+String.interpret(_44[_45[3]]);
});
}};
var $break=new Object();
var $continue=new Object();
var Enumerable={each:function(_47){
var _48=0;
try{
this._each(function(_49){
try{
_47(_49,_48++);
}
catch(e){
if(e!=$continue){
throw e;
}
}
});
}
catch(e){
if(e!=$break){
throw e;
}
}
return this;
},eachSlice:function(_4a,_4b){
var _4c=-_4a,_4d=[],_4e=this.toArray();
while((_4c+=_4a)<_4e.length){
_4d.push(_4e.slice(_4c,_4c+_4a));
}
return _4d.map(_4b);
},all:function(_4f){
var _50=true;
this.each(function(_51,_52){
_50=_50&&!!(_4f||Prototype.K)(_51,_52);
if(!_50){
throw $break;
}
});
return _50;
},any:function(_53){
var _54=false;
this.each(function(_55,_56){
if(_54=!!(_53||Prototype.K)(_55,_56)){
throw $break;
}
});
return _54;
},collect:function(_57){
var _58=[];
this.each(function(_59,_5a){
_58.push((_57||Prototype.K)(_59,_5a));
});
return _58;
},detect:function(_5b){
var _5c;
this.each(function(_5d,_5e){
if(_5b(_5d,_5e)){
_5c=_5d;
throw $break;
}
});
return _5c;
},findAll:function(_5f){
var _60=[];
this.each(function(_61,_62){
if(_5f(_61,_62)){
_60.push(_61);
}
});
return _60;
},grep:function(_63,_64){
var _65=[];
this.each(function(_66,_67){
var _68=_66.toString();
if(_68.match(_63)){
_65.push((_64||Prototype.K)(_66,_67));
}
});
return _65;
},include:function(_69){
var _6a=false;
this.each(function(_6b){
if(_6b==_69){
_6a=true;
throw $break;
}
});
return _6a;
},inGroupsOf:function(_6c,_6d){
_6d=_6d===undefined?null:_6d;
return this.eachSlice(_6c,function(_6e){
while(_6e.length<_6c){
_6e.push(_6d);
}
return _6e;
});
},inject:function(_6f,_70){
this.each(function(_71,_72){
_6f=_70(_6f,_71,_72);
});
return _6f;
},invoke:function(_73){
var _74=$A(arguments).slice(1);
return this.map(function(_75){
return _75[_73].apply(_75,_74);
});
},max:function(_76){
var _77;
this.each(function(_78,_79){
_78=(_76||Prototype.K)(_78,_79);
if(_77==undefined||_78>=_77){
_77=_78;
}
});
return _77;
},min:function(_7a){
var _7b;
this.each(function(_7c,_7d){
_7c=(_7a||Prototype.K)(_7c,_7d);
if(_7b==undefined||_7c<_7b){
_7b=_7c;
}
});
return _7b;
},partition:function(_7e){
var _7f=[],_80=[];
this.each(function(_81,_82){
((_7e||Prototype.K)(_81,_82)?_7f:_80).push(_81);
});
return [_7f,_80];
},pluck:function(_83){
var _84=[];
this.each(function(_85,_86){
_84.push(_85[_83]);
});
return _84;
},reject:function(_87){
var _88=[];
this.each(function(_89,_8a){
if(!_87(_89,_8a)){
_88.push(_89);
}
});
return _88;
},sortBy:function(_8b){
return this.map(function(_8c,_8d){
return {value:_8c,criteria:_8b(_8c,_8d)};
}).sort(function(_8e,_8f){
var a=_8e.criteria,b=_8f.criteria;
return a<b?-1:a>b?1:0;
}).pluck("value");
},toArray:function(){
return this.map();
},zip:function(){
var _92=Prototype.K,_93=$A(arguments);
if(typeof _93.last()=="function"){
_92=_93.pop();
}
var _94=[this].concat(_93).map($A);
return this.map(function(_95,_96){
return _92(_94.pluck(_96));
});
},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(_97){
if(!_97){
return [];
}
if(_97.toArray){
return _97.toArray();
}else{
var _98=[];
for(var i=0,_9a=_97.length;i<_9a;i++){
_98.push(_97[i]);
}
return _98;
}
};
Object.extend(Array.prototype,Enumerable);
if(!Array.prototype._reverse){
Array.prototype._reverse=Array.prototype.reverse;
}
Object.extend(Array.prototype,{_each:function(_9b){
for(var i=0,_9d=this.length;i<_9d;i++){
_9b(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(_9e){
return _9e!=null;
});
},flatten:function(){
return this.inject([],function(_9f,_a0){
return _9f.concat(_a0&&_a0.constructor==Array?_a0.flatten():[_a0]);
});
},without:function(){
var _a1=$A(arguments);
return this.select(function(_a2){
return !_a1.include(_a2);
});
},indexOf:function(_a3){
for(var i=0,_a5=this.length;i<_a5;i++){
if(this[i]==_a3){
return i;
}
}
return -1;
},reverse:function(_a6){
return (_a6!==false?this:this.toArray())._reverse();
},reduce:function(){
return this.length>1?this:this[0];
},uniq:function(){
return this.inject([],function(_a7,_a8){
return _a7.include(_a8)?_a7:_a7.concat([_a8]);
});
},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(_a9){
_a9=_a9.strip();
return _a9?_a9.split(/\s+/):[];
}
if(window.opera){
Array.prototype.concat=function(){
var _aa=[];
for(var i=0,_ac=this.length;i<_ac;i++){
_aa.push(this[i]);
}
for(var i=0,_ac=arguments.length;i<_ac;i++){
if(arguments[i].constructor==Array){
for(var j=0,_ae=arguments[i].length;j<_ae;j++){
_aa.push(arguments[i][j]);
}
}else{
_aa.push(arguments[i]);
}
}
return _aa;
};
}
var Hash={_each:function(_af){
for(var key in this){
var _b1=this[key];
if(typeof _b1=="function"){
continue;
}
var _b2=[key,_b1];
_b2.key=key;
_b2.value=_b1;
_af(_b2);
}
},keys:function(){
return this.pluck("key");
},values:function(){
return this.pluck("value");
},merge:function(_b3){
return $H(_b3).inject(this,function(_b4,_b5){
_b4[_b5.key]=_b5.value;
return _b4;
});
},toQueryString:function(){
return this.map(function(_b6){
if(!_b6.key){
return null;
}
if(_b6.value&&_b6.value.constructor==Array){
_b6.value=_b6.value.compact();
if(_b6.value.length<2){
_b6.value=_b6.value.reduce();
}else{
var key=encodeURIComponent(_b6.key);
return _b6.value.map(function(_b8){
return key+"="+encodeURIComponent(_b8);
}).join("&");
}
}
if(_b6.value==undefined){
_b6[1]="";
}
return _b6.map(encodeURIComponent).join("=");
}).join("&");
},inspect:function(){
return "#<Hash:{"+this.map(function(_b9){
return _b9.map(Object.inspect).join(": ");
}).join(", ")+"}>";
}};
function $H(_ba){
var _bb=Object.extend({},_ba||{});
Object.extend(_bb,Enumerable);
Object.extend(_bb,Hash);
return _bb;
}
ObjectRange=Class.create();
Object.extend(ObjectRange.prototype,Enumerable);
Object.extend(ObjectRange.prototype,{initialize:function(_bc,end,_be){
this.start=_bc;
this.end=end;
this.exclusive=_be;
},_each:function(_bf){
var _c0=this.start;
while(this.include(_c0)){
_bf(_c0);
_c0=_c0.succ();
}
},include:function(_c1){
if(_c1<this.start){
return false;
}
if(this.exclusive){
return _c1<this.end;
}
return _c1<=this.end;
}});
var $R=function(_c2,end,_c4){
return new ObjectRange(_c2,end,_c4);
};
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(_c5){
this.responders._each(_c5);
},register:function(_c6){
if(!this.include(_c6)){
this.responders.push(_c6);
}
},unregister:function(_c7){
this.responders=this.responders.without(_c7);
},dispatch:function(_c8,_c9,_ca,_cb){
this.each(function(_cc){
if(typeof _cc[_c8]=="function"){
try{
_cc[_c8].apply(_cc,[_c9,_ca,_cb]);
}
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(_cd){
this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:""};
Object.extend(this.options,_cd||{});
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(),{_complete:false,initialize:function(url,_cf){
this.transport=Ajax.getTransport();
this.setOptions(_cf);
this.request(url);
},request:function(url){
var _d1=this.options.parameters;
if(_d1.any()){
_d1["_"]="";
}
if(!["get","post"].include(this.options.method)){
_d1["_method"]=this.options.method;
this.options.method="post";
}
this.url=url;
if(this.options.method=="get"&&_d1.any()){
this.url+=(this.url.indexOf("?")>=0?"&":"?")+_d1.toQueryString();
}
try{
Ajax.Responders.dispatch("onCreate",this,this.transport);
this.transport.open(this.options.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 _d2=this.options.method=="post"?(this.options.postBody||_d1.toQueryString()):null;
this.transport.send(_d2);
if(!this.options.asynchronous&&this.transport.overrideMimeType){
this.onStateChange();
}
}
catch(e){
this.dispatchException(e);
}
},onStateChange:function(){
var _d3=this.transport.readyState;
if(_d3>1&&!((_d3==4)&&this._complete)){
this.respondToReadyState(this.transport.readyState);
}
},setRequestHeaders:function(){
var _d4={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,"Accept":"text/javascript, text/html, application/xml, text/xml, */*"};
if(this.options.method=="post"){
_d4["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){
_d4["Connection"]="close";
}
}
if(typeof this.options.requestHeaders=="object"){
var _d5=this.options.requestHeaders;
if(typeof _d5.push=="function"){
for(var i=0,_d7=_d5.length;i<_d7;i+=2){
_d4[_d5[i]]=_d5[i+1];
}
}else{
$H(_d5).each(function(_d8){
_d4[_d8.key]=_d8.value;
});
}
}
for(var _d9 in _d4){
this.transport.setRequestHeader(_d9,_d4[_d9]);
}
},success:function(){
return !this.transport.status||(this.transport.status>=200&&this.transport.status<300);
},respondToReadyState:function(_da){
var _db=Ajax.Request.Events[_da];
var _dc=this.transport,_dd=this.evalJSON();
if(_db=="Complete"){
try{
this._complete=true;
(this.options["on"+this.transport.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(_dc,_dd);
}
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"+_db]||Prototype.emptyFunction)(_dc,_dd);
Ajax.Responders.dispatch("on"+_db,this,_dc,_dd);
}
catch(e){
this.dispatchException(e);
}
if(_db=="Complete"){
this.transport.onreadystatechange=Prototype.emptyFunction;
}
},getHeader:function(_de){
try{
return this.transport.getResponseHeader(_de);
}
catch(e){
return null;
}
},evalJSON:function(){
try{
var _df=this.getHeader("X-JSON");
return _df?eval("("+_df+")"):null;
}
catch(e){
return null;
}
},evalResponse:function(){
try{
return eval(this.transport.responseText);
}
catch(e){
this.dispatchException(e);
}
},dispatchException:function(_e0){
(this.options.onException||Prototype.emptyFunction)(this,_e0);
Ajax.Responders.dispatch("onException",this,_e0);
}});
Ajax.Updater=Class.create();
Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(_e1,url,_e3){
this.container={success:(_e1.success||_e1),failure:(_e1.failure||(_e1.success?null:_e1))};
this.transport=Ajax.getTransport();
this.setOptions(_e3);
var _e4=this.options.onComplete||Prototype.emptyFunction;
this.options.onComplete=(function(_e5,_e6){
this.updateContent();
_e4(_e5,_e6);
}).bind(this);
this.request(url);
},updateContent:function(){
var _e7=this.container[this.success()?"success":"failure"];
var _e8=this.transport.responseText;
if(!this.options.evalScripts){
_e8=_e8.stripScripts();
}
if(_e7=$(_e7)){
if(this.options.insertion){
new this.options.insertion(_e7,_e8);
}else{
_e7.update(_e8);
}
}
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(_e9,url,_eb){
this.setOptions(_eb);
this.onComplete=this.options.onComplete;
this.frequency=(this.options.frequency||2);
this.decay=(this.options.decay||1);
this.updater={};
this.container=_e9;
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(_ec){
if(this.options.decay){
this.decay=(_ec.responseText==this.lastText?this.decay*this.options.decay:1);
this.lastText=_ec.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 $(_ed){
if(arguments.length>1){
for(var i=0,_ef=[],_f0=arguments.length;i<_f0;i++){
_ef.push($(arguments[i]));
}
return _ef;
}
if(typeof _ed=="string"){
_ed=document.getElementById(_ed);
}
return Element.extend(_ed);
}
if(Prototype.BrowserFeatures.XPath){
document._getElementsByXPath=function(_f1,_f2){
var _f3=[];
var _f4=document.evaluate(_f1,$(_f2)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for(var i=0,_f6=_f4.snapshotLength;i<_f6;i++){
_f3.push(_f4.snapshotItem(i));
}
return _f3;
};
}
document.getElementsByClassName=function(_f7,_f8){
if(Prototype.BrowserFeatures.XPath){
var q=".//*[contains(concat(' ', @class, ' '), ' "+_f7+" ')]";
return document._getElementsByXPath(q,_f8);
}else{
var _fa=($(_f8)||document.body).getElementsByTagName("*");
var _fb=[],_fc;
for(var i=0,_fe=_fa.length;i<_fe;i++){
_fc=_fa[i];
if(Element.hasClassName(_fc,_f7)){
_fb.push(Element.extend(_fc));
}
}
return _fb;
}
};
if(!window.Element){
var Element=new Object();
}
Element.extend=function(_ff){
if(!_ff||_nativeExtensions||_ff.nodeType==3){
return _ff;
}
if(!_ff._extended&&_ff.tagName&&_ff!=window){
var _100=Object.clone(Element.Methods),_101=Element.extend.cache;
if(_ff.tagName=="FORM"){
Object.extend(_100,Form.Methods);
}
if(["INPUT","TEXTAREA","SELECT"].include(_ff.tagName)){
Object.extend(_100,Form.Element.Methods);
}
Object.extend(_100,Element.Methods.Simulated);
for(var _102 in _100){
var _103=_100[_102];
if(typeof _103=="function"&&!(_102 in _ff)){
_ff[_102]=_101.findOrStore(_103);
}
}
}
_ff._extended=true;
return _ff;
};
Element.extend.cache={findOrStore:function(_104){
return this[_104]=this[_104]||function(){
return _104.apply(null,[this].concat($A(arguments)));
};
}};
Element.Methods={visible:function(_105){
return $(_105).style.display!="none";
},toggle:function(_106){
_106=$(_106);
Element[Element.visible(_106)?"hide":"show"](_106);
return _106;
},hide:function(_107){
$(_107).style.display="none";
return _107;
},show:function(_108){
$(_108).style.display="";
return _108;
},remove:function(_109){
_109=$(_109);
_109.parentNode.removeChild(_109);
return _109;
},update:function(_10a,html){
html=typeof html=="undefined"?"":html.toString();
$(_10a).innerHTML=html.stripScripts();
setTimeout(function(){
html.evalScripts();
},10);
return _10a;
},replace:function(_10c,html){
_10c=$(_10c);
html=typeof html=="undefined"?"":html.toString();
if(_10c.outerHTML){
_10c.outerHTML=html.stripScripts();
}else{
var _10e=_10c.ownerDocument.createRange();
_10e.selectNodeContents(_10c);
_10c.parentNode.replaceChild(_10e.createContextualFragment(html.stripScripts()),_10c);
}
setTimeout(function(){
html.evalScripts();
},10);
return _10c;
},inspect:function(_10f){
_10f=$(_10f);
var _110="<"+_10f.tagName.toLowerCase();
$H({"id":"id","className":"class"}).each(function(pair){
var _112=pair.first(),_113=pair.last();
var _114=(_10f[_112]||"").toString();
if(_114){
_110+=" "+_113+"="+_114.inspect(true);
}
});
return _110+">";
},recursivelyCollect:function(_115,_116){
_115=$(_115);
var _117=[];
while(_115=_115[_116]){
if(_115.nodeType==1){
_117.push(Element.extend(_115));
}
}
return _117;
},ancestors:function(_118){
return $(_118).recursivelyCollect("parentNode");
},descendants:function(_119){
return $A($(_119).getElementsByTagName("*"));
},immediateDescendants:function(_11a){
if(!(_11a=$(_11a).firstChild)){
return [];
}
while(_11a&&_11a.nodeType!=1){
_11a=_11a.nextSibling;
}
if(_11a){
return [_11a].concat($(_11a).nextSiblings());
}
return [];
},previousSiblings:function(_11b){
return $(_11b).recursivelyCollect("previousSibling");
},nextSiblings:function(_11c){
return $(_11c).recursivelyCollect("nextSibling");
},siblings:function(_11d){
_11d=$(_11d);
return _11d.previousSiblings().reverse().concat(_11d.nextSiblings());
},match:function(_11e,_11f){
if(typeof _11f=="string"){
_11f=new Selector(_11f);
}
return _11f.match($(_11e));
},up:function(_120,_121,_122){
return Selector.findElement($(_120).ancestors(),_121,_122);
},down:function(_123,_124,_125){
return Selector.findElement($(_123).descendants(),_124,_125);
},previous:function(_126,_127,_128){
return Selector.findElement($(_126).previousSiblings(),_127,_128);
},next:function(_129,_12a,_12b){
return Selector.findElement($(_129).nextSiblings(),_12a,_12b);
},getElementsBySelector:function(){
var args=$A(arguments),_12d=$(args.shift());
return Selector.findChildElements(_12d,args);
},getElementsByClassName:function(_12e,_12f){
return document.getElementsByClassName(_12f,_12e);
},readAttribute:function(_130,name){
return $(_130).getAttribute(name);
},getHeight:function(_132){
return $(_132).getDimensions().height;
},getWidth:function(_133){
return $(_133).getDimensions().width;
},classNames:function(_134){
return new Element.ClassNames(_134);
},hasClassName:function(_135,_136){
if(!(_135=$(_135))){
return;
}
var _137=_135.className;
if(_137.length==0){
return false;
}
if(_137==_136||_137.match(new RegExp("(^|\\s)"+_136+"(\\s|$)"))){
return true;
}
return false;
},addClassName:function(_138,_139){
if(!(_138=$(_138))){
return;
}
Element.classNames(_138).add(_139);
return _138;
},removeClassName:function(_13a,_13b){
if(!(_13a=$(_13a))){
return;
}
Element.classNames(_13a).remove(_13b);
return _13a;
},toggleClassName:function(_13c,_13d){
if(!(_13c=$(_13c))){
return;
}
Element.classNames(_13c)[_13c.hasClassName(_13d)?"remove":"add"](_13d);
return _13c;
},observe:function(){
Event.observe.apply(Event,arguments);
return $A(arguments).first();
},stopObserving:function(){
Event.stopObserving.apply(Event,arguments);
return $A(arguments).first();
},cleanWhitespace:function(_13e){
_13e=$(_13e);
var node=_13e.firstChild;
while(node){
var _140=node.nextSibling;
if(node.nodeType==3&&!/\S/.test(node.nodeValue)){
_13e.removeChild(node);
}
node=_140;
}
return _13e;
},empty:function(_141){
return $(_141).innerHTML.match(/^\s*$/);
},descendantOf:function(_142,_143){
_142=$(_142),_143=$(_143);
while(_142=_142.parentNode){
if(_142==_143){
return true;
}
}
return false;
},scrollTo:function(_144){
_144=$(_144);
var pos=Position.cumulativeOffset(_144);
window.scrollTo(pos[0],pos[1]);
return _144;
},getStyle:function(_146,_147){
_146=$(_146);
if(["float","cssFloat"].include(_147)){
_147=(typeof _146.style.styleFloat!="undefined"?"styleFloat":"cssFloat");
}
_147=_147.camelize();
var _148=_146.style[_147];
if(!_148){
if(document.defaultView&&document.defaultView.getComputedStyle){
var css=document.defaultView.getComputedStyle(_146,null);
_148=css?css[_147]:null;
}else{
if(_146.currentStyle){
_148=_146.currentStyle[_147];
}
}
}
if((_148=="auto")&&["width","height"].include(_147)&&(_146.getStyle("display")!="none")){
_148=_146["offset"+_147.capitalize()]+"px";
}
if(window.opera&&["left","top","right","bottom"].include(_147)){
if(Element.getStyle(_146,"position")=="static"){
_148="auto";
}
}
if(_147=="opacity"){
if(_148){
return parseFloat(_148);
}
if(_148=(_146.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){
if(_148[1]){
return parseFloat(_148[1])/100;
}
}
return 1;
}
return _148=="auto"?null:_148;
},setStyle:function(_14a,_14b){
_14a=$(_14a);
for(var name in _14b){
var _14d=_14b[name];
if(name=="opacity"){
if(_14d==1){
_14d=(/Gecko/.test(navigator.userAgent)&&!/Konqueror|Safari|KHTML/.test(navigator.userAgent))?0.999999:1;
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_14a.style.filter=_14a.getStyle("filter").replace(/alpha\([^\)]*\)/gi,"");
}
}else{
if(_14d==""){
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_14a.style.filter=_14a.getStyle("filter").replace(/alpha\([^\)]*\)/gi,"");
}
}else{
if(_14d<0.00001){
_14d=0;
}
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_14a.style.filter=_14a.getStyle("filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+_14d*100+")";
}
}
}
}else{
if(["float","cssFloat"].include(name)){
name=(typeof _14a.style.styleFloat!="undefined")?"styleFloat":"cssFloat";
}
}
_14a.style[name.camelize()]=_14d;
}
return _14a;
},getDimensions:function(_14e){
_14e=$(_14e);
var _14f=$(_14e).getStyle("display");
if(_14f!="none"&&_14f!=null){
return {width:_14e.offsetWidth,height:_14e.offsetHeight};
}
var els=_14e.style;
var _151=els.visibility;
var _152=els.position;
var _153=els.display;
els.visibility="hidden";
els.position="absolute";
els.display="block";
var _154=_14e.clientWidth;
var _155=_14e.clientHeight;
els.display=_153;
els.position=_152;
els.visibility=_151;
return {width:_154,height:_155};
},makePositioned:function(_156){
_156=$(_156);
var pos=Element.getStyle(_156,"position");
if(pos=="static"||!pos){
_156._madePositioned=true;
_156.style.position="relative";
if(window.opera){
_156.style.top=0;
_156.style.left=0;
}
}
return _156;
},undoPositioned:function(_158){
_158=$(_158);
if(_158._madePositioned){
_158._madePositioned=undefined;
_158.style.position=_158.style.top=_158.style.left=_158.style.bottom=_158.style.right="";
}
return _158;
},makeClipping:function(_159){
_159=$(_159);
if(_159._overflow){
return _159;
}
_159._overflow=_159.style.overflow||"auto";
if((Element.getStyle(_159,"overflow")||"visible")!="hidden"){
_159.style.overflow="hidden";
}
return _159;
},undoClipping:function(_15a){
_15a=$(_15a);
if(!_15a._overflow){
return _15a;
}
_15a.style.overflow=_15a._overflow=="auto"?"":_15a._overflow;
_15a._overflow=null;
return _15a;
}};
Object.extend(Element.Methods,{childOf:Element.Methods.descendantOf});
Element.Methods.Simulated={hasAttribute:function(_15b,_15c){
return $(_15b).getAttributeNode(_15c).specified;
}};
if(document.all){
Element.Methods.update=function(_15d,html){
_15d=$(_15d);
html=typeof html=="undefined"?"":html.toString();
var _15f=_15d.tagName.toUpperCase();
if(["THEAD","TBODY","TR","TD"].include(_15f)){
var div=document.createElement("div");
switch(_15f){
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(_15d.childNodes).each(function(node){
_15d.removeChild(node);
});
depth.times(function(){
div=div.firstChild;
});
$A(div.childNodes).each(function(node){
_15d.appendChild(node);
});
}else{
_15d.innerHTML=html.stripScripts();
}
setTimeout(function(){
html.evalScripts();
},10);
return _15d;
};
}
Object.extend(Element,Element.Methods);
var _nativeExtensions=false;
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
["","Form","Input","TextArea","Select"].each(function(tag){
var _164="HTML"+tag+"Element";
if(window[_164]){
return;
}
var _165=window[_164]={};
_165.prototype=document.createElement(tag?tag.toLowerCase():"div").__proto__;
});
}
Element.addMethods=function(_166){
Object.extend(Element.Methods,_166||{});
function copy(_167,_168,_169){
_169=_169||false;
var _16a=Element.extend.cache;
for(var _16b in _167){
var _16c=_167[_16b];
if(!_169||!(_16b in _168)){
_168[_16b]=_16a.findOrStore(_16c);
}
}
}
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(_16d){
copy(Form.Element.Methods,_16d.prototype);
});
_nativeExtensions=true;
}
};
var Toggle=new Object();
Toggle.display=Element.toggle;
Abstract.Insertion=function(_16e){
this.adjacency=_16e;
};
Abstract.Insertion.prototype={initialize:function(_16f,_170){
this.element=$(_16f);
this.content=_170.stripScripts();
if(this.adjacency&&this.element.insertAdjacentHTML){
try{
this.element.insertAdjacentHTML(this.adjacency,this.content);
}
catch(e){
var _171=this.element.tagName.toUpperCase();
if(["TBODY","TR"].include(_171)){
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(){
_170.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(_173){
_173.each((function(_174){
this.element.parentNode.insertBefore(_174,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(_175){
_175.reverse(false).each((function(_176){
this.element.insertBefore(_176,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(_177){
_177.each((function(_178){
this.element.appendChild(_178);
}).bind(this));
}});
Insertion.After=Class.create();
Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){
this.range.setStartAfter(this.element);
},insertContent:function(_179){
_179.each((function(_17a){
this.element.parentNode.insertBefore(_17a,this.element.nextSibling);
}).bind(this));
}});
Element.ClassNames=Class.create();
Element.ClassNames.prototype={initialize:function(_17b){
this.element=$(_17b);
},_each:function(_17c){
this.element.className.split(/\s+/).select(function(name){
return name.length>0;
})._each(_17c);
},set:function(_17e){
this.element.className=_17e;
},add:function(_17f){
if(this.include(_17f)){
return;
}
this.set($A(this).concat(_17f).join(" "));
},remove:function(_180){
if(!this.include(_180)){
return;
}
this.set($A(this).without(_180).join(" "));
},toString:function(){
return $A(this).join(" ");
}};
Object.extend(Element.ClassNames.prototype,Enumerable);
var Selector=Class.create();
Selector.prototype={initialize:function(_181){
this.params={classNames:[]};
this.expression=_181.toString().strip();
this.parseExpression();
this.compileMatcher();
},parseExpression:function(){
function abort(_182){
throw "Parse error in selector: "+_182;
}
if(this.expression==""){
abort("empty expression");
}
var _183=this.params,expr=this.expression,_185,_186,_187,rest;
while(_185=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){
_183.attributes=_183.attributes||[];
_183.attributes.push({name:_185[2],operator:_185[3],value:_185[4]||_185[5]||""});
expr=_185[1];
}
if(expr=="*"){
return this.params.wildcard=true;
}
while(_185=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)){
_186=_185[1],_187=_185[2],rest=_185[3];
switch(_186){
case "#":
_183.id=_187;
break;
case ".":
_183.classNames.push(_187);
break;
case "":
case undefined:
_183.tagName=_187.toUpperCase();
break;
default:
abort(expr.inspect());
}
expr=rest;
}
if(expr.length>0){
abort(expr.inspect());
}
},buildMatchExpression:function(){
var _189=this.params,_18a=[],_18b;
if(_189.wildcard){
_18a.push("true");
}
if(_18b=_189.id){
_18a.push("element.getAttribute(\"id\") == "+_18b.inspect());
}
if(_18b=_189.tagName){
_18a.push("element.tagName.toUpperCase() == "+_18b.inspect());
}
if((_18b=_189.classNames).length>0){
for(var i=0,_18d=_18b.length;i<_18d;i++){
_18a.push("Element.hasClassName(element, "+_18b[i].inspect()+")");
}
}
if(_18b=_189.attributes){
_18b.each(function(_18e){
var _18f="element.getAttribute("+_18e.name.inspect()+")";
var _190=function(_191){
return _18f+" && "+_18f+".split("+_191.inspect()+")";
};
switch(_18e.operator){
case "=":
_18a.push(_18f+" == "+_18e.value.inspect());
break;
case "~=":
_18a.push(_190(" ")+".include("+_18e.value.inspect()+")");
break;
case "|=":
_18a.push(_190("-")+".first().toUpperCase() == "+_18e.value.toUpperCase().inspect());
break;
case "!=":
_18a.push(_18f+" != "+_18e.value.inspect());
break;
case "":
case undefined:
_18a.push(_18f+" != null");
break;
default:
throw "Unknown operator "+_18e.operator+" in selector";
}
});
}
return _18a.join(" && ");
},compileMatcher:function(){
this.match=new Function("element","if (!element.tagName) return false;       return "+this.buildMatchExpression());
},findElements:function(_192){
var _193;
if(_193=$(this.params.id)){
if(this.match(_193)){
if(!_192||Element.childOf(_193,_192)){
return [_193];
}
}
}
_192=(_192||document).getElementsByTagName(this.params.tagName||"*");
var _194=[];
for(var i=0,_196=_192.length;i<_196;i++){
if(this.match(_193=_192[i])){
_194.push(Element.extend(_193));
}
}
return _194;
},toString:function(){
return this.expression;
}};
Object.extend(Selector,{matchElements:function(_197,_198){
var _199=new Selector(_198);
return _197.select(_199.match.bind(_199)).map(Element.extend);
},findElement:function(_19a,_19b,_19c){
if(typeof _19b=="number"){
_19c=_19b,_19b=false;
}
return Selector.matchElements(_19a,_19b||"*")[_19c||0];
},findChildElements:function(_19d,_19e){
return _19e.map(function(_19f){
return _19f.strip().split(/\s+/).inject([null],function(_1a0,expr){
var _1a2=new Selector(expr);
return _1a0.inject([],function(_1a3,_1a4){
return _1a3.concat(_1a2.findElements(_1a4||_19d));
});
});
}).flatten();
}});
function $$(){
return Selector.findChildElements(document,$A(arguments));
}
var Form={reset:function(form){
$(form).reset();
return form;
},serializeElements:function(_1a6){
return _1a6.inject([],function(_1a7,_1a8){
var _1a9=Form.Element.serialize(_1a8);
if(_1a9){
_1a7.push(_1a9);
}
return _1a7;
}).join("&");
}};
Form.Methods={serialize:function(form){
return Form.serializeElements(Form.getElements(form));
},getElements:function(form){
return $A($(form).getElementsByTagName("*")).inject([],function(_1ac,_1ad){
if(Form.Element.Serializers[_1ad.tagName.toLowerCase()]){
_1ac.push(Element.extend(_1ad));
}
return _1ac;
});
},getInputs:function(form,_1af,name){
form=$(form);
var _1b1=form.getElementsByTagName("input"),_1b2=[];
if(!_1af&&!name){
return $A(_1b1).map(Element.extend);
}
for(var i=0,_1b4=_1b1.length;i<_1b4;i++){
var _1b5=_1b1[i];
if((_1af&&_1b5.type!=_1af)||(name&&_1b5.name!=name)){
continue;
}
_1b2.push(Element.extend(_1b5));
}
return _1b2;
},disable:function(form){
form=$(form);
form.getElements().each(function(_1b7){
_1b7.blur();
_1b7.disabled="true";
});
return form;
},enable:function(form){
form=$(form);
form.getElements().each(function(_1b9){
_1b9.disabled="";
});
return form;
},findFirstElement:function(form){
return $(form).getElements().find(function(_1bb){
return _1bb.type!="hidden"&&!_1bb.disabled&&["input","select","textarea"].include(_1bb.tagName.toLowerCase());
});
},focusFirstElement:function(form){
form=$(form);
form.findFirstElement().activate();
return form;
}};
Object.extend(Form,Form.Methods);
Form.Element={focus:function(_1bd){
$(_1bd).focus();
return _1bd;
},select:function(_1be){
$(_1be).select();
return _1be;
}};
Form.Element.Methods={serialize:function(_1bf){
_1bf=$(_1bf);
if(_1bf.disabled){
return "";
}
var _1c0=_1bf.tagName.toLowerCase();
var _1c1=Form.Element.Serializers[_1c0](_1bf);
if(_1c1){
var key=encodeURIComponent(_1c1[0]);
if(key.length==0){
return;
}
if(_1c1[1].constructor!=Array){
_1c1[1]=[_1c1[1]];
}
return _1c1[1].map(function(_1c3){
return key+"="+encodeURIComponent(_1c3);
}).join("&");
}
},getValue:function(_1c4){
_1c4=$(_1c4);
var _1c5=_1c4.tagName.toLowerCase();
var _1c6=Form.Element.Serializers[_1c5](_1c4);
if(_1c6){
return _1c6[1];
}
},clear:function(_1c7){
$(_1c7).value="";
return _1c7;
},present:function(_1c8){
return $(_1c8).value!="";
},activate:function(_1c9){
_1c9=$(_1c9);
_1c9.focus();
if(_1c9.select&&(_1c9.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(_1c9.type))){
_1c9.select();
}
return _1c9;
},disable:function(_1ca){
_1ca=$(_1ca);
_1ca.disabled=true;
return _1ca;
},enable:function(_1cb){
_1cb=$(_1cb);
_1cb.blur();
_1cb.disabled=false;
return _1cb;
}};
Object.extend(Form.Element,Form.Element.Methods);
var Field=Form.Element;
Form.Element.Serializers={input:function(_1cc){
switch(_1cc.type.toLowerCase()){
case "checkbox":
case "radio":
return Form.Element.Serializers.inputSelector(_1cc);
default:
return Form.Element.Serializers.textarea(_1cc);
}
return false;
},inputSelector:function(_1cd){
if(_1cd.checked){
return [_1cd.name,_1cd.value];
}
},textarea:function(_1ce){
return [_1ce.name,_1ce.value];
},select:function(_1cf){
return Form.Element.Serializers[_1cf.type=="select-one"?"selectOne":"selectMany"](_1cf);
},selectOne:function(_1d0){
var _1d1="",opt,_1d3=_1d0.selectedIndex;
if(_1d3>=0){
opt=Element.extend(_1d0.options[_1d3]);
_1d1=opt.hasAttribute("value")?opt.value:opt.text;
}
return [_1d0.name,_1d1];
},selectMany:function(_1d4){
var _1d5=[];
for(var i=0,_1d7=_1d4.length;i<_1d7;i++){
var opt=Element.extend(_1d4.options[i]);
if(opt.selected){
_1d5.push(opt.hasAttribute("value")?opt.value:opt.text);
}
}
return [_1d4.name,_1d5];
}};
var $F=Form.Element.getValue;
Abstract.TimedObserver=function(){
};
Abstract.TimedObserver.prototype={initialize:function(_1d9,_1da,_1db){
this.frequency=_1da;
this.element=$(_1d9);
this.callback=_1db;
this.lastValue=this.getValue();
this.registerCallback();
},registerCallback:function(){
setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},onTimerEvent:function(){
var _1dc=this.getValue();
var _1dd=("string"==typeof this.lastValue&&"string"==typeof _1dc?this.lastValue!=_1dc:String(this.lastValue)!=String(_1dc));
if(_1dd){
this.callback(this.element,_1dc);
this.lastValue=_1dc;
}
}};
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(_1de,_1df){
this.element=$(_1de);
this.callback=_1df;
this.lastValue=this.getValue();
if(this.element.tagName.toLowerCase()=="form"){
this.registerFormCallbacks();
}else{
this.registerCallback(this.element);
}
},onElementEvent:function(){
var _1e0=this.getValue();
if(this.lastValue!=_1e0){
this.callback(this.element,_1e0);
this.lastValue=_1e0;
}
},registerFormCallbacks:function(){
Form.getElements(this.element).each(this.registerCallback.bind(this));
},registerCallback:function(_1e1){
if(_1e1.type){
switch(_1e1.type.toLowerCase()){
case "checkbox":
case "radio":
Event.observe(_1e1,"click",this.onElementEvent.bind(this));
break;
default:
Event.observe(_1e1,"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(_1e2){
return _1e2.target||_1e2.srcElement;
},isLeftClick:function(_1e3){
return (((_1e3.which)&&(_1e3.which==1))||((_1e3.button)&&(_1e3.button==1)));
},pointerX:function(_1e4){
return _1e4.pageX||(_1e4.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
},pointerY:function(_1e5){
return _1e5.pageY||(_1e5.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
},stop:function(_1e6){
if(_1e6.preventDefault){
_1e6.preventDefault();
_1e6.stopPropagation();
}else{
_1e6.returnValue=false;
_1e6.cancelBubble=true;
}
},findElement:function(_1e7,_1e8){
var _1e9=Event.element(_1e7);
while(_1e9.parentNode&&(!_1e9.tagName||(_1e9.tagName.toUpperCase()!=_1e8.toUpperCase()))){
_1e9=_1e9.parentNode;
}
return _1e9;
},observers:false,_observeAndCache:function(_1ea,name,_1ec,_1ed){
if(!this.observers){
this.observers=[];
}
if(_1ea.addEventListener){
this.observers.push([_1ea,name,_1ec,_1ed]);
_1ea.addEventListener(name,_1ec,_1ed);
}else{
if(_1ea.attachEvent){
this.observers.push([_1ea,name,_1ec,_1ed]);
_1ea.attachEvent("on"+name,_1ec);
}
}
},unloadCache:function(){
if(!Event.observers){
return;
}
for(var i=0,_1ef=Event.observers.length;i<_1ef;i++){
Event.stopObserving.apply(this,Event.observers[i]);
Event.observers[i][0]=null;
}
Event.observers=false;
},observe:function(_1f0,name,_1f2,_1f3){
_1f0=$(_1f0);
_1f3=_1f3||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_1f0.attachEvent)){
name="keydown";
}
Event._observeAndCache(_1f0,name,_1f2,_1f3);
},stopObserving:function(_1f4,name,_1f6,_1f7){
_1f4=$(_1f4);
_1f7=_1f7||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_1f4.detachEvent)){
name="keydown";
}
if(_1f4.removeEventListener){
_1f4.removeEventListener(name,_1f6,_1f7);
}else{
if(_1f4.detachEvent){
try{
_1f4.detachEvent("on"+name,_1f6);
}
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(_1f8){
var _1f9=0,_1fa=0;
do{
_1f9+=_1f8.scrollTop||0;
_1fa+=_1f8.scrollLeft||0;
_1f8=_1f8.parentNode;
}while(_1f8);
return [_1fa,_1f9];
},cumulativeOffset:function(_1fb){
var _1fc=0,_1fd=0;
do{
_1fc+=_1fb.offsetTop||0;
_1fd+=_1fb.offsetLeft||0;
_1fb=_1fb.offsetParent;
}while(_1fb);
return [_1fd,_1fc];
},positionedOffset:function(_1fe){
var _1ff=0,_200=0;
do{
_1ff+=_1fe.offsetTop||0;
_200+=_1fe.offsetLeft||0;
_1fe=_1fe.offsetParent;
if(_1fe){
if(_1fe.tagName=="BODY"){
break;
}
var p=Element.getStyle(_1fe,"position");
if(p=="relative"||p=="absolute"){
break;
}
}
}while(_1fe);
return [_200,_1ff];
},offsetParent:function(_202){
if(_202.offsetParent){
return _202.offsetParent;
}
if(_202==document.body){
return _202;
}
while((_202=_202.parentNode)&&_202!=document.body){
if(Element.getStyle(_202,"position")!="static"){
return _202;
}
}
return document.body;
},within:function(_203,x,y){
if(this.includeScrollOffsets){
return this.withinIncludingScrolloffsets(_203,x,y);
}
this.xcomp=x;
this.ycomp=y;
this.offset=this.cumulativeOffset(_203);
return (y>=this.offset[1]&&y<this.offset[1]+_203.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+_203.offsetWidth);
},withinIncludingScrolloffsets:function(_206,x,y){
var _209=this.realOffset(_206);
this.xcomp=x+_209[0]-this.deltaX;
this.ycomp=y+_209[1]-this.deltaY;
this.offset=this.cumulativeOffset(_206);
return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+_206.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+_206.offsetWidth);
},overlap:function(mode,_20b){
if(!mode){
return 0;
}
if(mode=="vertical"){
return ((this.offset[1]+_20b.offsetHeight)-this.ycomp)/_20b.offsetHeight;
}
if(mode=="horizontal"){
return ((this.offset[0]+_20b.offsetWidth)-this.xcomp)/_20b.offsetWidth;
}
},page:function(_20c){
var _20d=0,_20e=0;
var _20f=_20c;
do{
_20d+=_20f.offsetTop||0;
_20e+=_20f.offsetLeft||0;
if(_20f.offsetParent==document.body){
if(Element.getStyle(_20f,"position")=="absolute"){
break;
}
}
}while(_20f=_20f.offsetParent);
_20f=_20c;
do{
if(!window.opera||_20f.tagName=="BODY"){
_20d-=_20f.scrollTop||0;
_20e-=_20f.scrollLeft||0;
}
}while(_20f=_20f.parentNode);
return [_20e,_20d];
},clone:function(_210,_211){
var _212=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});
_210=$(_210);
var p=Position.page(_210);
_211=$(_211);
var _214=[0,0];
var _215=null;
if(Element.getStyle(_211,"position")=="absolute"){
_215=Position.offsetParent(_211);
_214=Position.page(_215);
}
if(_215==document.body){
_214[0]-=document.body.offsetLeft;
_214[1]-=document.body.offsetTop;
}
if(_212.setLeft){
_211.style.left=(p[0]-_214[0]+_212.offsetLeft)+"px";
}
if(_212.setTop){
_211.style.top=(p[1]-_214[1]+_212.offsetTop)+"px";
}
if(_212.setWidth){
_211.style.width=_210.offsetWidth+"px";
}
if(_212.setHeight){
_211.style.height=_210.offsetHeight+"px";
}
},absolutize:function(_216){
_216=$(_216);
if(_216.style.position=="absolute"){
return;
}
Position.prepare();
var _217=Position.positionedOffset(_216);
var top=_217[1];
var left=_217[0];
var _21a=_216.clientWidth;
var _21b=_216.clientHeight;
_216._originalLeft=left-parseFloat(_216.style.left||0);
_216._originalTop=top-parseFloat(_216.style.top||0);
_216._originalWidth=_216.style.width;
_216._originalHeight=_216.style.height;
_216.style.position="absolute";
_216.style.top=top+"px";
_216.style.left=left+"px";
_216.style.width=_21a+"px";
_216.style.height=_21b+"px";
},relativize:function(_21c){
_21c=$(_21c);
if(_21c.style.position=="relative"){
return;
}
Position.prepare();
_21c.style.position="relative";
var top=parseFloat(_21c.style.top||0)-(_21c._originalTop||0);
var left=parseFloat(_21c.style.left||0)-(_21c._originalLeft||0);
_21c.style.top=top+"px";
_21c.style.left=left+"px";
_21c.style.height=_21c._originalHeight;
_21c.style.width=_21c._originalWidth;
}};
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
Position.cumulativeOffset=function(_21f){
var _220=0,_221=0;
do{
_220+=_21f.offsetTop||0;
_221+=_21f.offsetLeft||0;
if(_21f.offsetParent==document.body){
if(Element.getStyle(_21f,"position")=="absolute"){
break;
}
}
_21f=_21f.offsetParent;
}while(_21f);
return [_221,_220];
};
}
Element.addMethods();

var css_browser_selector = function() {
var t=this,ua=navigator.userAgent.toLowerCase(),is=function(x){ return ua.indexOf(x) != -1; },h=document.getElementsByTagName('html')[0],
b=b = (ua.indexOf("opera/9")>-1)?'opera opera9':(ua.indexOf("opera 8")>-1)?'opera opera8':(ua.indexOf("opera 7")>-1)?'opera opera7':(ua.indexOf("msie 7")>-1)?'ie ie7':(ua.indexOf("msie 6")>-1)?'ie ie6':(ua.indexOf("msie 5.5")>-1)?'ie ie55':(ua.indexOf("msie 5.23")>-1)?'ie ie523':(ua.indexOf("msie 5.0")>-1)?'ie ie5':(ua.indexOf("safari")>-1)?'safari':(ua.indexOf("seamonkey")>-1)?'seamonkey gecko':(ua.indexOf("netscape")>-1)?'netscape gecko':(ua.indexOf("firefox")>-1)?'firefox gecko':(ua.indexOf("gecko")>-1)?'gecko':'',
os=(is('x11')||is('linux'))?' linux':is('mac')?' mac':is('win')?' win':'';var c=b+os+' js';h.className += h.className?' '+c:c;t.ver=navigator.appVersion;t.agent=navigator.userAgent;
t.mac=ua.indexOf("mac")>-1;t.pc=ua.indexOf("win")>-1;t.opera=ua.indexOf("opera")>-1;t.opera9=ua.indexOf("opera/9")>-1;
t.opera8=ua.indexOf("opera 8")>-1;t.opera7=ua.indexOf("opera 7")>-1;t.ie7=(ua.indexOf("msie 7")>-1 && !t.opera)?1:0;
t.ie6=(ua.indexOf("msie 6")>-1 && !t.opera)?1:0;t.ie55 =(ua.indexOf("msie 5.5")>-1 && !t.opera)?1:0;t.ie523 =(ua.indexOf("msie 5.23")>-1)?1:0;
t.ie5 =(ua.indexOf("msie 5.0")>-1 && !t.ie55 && !t.ie523)?1:0;t.ns71=(ua.indexOf("netscape/7.1")>-1)?1:0;t.safari=(ua.indexOf("safari")>-1)?1:0;
t.ie=(t.ie7 || t.ie55 || t.ie5 || t.ie6 || t.ie523);t.gecko=(ua.indexOf("gecko")>-1 &!t.ie)?1:0;t.ns=(t.ns71);
t.ajaxaware =(t.opera || t.ie7 || t.ie6 || t.safari ||t.gecko)?1:0
}();

if(typeof deconcept=="undefined"){
var deconcept=new Object();
}
if(typeof deconcept.util=="undefined"){
deconcept.util=new Object();
}
if(typeof deconcept.SWFObjectUtil=="undefined"){
deconcept.SWFObjectUtil=new Object();
}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
if(!document.getElementById){
return;
}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){
this.setAttribute("swf",_1);
}
if(id){
this.setAttribute("id",id);
}
if(w){
this.setAttribute("width",w);
}
if(h){
this.setAttribute("height",h);
}
if(_5){
this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));
}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(!window.opera&&document.all&&this.installedVer.major>7){
deconcept.SWFObject.doPrepUnload=true;
}
if(c){
this.addParam("bgcolor",c);
}
var q=_7?_7:"high";
this.addParam("quality",q);
if(_8+""!=""){
this.addParam("base",_8);
}
this.setAttribute("useExpressInstall",false);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){
this.setAttribute("redirectUrl",_a);
}
};
deconcept.SWFObject.prototype={useExpressInstall:function(_e){
this.xiSWFPath=!_e?"expressinstall.swf":_e;
this.setAttribute("useExpressInstall",true);
},setAttribute:function(_f,_10){
this.attributes[_f]=_10;
},getAttribute:function(_11){
return this.attributes[_11];
},addParam:function(_12,_13){
this.params[_12]=_13;
},getParams:function(){
return this.params;
},addVariable:function(_14,_15){
this.variables[_14]=_15;
},getVariable:function(_16){
return this.variables[_16];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _17=new Array();
var key;
var _19=this.getVariables();
for(key in _19){
_17[_17.length]=key+"="+_19[key];
}
return _17;
},getSWFHTML:function(){
var _1a="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");
this.setAttribute("swf",this.xiSWFPath);
}
_1a="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";
_1a+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1b=this.getParams();
for(var key in _1b){
_1a+=[key]+"=\""+_1b[key]+"\" ";
}
var _1d=this.getVariablePairs().join("&");
if(_1d.length>0){
_1a+="flashvars=\""+_1d+"\"";
}
_1a+="/>";
}else{
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","ActiveX");
this.setAttribute("swf",this.xiSWFPath);
}
_1a="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";
_1a+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1b=this.getParams();
for(var key in _1b){
_1a+="<param name=\""+key+"\" value=\""+_1b[key]+"\" />";
}
var _1d=this.getVariablePairs().join("&");
if(_1d.length>0){
_1a+="<param name=\"flashvars\" value=\""+_1d+"\" />";
}
_1a+="</object>";
}
return _1a;
},write:function(_1e){
if(this.getAttribute("useExpressInstall")){
var _1f=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_1f)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);
}
}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _1e=="string")?document.getElementById(_1e):_1e;
n.innerHTML=this.getSWFHTML();
return true;
}else{
if(this.getAttribute("redirectUrl")!=""){
document.location.replace(this.getAttribute("redirectUrl"));
}
}
return false;
}};
deconcept.SWFObjectUtil.getPlayerVersion=function(){
var _21=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){
_21=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));
}
}else{
if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){
var axo=1;
var _24=3;
while(axo){
try{
_24++;
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_24);
_21=new deconcept.PlayerVersion([_24,0,0]);
}
catch(e){
axo=null;
}
}
}else{
try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
}
catch(e){
try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_21=new deconcept.PlayerVersion([6,0,21]);
axo.AllowScriptAccess="always";
}
catch(e){
if(_21.major==6){
return _21;
}
}
try{
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
}
catch(e){
}
}
if(axo!=null){
_21=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
}
}
}
return _21;
};
deconcept.PlayerVersion=function(_25){
this.major=_25[0]!=null?parseInt(_25[0]):0;
this.minor=_25[1]!=null?parseInt(_25[1]):0;
this.rev=_25[2]!=null?parseInt(_25[2]):0;
};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){
return false;
}
if(this.major>fv.major){
return true;
}
if(this.minor<fv.minor){
return false;
}
if(this.minor>fv.minor){
return true;
}
if(this.rev<fv.rev){
return false;
}
return true;
};
deconcept.util={getRequestParameter:function(_27){
var q=document.location.search||document.location.hash;
if(_27==null){
return q;
}
if(q){
var _29=q.substring(1).split("&");
for(var i=0;i<_29.length;i++){
if(_29[i].substring(0,_29[i].indexOf("="))==_27){
return _29[i].substring((_29[i].indexOf("=")+1));
}
}
}
return "";
}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){
var _2b=document.getElementsByTagName("OBJECT");
for(var i=_2b.length-1;i>=0;i--){
_2b[i].style.display="none";
for(var x in _2b[i]){
if(typeof _2b[i][x]=="function"){
_2b[i][x]=function(){
};
}
}
}
};
if(deconcept.SWFObject.doPrepUnload){
if(!deconcept.unloadSet){
deconcept.SWFObjectUtil.prepUnload=function(){
__flash_unloadHandler=function(){
};
__flash_savedUnloadHandler=function(){
};
window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);
};
window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);
deconcept.unloadSet=true;
}
}
if(!document.getElementById&&document.all){
document.getElementById=function(id){
return document.all[id];
};
}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject;
var SWFObject=deconcept.SWFObject;

/* basic object browser */
var _ObjectBrowsers = Class.create();
_ObjectBrowsers.prototype = {
  initialize: function()
  {
    this.oba=new Array();
    this.obh=new Array();
  },
  
  add:function(ob)
  {
    this.oba.push(ob);
  },
  store:function(bname,ob)
  {
    var x=this.getBrowserPair(bname);
    if(x)x.ob=ob;else this.obh.push({bname:bname,ob:ob});
  },
  getBrowserPair:function(bname)
  {
    for (var i=0;i<this.obh.length;i++)
      if(this.obh[i].bname==bname)return this.obh[i];
    return null;  
  },
  getBrowser:function(bname)
  {
    for (var i=0;i<this.obh.length;i++)
      if (this.obh[i].bname==bname)return this.obh[i].ob;
    return null;  
  },
  stopAll:function(){this.oba.each(function(n){n.stop();});},
  
  moveLeft:function(bname){try{this.getBrowser(bname).moveLeft();}catch(e){}},
  moveRight:function(bname){try{this.getBrowser(bname).moveRight();}catch(e){}},
  moveTo:function(bname,i){try{this.getBrowser(bname).moveTo(i);}catch(e){}}
}
var ObjectBrowsers = new _ObjectBrowsers();
var BaseObjectBrowser = Class.create();
BaseObjectBrowser.prototype = {
  baseInit:function(leftArrowID,rightArrowID,bulletID){
    var t = this;
    t.firstInt = 10;
    t.othInt = 10;
    t.state = 0
    t.e = new Array();
    t.eC = 0;
    t.c = 0;
    t.arrowL=leftArrowID;
    t.arrowR=rightArrowID;
    t.bullet=bulletID;
    ObjectBrowsers.add(t);
  },
  onTimer:function(){
    var t=this;
    /*console.log(t.cID + "   " + t.pe.timer);*/
    t.moveNext();
    if(this.state==1)
    {
      t.pe.stop();
      t.state=2;
      t.pe = new PeriodicalExecuter(t.onTimer.bind(t),t.othInt);
      t.pe.ob=t;
    }  
  },
  start:function(){
    var t=this;
    t.pe=new PeriodicalExecuter(t.onTimer.bind(t),t.firstInt);
    t.pe.ob=t;
    t.state=1
    var s=0;
    if(arguments&&arguments.length>0) s=arguments[0];
    if(s==-1)s=Math.ceil(Math.random()*(t.eC-1));
    t.c=s;
    t.moveElement();
  },
  stop:function(){this.pe.stop();},
  moveRight:function(i){
    var t=this;
    t.pe.stop();   
    t.c++;
    if (t.c>=t.eC)t.c=0;
    t.moveElement();
  },
  
  moveLeft:function(idx){
    var t=this;
    t.pe.stop();   
    t.c--;
    if(t.c<0)t.c=t.eC-1;
    t.moveElement();
  },
  
  moveTo:function(i){
    var t=this;
    t.pe.stop();   
    t.c=i;
    t.moveElement();
  },
  
  moveNext:function(){
    var t=this;
    t.c++;
    if(t.c>=t.eC)t.c=0;
    t.moveElement();
  },
  
  refreshControls:function(){
    var t=this;
/*  if (t.c==0)
      $(t.arrowL).className='naLE';
    else 
      $(t.arrowL).className='naLF';
      
    if (t.c==(t.eC-1))
      $(t.arrowR).className='naRE';
    else
      $(t.arrowR).className='naRF';*/
    for (var l=0;l<t.eC;l++) $(t.bullet+l).className='';
    $(t.bullet+t.c).className='nbSel';
  }
};
/* photo browser used inside the article */
ArticlePhotoBrowser = Class.create();
Object.extend(Object.extend(ArticlePhotoBrowser.prototype,BaseObjectBrowser.prototype),{
  initialize: function(iID,cID,lAID,rAID,bID) {
    var t=this;
    t.baseInit(lAID,rAID,bID);
    t.img=iID;
    t.credit=cID;
  },
  addElement: function (src,h,w,alt,c) {
    this.eC=this.e.push({src:src,h:h,w:w,alt:alt,c:c});
  },
  moveElement:function () {
    var t=this;
    var el=t.e[t.c];
    $(t.img).src=unescape(el.src);
    $(t.img).height=el.h;
    $(t.img).width=el.w;
    $(t.img).alt=el.t;
    $(t.credit).update(el.c);
    t.refreshControls();
  }
});
NewsBrowser=Class.create();
Object.extend(Object.extend(NewsBrowser.prototype,BaseObjectBrowser.prototype),{
  initialize:function(pS,nC,cID,lID,rID,bID){
    var t=this;
    t.baseInit(lID,rID,bID);
    t.cID=cID;
    t.pS=pS;
    t.eC=(((nC%t.pS)==1?nC-1:nC)/t.pS)+((nC%t.pS)==1?1:0);
  },
  addElement:function(){},
  moveElement:function(){
    var t=this;
    var xhtml='';
    var i,b=t.c*t.pS;
    for(i=0;i<t.pS;i++){
      try {xhtml+="<li>"+$('newsRollerE'+(i+b)).innerHTML+"</li>";}catch(e){}}
    $(t.cID).update(xhtml);
    t.refreshControls();
  }
});
PhotoBrowser=Class.create();
Object.extend(Object.extend(PhotoBrowser.prototype,BaseObjectBrowser.prototype),{
  initialize:function(pS,nC,cID,lID,rID,bID){
    var t=this;
    t.baseInit(lID,rID,bID);
    t.cID=cID;
    t.pS=pS;
    t.eC=(((nC%t.pS)==1?nC-1:nC)/t.pS)+((nC%t.pS)==1?1:0);
  },
  addElement:function(){},
  moveElement:function(){
    var t=this;
    var xhtml='';
    var i,b=t.c*t.pS;
    for(i=0;i<t.pS;i++){
      try {xhtml+="<li>"+$('photoRollerE'+(i+b)).innerHTML+"</li>";}catch(e){}}
    $(t.cID).update(xhtml);
    t.refreshControls();
  }
});
/* news navigation */
function pageNavigate(st,ps)
{
  var bU=document.location.pathname;
	var page=parseInt(ps,10)-1;var pN=",page=";var b=bU.indexOf(pN);var nI,oI,nL;
	if(b>0){oI=parseInt(bU.substring(b+pN.length,bU.lastIndexOf('.')),10);}
	else{oI=1;b=bU.indexOf('.htm')}
	nI=oI+parseInt(st,10);if(nI<=0)nI=1;nL=bU.substring(0,b);
	if (nI>1)nL+=pN+nI+'.htmx';else nL+='.html';window.location.href=nL;
}

var HashListener = Class.create();
HashListener.prototype={
  getHash:function(){
    try{return location.hash.substring(1)}catch (e){return '';}
  },
  initialize:function(){
    var t=this;
    t.l=new Array();
    t.cE=false;
    t.h=t.getHash();
    t.tm = setInterval(t.onTimer.bind(t), 200);
  },
  
  addListner:function(lf){
    this.l.push(lf);
  },
  onTimer:function(){
    var t=this;if(!t.cE){try {if (t.h!=t.getHash()&&t.getHash()!=''){t.h=t.getHash();t.cE = true;t.l.each(function(n){ n(t.h);});}} finally {t.cE = false;}}
  }
}
var HashUpdater=Class.create();
HashUpdater.prototype={
  initialize:function(tID,buildPathFunc,beforeChangeFunc,opt,afterChangeFunc){
    var t=this;
    t.tID=tID;
    t.bPF=buildPathFunc;
    t.bCF=beforeChangeFunc;
    t.aCF=afterChangeFunc;
    t.opt=opt; 
    t.hel=new Array();
  },
  addHash:function(h){this.hel.push(h);},
  onHash: function(h) {
    var t=this;
    t.h = h;
    try{t.bCF(t);}catch(e){};
    var u=t.bPF(h,t);
    if (u==null||u==undefined||u.length==0) return;
    new Ajax.Updater({success:t.tID},u,{method:'get',evalScripts:true,onComplete: t.onComplete.bind(t)});
  },
  onComplete: function() {
    try{this.aCF(this);}
    catch (e) {}
  },
  checkHash: function (h) {
    for (var i=0;i<this.hel.length;i++)
      if (this.hel[i]==h)return true;
    return false;  
  },
  
  start: function(sH) {
    var t=this;
    t.hl=new HashListener();
    t.hl.addListner(t.onHash.bind(t));
    var h=t.hl.getHash();
    if ((h===undefined||h==null||h=='') && t.hel.length>1)
    {
      if (sH!=null&&sH!=undefined&&sH.length>0)
        h=sH;
      else
      {  
        var i=Math.ceil(((Math.random()+0.1)*t.hel.length)-1);
        if(i<0||i>=t.hel.length) i=0;
        h =t.hel[i];
      }
    }else if ((h===undefined||h==null||h=='') && t.hel.length==1)
    {
      h=t.hel[0]; 
    }
    try{t.bCF(t);}catch(e){};
    t.onHash(h);
  }
}
var HashUpdaterPhoto=Class.create();
HashUpdaterPhoto.prototype={
 initialize:function(tID,buildPathFunc,beforeChangeFunc,opt,afterChangeFunc){
 var t=this;
 t.tID=tID;
 t.bPF=buildPathFunc;
 t.bCF=beforeChangeFunc;
 t.aCF=afterChangeFunc;
 t.opt=opt;
 t.hel=new Array();
 },
 addHash:function(h){this.hel.push(h);},
 onHash: function(h) {
 var t=this;
 t.h = h;
 try{t.bCF(t);}catch(e){};
 var u=t.bPF(h,t);
 if (u==null||u==undefined||u.length==0) return;
 new Ajax.Updater({success:t.tID},u,{method:'get',evalScripts:true,onComplete: t.onComplete.bind(t)});
 },
 onComplete: function() {
 try{this.aCF(this);}
 catch (e) {}
 },
 checkHash: function (h) {
 for (var i=0;i<this.hel.length;i++)
 if (this.hel[i]==h)return true;
 return false;
 },
 start: function(sH) {
 var t=this;
 t.hl=new HashListener();
 t.hl.addListner(t.onHash.bind(t));
 var h=t.hl.getHash();
 if ((!h||h=='') && t.hel.length>1)
 {
 if (sH!=null&&sH!=undefined&&sH.length>0)
 h=sH;
 else
 {
 var i=Math.ceil(((Math.random()+0.1)*t.hel.length)-1);
 if(i<0||i>t.hel.length) i=0;
 h =t.hel[i];
 }
 }else if ((!h||h=='') && t.hel.length==1)
 {
 h=t.hel[0];
 }
 try{t.bCF(t);}catch(e){};
 t.onHash(h);
 //alert('hash3:'+h);
 }
}

var Cookie={
  setRaw:function(n,v,daysToExp,pg){
    var ex='';
    if (daysToExp!=undefined){
      var d=new Date();
      d.setTime(d.getTime()+(86400000*parseFloat(daysToExp)));
      ex='; expires='+d.toGMTString();
    }
    if (pg!=undefined){if(pg!='.')ex+='; path='+pg;}
    else {ex+='; path=/';}
    return(document.cookie=escape(n)+'='+(v||'')+ex);
  },
  set:function(n,v,daysToExp,pg){
    return this.setRaw(n,escape(v||''),daysToExp,pg);
  },
  get:function(n){
    var c=document.cookie.match(new RegExp('(^|;)\\s*'+escape(n)+'=([^;\\s]*)'));
    return(c?unescape(c[2]):null);
  },
  erase:function(n,pg){
    var c=Cookie.get(n)||true;
    Cookie.set(n,'',-1,pg);
    return c;
  },
  accept:function(){
    if (typeof(navigator.cookieEnabled)=='boolean'){return navigator.cookieEnabled;}
    Cookie.set('_t','1');return(Cookie.erase('_t')==='1');
  }
};

var User = Class.create();
User.prototype = {
  initialize: function (p)
  {},
  IfExists:function()
  {
    var c=Cookie.get('RugbyUser');
    if(c==null || c==undefined) return false;
    return true;    
  },
  SetUserInfo:function(c_uid, c_em)
  {
    var c = Cookie.get('RWCMediaZone');
    if (!c) return false;
    $(c_uid).update(c.toQueryParams().un);
    $(c_em).update(c.toQueryParams().em);
  },
  
  GetUserInfo:function(c_pa)
  {
    var c=Cookie.get('RugbyUser');
    if(c==null || c==undefined) return null;
    return eval('c.toQueryParams().'+ c_pa);    
  },
  
  CheckUserLoginMZ:function(c_pa)
  {
    //alert(document.location.href +" --i:"+document.location.href.indexOf('login.htm'));
    if (document.location.href.indexOf('login.htm') == -1 )
    {
      var p=this.GetUserInfo(c_pa);
      if (p==null||p==undefined||p.toLowerCase()!='true')
      {
        var t=document.location.href.indexOf('/mediazone');
        //alert("u:"+document.location.href+"-- t:"+t+" -- tu:"+document.location.href.substring(t,document.location.href.length));
        document.location.href="/mediazone/login.htmx"+"?target="+document.location.href.substring(t,document.location.href.length);
      }
    }
  }
}

var DBClickOrd = Math.random()*10000000000000000;
var DBClickTile = 0;

function getUrlParams() {var s = document.location.href; if(s.indexOf('?')!=-1) return s.substring(s.indexOf('?')+1);return '';}
function fnClearInput(inp,ot){if(inp.value.toLowerCase() == ot.toLowerCase()) inp.value='';}
function wlc(){}
function wlo(){}
/* ma popup*/
function wmac(){
$('wMA').hide();
}
function wmao(){
  if($('wMA').empty())
    var pA = new Ajax.Request("/countries.html",{method:'get',onComplete:wmaoc});
  else 
    $('wMA').show();
}
function wmaoc(originalResponse){
$('wMA').update(originalResponse.responseText);
$('wMA').show();
}
function writeDate(lang, div)
{				
	var curdate = new Date();
	var weekDays;
	var monthName;
	if(lang == 'E') {
		weekDays = new Array('SUN','MON','TUE','WED','THU','FRI','SAT');
		monthName= new Array( 'JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC');
	}
	if(lang == 'F') {
		weekDays = new Array('DIM','LUN','MAR','MER','JEU','VEN','SAM');
		monthName= new Array( 'JAN','FEV','MARS','AVR','MAI','JUIN','JUIL','AOUT','SEPT','OCT','NOV','DEC');
	}
	if(lang == 'S') {
		weekDays = new Array('DOM','LUN','MAR','MIE','JUE','VIE','SAB');
		monthName= new Array( 'ENE','FEB','MAR','ABR','MAYO','JUN','JUL','AGO','SEPT','OCT','NOV','DIC');
	}
	if(navigator.appName == 'Microsoft Internet Explorer')
	year = curdate.getYear();
	else
	year = curdate.getYear()+1900;
	var so = weekDays[curdate.getDay()] + ", " + curdate.getDate()+" "+monthName[curdate.getMonth()]+" "+year;
	
	$(div).innerHTML = so;
}			
function calGetPrevLink(y,m,d)
{
  if (d > 1){d--;return "#year="+y+"/month="+m+"/day="+d;}
  else
  {
    if (m==5 || m==7 || m==8 || m==10 || m==12){m--;return "#year="+y+"/month="+m+"/day=30";}
    else if (m==2 || m==4 || m==6 || m==9 || m==11){m--;return "#year="+y+"/month="+m+"/day=31";}
    else if (m==3)
    {m--;
      if ((y % 4 == 0 && y % 100 != 0 )|| y % 400 == 0){return "#year="+y+"/month="+m+"/day=29";}
     else {return "#year="+y+"/month="+m+"/day=28";}
    }
    else if (m==1){y--;return "#year="+y+"/month=12/day=31";} 
  }
}
function calGetNextLink(y,m,d)
{
  if ((d==31 && (m==1 || m==3 || m==5 || m==7 || m==8 || m==10))||(d==30 && (m==4 || m==6 || m==9 || m==11))||((d==28 || d==29)&& m==2))
  {m++;return "#year="+y+"/month="+m+"/day=1";} 
  else if (d==31 && m==12){y++;return "#year="+y+"/month=1/day=1";}
  else{d++;return "#year="+y+"/month="+m+"/day="+d;}  
}
function updateHead2Head()
{
    var url1 = '/statistics/season=2007/_listTeamsH2H_1.html';
    var url2 = '/statistics/season=2007/_listTeamsH2H_2.html';
    new Ajax.Updater({success:'divTeam1'},url1,{method:'get',evalScripts:true,asynchronous:true});		  
    new Ajax.Updater({success:'divTeam2'},url2,{method:'get',evalScripts:true,asynchronous:true});		  	
}
function doHead2Head() {
    var path= '/statistics/head2head';
    var ddTeam1Value = $F('team1');
    var ddTeam2Value = $F('team2');
    path += '/teamA=' + ddTeam1Value + '/teamB=' + ddTeam2Value + '/index.html';
    if(ddTeam1Value == ddTeam2Value) alert('Please select two different teams'); else if((ddTeam1Value != -1) && (ddTeam2Value!= -1)) location.href=path;
    else alert('Select the two teams')
} 
function updateTPlayer(){ 
    var url1 = '/statistics/season=2007/_listTeamsForPlayer.html';
    var url2 = '/statistics/season=2007/type=Team/team=0/_listPlayers.html';
    new Ajax.Updater({success:'divTeamP1'},url1,{method:'get',evalScripts:true,asynchronous:true}); 
    new Ajax.Updater({success:'divTeamP2'},url2,{method:'get',evalScripts:true,asynchronous:true}); }
function selectPlayer() { var path= '/statistics/season=2007/type=Team/team=';
      
    var ddTeam1Value = $F('teamDropDown'); 
    var url2= '/statistics/season=2007/type=Team/team='+ddTeam1Value+'/_listPlayers.html'; 
	  new Ajax.Updater({success:'divTeamP2'},url2,{method:'get',evalScripts:true,asynchronous:true}); 
}
function doTPlayer() { var path= '/statistics/player=';
			
		var ddPlayerValue = $F('playerDropDown'); 
		var path = '/statistics/player='+ddPlayerValue+'/index.html'; 
		location.href=path;
} 


