(function(){
var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\"":"\\\"","\\":"\\\\"},s={array:function(x){
var a=["["],b,f,i,l=x.length,v;
for(i=0;i<l;i+=1){
v=x[i];
f=s[typeof v];
if(f){
v=f(v);
if(typeof v=="string"){
if(b){
a[a.length]=",";
}
a[a.length]=v;
b=true;
}
}
}
a[a.length]="]";
return a.join("");
},"boolean":function(x){
return String(x);
},"null":function(x){
return "null";
},number:function(x){
return isFinite(x)?String(x):"null";
},object:function(x){
if(x){
if(x instanceof Array){
return s.array(x);
}
var a=["{"],b,f,i,v;
for(i in x){
v=x[i];
f=s[typeof v];
if(f){
v=f(v);
if(typeof v=="string"){
if(b){
a[a.length]=",";
}
a.push(s.string(i),":",v);
b=true;
}
}
}
a[a.length]="}";
return a.join("");
}
return "null";
},string:function(x){
if(/["\\\x00-\x1f]/.test(x)){
x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){
var c=m[b];
if(c){
return c;
}
c=b.charCodeAt();
return "\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16);
});
}
return "\""+x+"\"";
}};
Object.prototype.toJSONString=function(){
return s.object(this);
};
Array.prototype.toJSONString=function(){
return s.array(this);
};
})();
String.prototype.parseJSON=function(){
try{
return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(this.replace(/"(\\.|[^"\\])*"/g,"")))&&eval("("+this+")");
}
catch(e){
return false;
}
};
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(_18,_19){
for(var _1a in _19){
_18[_1a]=_19[_1a];
}
return _18;
};
Object.extend(Object,{inspect:function(_1b){
try{
if(_1b==undefined){
return "undefined";
}
if(_1b==null){
return "null";
}
return _1b.inspect?_1b.inspect():_1b.toString();
}
catch(e){
if(e instanceof RangeError){
return "...";
}
throw e;
}
},keys:function(_1c){
var _1d=[];
for(var _1e in _1c){
_1d.push(_1e);
}
return _1d;
},values:function(_1f){
var _20=[];
for(var _21 in _1f){
_20.push(_1f[_21]);
}
return _20;
},clone:function(_22){
return Object.extend({},_22);
}});
Function.prototype.bind=function(){
var _23=this,_24=$A(arguments),_25=_24.shift();
return function(){
return _23.apply(_25,_24.concat($A(arguments)));
};
};
Function.prototype.bindAsEventListener=function(_26){
var _27=this,_28=$A(arguments),_26=_28.shift();
return function(_29){
return _27.apply(_26,[(_29||window.event)].concat(_28).concat($A(arguments)));
};
};
Object.extend(Number.prototype,{toColorPart:function(){
var _2a=this.toString(16);
if(this<16){
return "0"+_2a;
}
return _2a;
},succ:function(){
return this+1;
},times:function(_2b){
$R(0,this,true).each(_2b);
return this;
}});
var Try={these:function(){
var _2c;
for(var i=0;i<arguments.length;i++){
var _2e=arguments[i];
try{
_2c=_2e();
break;
}
catch(e){
}
}
return _2c;
}};
var PeriodicalExecuter=Class.create();
PeriodicalExecuter.prototype={initialize:function(_2f,_30){
this.callback=_2f;
this.frequency=_30;
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(_31,_32){
var _33="",_34=this,_35;
_32=arguments.callee.prepareReplacement(_32);
while(_34.length>0){
if(_35=_34.match(_31)){
_33+=_34.slice(0,_35.index);
_33+=(_32(_35)||"").toString();
_34=_34.slice(_35.index+_35[0].length);
}else{
_33+=_34,_34="";
}
}
return _33;
},sub:function(_36,_37,_38){
_37=this.gsub.prepareReplacement(_37);
_38=_38===undefined?1:_38;
return this.gsub(_36,function(_39){
if(--_38<0){
return _39[0];
}
return _37(_39);
});
},scan:function(_3a,_3b){
this.gsub(_3a,_3b);
return this;
},truncate:function(_3c,_3d){
_3c=_3c||30;
_3d=_3d===undefined?"...":_3d;
return this.length>_3c?this.slice(0,_3c-_3d.length)+_3d: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 _3e=new RegExp(Prototype.ScriptFragment,"img");
var _3f=new RegExp(Prototype.ScriptFragment,"im");
return (this.match(_3e)||[]).map(function(_40){
return (_40.match(_3f)||["",""])[1];
});
},evalScripts:function(){
return this.extractScripts().map(function(_41){
return eval(_41);
});
},escapeHTML:function(){
var div=document.createElement("div");
var _43=document.createTextNode(this);
div.appendChild(_43);
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 _45=this.match(/^\??(.*)$/)[1].split("&");
return _45.inject({},function(_46,_47){
var _48=_47.split("=");
var _49=_48[1]?decodeURIComponent(_48[1]):undefined;
_46[decodeURIComponent(_48[0])]=_49;
return _46;
});
},toArray:function(){
return this.split("");
},camelize:function(){
var _4a=this.split("-");
if(_4a.length==1){
return _4a[0];
}
var _4b=this.indexOf("-")==0?_4a[0].charAt(0).toUpperCase()+_4a[0].substring(1):_4a[0];
for(var i=1,len=_4a.length;i<len;i++){
var s=_4a[i];
_4b+=s.charAt(0).toUpperCase()+s.substring(1);
}
return _4b;
},inspect:function(_4f){
var _50=this.replace(/\\/g,"\\\\");
if(_4f){
return "\""+_50.replace(/"/g,"\\\"")+"\"";
}else{
return "'"+_50.replace(/'/g,"\\'")+"'";
}
}});
String.prototype.gsub.prepareReplacement=function(_51){
if(typeof _51=="function"){
return _51;
}
var _52=new Template(_51);
return function(_53){
return _52.evaluate(_53);
};
};
String.prototype.parseQuery=String.prototype.toQueryParams;
var Template=Class.create();
Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;
Template.prototype={initialize:function(_54,_55){
this.template=_54.toString();
this.pattern=_55||Template.Pattern;
},evaluate:function(_56){
return this.template.gsub(this.pattern,function(_57){
var _58=_57[1];
if(_58=="\\"){
return _57[2];
}
return _58+(_56[_57[3]]||"").toString();
});
}};
var $break=new Object();
var $continue=new Object();
var Enumerable={each:function(_59){
var _5a=0;
try{
this._each(function(_5b){
try{
_59(_5b,_5a++);
}
catch(e){
if(e!=$continue){
throw e;
}
}
});
}
catch(e){
if(e!=$break){
throw e;
}
}
},all:function(_5c){
var _5d=true;
this.each(function(_5e,_5f){
_5d=_5d&&!!(_5c||Prototype.K)(_5e,_5f);
if(!_5d){
throw $break;
}
});
return _5d;
},any:function(_60){
var _61=false;
this.each(function(_62,_63){
if(_61=!!(_60||Prototype.K)(_62,_63)){
throw $break;
}
});
return _61;
},collect:function(_64){
var _65=[];
this.each(function(_66,_67){
_65.push(_64(_66,_67));
});
return _65;
},detect:function(_68){
var _69;
this.each(function(_6a,_6b){
if(_68(_6a,_6b)){
_69=_6a;
throw $break;
}
});
return _69;
},findAll:function(_6c){
var _6d=[];
this.each(function(_6e,_6f){
if(_6c(_6e,_6f)){
_6d.push(_6e);
}
});
return _6d;
},grep:function(_70,_71){
var _72=[];
this.each(function(_73,_74){
var _75=_73.toString();
if(_75.match(_70)){
_72.push((_71||Prototype.K)(_73,_74));
}
});
return _72;
},include:function(_76){
var _77=false;
this.each(function(_78){
if(_78==_76){
_77=true;
throw $break;
}
});
return _77;
},inject:function(_79,_7a){
this.each(function(_7b,_7c){
_79=_7a(_79,_7b,_7c);
});
return _79;
},invoke:function(_7d){
var _7e=$A(arguments).slice(1);
return this.collect(function(_7f){
return _7f[_7d].apply(_7f,_7e);
});
},max:function(_80){
var _81;
this.each(function(_82,_83){
_82=(_80||Prototype.K)(_82,_83);
if(_81==undefined||_82>=_81){
_81=_82;
}
});
return _81;
},min:function(_84){
var _85;
this.each(function(_86,_87){
_86=(_84||Prototype.K)(_86,_87);
if(_85==undefined||_86<_85){
_85=_86;
}
});
return _85;
},partition:function(_88){
var _89=[],_8a=[];
this.each(function(_8b,_8c){
((_88||Prototype.K)(_8b,_8c)?_89:_8a).push(_8b);
});
return [_89,_8a];
},pluck:function(_8d){
var _8e=[];
this.each(function(_8f,_90){
_8e.push(_8f[_8d]);
});
return _8e;
},reject:function(_91){
var _92=[];
this.each(function(_93,_94){
if(!_91(_93,_94)){
_92.push(_93);
}
});
return _92;
},sortBy:function(_95){
return this.collect(function(_96,_97){
return {value:_96,criteria:_95(_96,_97)};
}).sort(function(_98,_99){
var a=_98.criteria,b=_99.criteria;
return a<b?-1:a>b?1:0;
}).pluck("value");
},toArray:function(){
return this.collect(Prototype.K);
},zip:function(){
var _9c=Prototype.K,_9d=$A(arguments);
if(typeof _9d.last()=="function"){
_9c=_9d.pop();
}
var _9e=[this].concat(_9d).map($A);
return this.map(function(_9f,_a0){
return _9c(_9e.pluck(_a0));
});
},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(_a1){
if(!_a1){
return [];
}
if(_a1.toArray){
return _a1.toArray();
}else{
var _a2=[];
for(var i=0;i<_a1.length;i++){
_a2.push(_a1[i]);
}
return _a2;
}
};
Object.extend(Array.prototype,Enumerable);
if(!Array.prototype._reverse){
Array.prototype._reverse=Array.prototype.reverse;
}
Object.extend(Array.prototype,{_each:function(_a4){
for(var i=0;i<this.length;i++){
_a4(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(_a6){
return _a6!=undefined||_a6!=null;
});
},flatten:function(){
return this.inject([],function(_a7,_a8){
return _a7.concat(_a8&&_a8.constructor==Array?_a8.flatten():[_a8]);
});
},without:function(){
var _a9=$A(arguments);
return this.select(function(_aa){
return !_a9.include(_aa);
});
},indexOf:function(_ab){
for(var i=0;i<this.length;i++){
if(this[i]==_ab){
return i;
}
}
return -1;
},reverse:function(_ad){
return (_ad!==false?this:this.toArray())._reverse();
},reduce:function(){
return this.length>1?this:this[0];
},uniq:function(){
return this.inject([],function(_ae,_af){
return _ae.include(_af)?_ae:_ae.concat([_af]);
});
},inspect:function(){
return "["+this.map(Object.inspect).join(", ")+"]";
}});
var Hash={_each:function(_b0){
for(var key in this){
var _b2=this[key];
if(typeof _b2=="function"){
continue;
}
var _b3=[key,_b2];
_b3.key=key;
_b3.value=_b2;
_b0(_b3);
}
},keys:function(){
return this.pluck("key");
},values:function(){
return this.pluck("value");
},merge:function(_b4){
return $H(_b4).inject($H(this),function(_b5,_b6){
_b5[_b6.key]=_b6.value;
return _b5;
});
},toQueryString:function(){
return this.map(function(_b7){
return _b7.map(encodeURIComponent).join("=");
}).join("&");
},inspect:function(){
return "#<Hash:{"+this.map(function(_b8){
return _b8.map(Object.inspect).join(": ");
}).join(", ")+"}>";
}};
function $H(_b9){
var _ba=Object.extend({},_b9||{});
Object.extend(_ba,Enumerable);
Object.extend(_ba,Hash);
return _ba;
}
ObjectRange=Class.create();
Object.extend(ObjectRange.prototype,Enumerable);
Object.extend(ObjectRange.prototype,{initialize:function(_bb,end,_bd){
this.start=_bb;
this.end=end;
this.exclusive=_bd;
},_each:function(_be){
var _bf=this.start;
while(this.include(_bf)){
_be(_bf);
_bf=_bf.succ();
}
},include:function(_c0){
if(_c0<this.start){
return false;
}
if(this.exclusive){
return _c0<this.end;
}
return _c0<=this.end;
}});
var $R=function(_c1,end,_c3){
return new ObjectRange(_c1,end,_c3);
};
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(_c4){
this.responders._each(_c4);
},register:function(_c5){
if(!this.include(_c5)){
this.responders.push(_c5);
}
},unregister:function(_c6){
this.responders=this.responders.without(_c6);
},dispatch:function(_c7,_c8,_c9,_ca){
this.each(function(_cb){
if(_cb[_c7]&&typeof _cb[_c7]=="function"){
try{
_cb[_c7].apply(_cb,[_c8,_c9,_ca]);
}
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(_cc){
this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",parameters:""};
Object.extend(this.options,_cc||{});
},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,_ce){
this.transport=Ajax.getTransport();
this.setOptions(_ce);
this.request(url);
},request:function(url){
var _d0=this.options.parameters||"";
if(_d0.length>0){
_d0+="&_=";
}
if(this.options.method!="get"&&this.options.method!="post"){
_d0+=(_d0.length>0?"&":"")+"_method="+this.options.method;
this.options.method="post";
}
try{
this.url=url;
if(this.options.method=="get"&&_d0.length>0){
this.url+=(this.url.match(/\?/)?"&":"?")+_d0;
}
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 _d1=this.options.postBody?this.options.postBody:_d0;
this.transport.send(this.options.method=="post"?_d1:null);
if(!this.options.asynchronous&&this.transport.overrideMimeType){
this.onStateChange();
}
}
catch(e){
this.dispatchException(e);
}
},setRequestHeaders:function(){
var _d2=["X-Requested-With","XMLHttpRequest","X-Prototype-Version",Prototype.Version,"Accept","text/javascript, text/html, application/xml, text/xml, */*"];
if(this.options.method=="post"){
_d2.push("Content-type",this.options.contentType);
if(this.transport.overrideMimeType){
_d2.push("Connection","close");
}
}
if(this.options.requestHeaders){
_d2.push.apply(_d2,this.options.requestHeaders);
}
for(var i=0;i<_d2.length;i+=2){
this.transport.setRequestHeader(_d2[i],_d2[i+1]);
}
},onStateChange:function(){
var _d4=this.transport.readyState;
if(_d4!=1){
this.respondToReadyState(this.transport.readyState);
}
},header:function(_d5){
try{
return this.transport.getResponseHeader(_d5);
}
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(_d6){
var _d7=Ajax.Request.Events[_d6];
var _d8=this.transport,_d9=this.evalJSON();
if(_d7=="Complete"){
try{
(this.options["on"+this.transport.status]||this.options["on"+(this.responseIsSuccess()?"Success":"Failure")]||Prototype.emptyFunction)(_d8,_d9);
}
catch(e){
this.dispatchException(e);
}
if((this.header("Content-type")||"").match(/^text\/javascript/i)){
this.evalResponse();
}
}
try{
(this.options["on"+_d7]||Prototype.emptyFunction)(_d8,_d9);
Ajax.Responders.dispatch("on"+_d7,this,_d8,_d9);
}
catch(e){
this.dispatchException(e);
}
if(_d7=="Complete"){
this.transport.onreadystatechange=Prototype.emptyFunction;
}
},dispatchException:function(_da){
(this.options.onException||Prototype.emptyFunction)(this,_da);
Ajax.Responders.dispatch("onException",this,_da);
}});
Ajax.Updater=Class.create();
Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(_db,url,_dd){
this.containers={success:_db.success?$(_db.success):$(_db),failure:_db.failure?$(_db.failure):(_db.success?null:$(_db))};
this.transport=Ajax.getTransport();
this.setOptions(_dd);
var _de=this.options.onComplete||Prototype.emptyFunction;
this.options.onComplete=(function(_df,_e0){
this.updateContent();
_de(_df,_e0);
}).bind(this);
this.request(url);
},updateContent:function(){
var _e1=this.responseIsSuccess()?this.containers.success:this.containers.failure;
var _e2=this.transport.responseText;
if(!this.options.evalScripts){
_e2=_e2.stripScripts();
}
if(_e1){
if(this.options.insertion){
new this.options.insertion(_e1,_e2);
}else{
Element.update(_e1,_e2);
}
}
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(_e3,url,_e5){
this.setOptions(_e5);
this.onComplete=this.options.onComplete;
this.frequency=(this.options.frequency||2);
this.decay=(this.options.decay||1);
this.updater={};
this.container=_e3;
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(_e6){
if(this.options.decay){
this.decay=(_e6.responseText==this.lastText?this.decay*this.options.decay:1);
this.lastText=_e6.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 _e7=[],_e8;
for(var i=0;i<arguments.length;i++){
_e8=arguments[i];
if(typeof _e8=="string"){
_e8=document.getElementById(_e8);
}
_e7.push(Element.extend(_e8));
}
return _e7.reduce();
}
document.getElementsByClassName=function(_ea,_eb){
var _ec=($(_eb)||document.body).getElementsByTagName("*");
return $A(_ec).inject([],function(_ed,_ee){
if(_ee.className.match(new RegExp("(^|\\s)"+_ea+"(\\s|$)"))){
_ed.push(Element.extend(_ee));
}
return _ed;
});
};
if(!window.Element){
var Element=new Object();
}
Element.extend=function(_ef){
if(!_ef){
return;
}
if(_nativeExtensions||_ef.nodeType==3){
return _ef;
}
if(!_ef._extended&&_ef.tagName&&_ef!=window){
var _f0=Object.clone(Element.Methods),_f1=Element.extend.cache;
if(_ef.tagName=="FORM"){
Object.extend(_f0,Form.Methods);
}
if(["INPUT","TEXTAREA","SELECT"].include(_ef.tagName)){
Object.extend(_f0,Form.Element.Methods);
}
for(var _f2 in _f0){
var _f3=_f0[_f2];
if(typeof _f3=="function"){
_ef[_f2]=_f1.findOrStore(_f3);
}
}
}
_ef._extended=true;
return _ef;
};
Element.extend.cache={findOrStore:function(_f4){
return this[_f4]=this[_f4]||function(){
return _f4.apply(null,[this].concat($A(arguments)));
};
}};
Element.Methods={visible:function(_f5){
return $(_f5).style.display!="none";
},toggle:function(_f6){
_f6=$(_f6);
Element[Element.visible(_f6)?"hide":"show"](_f6);
return _f6;
},hide:function(_f7){
$(_f7).style.display="none";
return _f7;
},show:function(_f8){
$(_f8).style.display="";
return _f8;
},remove:function(_f9){
_f9=$(_f9);
_f9.parentNode.removeChild(_f9);
return _f9;
},update:function(_fa,_fb){
$(_fa).innerHTML=_fb.stripScripts();
setTimeout(function(){
_fb.evalScripts();
},10);
return _fa;
},replace:function(_fc,_fd){
_fc=$(_fc);
if(_fc.outerHTML){
_fc.outerHTML=_fd.stripScripts();
}else{
var _fe=_fc.ownerDocument.createRange();
_fe.selectNodeContents(_fc);
_fc.parentNode.replaceChild(_fe.createContextualFragment(_fd.stripScripts()),_fc);
}
setTimeout(function(){
_fd.evalScripts();
},10);
return _fc;
},inspect:function(_ff){
_ff=$(_ff);
var _100="<"+_ff.tagName.toLowerCase();
$H({"id":"id","className":"class"}).each(function(pair){
var _102=pair.first(),_103=pair.last();
var _104=(_ff[_102]||"").toString();
if(_104){
_100+=" "+_103+"="+_104.inspect(true);
}
});
return _100+">";
},recursivelyCollect:function(_105,_106){
_105=$(_105);
var _107=[];
while(_105=_105[_106]){
if(_105.nodeType==1){
_107.push(Element.extend(_105));
}
}
return _107;
},ancestors:function(_108){
return $(_108).recursivelyCollect("parentNode");
},descendants:function(_109){
_109=$(_109);
return $A(_109.getElementsByTagName("*"));
},previousSiblings:function(_10a){
return $(_10a).recursivelyCollect("previousSibling");
},nextSiblings:function(_10b){
return $(_10b).recursivelyCollect("nextSibling");
},siblings:function(_10c){
_10c=$(_10c);
return _10c.previousSiblings().reverse().concat(_10c.nextSiblings());
},match:function(_10d,_10e){
_10d=$(_10d);
if(typeof _10e=="string"){
_10e=new Selector(_10e);
}
return _10e.match(_10d);
},up:function(_10f,_110,_111){
return Selector.findElement($(_10f).ancestors(),_110,_111);
},down:function(_112,_113,_114){
return Selector.findElement($(_112).descendants(),_113,_114);
},previous:function(_115,_116,_117){
return Selector.findElement($(_115).previousSiblings(),_116,_117);
},next:function(_118,_119,_11a){
return Selector.findElement($(_118).nextSiblings(),_119,_11a);
},getElementsBySelector:function(){
var args=$A(arguments),_11c=$(args.shift());
return Selector.findChildElements(_11c,args);
},getElementsByClassName:function(_11d,_11e){
_11d=$(_11d);
return document.getElementsByClassName(_11e,_11d);
},getHeight:function(_11f){
_11f=$(_11f);
return _11f.offsetHeight;
},classNames:function(_120){
return new Element.ClassNames(_120);
},hasClassName:function(_121,_122){
if(!(_121=$(_121))){
return;
}
return Element.classNames(_121).include(_122);
},addClassName:function(_123,_124){
if(!(_123=$(_123))){
return;
}
Element.classNames(_123).add(_124);
return _123;
},removeClassName:function(_125,_126){
if(!(_125=$(_125))){
return;
}
Element.classNames(_125).remove(_126);
return _125;
},observe:function(){
Event.observe.apply(Event,arguments);
return $A(arguments).first();
},stopObserving:function(){
Event.stopObserving.apply(Event,arguments);
return $A(arguments).first();
},cleanWhitespace:function(_127){
_127=$(_127);
var node=_127.firstChild;
while(node){
var _129=node.nextSibling;
if(node.nodeType==3&&!/\S/.test(node.nodeValue)){
_127.removeChild(node);
}
node=_129;
}
return _127;
},empty:function(_12a){
return $(_12a).innerHTML.match(/^\s*$/);
},childOf:function(_12b,_12c){
_12b=$(_12b),_12c=$(_12c);
while(_12b=_12b.parentNode){
if(_12b==_12c){
return true;
}
}
return false;
},scrollTo:function(_12d){
_12d=$(_12d);
var x=_12d.x?_12d.x:_12d.offsetLeft,y=_12d.y?_12d.y:_12d.offsetTop;
window.scrollTo(x,y);
return _12d;
},getStyle:function(_130,_131){
_130=$(_130);
var _132=_130.style[_131.camelize()];
if(!_132){
if(document.defaultView&&document.defaultView.getComputedStyle){
var css=document.defaultView.getComputedStyle(_130,null);
_132=css?css.getPropertyValue(_131):null;
}else{
if(_130.currentStyle){
_132=_130.currentStyle[_131.camelize()];
}
}
}
if(window.opera&&["left","top","right","bottom"].include(_131)){
if(Element.getStyle(_130,"position")=="static"){
_132="auto";
}
}
return _132=="auto"?null:_132;
},setStyle:function(_134,_135){
_134=$(_134);
for(var name in _135){
_134.style[name.camelize()]=_135[name];
}
return _134;
},getDimensions:function(_137){
_137=$(_137);
if(Element.getStyle(_137,"display")!="none"){
return {width:_137.offsetWidth,height:_137.offsetHeight};
}
var els=_137.style;
var _139=els.visibility;
var _13a=els.position;
els.visibility="hidden";
els.position="absolute";
els.display="";
var _13b=_137.clientWidth;
var _13c=_137.clientHeight;
els.display="none";
els.position=_13a;
els.visibility=_139;
return {width:_13b,height:_13c};
},makePositioned:function(_13d){
_13d=$(_13d);
var pos=Element.getStyle(_13d,"position");
if(pos=="static"||!pos){
_13d._madePositioned=true;
_13d.style.position="relative";
if(window.opera){
_13d.style.top=0;
_13d.style.left=0;
}
}
return _13d;
},undoPositioned:function(_13f){
_13f=$(_13f);
if(_13f._madePositioned){
_13f._madePositioned=undefined;
_13f.style.position=_13f.style.top=_13f.style.left=_13f.style.bottom=_13f.style.right="";
}
return _13f;
},makeClipping:function(_140){
_140=$(_140);
if(_140._overflow){
return;
}
_140._overflow=_140.style.overflow||"auto";
if((Element.getStyle(_140,"overflow")||"visible")!="hidden"){
_140.style.overflow="hidden";
}
return _140;
},undoClipping:function(_141){
_141=$(_141);
if(!_141._overflow){
return;
}
_141.style.overflow=_141._overflow=="auto"?"":_141._overflow;
_141._overflow=null;
return _141;
}};
if(document.all){
Element.Methods.update=function(_142,html){
_142=$(_142);
var _144=_142.tagName.toUpperCase();
if(["THEAD","TBODY","TR","TD"].indexOf(_144)>-1){
var div=document.createElement("div");
switch(_144){
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(_142.childNodes).each(function(node){
_142.removeChild(node);
});
depth.times(function(){
div=div.firstChild;
});
$A(div.childNodes).each(function(node){
_142.appendChild(node);
});
}else{
_142.innerHTML=html.stripScripts();
}
setTimeout(function(){
html.evalScripts();
},10);
return _142;
};
}
Object.extend(Element,Element.Methods);
var _nativeExtensions=false;
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
["","Form","Input","TextArea","Select"].each(function(tag){
var _149="HTML"+tag+"Element";
if(window[_149]){
return;
}
var _14a=window[_149]={};
_14a.prototype=document.createElement(tag?tag.toLowerCase():"div").__proto__;
});
}
Element.addMethods=function(_14b){
Object.extend(Element.Methods,_14b||{});
function copy(_14c,_14d){
var _14e=Element.extend.cache;
for(var _14f in _14c){
var _150=_14c[_14f];
_14d[_14f]=_14e.findOrStore(_150);
}
}
if(typeof HTMLElement!="undefined"){
copy(Element.Methods,HTMLElement.prototype);
copy(Form.Methods,HTMLFormElement.prototype);
[HTMLInputElement,HTMLTextAreaElement,HTMLSelectElement].each(function(_151){
copy(Form.Element.Methods,_151.prototype);
});
_nativeExtensions=true;
}
};
var Toggle=new Object();
Toggle.display=Element.toggle;
Abstract.Insertion=function(_152){
this.adjacency=_152;
};
Abstract.Insertion.prototype={initialize:function(_153,_154){
this.element=$(_153);
this.content=_154.stripScripts();
if(this.adjacency&&this.element.insertAdjacentHTML){
try{
this.element.insertAdjacentHTML(this.adjacency,this.content);
}
catch(e){
var _155=this.element.tagName.toLowerCase();
if(_155=="tbody"||_155=="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(){
_154.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(_157){
_157.each((function(_158){
this.element.parentNode.insertBefore(_158,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(_159){
_159.reverse(false).each((function(_15a){
this.element.insertBefore(_15a,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(_15b){
_15b.each((function(_15c){
this.element.appendChild(_15c);
}).bind(this));
}});
Insertion.After=Class.create();
Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){
this.range.setStartAfter(this.element);
},insertContent:function(_15d){
_15d.each((function(_15e){
this.element.parentNode.insertBefore(_15e,this.element.nextSibling);
}).bind(this));
}});
Element.ClassNames=Class.create();
Element.ClassNames.prototype={initialize:function(_15f){
this.element=$(_15f);
},_each:function(_160){
this.element.className.split(/\s+/).select(function(name){
return name.length>0;
})._each(_160);
},set:function(_162){
this.element.className=_162;
},add:function(_163){
if(this.include(_163)){
return;
}
this.set(this.toArray().concat(_163).join(" "));
},remove:function(_164){
if(!this.include(_164)){
return;
}
this.set(this.select(function(_165){
return _165!=_164;
}).join(" "));
},toString:function(){
return this.toArray().join(" ");
}};
Object.extend(Element.ClassNames.prototype,Enumerable);
var Selector=Class.create();
Selector.prototype={initialize:function(_166){
this.params={classNames:[]};
this.expression=_166.toString().strip();
this.parseExpression();
this.compileMatcher();
},parseExpression:function(){
function abort(_167){
throw "Parse error in selector: "+_167;
}
if(this.expression==""){
abort("empty expression");
}
var _168=this.params,expr=this.expression,_16a,_16b,_16c,rest;
while(_16a=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){
_168.attributes=_168.attributes||[];
_168.attributes.push({name:_16a[2],operator:_16a[3],value:_16a[4]||_16a[5]||""});
expr=_16a[1];
}
if(expr=="*"){
return this.params.wildcard=true;
}
while(_16a=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)){
_16b=_16a[1],_16c=_16a[2],rest=_16a[3];
switch(_16b){
case "#":
_168.id=_16c;
break;
case ".":
_168.classNames.push(_16c);
break;
case "":
case undefined:
_168.tagName=_16c.toUpperCase();
break;
default:
abort(expr.inspect());
}
expr=rest;
}
if(expr.length>0){
abort(expr.inspect());
}
},buildMatchExpression:function(){
var _16e=this.params,_16f=[],_170;
if(_16e.wildcard){
_16f.push("true");
}
if(_170=_16e.id){
_16f.push("element.id == "+_170.inspect());
}
if(_170=_16e.tagName){
_16f.push("element.tagName.toUpperCase() == "+_170.inspect());
}
if((_170=_16e.classNames).length>0){
for(var i=0;i<_170.length;i++){
_16f.push("Element.hasClassName(element, "+_170[i].inspect()+")");
}
}
if(_170=_16e.attributes){
_170.each(function(_172){
var _173="element.getAttribute("+_172.name.inspect()+")";
var _174=function(_175){
return _173+" && "+_173+".split("+_175.inspect()+")";
};
switch(_172.operator){
case "=":
_16f.push(_173+" == "+_172.value.inspect());
break;
case "~=":
_16f.push(_174(" ")+".include("+_172.value.inspect()+")");
break;
case "|=":
_16f.push(_174("-")+".first().toUpperCase() == "+_172.value.toUpperCase().inspect());
break;
case "!=":
_16f.push(_173+" != "+_172.value.inspect());
break;
case "":
case undefined:
_16f.push(_173+" != null");
break;
default:
throw "Unknown operator "+_172.operator+" in selector";
}
});
}
return _16f.join(" && ");
},compileMatcher:function(){
this.match=new Function("element","if (!element.tagName) return false;       return "+this.buildMatchExpression());
},findElements:function(_176){
var _177;
if(_177=$(this.params.id)){
if(this.match(_177)){
if(!_176||Element.childOf(_177,_176)){
return [_177];
}
}
}
_176=(_176||document).getElementsByTagName(this.params.tagName||"*");
var _178=[];
for(var i=0;i<_176.length;i++){
if(this.match(_177=_176[i])){
_178.push(Element.extend(_177));
}
}
return _178;
},toString:function(){
return this.expression;
}};
Object.extend(Selector,{matchElements:function(_17a,_17b){
var _17c=new Selector(_17b);
return _17a.select(_17c.match.bind(_17c));
},findElement:function(_17d,_17e,_17f){
if(typeof _17e=="number"){
_17f=_17e,_17e=false;
}
return Selector.matchElements(_17d,_17e||"*")[_17f||0];
},findChildElements:function(_180,_181){
return _181.map(function(_182){
return _182.strip().split(/\s+/).inject([null],function(_183,expr){
var _185=new Selector(expr);
return _183.inject([],function(_186,_187){
return _186.concat(_185.findElements(_187||_180));
});
});
}).flatten();
}});
function $$(){
return Selector.findChildElements(document,$A(arguments));
}
var Form={reset:function(form){
$(form).reset();
return form;
}};
Form.Methods={serialize:function(form){
var _18a=Form.getElements($(form));
var _18b=new Array();
for(var i=0;i<_18a.length;i++){
var _18d=Form.Element.serialize(_18a[i]);
if(_18d){
_18b.push(_18d);
}
}
return _18b.join("&");
},getElements:function(form){
form=$(form);
var _18f=new Array();
for(var _190 in Form.Element.Serializers){
var _191=form.getElementsByTagName(_190);
for(var j=0;j<_191.length;j++){
_18f.push(_191[j]);
}
}
return _18f;
},getInputs:function(form,_194,name){
form=$(form);
var _196=form.getElementsByTagName("input");
if(!_194&&!name){
return _196;
}
var _197=new Array();
for(var i=0;i<_196.length;i++){
var _199=_196[i];
if((_194&&_199.type!=_194)||(name&&_199.name!=name)){
continue;
}
_197.push(_199);
}
return _197;
},disable:function(form){
form=$(form);
var _19b=Form.getElements(form);
for(var i=0;i<_19b.length;i++){
var _19d=_19b[i];
_19d.blur();
_19d.disabled="true";
}
return form;
},enable:function(form){
form=$(form);
var _19f=Form.getElements(form);
for(var i=0;i<_19f.length;i++){
var _1a1=_19f[i];
_1a1.disabled="";
}
return form;
},findFirstElement:function(form){
return Form.getElements(form).find(function(_1a3){
return _1a3.type!="hidden"&&!_1a3.disabled&&["input","select","textarea"].include(_1a3.tagName.toLowerCase());
});
},focusFirstElement:function(form){
form=$(form);
Field.activate(Form.findFirstElement(form));
return form;
}};
Object.extend(Form,Form.Methods);
Form.Element={focus:function(_1a5){
$(_1a5).focus();
return _1a5;
},select:function(_1a6){
$(_1a6).select();
return _1a6;
}};
Form.Element.Methods={serialize:function(_1a7){
_1a7=$(_1a7);
var _1a8=_1a7.tagName.toLowerCase();
var _1a9=Form.Element.Serializers[_1a8](_1a7);
if(_1a9){
var key=encodeURIComponent(_1a9[0]);
if(key.length==0){
return;
}
if(_1a9[1].constructor!=Array){
_1a9[1]=[_1a9[1]];
}
return _1a9[1].map(function(_1ab){
return key+"="+encodeURIComponent(_1ab);
}).join("&");
}
},getValue:function(_1ac){
_1ac=$(_1ac);
var _1ad=_1ac.tagName.toLowerCase();
var _1ae=Form.Element.Serializers[_1ad](_1ac);
if(_1ae){
return _1ae[1];
}
},clear:function(_1af){
$(_1af).value="";
return _1af;
},present:function(_1b0){
return $(_1b0).value!="";
},activate:function(_1b1){
_1b1=$(_1b1);
_1b1.focus();
if(_1b1.select){
_1b1.select();
}
return _1b1;
},disable:function(_1b2){
_1b2=$(_1b2);
_1b2.disabled="";
return _1b2;
},enable:function(_1b3){
_1b3=$(_1b3);
_1b3.blur();
_1b3.disabled="true";
return _1b3;
}};
Object.extend(Form.Element,Form.Element.Methods);
var Field=Form.Element;
Form.Element.Serializers={input:function(_1b4){
switch(_1b4.type.toLowerCase()){
case "checkbox":
case "radio":
return Form.Element.Serializers.inputSelector(_1b4);
default:
return Form.Element.Serializers.textarea(_1b4);
}
return false;
},inputSelector:function(_1b5){
if(_1b5.checked){
return [_1b5.name,_1b5.value];
}
},textarea:function(_1b6){
return [_1b6.name,_1b6.value];
},select:function(_1b7){
return Form.Element.Serializers[_1b7.type=="select-one"?"selectOne":"selectMany"](_1b7);
},selectOne:function(_1b8){
var _1b9="",opt,_1bb=_1b8.selectedIndex;
if(_1bb>=0){
opt=_1b8.options[_1bb];
_1b9=opt.value||opt.text;
}
return [_1b8.name,_1b9];
},selectMany:function(_1bc){
var _1bd=[];
for(var i=0;i<_1bc.length;i++){
var opt=_1bc.options[i];
if(opt.selected){
_1bd.push(opt.value||opt.text);
}
}
return [_1bc.name,_1bd];
}};
var $F=Form.Element.getValue;
Abstract.TimedObserver=function(){
};
Abstract.TimedObserver.prototype={initialize:function(_1c0,_1c1,_1c2){
this.frequency=_1c1;
this.element=$(_1c0);
this.callback=_1c2;
this.lastValue=this.getValue();
this.registerCallback();
},registerCallback:function(){
setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},onTimerEvent:function(){
var _1c3=this.getValue();
if(this.lastValue!=_1c3){
this.callback(this.element,_1c3);
this.lastValue=_1c3;
}
}};
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(_1c4,_1c5){
this.element=$(_1c4);
this.callback=_1c5;
this.lastValue=this.getValue();
if(this.element.tagName.toLowerCase()=="form"){
this.registerFormCallbacks();
}else{
this.registerCallback(this.element);
}
},onElementEvent:function(){
var _1c6=this.getValue();
if(this.lastValue!=_1c6){
this.callback(this.element,_1c6);
this.lastValue=_1c6;
}
},registerFormCallbacks:function(){
var _1c7=Form.getElements(this.element);
for(var i=0;i<_1c7.length;i++){
this.registerCallback(_1c7[i]);
}
},registerCallback:function(_1c9){
if(_1c9.type){
switch(_1c9.type.toLowerCase()){
case "checkbox":
case "radio":
Event.observe(_1c9,"click",this.onElementEvent.bind(this));
break;
default:
Event.observe(_1c9,"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(_1ca){
return _1ca.target||_1ca.srcElement;
},isLeftClick:function(_1cb){
return (((_1cb.which)&&(_1cb.which==1))||((_1cb.button)&&(_1cb.button==1)));
},pointerX:function(_1cc){
return _1cc.pageX||(_1cc.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
},pointerY:function(_1cd){
return _1cd.pageY||(_1cd.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
},stop:function(_1ce){
if(_1ce.preventDefault){
_1ce.preventDefault();
_1ce.stopPropagation();
}else{
_1ce.returnValue=false;
_1ce.cancelBubble=true;
}
},findElement:function(_1cf,_1d0){
var _1d1=Event.element(_1cf);
while(_1d1.parentNode&&(!_1d1.tagName||(_1d1.tagName.toUpperCase()!=_1d0.toUpperCase()))){
_1d1=_1d1.parentNode;
}
return _1d1;
},observers:false,_observeAndCache:function(_1d2,name,_1d4,_1d5){
if(!this.observers){
this.observers=[];
}
if(_1d2.addEventListener){
this.observers.push([_1d2,name,_1d4,_1d5]);
_1d2.addEventListener(name,_1d4,_1d5);
}else{
if(_1d2.attachEvent){
this.observers.push([_1d2,name,_1d4,_1d5]);
_1d2.attachEvent("on"+name,_1d4);
}
}
},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(_1d7,name,_1d9,_1da){
_1d7=$(_1d7);
_1da=_1da||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_1d7.attachEvent)){
name="keydown";
}
Event._observeAndCache(_1d7,name,_1d9,_1da);
},stopObserving:function(_1db,name,_1dd,_1de){
_1db=$(_1db);
_1de=_1de||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_1db.detachEvent)){
name="keydown";
}
if(_1db.removeEventListener){
_1db.removeEventListener(name,_1dd,_1de);
}else{
if(_1db.detachEvent){
try{
_1db.detachEvent("on"+name,_1dd);
}
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(_1df){
var _1e0=0,_1e1=0;
do{
_1e0+=_1df.scrollTop||0;
_1e1+=_1df.scrollLeft||0;
_1df=_1df.parentNode;
}while(_1df);
return [_1e1,_1e0];
},cumulativeOffset:function(_1e2){
var _1e3=0,_1e4=0;
do{
_1e3+=_1e2.offsetTop||0;
_1e4+=_1e2.offsetLeft||0;
_1e2=_1e2.offsetParent;
}while(_1e2);
return [_1e4,_1e3];
},positionedOffset:function(_1e5){
var _1e6=0,_1e7=0;
do{
_1e6+=_1e5.offsetTop||0;
_1e7+=_1e5.offsetLeft||0;
_1e5=_1e5.offsetParent;
if(_1e5){
p=Element.getStyle(_1e5,"position");
if(p=="relative"||p=="absolute"){
break;
}
}
}while(_1e5);
return [_1e7,_1e6];
},offsetParent:function(_1e8){
if(_1e8.offsetParent){
return _1e8.offsetParent;
}
if(_1e8==document.body){
return _1e8;
}
while((_1e8=_1e8.parentNode)&&_1e8!=document.body){
if(Element.getStyle(_1e8,"position")!="static"){
return _1e8;
}
}
return document.body;
},within:function(_1e9,x,y){
if(this.includeScrollOffsets){
return this.withinIncludingScrolloffsets(_1e9,x,y);
}
this.xcomp=x;
this.ycomp=y;
this.offset=this.cumulativeOffset(_1e9);
return (y>=this.offset[1]&&y<this.offset[1]+_1e9.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+_1e9.offsetWidth);
},withinIncludingScrolloffsets:function(_1ec,x,y){
var _1ef=this.realOffset(_1ec);
this.xcomp=x+_1ef[0]-this.deltaX;
this.ycomp=y+_1ef[1]-this.deltaY;
this.offset=this.cumulativeOffset(_1ec);
return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+_1ec.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+_1ec.offsetWidth);
},overlap:function(mode,_1f1){
if(!mode){
return 0;
}
if(mode=="vertical"){
return ((this.offset[1]+_1f1.offsetHeight)-this.ycomp)/_1f1.offsetHeight;
}
if(mode=="horizontal"){
return ((this.offset[0]+_1f1.offsetWidth)-this.xcomp)/_1f1.offsetWidth;
}
},page:function(_1f2){
var _1f3=0,_1f4=0;
var _1f5=_1f2;
do{
_1f3+=_1f5.offsetTop||0;
_1f4+=_1f5.offsetLeft||0;
if(_1f5.offsetParent==document.body){
if(Element.getStyle(_1f5,"position")=="absolute"){
break;
}
}
}while(_1f5=_1f5.offsetParent);
_1f5=_1f2;
do{
if(!window.opera||_1f5.tagName=="BODY"){
_1f3-=_1f5.scrollTop||0;
_1f4-=_1f5.scrollLeft||0;
}
}while(_1f5=_1f5.parentNode);
return [_1f4,_1f3];
},clone:function(_1f6,_1f7){
var _1f8=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});
_1f6=$(_1f6);
var p=Position.page(_1f6);
_1f7=$(_1f7);
var _1fa=[0,0];
var _1fb=null;
if(Element.getStyle(_1f7,"position")=="absolute"){
_1fb=Position.offsetParent(_1f7);
_1fa=Position.page(_1fb);
}
if(_1fb==document.body){
_1fa[0]-=document.body.offsetLeft;
_1fa[1]-=document.body.offsetTop;
}
if(_1f8.setLeft){
_1f7.style.left=(p[0]-_1fa[0]+_1f8.offsetLeft)+"px";
}
if(_1f8.setTop){
_1f7.style.top=(p[1]-_1fa[1]+_1f8.offsetTop)+"px";
}
if(_1f8.setWidth){
_1f7.style.width=_1f6.offsetWidth+"px";
}
if(_1f8.setHeight){
_1f7.style.height=_1f6.offsetHeight+"px";
}
},absolutize:function(_1fc){
_1fc=$(_1fc);
if(_1fc.style.position=="absolute"){
return;
}
Position.prepare();
var _1fd=Position.positionedOffset(_1fc);
var top=_1fd[1];
var left=_1fd[0];
var _200=_1fc.clientWidth;
var _201=_1fc.clientHeight;
_1fc._originalLeft=left-parseFloat(_1fc.style.left||0);
_1fc._originalTop=top-parseFloat(_1fc.style.top||0);
_1fc._originalWidth=_1fc.style.width;
_1fc._originalHeight=_1fc.style.height;
_1fc.style.position="absolute";
_1fc.style.top=top+"px";
_1fc.style.left=left+"px";
_1fc.style.width=_200+"px";
_1fc.style.height=_201+"px";
},relativize:function(_202){
_202=$(_202);
if(_202.style.position=="relative"){
return;
}
Position.prepare();
_202.style.position="relative";
var top=parseFloat(_202.style.top||0)-(_202._originalTop||0);
var left=parseFloat(_202.style.left||0)-(_202._originalLeft||0);
_202.style.top=top+"px";
_202.style.left=left+"px";
_202.style.height=_202._originalHeight;
_202.style.width=_202._originalWidth;
}};
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
Position.cumulativeOffset=function(_205){
var _206=0,_207=0;
do{
_206+=_205.offsetTop||0;
_207+=_205.offsetLeft||0;
if(_205.offsetParent==document.body){
if(Element.getStyle(_205,"position")=="absolute"){
break;
}
}
_205=_205.offsetParent;
}while(_205);
return [_207,_206];
};
}
Element.addMethods();
var Scriptaculous={Version:"1.6.4",require:function(_208){
document.write("<script type=\"text/javascript\" src=\""+_208+"\"></script>");
},load:function(){
if((typeof Prototype=="undefined")||(typeof Element=="undefined")||(typeof Element.Methods=="undefined")||parseFloat(Prototype.Version.split(".")[0]+"."+Prototype.Version.split(".")[1])<1.5){
throw ("script.aculo.us requires the Prototype JavaScript framework >= 1.5.0");
}
$A(document.getElementsByTagName("script")).findAll(function(s){
return (s.src&&s.src.match(/scriptaculous\.js(\?.*)?$/));
}).each(function(s){
var path=s.src.replace(/scriptaculous\.js(\?.*)?$/,"");
var _20c=s.src.match(/\?.*load=([a-z,]*)/);
(_20c?_20c[1]:"effects,dragdrop,slider").split(",").each(function(_20d){
Scriptaculous.require(path+_20d+".js");
});
});
}};
String.prototype.parseColor=function(){
var _20e="#";
if(this.slice(0,4)=="rgb("){
var cols=this.slice(4,this.length-1).split(",");
var i=0;
do{
_20e+=parseInt(cols[i]).toColorPart();
}while(++i<3);
}else{
if(this.slice(0,1)=="#"){
if(this.length==4){
for(var i=1;i<4;i++){
_20e+=(this.charAt(i)+this.charAt(i)).toLowerCase();
}
}
if(this.length==7){
_20e=this.toLowerCase();
}
}
}
return (_20e.length==7?_20e:(arguments[0]||this));
};
Element.collectTextNodes=function(_211){
return $A($(_211).childNodes).collect(function(node){
return (node.nodeType==3?node.nodeValue:(node.hasChildNodes()?Element.collectTextNodes(node):""));
}).flatten().join("");
};
Element.collectTextNodesIgnoreClass=function(_213,_214){
return $A($(_213).childNodes).collect(function(node){
return (node.nodeType==3?node.nodeValue:((node.hasChildNodes()&&!Element.hasClassName(node,_214))?Element.collectTextNodesIgnoreClass(node,_214):""));
}).flatten().join("");
};
Element.setContentZoom=function(_216,_217){
_216=$(_216);
Element.setStyle(_216,{fontSize:(_217/100)+"em"});
if(navigator.appVersion.indexOf("AppleWebKit")>0){
window.scrollBy(0,0);
}
};
Element.getOpacity=function(_218){
var _219;
if(_219=Element.getStyle(_218,"opacity")){
return parseFloat(_219);
}
if(_219=(Element.getStyle(_218,"filter")||"").match(/alpha\(opacity=(.*)\)/)){
if(_219[1]){
return parseFloat(_219[1])/100;
}
}
return 1;
};
Element.setOpacity=function(_21a,_21b){
_21a=$(_21a);
if(_21b==1){
Element.setStyle(_21a,{opacity:(/Gecko/.test(navigator.userAgent)&&!/Konqueror|Safari|KHTML/.test(navigator.userAgent))?0.999999:1});
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
Element.setStyle(_21a,{filter:Element.getStyle(_21a,"filter").replace(/alpha\([^\)]*\)/gi,"")});
}
}else{
if(_21b<0.00001){
_21b=0;
}
Element.setStyle(_21a,{opacity:_21b});
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
Element.setStyle(_21a,{filter:Element.getStyle(_21a,"filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+_21b*100+")"});
}
}
};
Element.getInlineOpacity=function(_21c){
return $(_21c).style.opacity||"";
};
Element.childrenWithClassName=function(_21d,_21e,_21f){
var _220=new RegExp("(^|\\s)"+_21e+"(\\s|$)");
var _221=$A($(_21d).getElementsByTagName("*"))[_21f?"detect":"select"](function(c){
return (c.className&&c.className.match(_220));
});
if(!_221){
_221=[];
}
return _221;
};
Element.forceRerendering=function(_223){
try{
_223=$(_223);
var n=document.createTextNode(" ");
_223.appendChild(n);
_223.removeChild(n);
}
catch(e){
}
};
Array.prototype.call=function(){
var args=arguments;
this.each(function(f){
f.apply(this,args);
});
};
var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},tagifyText:function(_227){
if(typeof Builder=="undefined"){
throw ("Effect.tagifyText requires including script.aculo.us' builder.js library");
}
var _228="position:relative";
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_228+=";zoom:1";
}
_227=$(_227);
$A(_227.childNodes).each(function(_229){
if(_229.nodeType==3){
_229.nodeValue.toArray().each(function(_22a){
_227.insertBefore(Builder.node("span",{style:_228},_22a==" "?String.fromCharCode(160):_22a),_229);
});
Element.remove(_229);
}
});
},multiple:function(_22b,_22c){
var _22d;
if(((typeof _22b=="object")||(typeof _22b=="function"))&&(_22b.length)){
_22d=_22b;
}else{
_22d=$(_22b).childNodes;
}
var _22e=Object.extend({speed:0.1,delay:0},arguments[2]||{});
var _22f=_22e.delay;
$A(_22d).each(function(_230,_231){
new _22c(_230,Object.extend(_22e,{delay:_231*_22e.speed+_22f}));
});
},PAIRS:{"slide":["SlideDown","SlideUp"],"blind":["BlindDown","BlindUp"],"appear":["Appear","Fade"]},toggle:function(_232,_233){
_232=$(_232);
_233=(_233||"appear").toLowerCase();
var _234=Object.extend({queue:{position:"end",scope:(_232.id||"global"),limit:1}},arguments[2]||{});
Effect[_232.visible()?Effect.PAIRS[_233][1]:Effect.PAIRS[_233][0]](_232,_234);
}};
var Effect2=Effect;
Effect.Transitions={};
Effect.Transitions.linear=Prototype.K;
Effect.Transitions.sinoidal=function(pos){
return (-Math.cos(pos*Math.PI)/2)+0.5;
};
Effect.Transitions.reverse=function(pos){
return 1-pos;
};
Effect.Transitions.flicker=function(pos){
return ((-Math.cos(pos*Math.PI)/4)+0.75)+Math.random()/4;
};
Effect.Transitions.wobble=function(pos){
return (-Math.cos(pos*Math.PI*(9*pos))/2)+0.5;
};
Effect.Transitions.pulse=function(pos){
return (Math.floor(pos*10)%2==0?(pos*10-Math.floor(pos*10)):1-(pos*10-Math.floor(pos*10)));
};
Effect.Transitions.none=function(pos){
return 0;
};
Effect.Transitions.full=function(pos){
return 1;
};
Effect.ScopedQueue=Class.create();
Object.extend(Object.extend(Effect.ScopedQueue.prototype,Enumerable),{initialize:function(){
this.effects=[];
this.interval=null;
},_each:function(_23c){
this.effects._each(_23c);
},add:function(_23d){
var _23e=new Date().getTime();
var _23f=(typeof _23d.options.queue=="string")?_23d.options.queue:_23d.options.queue.position;
switch(_23f){
case "front":
this.effects.findAll(function(e){
return e.state=="idle";
}).each(function(e){
e.startOn+=_23d.finishOn;
e.finishOn+=_23d.finishOn;
});
break;
case "end":
_23e=this.effects.pluck("finishOn").max()||_23e;
break;
}
_23d.startOn+=_23e;
_23d.finishOn+=_23e;
if(!_23d.options.queue.limit||(this.effects.length<_23d.options.queue.limit)){
this.effects.push(_23d);
}
if(!this.interval){
this.interval=setInterval(this.loop.bind(this),40);
}
},remove:function(_242){
this.effects=this.effects.reject(function(e){
return e==_242;
});
if(this.effects.length==0){
clearInterval(this.interval);
this.interval=null;
}
},loop:function(){
var _244=new Date().getTime();
this.effects.invoke("loop",_244);
}});
Effect.Queues={instances:$H(),get:function(_245){
if(typeof _245!="string"){
return _245;
}
if(!this.instances[_245]){
this.instances[_245]=new Effect.ScopedQueue();
}
return this.instances[_245];
}};
Effect.Queue=Effect.Queues.get("global");
Effect.DefaultOptions={transition:Effect.Transitions.sinoidal,duration:1,fps:25,sync:false,from:0,to:1,delay:0,queue:"parallel"};
Effect.Base=function(){
};
Effect.Base.prototype={position:null,start:function(_246){
this.options=Object.extend(Object.extend({},Effect.DefaultOptions),_246||{});
this.currentFrame=0;
this.state="idle";
this.startOn=this.options.delay*1000;
this.finishOn=this.startOn+(this.options.duration*1000);
this.event("beforeStart");
if(!this.options.sync){
Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).add(this);
}
},loop:function(_247){
if(_247>=this.startOn){
if(_247>=this.finishOn){
this.render(1);
this.cancel();
this.event("beforeFinish");
if(this.finish){
this.finish();
}
this.event("afterFinish");
return;
}
var pos=(_247-this.startOn)/(this.finishOn-this.startOn);
var _249=Math.round(pos*this.options.fps*this.options.duration);
if(_249>this.currentFrame){
this.render(pos);
this.currentFrame=_249;
}
}
},render:function(pos){
if(this.state=="idle"){
this.state="running";
this.event("beforeSetup");
if(this.setup){
this.setup();
}
this.event("afterSetup");
}
if(this.state=="running"){
if(this.options.transition){
pos=this.options.transition(pos);
}
pos*=(this.options.to-this.options.from);
pos+=this.options.from;
this.position=pos;
this.event("beforeUpdate");
if(this.update){
this.update(pos);
}
this.event("afterUpdate");
}
},cancel:function(){
if(!this.options.sync){
Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).remove(this);
}
this.state="finished";
},event:function(_24b){
if(this.options[_24b+"Internal"]){
this.options[_24b+"Internal"](this);
}
if(this.options[_24b]){
this.options[_24b](this);
}
},inspect:function(){
return "#<Effect:"+$H(this).inspect()+",options:"+$H(this.options).inspect()+">";
}};
Effect.Parallel=Class.create();
Object.extend(Object.extend(Effect.Parallel.prototype,Effect.Base.prototype),{initialize:function(_24c){
this.effects=_24c||[];
this.start(arguments[1]);
},update:function(_24d){
this.effects.invoke("render",_24d);
},finish:function(_24e){
this.effects.each(function(_24f){
_24f.render(1);
_24f.cancel();
_24f.event("beforeFinish");
if(_24f.finish){
_24f.finish(_24e);
}
_24f.event("afterFinish");
});
}});
Effect.Opacity=Class.create();
Object.extend(Object.extend(Effect.Opacity.prototype,Effect.Base.prototype),{initialize:function(_250){
this.element=$(_250);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
if(/MSIE/.test(navigator.userAgent)&&!window.opera&&(!this.element.currentStyle.hasLayout)){
this.element.setStyle({zoom:1});
}
var _251=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});
this.start(_251);
},update:function(_252){
this.element.setOpacity(_252);
}});
Effect.Move=Class.create();
Object.extend(Object.extend(Effect.Move.prototype,Effect.Base.prototype),{initialize:function(_253){
this.element=$(_253);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _254=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});
this.start(_254);
},setup:function(){
this.element.makePositioned();
this.originalLeft=parseFloat(this.element.getStyle("left")||"0");
this.originalTop=parseFloat(this.element.getStyle("top")||"0");
if(this.options.mode=="absolute"){
this.options.x=this.options.x-this.originalLeft;
this.options.y=this.options.y-this.originalTop;
}
},update:function(_255){
this.element.setStyle({left:Math.round(this.options.x*_255+this.originalLeft)+"px",top:Math.round(this.options.y*_255+this.originalTop)+"px"});
}});
Effect.MoveBy=function(_256,_257,_258){
return new Effect.Move(_256,Object.extend({x:_258,y:_257},arguments[3]||{}));
};
Effect.Scale=Class.create();
Object.extend(Object.extend(Effect.Scale.prototype,Effect.Base.prototype),{initialize:function(_259,_25a){
this.element=$(_259);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _25b=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_25a},arguments[2]||{});
this.start(_25b);
},setup:function(){
this.restoreAfterFinish=this.options.restoreAfterFinish||false;
this.elementPositioning=this.element.getStyle("position");
this.originalStyle={};
["top","left","width","height","fontSize"].each(function(k){
this.originalStyle[k]=this.element.style[k];
}.bind(this));
this.originalTop=this.element.offsetTop;
this.originalLeft=this.element.offsetLeft;
var _25d=this.element.getStyle("font-size")||"100%";
["em","px","%","pt"].each(function(_25e){
if(_25d.indexOf(_25e)>0){
this.fontSize=parseFloat(_25d);
this.fontSizeType=_25e;
}
}.bind(this));
this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;
this.dims=null;
if(this.options.scaleMode=="box"){
this.dims=[this.element.offsetHeight,this.element.offsetWidth];
}
if(/^content/.test(this.options.scaleMode)){
this.dims=[this.element.scrollHeight,this.element.scrollWidth];
}
if(!this.dims){
this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth];
}
},update:function(_25f){
var _260=(this.options.scaleFrom/100)+(this.factor*_25f);
if(this.options.scaleContent&&this.fontSize){
this.element.setStyle({fontSize:this.fontSize*_260+this.fontSizeType});
}
this.setDimensions(this.dims[0]*_260,this.dims[1]*_260);
},finish:function(_261){
if(this.restoreAfterFinish){
this.element.setStyle(this.originalStyle);
}
},setDimensions:function(_262,_263){
var d={};
if(this.options.scaleX){
d.width=Math.round(_263)+"px";
}
if(this.options.scaleY){
d.height=Math.round(_262)+"px";
}
if(this.options.scaleFromCenter){
var topd=(_262-this.dims[0])/2;
var _266=(_263-this.dims[1])/2;
if(this.elementPositioning=="absolute"){
if(this.options.scaleY){
d.top=this.originalTop-topd+"px";
}
if(this.options.scaleX){
d.left=this.originalLeft-_266+"px";
}
}else{
if(this.options.scaleY){
d.top=-topd+"px";
}
if(this.options.scaleX){
d.left=-_266+"px";
}
}
}
this.element.setStyle(d);
}});
Effect.Highlight=Class.create();
Object.extend(Object.extend(Effect.Highlight.prototype,Effect.Base.prototype),{initialize:function(_267){
this.element=$(_267);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _268=Object.extend({startcolor:"#ffff99"},arguments[1]||{});
this.start(_268);
},setup:function(){
if(this.element.getStyle("display")=="none"){
this.cancel();
return;
}
this.oldStyle={backgroundImage:this.element.getStyle("background-image")};
this.element.setStyle({backgroundImage:"none"});
if(!this.options.endcolor){
this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff");
}
if(!this.options.restorecolor){
this.options.restorecolor=this.element.getStyle("background-color");
}
this._base=$R(0,2).map(function(i){
return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16);
}.bind(this));
this._delta=$R(0,2).map(function(i){
return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i];
}.bind(this));
},update:function(_26b){
this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(m,v,i){
return m+(Math.round(this._base[i]+(this._delta[i]*_26b)).toColorPart());
}.bind(this))});
},finish:function(){
this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}));
}});
Effect.ScrollTo=Class.create();
Object.extend(Object.extend(Effect.ScrollTo.prototype,Effect.Base.prototype),{initialize:function(_26f){
this.element=$(_26f);
this.start(arguments[1]||{});
},setup:function(){
Position.prepare();
var _270=Position.cumulativeOffset(this.element);
if(this.options.offset){
_270[1]+=this.options.offset;
}
var max=window.innerHeight?window.height-window.innerHeight:document.body.scrollHeight-(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight);
this.scrollStart=Position.deltaY;
this.delta=(_270[1]>max?max:_270[1])-this.scrollStart;
},update:function(_272){
Position.prepare();
window.scrollTo(Position.deltaX,this.scrollStart+(_272*this.delta));
}});
Effect.Fade=function(_273){
_273=$(_273);
var _274=_273.getInlineOpacity();
var _275=Object.extend({from:_273.getOpacity()||1,to:0,afterFinishInternal:function(_276){
if(_276.options.to!=0){
return;
}
_276.element.hide();
_276.element.setStyle({opacity:_274});
}},arguments[1]||{});
return new Effect.Opacity(_273,_275);
};
Effect.Appear=function(_277){
_277=$(_277);
var _278=Object.extend({from:(_277.getStyle("display")=="none"?0:_277.getOpacity()||0),to:1,afterFinishInternal:function(_279){
_279.element.forceRerendering();
},beforeSetup:function(_27a){
_27a.element.setOpacity(_27a.options.from);
_27a.element.show();
}},arguments[1]||{});
return new Effect.Opacity(_277,_278);
};
Effect.Puff=function(_27b){
_27b=$(_27b);
var _27c={opacity:_27b.getInlineOpacity(),position:_27b.getStyle("position"),top:_27b.style.top,left:_27b.style.left,width:_27b.style.width,height:_27b.style.height};
return new Effect.Parallel([new Effect.Scale(_27b,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(_27b,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(_27d){
Position.absolutize(_27d.effects[0].element);
},afterFinishInternal:function(_27e){
_27e.effects[0].element.hide();
_27e.effects[0].element.setStyle(_27c);
}},arguments[1]||{}));
};
Effect.BlindUp=function(_27f){
_27f=$(_27f);
_27f.makeClipping();
return new Effect.Scale(_27f,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(_280){
_280.element.hide();
_280.element.undoClipping();
}},arguments[1]||{}));
};
Effect.BlindDown=function(_281){
_281=$(_281);
var _282=_281.getDimensions();
return new Effect.Scale(_281,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_282.height,originalWidth:_282.width},restoreAfterFinish:true,afterSetup:function(_283){
_283.element.makeClipping();
_283.element.setStyle({height:"0px"});
_283.element.show();
},afterFinishInternal:function(_284){
_284.element.undoClipping();
}},arguments[1]||{}));
};
Effect.SwitchOff=function(_285){
_285=$(_285);
var _286=_285.getInlineOpacity();
return new Effect.Appear(_285,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(_287){
new Effect.Scale(_287.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(_288){
_288.element.makePositioned();
_288.element.makeClipping();
},afterFinishInternal:function(_289){
_289.element.hide();
_289.element.undoClipping();
_289.element.undoPositioned();
_289.element.setStyle({opacity:_286});
}});
}},arguments[1]||{}));
};
Effect.DropOut=function(_28a){
_28a=$(_28a);
var _28b={top:_28a.getStyle("top"),left:_28a.getStyle("left"),opacity:_28a.getInlineOpacity()};
return new Effect.Parallel([new Effect.Move(_28a,{x:0,y:100,sync:true}),new Effect.Opacity(_28a,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(_28c){
_28c.effects[0].element.makePositioned();
},afterFinishInternal:function(_28d){
_28d.effects[0].element.hide();
_28d.effects[0].element.undoPositioned();
_28d.effects[0].element.setStyle(_28b);
}},arguments[1]||{}));
};
Effect.Shake=function(_28e){
_28e=$(_28e);
var _28f={top:_28e.getStyle("top"),left:_28e.getStyle("left")};
return new Effect.Move(_28e,{x:20,y:0,duration:0.05,afterFinishInternal:function(_290){
new Effect.Move(_290.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_291){
new Effect.Move(_291.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_292){
new Effect.Move(_292.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_293){
new Effect.Move(_293.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_294){
new Effect.Move(_294.element,{x:-20,y:0,duration:0.05,afterFinishInternal:function(_295){
_295.element.undoPositioned();
_295.element.setStyle(_28f);
}});
}});
}});
}});
}});
}});
};
Effect.SlideDown=function(_296){
_296=$(_296);
_296.cleanWhitespace();
var _297=$(_296.firstChild).getStyle("bottom");
var _298=_296.getDimensions();
return new Effect.Scale(_296,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:_298.height,originalWidth:_298.width},restoreAfterFinish:true,afterSetup:function(_299){
_299.element.makePositioned();
_299.element.firstChild.makePositioned();
if(window.opera){
_299.element.setStyle({top:""});
}
_299.element.makeClipping();
_299.element.setStyle({height:"0px"});
_299.element.show();
},afterUpdateInternal:function(_29a){
_29a.element.firstChild.setStyle({bottom:(_29a.dims[0]-_29a.element.clientHeight)+"px"});
},afterFinishInternal:function(_29b){
_29b.element.undoClipping();
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_29b.element.undoPositioned();
_29b.element.firstChild.undoPositioned();
}else{
_29b.element.firstChild.undoPositioned();
_29b.element.undoPositioned();
}
_29b.element.firstChild.setStyle({bottom:_297});
}},arguments[1]||{}));
};
Effect.SlideUp=function(_29c){
_29c=$(_29c);
_29c.cleanWhitespace();
var _29d=$(_29c.firstChild).getStyle("bottom");
return new Effect.Scale(_29c,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_29e){
_29e.element.makePositioned();
_29e.element.firstChild.makePositioned();
if(window.opera){
_29e.element.setStyle({top:""});
}
_29e.element.makeClipping();
_29e.element.show();
},afterUpdateInternal:function(_29f){
_29f.element.firstChild.setStyle({bottom:(_29f.dims[0]-_29f.element.clientHeight)+"px"});
},afterFinishInternal:function(_2a0){
_2a0.element.hide();
_2a0.element.undoClipping();
_2a0.element.firstChild.undoPositioned();
_2a0.element.undoPositioned();
_2a0.element.setStyle({bottom:_29d});
}},arguments[1]||{}));
};
Effect.Squish=function(_2a1){
return new Effect.Scale(_2a1,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(_2a2){
_2a2.element.makeClipping(_2a2.element);
},afterFinishInternal:function(_2a3){
_2a3.element.hide(_2a3.element);
_2a3.element.undoClipping(_2a3.element);
}});
};
Effect.Grow=function(_2a4){
_2a4=$(_2a4);
var _2a5=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});
var _2a6={top:_2a4.style.top,left:_2a4.style.left,height:_2a4.style.height,width:_2a4.style.width,opacity:_2a4.getInlineOpacity()};
var dims=_2a4.getDimensions();
var _2a8,_2a9;
var _2aa,_2ab;
switch(_2a5.direction){
case "top-left":
_2a8=_2a9=_2aa=_2ab=0;
break;
case "top-right":
_2a8=dims.width;
_2a9=_2ab=0;
_2aa=-dims.width;
break;
case "bottom-left":
_2a8=_2aa=0;
_2a9=dims.height;
_2ab=-dims.height;
break;
case "bottom-right":
_2a8=dims.width;
_2a9=dims.height;
_2aa=-dims.width;
_2ab=-dims.height;
break;
case "center":
_2a8=dims.width/2;
_2a9=dims.height/2;
_2aa=-dims.width/2;
_2ab=-dims.height/2;
break;
}
return new Effect.Move(_2a4,{x:_2a8,y:_2a9,duration:0.01,beforeSetup:function(_2ac){
_2ac.element.hide();
_2ac.element.makeClipping();
_2ac.element.makePositioned();
},afterFinishInternal:function(_2ad){
new Effect.Parallel([new Effect.Opacity(_2ad.element,{sync:true,to:1,from:0,transition:_2a5.opacityTransition}),new Effect.Move(_2ad.element,{x:_2aa,y:_2ab,sync:true,transition:_2a5.moveTransition}),new Effect.Scale(_2ad.element,100,{scaleMode:{originalHeight:dims.height,originalWidth:dims.width},sync:true,scaleFrom:window.opera?1:0,transition:_2a5.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(_2ae){
_2ae.effects[0].element.setStyle({height:"0px"});
_2ae.effects[0].element.show();
},afterFinishInternal:function(_2af){
_2af.effects[0].element.undoClipping();
_2af.effects[0].element.undoPositioned();
_2af.effects[0].element.setStyle(_2a6);
}},_2a5));
}});
};
Effect.Shrink=function(_2b0){
_2b0=$(_2b0);
var _2b1=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});
var _2b2={top:_2b0.style.top,left:_2b0.style.left,height:_2b0.style.height,width:_2b0.style.width,opacity:_2b0.getInlineOpacity()};
var dims=_2b0.getDimensions();
var _2b4,_2b5;
switch(_2b1.direction){
case "top-left":
_2b4=_2b5=0;
break;
case "top-right":
_2b4=dims.width;
_2b5=0;
break;
case "bottom-left":
_2b4=0;
_2b5=dims.height;
break;
case "bottom-right":
_2b4=dims.width;
_2b5=dims.height;
break;
case "center":
_2b4=dims.width/2;
_2b5=dims.height/2;
break;
}
return new Effect.Parallel([new Effect.Opacity(_2b0,{sync:true,to:0,from:1,transition:_2b1.opacityTransition}),new Effect.Scale(_2b0,window.opera?1:0,{sync:true,transition:_2b1.scaleTransition,restoreAfterFinish:true}),new Effect.Move(_2b0,{x:_2b4,y:_2b5,sync:true,transition:_2b1.moveTransition})],Object.extend({beforeStartInternal:function(_2b6){
_2b6.effects[0].element.makePositioned();
_2b6.effects[0].element.makeClipping();
},afterFinishInternal:function(_2b7){
_2b7.effects[0].element.hide();
_2b7.effects[0].element.undoClipping();
_2b7.effects[0].element.undoPositioned();
_2b7.effects[0].element.setStyle(_2b2);
}},_2b1));
};
Effect.Pulsate=function(_2b8){
_2b8=$(_2b8);
var _2b9=arguments[1]||{};
var _2ba=_2b8.getInlineOpacity();
var _2bb=_2b9.transition||Effect.Transitions.sinoidal;
var _2bc=function(pos){
return _2bb(1-Effect.Transitions.pulse(pos));
};
_2bc.bind(_2bb);
return new Effect.Opacity(_2b8,Object.extend(Object.extend({duration:3,from:0,afterFinishInternal:function(_2be){
_2be.element.setStyle({opacity:_2ba});
}},_2b9),{transition:_2bc}));
};
Effect.Fold=function(_2bf){
_2bf=$(_2bf);
var _2c0={top:_2bf.style.top,left:_2bf.style.left,width:_2bf.style.width,height:_2bf.style.height};
Element.makeClipping(_2bf);
return new Effect.Scale(_2bf,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(_2c1){
new Effect.Scale(_2bf,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(_2c2){
_2c2.element.hide();
_2c2.element.undoClipping();
_2c2.element.setStyle(_2c0);
}});
}},arguments[1]||{}));
};
["setOpacity","getOpacity","getInlineOpacity","forceRerendering","setContentZoom","collectTextNodes","collectTextNodesIgnoreClass","childrenWithClassName"].each(function(f){
Element.Methods[f]=Element[f];
});
Element.Methods.visualEffect=function(_2c4,_2c5,_2c6){
s=_2c5.gsub(/_/,"-").camelize();
effect_class=s.charAt(0).toUpperCase()+s.substring(1);
new Effect[effect_class](_2c4,_2c6);
return $(_2c4);
};
Element.addMethods();
function CCallWrapper(_2c7,_2c8,_2c9,_2ca,_2cb,_2cc,_2cd,_2ce,_2cf,_2d0,_2d1,_2d2,_2d3){
this.mId="CCallWrapper_"+(CCallWrapper.mCounter++);
this.mObjectReference=_2c7;
this.mDelay=_2c8;
this.mTimerId=0;
this.mMethodName=_2c9;
this.mArgument0=_2ca;
this.mArgument1=_2cb;
this.mArgument2=_2cc;
this.mArgument3=_2cd;
this.mArgument4=_2ce;
this.mArgument5=_2cf;
this.mArgument6=_2d0;
this.mArgument7=_2d1;
this.mArgument8=_2d2;
this.mArgument9=_2d3;
CCallWrapper.mPendingCalls[this.mId]=this;
}
CCallWrapper.prototype.execute=function(){
this.mObjectReference[this.mMethodName](this.mArgument0,this.mArgument1,this.mArgument2,this.mArgument3,this.mArgument4,this.mArgument5,this.mArgument6,this.mArgument7,this.mArgument8,this.mArgument9);
delete CCallWrapper.mPendingCalls[this.mId];
};
CCallWrapper.prototype.cancel=function(){
clearTimeout(this.mTimerId);
delete CCallWrapper.mPendingCalls[this.mId];
};
CCallWrapper.asyncExecute=function(_2d4){
CCallWrapper.mPendingCalls[_2d4.mId].mTimerId=setTimeout("CCallWrapper.mPendingCalls[\""+_2d4.mId+"\"].execute()",_2d4.mDelay);
};
CCallWrapper.mCounter=0;
CCallWrapper.mPendingCalls={};
function SycuseHookObjEvent(_2d5,_2d6){
return (function(evt){
if(!evt){
evt=window.event;
}
return _2d5[_2d6](evt,this);
});
}
function SycuseJSEvents(evt){
this.event=evt;
this.haltEvent=function(){
if(window.event){
window.event.cancelBubble=true;
window.event.returnValue=false;
}
if(this.event){
if(this.event.stopPropagation){
this.event.stopPropagation();
}
if(this.event.preventDefault){
this.event.preventDefault();
}
}
};
this.getTarget=function(){
if(window.event&&window.event.srcElement){
return window.event.srcElement;
}
if(this.event.target){
return this.event.target;
}
return null;
};
}
function SycuseAddEvent(obj,_2da,_2db,_2dc){
if(obj.addEventListener){
obj.addEventListener(_2da,_2db,_2dc);
return true;
}else{
if(obj.attachEvent){
var r=obj.attachEvent("on"+_2da,_2db);
return r;
}else{
return false;
}
}
}
function Sycuseis_all_ws(nod){
return !(/[^\t\n\r ]/.test(nod.data));
}
function Sycuseis_ignorable(nod){
return (nod.nodeType==8)||((nod.nodeType==3)&&Sycuseis_all_ws(nod));
}
function SycuseFirstChild(par){
var res=par.firstChild;
while(res){
if(!Sycuseis_ignorable(res)){
return res;
}
res=res.nextSibling;
}
return null;
}
function SycuseWindowSize(){
var x,y;
if(window.innerHeight){
x=window.innerWidth;
y=window.innerHeight;
}else{
if(document.documentElement&&document.documentElement.clientHeight){
x=document.documentElement.clientWidth;
y=document.documentElement.clientHeight;
}else{
if(document.body){
x=document.body.clientWidth;
y=document.body.clientHeight;
}
}
}
this.x=x;
this.y=y;
}
SycuseWindowSize.prototype.getX=function(){
return this.x;
};
SycuseWindowSize.prototype.getY=function(){
return this.y;
};
function SycuseAttachConfirm(_2e4){
var elem;
if(elem=$(_2e4)){
elem.onclick=SycuseHookObjEvent(this,"validate");
}
}
SycuseAttachConfirm.prototype.validate=function(evt,elem){
return confirm("Are you sure you want to delete this item?");
};
function SycuseBind(what,obj,_2ea,_2eb){
if(_2eb==undefined){
_2eb="click";
}
var _2ec=_2ea.bindAsEventListener(obj);
Event.observe(what,_2eb,_2ec,false);
return _2ec;
}
function SycuseUnbind(what,_2ee,_2ef){
if(_2ef==undefined){
_2ef="click";
}
Event.stopObserving(what,_2ef,_2ee);
}
InputFirstFocusBehaviour=function(elem){
this.init(elem);
this.cleared=false;
};
InputFirstFocusBehaviour.prototype={init:function(elem){
this.elem=$(elem);
if(this.elem){
SycuseBind(this.elem,this,this.onFocus,"focus");
}
},onFocus:function(){
if(!this.cleared){
this.elem.value="";
this.elem.style.color="#000";
this.cleared=true;
}
}};
function SycuseSetValue(_2f2,_2f3){
for(var i=0;i<_2f2.options.length;i++){
if(_2f2.options[i].value==_2f3){
_2f2.selectedIndex=i;
return true;
}
}
}
function SycuseValJumpTo(_2f5){
if(this.elem=document.getElementById(_2f5)){
this.scrollto(this.elem);
if(this.elem.select){
this.elem.select();
}
this.elem.focus();
}else{
if(elem=document.getElementById("SFc_"+_2f5)){
this.scrollto(elem);
}
}
}
SycuseValJumpTo.prototype.scrollto=function(elem){
Position.prepare();
var loc=Position.cumulativeOffset(elem);
ss=new SycuseWindowSize();
loc[1]=loc[1]-(ss.getY()/2);
if(loc[1]>0){
window.scrollTo(0,loc[1]);
}
};
function ImagePreloader(_2f8){
this.nLoaded=0;
this.nProcessed=0;
this.aImages=new Array;
this.nImages=_2f8.length;
for(var i=0;i<_2f8.length;i++){
this.preload(_2f8[i]);
}
}
ImagePreloader.prototype.preload=function(_2fa){
var _2fb=new Image;
this.aImages.push(_2fb);
_2fb.onload=ImagePreloader.prototype.onload;
_2fb.onerror=ImagePreloader.prototype.onerror;
_2fb.onabort=ImagePreloader.prototype.onabort;
_2fb.oImagePreloader=this;
_2fb.bLoaded=false;
_2fb.src=_2fa;
};
ImagePreloader.prototype.onComplete=function(){
this.nProcessed++;
if(this.nProcessed==this.nImages){
}
};
ImagePreloader.prototype.onload=function(){
this.bLoaded=true;
this.oImagePreloader.nLoaded++;
this.oImagePreloader.onComplete();
};
ImagePreloader.prototype.onerror=function(){
this.bError=true;
this.oImagePreloader.onComplete();
};
ImagePreloader.prototype.onabort=function(){
this.bAbort=true;
this.oImagePreloader.onComplete();
};
function SycuseFlyOut(_2fc,_2fd,_2fe,_2ff,_300){
this.closeonclick=true;
this.centered=false;
this.swidth=(_2ff)?_2ff:250;
this.sheight=(_300)?_300:200;
this.container=_2fc;
var _301=document.createElement("div");
_301.className="flyoutholder";
_301.style.display="none";
_301.style.position="absolute";
_301.style.backgroundColor="#eee";
this.shadow=_301;
var _302=document.createElement("h2");
this.closeButton=document.createElement("img");
this.closeButton.title="Close";
this.closeButton.style.styleFloat=this.closeButton.style.cssFloat="right";
this.closeButton.style.cursor="pointer";
this.closeButton.src="/js/flyout-close.gif";
_302.appendChild(this.closeButton);
_302.appendChild(document.createTextNode(_2fe));
_301.appendChild(_302);
this.elem=document.createElement("div");
this.elem.className="flyoutinner";
this.elem.style.display="block";
this.elem.style.position="absolute";
this.elem.style.margin="3px 3px 3px 3px";
this.elem.style.backgroundColor="#fff";
_301.appendChild(this.elem);
this.canvas=this.elem;
this.visible=false;
this.contentLoaded=false;
_2fc.appendChild(_301);
if(_2fd){
Event.observe(_2fd,"click",this.ToggleShow.bindAsEventListener(this),false);
_2fd.style.display="inline";
}
Event.observe(_301,"keyup",this.onKeyUp.bindAsEventListener(this),false);
}
SycuseFlyOut.prototype.onKeyUp=function(evt){
Event.stop(evt);
if(evt.keyCode==Event.KEY_ESC){
return this.hide();
}
if(this.onkeyup){
this.onkeyup(evt);
}
};
SycuseFlyOut.prototype.ToggleShow=function(evt){
if(this.visible){
var _305=this;
Effect.Fade(this.realshadow,{duration:0.1,afterFinish:function(){
_305.killShadow();
}});
Effect.Fade(this.shadow,{duration:0.1});
this.visible=false;
}else{
var top=Event.pointerY(evt)+15;
var left=Event.pointerX(evt);
this.show(top,left);
}
Event.stop(evt);
return true;
};
SycuseFlyOut.prototype.loadContent=function(){
Event.observe(this.closeButton,"click",this.hide.bindAsEventListener(this),false);
this.contentLoaded=true;
if(this.onLoadContent){
this.onLoadContent();
}
var _308=this.canvas.getElementsByTagName("input");
for(var x=0;x<_308.length;x++){
if(!this.lastfocus){
this.lastfocus=_308[x];
}
_308[x].onfocus=this.rememberFocus.bindAsEventListener(this);
}
};
SycuseFlyOut.prototype.clearContent=function(){
this.hide();
this.contentLoaded=false;
this.canvas.innerHTML="";
};
SycuseFlyOut.prototype.updateContent=function(html){
this.canvas.innerHTML=html;
};
SycuseFlyOut.prototype.rememberFocus=function(evt){
this.lastfocus=Event.element(evt);
};
SycuseFlyOut.prototype.show=function(top,left){
this.visible=true;
if(!this.contentLoaded){
this.loadContent();
}
if(this.onShow){
this.onShow();
}
if(this.closeonclick){
Event.observe(document,"click",this.onCapturedClick.bindAsEventListener(this),false);
}
cwidth=this.swidth;
cheight=this.sheight;
if(this.centered){
ws=new SycuseWindowSize;
left=Math.max(0,(ws.getX()-cwidth)/2);
top=Math.max(0,(ws.getY()-cheight)/2);
}
if(!Position.within(document.body,left+cwidth,10)){
left=left-cwidth;
}
this.shadow.style.top=top+"px";
this.shadow.style.left=left+"px";
this.shadow.style.width=cwidth+"px";
this.shadow.style.height=(cheight+20)+"px";
this.elem.style.width=(cwidth-10)+"px";
this.elem.style.height=(cheight-10)+"px";
realshadow=this.shadow.cloneNode(false);
realshadow.style.backgroundColor="#bbb";
realshadow.style.border="none";
realshadow.style.padding="0";
realshadow.style.margin="0";
realshadow.style.top=top+5+"px";
realshadow.style.left=left+5+"px";
realshadow.style.zIndex=999;
this.realshadow=realshadow;
this.container.appendChild(realshadow);
var _30e=this;
Effect.Appear(this.shadow,{duration:0.2,afterFinish:function(){
if(_30e.lastfocus){
_30e.lastfocus.focus();
_30e.lastfocus.select();
}
}});
Effect.Appear(realshadow,{duration:0.2,to:0.7});
};
SycuseFlyOut.prototype.onCapturedClick=function(evt){
var elem=Event.element(evt);
while(elem=elem.parentNode){
if(elem==this.shadow){
return true;
}
}
this.hide();
};
SycuseFlyOut.prototype.hide=function(evt){
if(this.closeonclick){
Event.stopObserving(document,"click",this.hide.bindAsEventListener(this),false);
}
this.killShadow();
this.shadow.style.display="none";
this.visible=false;
};
SycuseFlyOut.prototype.destroy=function(){
this.killShadow();
this.shadow.parentNode.removeChild(this.shadow);
};
SycuseFlyOut.prototype.killShadow=function(){
if(this.realshadow){
this.container.removeChild(this.realshadow);
this.realshadow=null;
}
};
function showAdImg(){
ws=new SycuseWindowSize;
if($("adimg")&&ws.getX()>950){
$("adimg").style.display="inline";
}
}
var crsearch;
var tagger;
function CycleRoutes(_312){
this.lng=0;
this.lat=15;
this.zoom=2;
this.plotting=false;
var _313;
this.editable=false;
this.saveInProgress=false;
this.pinger=null;
this.mode="new";
this.ignoreMouseMovements=false;
this.visible=0;
this.oneroutemode=true;
this.timesince=0;
var _314;
if($("waypoints")){
$("waypoints").style.display="none";
}
if(_312){
if(_312.embed){
this.showEmbeddedMapRoute(_312);
}else{
this.showMapRoute(_312);
this.googlead=new CRGoogleAd(this.map);
}
}
}
CycleRoutes.prototype.showEmbeddedMapRoute=function(_315){
this.embed=true;
this.bind(window,this.resizeToFit,"resize");
this.resizeToFit();
if(GBrowserIsCompatible()){
_mSvgEnabled=true;
_mSvgForced=true;
this.map=new GMap2(document.getElementById("map"),{draggableCursor:"crosshair",logoPassive:true});
this.map.addControl(new GSmallZoomControl(),new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(1,1)));
this.map.addControl(new GHierarchicalMapTypeControl(),new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(21,0)));
if(this.map.va){
var _316=this.map.va[1];
if(_316){
var pos=new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(1,1));
pos.apply(_316.element);
}
}
this.cPath=new CRPath(this.map);
this.status=new CRStatus(this.cPath,this.map);
this.cPath.status=this.status;
this.map.setCenter(new GLatLng(this.lat,this.lng),this.zoom);
this.loadExistingRoute(_315);
GEvent.bind(this.map,"movestart",this,this.onMapMoveStart);
GEvent.bind(this.map,"moveend",this,this.onMapMoveEnd);
this.doWatchMouse();
GEvent.bind(this.map,"mouseout",this,this.onMapMouseOut);
}
};
CycleRoutes.prototype.getUserId=function(){
return 8112;
};
CycleRoutes.prototype.showMapRoute=function(_318){
this.embed=false;
this.bind(window,this.resizeToFit,"resize");
this.resizeToFit();
if(GBrowserIsCompatible()){
_mSvgEnabled=true;
_mSvgForced=true;
this.map=new GMap2(document.getElementById("map"),{draggableCursor:"crosshair"});
this.map.addControl(new GLargeMapControl(),new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(4,30)));
this.map.addControl(new GHierarchicalMapTypeControl());
this.map.addMapType(G_PHYSICAL_MAP);
this.map.enableScrollWheelZoom();
new GKeyboardHandler(this.map);
this.bind(document,this.onKeyUp,"keyup");
this.cPath=new CRPath(this.map);
this.status=new CRStatus(this.cPath,this.map);
this.cPath.status=this.status;
this.waypoints=new CRWaypointManager(_318,this);
crsearch=new CRSearch(this);
this.map.setCenter(new GLatLng(this.lat,this.lng),this.zoom);
if(_318.isfave!==undefined){
this.faves=new CRFaves(_318);
}
if(_318.mode=="edit"){
this.loadExistingRoute(_318);
}else{
this.editable=true;
if(_318.cityid){
this.setMapType(readCookie("m"));
this.status.setLocale(_318.cityid,_318.locale);
this.map.setCenter(new GLatLng(_318.lat,_318.lng),12);
}
if(_318.pathData){
this.loadImportedPoints(_318);
}
this.status.showCalipers();
}
this.cPath.editable=this.editable;
this.cPath.getelevations=_318.getelevations;
if(this.editable){
tagger=new CRTagging;
if(this.mode=="edit"){
if(!_318.cityid){
var _319="Locate";
}else{
var _319="Draw";
}
this.status.selectPoint(0);
}else{
var _319="Locate";
if(/Safari/.test(navigator.userAgent)){
alert("Some Safari versions have trouble saving routes. Please test that you can save your route before you spend a long time working on it!");
}
}
this.setupDrawingButtons();
}else{
rater=new CRRatings(_318);
var _319="Explore";
}
var _31a=(this.mode=="new"&&_318.firsttimer==1);
this.maptabs=new CRMapTabs(this.status,this.map,this.editable,_31a);
this.maptabs.selectTab(_319);
this.sharemenu=new SycuseSocialBookmark("sharemenu",_318.visible==1?1:0);
this.setupCommentsLink(_318.visible,_318.pathid);
if(this.editable){
this.pinger=new PeriodicalExecuter(this.pingServer.bindAsEventListener(this),300);
this.routesettings=new RouteSettings(this);
}
if(this.oneroutemode){
GEvent.bind(this.map,"click",this,this.onMapClick);
GEvent.bind(this.map,"movestart",this,this.onMapMoveStart);
GEvent.bind(this.map,"moveend",this,this.onMapMoveEnd);
this.doWatchMouse();
GEvent.bind(this.map,"mouseout",this,this.onMapMouseOut);
}
var _31b=this;
GEvent.addListener(this.map,"maptypechanged",function(){
createCookie("m",_31b.map.getCurrentMapType().getUrlArg(),365);
});
this.bind("btnElevation",this.onElevationClick);
this.bind("btnPFirst",this.onPointNavClick);
this.bind("btnPPrev",this.onPointNavClick);
this.bind("btnPNext",this.onPointNavClick);
this.bind("btnPLast",this.onPointNavClick);
if($("btnStartTour")){
this.bind("btnStartTour",this.onPointNavClick);
}
this.bind("btnResetView",this.onResetClick);
this.foNearby=new SycuseFlyOut(document.body,$("btnNearby"),"Nearby Routes",370,180);
this.foNearby.onLoadContent=this.getNearbyRoutes.bindAsEventListener(this);
}
};
CycleRoutes.prototype.setupCommentsLink=function(_31c,_31d){
var link=$("btnCommentOnRoute");
if(!_31c||link.href=="#"){
this.commentstrigger=function(){
alert("You must make this route publically visible before commenting on it.");
};
Event.observe(link,"click",this.commentstrigger,false);
}else{
if(_31c&&link.href=="javascript://"){
link.href="/forum/post/category/3/?routeid="+_31d;
}
}
};
CycleRoutes.prototype.updateCommentsLink=function(_31f){
if(this.commentstrigger){
var link=$("btnCommentOnRoute");
Event.stopObserving(link,"click",this.commentstrigger,false);
this.commentstrigger=null;
link.href="/forum/post/category/3/?routeid="+_31f;
}
};
CycleRoutes.prototype.setupDrawingButtons=function(){
this.bind("btnSave",this.onSaveClick);
this.bind("btnSaveWork",this.onSaveClick);
this.bind("btnInsertBefore",this.onInsertBeforeClick);
this.bind("btnInsertAfter",this.onInsertAfterClick);
this.bind("btnDelPoint",this.onDeletePointClick);
this.bind("btnDeleteAll",this.onDeleteAllClick);
this.bind("btnAddWPT_photo",this.onAddWaypoint);
this.bind("locator",this.onCitySearch,"submit");
this.drawbuttons=new CRButtonBar;
this.drawbuttons.isNotDrawing();
this.bind("btnStopDraw",this.onStopDrawingClick);
this.bind("btnStartDraw",this.onStartDrawingClick);
var self=this;
this.bind("btnStartDrawing",function(){
self.maptabs.selectTab("Draw");
this.onStartDrawingClick();
});
this.bind("btnEndDrawing",function(){
this.onStopDrawingClick();
self.maptabs.selectTab("Describe");
});
};
CycleRoutes.prototype.resizeToFit=function(){
var _322=new SycuseWindowSize;
var _323=_322.getY();
if(!this.embed){
_323-=75;
}
$("map").style.height=_323+"px";
if($("adimg")&&_322.getX()<=950){
$("adimg").style.display="none";
}
if(this.embed&&this.cPath){
this.initialview=null;
var cw=new CCallWrapper(this,150,"onResetClick");
CCallWrapper.asyncExecute(cw);
}
};
CycleRoutes.prototype.selectCity=function(_325,lng,lat,_328){
this.status.setLocale(_325,_328);
this.status.refreshTitle();
createCookie("city",_325,365);
if(this.mode=="new"){
if(this.map.getZoom()!=12){
this.map.setZoom(12);
}
this.map.panTo(new GLatLng(lat,lng));
}
};
CycleRoutes.prototype.onCityChange=function(){
eval("var geodata = "+$F("selCity"));
this.map.setCenter(new GLatLng(geodata.lat,geodata.lng),12);
};
CycleRoutes.prototype.onCitySearch=function(){
crsearch.execute($F("citysearch"));
};
CycleRoutes.prototype.onPointNavClick=function(evt){
this.status.onPointNavClick(evt);
};
CycleRoutes.prototype.onInsertBeforeClick=function(){
this.cPath.onInsertBeforeClick();
};
CycleRoutes.prototype.onInsertAfterClick=function(){
this.cPath.onInsertAfterClick();
};
CycleRoutes.prototype.onElevationClick=function(){
if($("elevationFO")){
this.bg.closeGraph();
delete this.bg;
return;
}
this.bg=new BikelyEGraph();
this.bg.showGraph(this.cPath);
};
CycleRoutes.prototype.onResetClick=function(){
if(this.initialview){
this.map.setCenter(this.initialview.center,this.initialview.zoom);
this.cPath.softRedraw();
}else{
var _32a=this.cPath.getPoints();
var p2=new Array;
for(x=0;x<_32a.length;x++){
p2.push({"lat":_32a[x].lat(),"lng":_32a[x].lng()});
}
this.zoomOutShowAll(p2);
}
};
CycleRoutes.prototype.onAddWaypoint=function(e,k){
var elem=Event.element(e).parentNode;
var _32f=elem.id.substring(10,elem.id.length);
this.waypoints.createNew(_32f);
};
CycleRoutes.prototype.purgeMouseEvent=function(){
if(this.callwrapper){
this.callwrapper.cancel();
delete this.callwrapper;
}
};
CycleRoutes.prototype.onMapMouseOut=function(){
this.purgeMouseEvent();
};
CycleRoutes.prototype.onMapMouseMove=function(_330){
if(this.ignoreMouseMovements){
return;
}
var _331=new Date();
if(_331.getTime()-this.timesince>450){
this.purgeMouseEvent();
this.callwrapper=new CCallWrapper(this,150,"showNearbyPoints",_330);
CCallWrapper.asyncExecute(this.callwrapper);
}
};
CycleRoutes.prototype.showNearbyPoints=function(_332){
var _333=new Date();
if(_333.getTime()-this.timesince>450){
var _334=this.map.fromLatLngToDivPixel(_332);
this.cPath.showNearbyPoints(_334,_332);
}
};
CycleRoutes.prototype.overlayNearbyRoute=function(_335){
if(this.secondpath){
this.secondpath.hide();
this.secondpath=null;
}
this.secondpath=new CRPath(this.map);
this.secondpath.linecolor="#990099";
this.secondpath.loadPoints(_335);
this.secondpath.show();
};
CycleRoutes.prototype.setMapType=function(type){
switch(type){
case "k":
this.map.setMapType(G_SATELLITE_MAP);
break;
case "h":
this.map.setMapType(G_HYBRID_MAP);
break;
case "p":
this.map.setMapType(G_PHYSICAL_MAP);
break;
default:
this.map.setMapType(G_NORMAL_MAP);
break;
}
};
CycleRoutes.prototype.loadExistingRoute=function(_337){
this.mode="edit";
this.setMapType(_337.maptype);
this.map.setCenter(new GLatLng(_337.pathData[0].lat,_337.pathData[0].lng),this.zoom);
this.cPath.loadPoints(_337);
this.status.loadMeta(_337);
this.visible=_337.visible;
this.zoomOutShowAll(_337.pathData);
if(_337.editable){
this.editable=true;
}
if(!_337.editable||_337.cityid){
this.status.selectPoint(0);
}
};
CycleRoutes.prototype.loadImportedPoints=function(_338){
_338.editable=true;
this.mode="import";
this.cPath.loadPoints(_338);
this.status.loadMeta(_338);
this.zoomOutShowAll(_338.pathData);
this.status.selectPoint(0);
};
CycleRoutes.prototype.getNearbyRoutes=function(){
this.foNearby.canvas.innerHTML="<p>Searching...</p>";
var cp=new CRProximity(this);
var _33a=this.map.getBounds();
var ne=_33a.getNorthEast();
var sw=_33a.getSouthWest();
cp.searchRoutes([{"lat":ne.lat(),"lng":ne.lng()},{"lat":sw.lat(),"lng":sw.lng()}],this.foNearby.canvas);
};
CycleRoutes.prototype.zoomOutShowAll=function(_33d){
var _33e=latmax=_33d[0].lat;
var _33f=lngmax=_33d[0].lng;
for(var x=0;x<_33d.length;x++){
_33e=Math.min(_33e,_33d[x].lat);
latmax=Math.max(latmax,_33d[x].lat);
_33f=Math.min(_33f,_33d[x].lng);
lngmax=Math.max(lngmax,_33d[x].lng);
}
var _341=new GLatLngBounds(new GLatLng(_33e,_33f),new GLatLng(latmax,lngmax));
var zoom=this.map.getBoundsZoomLevel(_341);
var _343=new GLatLng(((_33e+latmax)/2),((_33f+lngmax)/2));
this.initialview={"center":_343,"zoom":zoom};
this.map.setCenter(this.initialview.center,this.initialview.zoom);
this.cPath.redraw();
};
CycleRoutes.prototype.onKeyUp=function(evt){
if(evt.altKey){
switch(String.fromCharCode(evt.keyCode)){
case "C":
if(this.plotting){
this.onStopDrawingClick();
}else{
this.maptabs.selectTab("Draw");
this.onStartDrawingClick();
}
break;
case "S":
this.onSaveClick();
break;
case "X":
this.onDeletePointClick();
break;
}
}
};
CycleRoutes.prototype.onMapClick=function(_345,_346){
if(_345||!this.editable){
return;
}
this.cPath.deselectPoint();
$("txtLng").value=_346.lat();
$("txtLat").value=_346.lng();
$("txtZoom").value=this.map.getZoom();
if(!this.plotting){
return this.status.selectPoint(null);
}
this.dontWatchMouse();
if($("chkFollowTheRoad").checked){
this.followTheRoad(_346);
}
var _347=this.cPath.addPoint(_346);
this.initialview=null;
this.status.selectPoint(_347);
this.cPath.redraw();
this.cPath.selectPoint(_346,"create");
this.doWatchMouse();
};
CycleRoutes.prototype.onMapMoveStart=function(){
this.dontWatchMouse();
this.purgeMouseEvent();
if(this.foNearby){
this.foNearby.clearContent();
}
};
CycleRoutes.prototype.onMapMoveEnd=function(){
this.doWatchMouse();
this.cPath.softRedraw();
if(this.secondpath){
this.secondpath.softRedraw();
}
};
CycleRoutes.prototype.dontWatchMouse=function(){
GEvent.removeListener(this.handleMouseMove);
this.ignoreMouseMovements=true;
};
CycleRoutes.prototype.doWatchMouse=function(){
this.handleMouseMove=GEvent.bind(this.map,"mousemove",this,this.onMapMouseMove);
this.ignoreMouseMovements=false;
};
CycleRoutes.prototype.onStartDrawingClick=function(){
$("map").style.cursor="crosshair";
this.plotting=true;
this.drawbuttons.isDrawing();
this.selectLastPoint();
};
CycleRoutes.prototype.selectLastPoint=function(_348){
if(_348===undefined){
_348=true;
}
var len=this.cPath.length();
if(len>0){
this.status.selectPoint(len-1,_348);
}
};
CycleRoutes.prototype.onStopDrawingClick=function(){
this.plotting=false;
$("map").style.cursor="";
this.status.selectPoint(null);
this.drawbuttons.isNotDrawing();
};
CycleRoutes.prototype.onDeletePointClick=function(){
if(this.status.currentPoint===null){
return alert("You need to select the point you wish to delete by clicking on it.");
}
this.cPath.deleteCurrentPoint();
this.cPath.redraw();
};
CycleRoutes.prototype.onDeleteAllClick=function(){
if(!confirm("Delete all points in this route?")){
return;
}
this.cPath.deleteAllPoints();
this.cPath.redraw();
};
CycleRoutes.prototype.onClearPathClick=function(){
this.cPath.hide();
this.cPath.clear();
};
CycleRoutes.prototype.onSaveClick=function(){
if(this.saveInProgress==true){
return;
}
if(this.routesettings.visible&&$("routename").value.length<5){
return alert("You must provide a name of at least 5 characters before making this route public.");
}
this.saveInProgress=true;
$("savemsg").style.display="none";
CRShowProgress.start("saveindicator");
this.status.saveChanges();
var _34a=new CRSaver(this.cPath,this.status,this.map,this);
_34a.saveRoute();
};
CycleRoutes.prototype.onSaveDone=function(){
this.saveInProgress=false;
CRShowProgress.stop("saveindicator");
};
CycleRoutes.prototype.onSaveSuccess=function(_34b){
var elem=$("savemsg");
elem.style.display="block";
elem.style.backgroundColor="#ffffff";
var hl=new Effect.Highlight(elem,{endcolor:"#990000",afterFinish:function(){
elem.style.backgroundColor="#990000";
setTimeout(function(){
elem.style.display="none";
},2500);
}});
if(_34b.url){
this.sharemenu.applyTo("sharemenu",1,_34b.url,$F("routename"));
this.updateCommentsLink(_34b.pathid);
}
};
CycleRoutes.prototype.bind=function(what,_34f,_350){
if(!_350){
var _350="click";
}
Event.observe(what,_350,_34f.bindAsEventListener(this),false);
};
CycleRoutes.prototype.pingServer=function(){
var _351=new Ajax.Request("/rpc/do/ping",{method:"get"});
};
CycleRoutes.prototype.enableFinder=function(_352){
this.editable=false;
this.oneroutemode=false;
this.showMapRoute(null);
if(_352.cityid){
this.setMapType(readCookie("m"));
this.status.setLocale(_352.cityid,_352.locale);
this.map.setCenter(new GLatLng(_352.lat,_352.lng),12);
}
this.finder=new CRFinder(this);
};
CycleRoutes.prototype.followTheRoad=function(_353){
if(this.FTRthread){
return;
}
var _354=this.cPath.getPoints();
if(_354.length>0){
var _355=_354[_354.length-1];
this.FTRthread=new GDirections();
GEvent.addListener(this.FTRthread,"load",GEvent.callbackArgs(this,this.onFTRPointsLoaded,this.FTRthread,_354.length));
GEvent.addListener(this.FTRthread,"error",function(){
$("chkFollowTheRoad").checked=false;
});
this.FTRthread.loadFromWaypoints([_355,_353],{preserveViewport:false,getPolyline:true,getSteps:false});
}
};
CycleRoutes.prototype.onFTRPointsLoaded=function(pnts,_357){
var _358=pnts.getPolyline();
var len=_358.getVertexCount();
var _35a=this.cPath.getPointByIdx(_357);
for(var x=1;x<len-1;x++){
var step=_358.getVertex(x);
if(step.distanceFrom(_35a)>35){
this.cPath.addPointAfterIndex(step,_357);
_357++;
_35a=step;
}
}
this.cPath.redraw();
this.selectLastPoint(false);
delete this.FTRthread;
};
function createCookie(name,_35e,days){
if(days){
var date=new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var _361="; expires="+date.toGMTString();
}else{
var _361="";
}
document.cookie=name+"="+_35e+_361+"; path=/";
}
function readCookie(name){
var _363=name+"=";
var ca=document.cookie.split(";");
for(var i=0;i<ca.length;i++){
var c=ca[i];
while(c.charAt(0)==" "){
c=c.substring(1,c.length);
}
if(c.indexOf(_363)==0){
return c.substring(_363.length,c.length);
}
}
return null;
}
function eraseCookie(name){
createCookie(name,"",-1);
}
function RouteSettings(_368){
this.visible=_368.visible;
this.cycleroutes=_368;
this.init();
this.updateUI();
}
RouteSettings.prototype.init=function(){
var _369=this;
Event.observe($("rs_vis"),"click",function(){
_369.visible=1;
},false);
Event.observe($("rs_invis"),"click",function(){
_369.visible=0;
},false);
};
RouteSettings.prototype.updateUI=function(){
if(this.visible){
$("rs_vis").checked=true;
}else{
$("rs_invis").checked=true;
}
};
function CRPath(map){
this.aPath=new Array;
this.markers=new Array;
this.map=map;
this.status=null;
this.lastCursor="";
this.pathid=null;
this.hilightmarker=null;
this.editable=false;
this.showeachpoint=false;
this.draggingmarker=false;
this.linecolor="#CC00FF";
this.idxqueue=0;
this.equeue=new Array;
}
CRPath.prototype.loadPoints=function(_36b){
for(var x=0;x<_36b.pathData.length;x++){
var pnt=new GLatLng(_36b.pathData[x].lat,_36b.pathData[x].lng);
if(_36b.pathData[x].e==undefined){
pnt.bkElev=0;
}else{
pnt.bkElev=_36b.pathData[x].e;
}
this.addPoint(pnt);
}
if(_36b.pathid){
this.pathid=_36b.pathid;
}
};
CRPath.prototype.addPoint=function(_36e){
this.lastpoint=_36e;
_36e.origPathIndex=this.aPath.length;
if(_36e.bkElev==undefined){
this.queueElevationRequest(_36e);
}
this.aPath.push(_36e);
return this.aPath.length-1;
};
CRPath.prototype.onInsertBeforeClick=function(_36f){
if(_36f===undefined){
_36f=this.status.currentPoint;
}
if(_36f>(this.aPath.length-1)){
return alert("You're at the last point, just keep plotting points on the map!");
}
this.deselectPoint();
this.clearPoints();
$("suburb").value="";
$("notes").value="";
if(_36f<1){
var p1=this.aPath[_36f+1];
var _371=this.aPath[_36f];
var _372=new GLatLng(2*_371.lat()-p1.lat(),2*_371.lng()-p1.lng());
}else{
var p1=this.aPath[_36f];
var p2=this.aPath[_36f-1];
var _372=new GLatLng((p1.lat()+p2.lat())/2,(p1.lng()+p2.lng())/2);
}
_372.origPathIndex=_36f;
this.aPath.splice(_36f,0,_372);
this.status.insertPointBefore(_36f);
this.redraw();
this.status.selectPoint(_36f,"create");
this.selectPoint(this.aPath[_36f]);
};
CRPath.prototype.addPointAfterIndex=function(_374,idx){
this.clearPoints();
this.deselectPoint();
this.aPath[idx].origPathIndex++;
_374.origPathIndex=idx;
this.aPath.splice(idx,0,_374);
this.status.insertPointBefore(idx);
if(this.getelevations){
this.queueElevationRequest(_374);
}
};
CRPath.prototype.onInsertAfterClick=function(){
this.onInsertBeforeClick(this.status.currentPoint+1);
};
CRPath.prototype.getPointByIdx=function(idx){
return this.aPath[idx];
};
CRPath.prototype.deleteCurrentPoint=function(){
this.deselectPoint();
var _377=this.status.currentPoint;
this.aPath.splice(_377,1);
this.status.deleteCurrentPoint();
this.clearPoints();
var _378=this.aPath.length;
if(this.status.currentPoint>=_378){
this.status.currentPoint=0;
}
if(_378>0){
this.selectPoint(this.aPath[this.status.currentPoint]);
this.status.selectPoint(this.status.currentPoint);
}else{
this.status.selectPoint(null);
}
};
CRPath.prototype.deleteAllPoints=function(){
this.deselectPoint();
this.clearPoints();
this.aPath=new Array;
this.status.deleteAllPoints();
this.status.selectPoint(null);
};
CRPath.prototype.showPointsInViewport=function(){
this.showeachpoint=true;
var _379=this.getPointsInViewport(this.aPath,true);
for(var x=0;x<_379.length;x++){
this.markPoint(_379[x].origPathIndex);
}
};
CRPath.prototype.markPoint=function(idx){
var icon=new GIcon();
if(this.status.hasMeta(idx)){
icon.image="/css/pointnotes.png";
icon.shadow="/css/pointnotes_s.png";
icon.iconSize=new GSize(12,33);
icon.shadowSize=new GSize(22,33);
icon.iconAnchor=new GPoint(7,31);
}else{
icon.image="http://labs.google.com/ridefinder/images/mm_20_red.png";
icon.shadow="http://labs.google.com/ridefinder/images/mm_20_shadow.png";
icon.iconSize=new GSize(12,20);
icon.shadowSize=new GSize(22,20);
icon.iconAnchor=new GPoint(7,20);
}
icon.dragCrossAnchor=new GPoint(7,7);
var _37d=this.aPath[idx];
var _37e=new GMarker(_37d,{"icon":icon,draggable:this.editable,bouncy:false,bounceGravity:3});
var _37f=this;
var _380=_37e;
GEvent.addListener(_37e,"click",function(){
_37f.onPointClick(_380);
});
this.makeMarkerDraggable(_380);
_37e.pathIndex=idx;
this.markers.push(_37e);
this.map.addOverlay(_37e);
};
CRPath.prototype.clearPoints=function(){
var pnt;
while(pnt=this.markers.pop()){
this.hideMarker(pnt);
}
};
CRPath.prototype.pixelDistance=function(_382,_383){
return Math.sqrt(Math.pow(_382.x-_383.x,2)+Math.pow(_382.y-_383.y,2));
};
CRPath.prototype.showNearbyPoints=function(_384,_385){
if(this.draggingmarker){
return;
}
var _386=this.getPointsNearMouse(_384,_385);
if(this.markers[0]&&_386[0]==this.markers[0].pathIndex){
return;
}
var _387=new Array;
var _388=new Array;
if(this.hilightmarker){
skipover=this.hilightmarker.pathIndex;
}else{
skipover=-1;
}
for(var x=0;x<this.markers.length;x++){
var idx=_386.indexOf(this.markers[x].pathIndex);
if(idx>-1){
_386.splice(idx,1);
_388.push(this.markers[x]);
}else{
_387.push(x);
}
}
for(var y=0;y<_387.length;y++){
x=_387[y];
this.hideMarker(this.markers[x]);
}
this.markers=new Array;
for(var x=0;x<_386.length;x++){
if(_386[x]!==undefined){
if(skipover!=_386[x]){
this.markPoint(_386[x]);
}
}
}
};
CRPath.prototype.hideMarker=function(_38c){
GEvent.clearInstanceListeners(_38c);
this.map.removeOverlay(_38c);
};
CRPath.prototype.clear=function(){
this.aPath=new Array;
};
CRPath.prototype.deselectPoint=function(){
if(this.hilightmarker){
this.hideMarker(this.hilightmarker);
delete this.hilightmarker;
}
this.map.closeInfoWindow();
this.status.saveChanges();
};
CRPath.prototype.selectPoint=function(_38d,mode){
if(mode==undefined){
mode="";
}
this.deselectPoint();
var icon=new GIcon();
if(mode=="create"){
icon.image="/dot.gif";
icon.iconSize=new GSize(8,8);
icon.iconAnchor=new GPoint(3,4);
icon.infoWindowAnchor=new GPoint(4,1);
}else{
icon.image="/css/dd-start.png";
icon.shadow="http://www.google.com/mapfiles/shadow50.png";
icon.shadowSize=new GSize(37,34);
icon.iconSize=new GSize(20,34);
icon.iconAnchor=new GPoint(9,34);
icon.infoWindowAnchor=new GPoint(9,1);
}
this.hilightmarker=new GMarker(_38d,{"icon":icon,draggable:this.editable,bouncy:false});
var _390=this;
var _391=this.hilightmarker;
_391.pathIndex=_38d.origPathIndex;
this.makeMarkerDraggable(_391);
this.map.addOverlay(_391);
};
CRPath.prototype.makeMarkerDraggable=function(_392){
var _393=this;
GEvent.addListener(_392,"dblclick",function(){
_393.map.setZoom(15);
_393.hilight(_392.pathIndex,_393.status.getMeta(_392.pathIndex));
});
if(this.editable){
GEvent.addListener(_392,"dragstart",function(){
_393.draggingmarker=true;
});
GEvent.addListener(_392,"dragend",function(){
_393.draggingmarker=false;
_393.updatePointInPath(_392);
});
}
};
CRPath.prototype.hilightNoInfoWindow=function(_394){
this.map.panTo(this.aPath[_394]);
this.selectPoint(this.aPath[_394]);
};
CRPath.prototype.hilight=function(_395,meta){
this.hilightNoInfoWindow(_395);
if((_395==(this.aPath.length-1))&&!meta.suburb.length){
meta.suburb="End Point";
}
if(!meta.suburb.length&&!meta.notes.length){
return this.map.closeInfoWindow();
}
var _397="<p>";
if(meta.suburb.length){
_397+="<strong>"+meta.suburb.escapeHTML()+"</strong><br />";
}
if(meta.notes.length){
_397+=meta.notes.escapeHTML();
}
_397+="</p>";
this.hilightmarker.openInfoWindowHtml(_397);
};
CRPath.prototype.show=function(_398){
if(this.aPath.length<2){
return;
}
if(!_398){
var _398=this.getPointsInViewport(this.aPath);
}
this.polyline=new GPolyline(_398,this.linecolor,4,0.7);
this.map.addOverlay(this.polyline);
};
CRPath.prototype.softRedraw=function(){
var _399=this.pointsShown;
var _39a=this.getPointsInViewport(this.aPath);
for(var x=0;x<this.pointsShown.length;x++){
if(_399.indexOf(this.pointsShown[x])==-1){
if(this.polyline){
this.hide();
}
this.show(_39a);
return;
}
}
this.pointsShown=_399;
};
CRPath.prototype.getPointsNearMouse=function(_39c,_39d){
var _39e=this.aPath;
var _39f=new Array;
var _3a0=-1;
var _3a1;
for(var x=0;x<_39e.length;x++){
if(!this.editable){
if(!this.status.hasMeta(x)){
continue;
}
}
var _3a3=_39d.distanceFrom(_39e[x]);
if(_3a0==-1||_3a3<_3a0){
_3a1=x;
_3a0=_3a3;
}
}
_39f.push(_3a1);
return _39f;
};
CRPath.prototype.getPointsInViewport=function(_3a4,_3a5){
var _3a6=new Array;
if(!_3a5){
var _3a5=false;
}
var _3a7=this.map.getBounds();
var ne=_3a7.getNorthEast();
var sw=_3a7.getSouthWest();
var _3aa=false;
if(!_3aa){
var _3ab=this.map.getSize();
var dist=Math.sqrt(_3ab.width*_3ab.width+_3ab.height*_3ab.height);
var ppm=dist/ne.distanceFrom(sw);
}
this.pointsShown=new Array;
var _3ae=new GBounds([this.map.fromLatLngToDivPixel(sw),this.map.fromLatLngToDivPixel(ne)]);
if(!_3a5){
var _3af=Math.round((_3ae.maxX-_3ae.minX)/2);
var _3b0=Math.round((_3ae.maxY-_3ae.minY)/2);
_3ae.extend(new GPoint(_3ae.minX-_3af,_3ae.minY-_3b0));
_3ae.extend(new GPoint(_3ae.maxX+_3af,_3ae.maxY+_3b0));
}
var _3b1=true;
for(var x=1;x<_3a4.length;x++){
var _3b3=new GBounds([this.map.fromLatLngToDivPixel(_3a4[x]),this.map.fromLatLngToDivPixel(_3a4[x-1])]);
if(this.doBoundsIntersect(_3ae,_3b3)&&(_3aa||this.notTooClose(_3a4[x],_3a6.last(),ppm))){
if(_3b1){
_3a4[x-1].origPathIndex=x-1;
_3a6.push(_3a4[x-1]);
this.pointsShown.push(x-1);
}
_3a4[x].origPathIndex=x;
_3a6.push(_3a4[x]);
this.pointsShown.push(x);
_3b1=false;
}else{
_3b1=true;
}
}
return _3a6;
};
CRPath.prototype.notTooClose=function(_3b4,_3b5,ppm){
if(!_3b5){
return true;
}
var _3b7=_3b4.distanceFrom(_3b5)*ppm;
if(_3b7>18){
return true;
}else{
return false;
}
};
CRPath.prototype.doBoundsIntersect=function(_3b8,_3b9){
var _3ba,_3bb,top1,_3bd;
var _3be,_3bf,top2,_3c1;
_3ba=_3b8.minX;
_3bb=_3b8.maxX;
top1=_3b8.minY;
_3bd=_3b8.maxY;
_3be=_3b9.minX;
_3bf=_3b9.maxX;
top2=_3b9.minY;
_3c1=_3b9.maxY;
return !(_3be>_3bb||_3bf<_3ba||top2>_3bd||_3c1<top1);
};
CRPath.prototype.hide=function(){
this.map.removeOverlay(this.polyline);
};
CRPath.prototype.redraw=function(){
if(this.polyline){
this.hide();
}
this.show();
};
CRPath.prototype.updatePointInPath=function(_3c2){
this.aPath[_3c2.pathIndex]=_3c2.getPoint();
this.redraw();
this.queueElevationRequest(this.aPath[_3c2.pathIndex]);
this.status.showCalipers();
};
CRPath.prototype.length=function(){
return this.aPath.length;
};
CRPath.prototype.onPointClick=function(_3c3){
this.hideMarker(_3c3);
this.selectPoint(this.aPath[_3c3.pathIndex]);
this.status.selectPoint(_3c3.pathIndex,(this.editable?"update":null));
if(!this.editable){
this.hilight(_3c3.pathIndex,this.status.getMeta(_3c3.pathIndex));
}
};
CRPath.prototype.getPoints=function(){
return this.aPath;
};
CRPath.prototype.calculateDistances=function(_3c4){
if(this.aPath.length<1){
return {fs:this.prettyDist(0),fe:this.prettyDist(0),tot:this.prettyDist(0)};
}
var fs=fe=0;
var _3c6=this.aPath[0];
for(var x=1;x<this.aPath.length;x++){
if(x<=_3c4){
fs+=this.aPath[x].distanceFrom(_3c6);
}else{
fe+=this.aPath[x].distanceFrom(_3c6);
}
_3c6=this.aPath[x];
}
return {fs:this.prettyDist(fs),fe:this.prettyDist(fe),tot:this.prettyDist(fs+fe)};
};
CRPath.prototype.distanceBetween=function(x,y){
return this.aPath[x].distanceFrom(this.aPath[y]);
};
CRPath.prototype.prettyDist=function(ival){
ival=Math.round(ival);
if(readCookie("units")=="unitskm"){
if(ival<=1000){
return ival+"m";
}
ival=Math.round(ival/100)/10;
return ival+"km";
}else{
ival=ival/0.3048;
if(ival<=2000){
return Math.round(ival)+"ft";
}
ival=ival/5280;
ival=Math.round(ival*10)/10;
return ival+"mi";
}
};
CRPath.prototype.queueElevationRequest=function(_3cb){
this.equeue.push(_3cb);
this.startEQueuePoller();
};
CRPath.prototype.startEQueuePoller=function(){
if(!this.eQueueThread){
var self=this;
this.eQueueThread=setTimeout(function(){
self.doEQueuePoll();
},150);
}
};
CRPath.prototype.doEQueuePoll=function(){
delete this.eQueueThread;
if(this.idxqueue<this.equeue.length){
point=this.equeue[this.idxqueue++];
this.getElevRPC(point);
}
};
CRPath.prototype.getElevRPC=function(_3cd){
var _3ce=this;
var _3cf=new Ajax.Request("/rpc/do/getelev/"+"la/"+_3cd.lat()+"/lo/"+_3cd.lng(),{method:"get",onComplete:function(resp){
_3ce.receivedElevation(_3cd,resp);
_3ce.startEQueuePoller();
}});
};
CRPath.prototype.receivedElevation=function(_3d1,resp){
eval(resp.responseText);
if(rpcerror){
}else{
_3d1.bkElev=elev;
}
};
function CRStatus(_3d3,map){
this.cPath=_3d3;
this.map=map;
this.currentPoint=null;
this.meta=new Array;
this.cityid=null;
this.locale="";
this.editable=true;
if($("status")){
this.panels=document.getElementsByClassName("info",$("status"));
Event.observe("unitskm","click",this.onToggleUnits.bindAsEventListener(this),false);
Event.observe("unitsmi","click",this.onToggleUnits.bindAsEventListener(this),false);
var _3d5=readCookie("units");
if(_3d5){
$(_3d5).checked=true;
}else{
$("unitskm").checked=true;
createCookie("units","unitskm",365);
}
this.embed=false;
}else{
this.embed=true;
}
}
CRStatus.prototype.show=function(what){
var len=this.panels.length;
for(var x=0;x<len;x++){
this.panels[x].style.display="none";
}
if(what!="iHide"){
$(what).style.display="block";
}
try{
switch(what){
case "iDescribe":
Form.focusFirstElement($("routesettings"));
break;
case "iLocate":
Form.focusFirstElement($("locator"));
break;
}
}
catch(err){
}
};
CRStatus.prototype.loadMeta=function(_3d9){
this.editable=_3d9.editable;
for(var x=0;x<_3d9.pathData.length;x++){
var m=_3d9.pathData[x];
var a={suburb:(m.suburb)?m.suburb:"",notes:(m.notes)?m.notes:""};
this.meta[x]=a;
}
if(!this.embed){
$("routename").value=_3d9.title;
this.setLocale(_3d9.cityid,_3d9.locale);
}
};
CRStatus.prototype.selectPoint=function(_3dd,_3de){
if(_3de===undefined){
_3de=false;
}
this.saveChanges();
this.currentPoint=_3dd;
this.loadData();
var _3df=this.cPath.length();
if(_3df>0){
$("valPoint").innerHTML=_3dd+1;
$("valPointOf").innerHTML=this.cPath.length();
}else{
$("valPoint").innerHTML=0;
$("valPointOf").innerHTML=0;
}
this.showCalipers();
try{
if(this.editable){
$("suburb").focus();
}
}
catch(err){
}
if(_3de){
this.cPath.hilightNoInfoWindow(_3dd);
}
return true;
};
CRStatus.prototype.deleteCurrentPoint=function(){
this.meta.splice(this.currentPoint,1);
if(this.cPath.length()==0){
return;
}
if(this.currentPoint>0){
this.selectPoint(this.currentPoint-1,"update");
}else{
this.selectPoint(this.currentPoint+1,"update");
}
};
CRStatus.prototype.deleteAllPoints=function(){
this.meta=new Array;
};
CRStatus.prototype.insertPointBefore=function(_3e0){
var a={suburb:"",notes:""};
this.meta.splice(_3e0,0,a);
this.currentPoint=_3e0;
};
CRStatus.prototype.setLocale=function(id,_3e3){
this.cityid=id;
this.locale=_3e3;
};
CRStatus.prototype.onPointNavClick=function(evt){
var _3e5=this.cPath.length()-1;
var x;
var _3e7=this.map.getBounds();
var ne=_3e7.getNorthEast();
var sw=_3e7.getSouthWest();
var _3ea=this.map.getSize();
var dist=Math.sqrt(_3ea.width*_3ea.width+_3ea.height*_3ea.height);
var ppm=dist/ne.distanceFrom(sw);
var _3ed=150/ppm;
switch(Event.element(evt).id){
case "btnStartTour":
case "btnPFirst":
this.navigateTo(0);
break;
case "btnPPrev":
for(x=(this.currentPoint-1);x>=0;x--){
if(this.meta[x].suburb.length||this.meta[x].notes.length||(this.cPath.distanceBetween(this.currentPoint,x)>_3ed&&!evt.ctrlKey)){
break;
}
}
if(x<0){
x=0;
}
this.navigateTo(x);
break;
case "btnPNext":
for(x=(this.currentPoint+1);x<=_3e5;x++){
if(this.meta[x].suburb.length||this.meta[x].notes.length||(this.cPath.distanceBetween(this.currentPoint,x)>_3ed&&!evt.ctrlKey)){
break;
}
}
if(x>_3e5){
x=_3e5;
}
this.navigateTo(x);
break;
case "btnPLast":
this.navigateTo(_3e5);
break;
}
};
CRStatus.prototype.navigateTo=function(_3ee){
if(this.cPath.length()>0){
this.selectPoint(_3ee);
this.cPath.hilight(_3ee,this.meta[_3ee]);
}else{
alert("You need to draw some points before you can navigate between them.");
}
};
CRStatus.prototype.onToggleUnits=function(evt){
createCookie("units",Event.element(evt).id,365);
this.showCalipers();
};
CRStatus.prototype.showCalipers=function(){
res=this.cPath.calculateDistances(this.currentPoint);
$("calipers").innerHTML="<strong>"+res.fs+"</strong> from start + <br /><strong>"+res.fe+"</strong> from end = <strong>"+res.tot+"</strong>";
};
CRStatus.prototype.isSelected=function(_3f0){
return this.currentPoint==_3f0;
};
CRStatus.prototype.saveChanges=function(){
if(this.currentPoint!=null){
var a={suburb:$F("suburb"),notes:$F("notes")};
this.meta[this.currentPoint]=a;
}
};
CRStatus.prototype.loadData=function(){
if((this.currentPoint!=null)&&this.meta[this.currentPoint]){
var a=this.meta[this.currentPoint];
$("suburb").value=a.suburb;
$("notes").value=a.notes;
}else{
$("suburb").value="";
$("notes").value="";
}
};
CRStatus.prototype.refreshTitle=function(){
$("lblRoutetitle").innerHTML="<span class=\"locale\">"+this.locale+"</span>: "+$F("routename").escapeHTML();
};
CRStatus.prototype.getMeta=function(idx){
if(idx===undefined){
return this.meta;
}else{
return this.meta[idx];
}
};
CRStatus.prototype.hasMeta=function(idx){
return this.meta[idx]&&(this.meta[idx].suburb||this.meta[idx].notes);
};
function CRSaver(_3f5,_3f6,map,_3f8){
this.cPath=_3f5;
this.status=_3f6;
this.callback=_3f8;
this.map=map;
}
CRSaver.prototype.saveRoute=function(){
var _3f9=this.cPath.getPoints();
var meta=this.status.getMeta();
var _3fb=new Array;
var _3fc=new Array("suburb","notes");
for(var x=0;x<_3f9.length;x++){
var _3fe=new Object;
var _3ff=false;
for(var y=0;y<_3fc.length;y++){
if(meta[x][_3fc[y]].length>0){
_3ff=true;
_3fe[_3fc[y]]=meta[x][_3fc[y]];
}
}
var _401={lng:_3f9[x].lng(),lat:_3f9[x].lat(),e:_3f9[x].bkElev};
if(_3ff){
_401.meta=_3fe;
}
_3fb.push(_401);
}
var _402=new Object;
_402.maptype=this.map.getCurrentMapType().getUrlArg();
_402.cityid=this.status.cityid;
_402.title=$F("routename");
_402.photoset="";
_402.visible=this.callback.routesettings.visible;
if(this.callback.mode=="import"){
_402.haveelevation=0;
}else{
_402.haveelevation=1;
}
_402.pathid=this.cPath.pathid;
_402.pathData=_3fb;
_402.tags=tagger.getChosenTags();
var _403=this;
var _404=new Ajax.Request("/rpc/do/save",{method:"post",parameters:"json="+encodeURIComponent(_402.toJSONString()),onSuccess:function(resp){
_403.onSaveSuccess(resp);
},onFailure:function(resp){
_403.onSaveFailure(resp);
}});
};
CRSaver.prototype.onSaveSuccess=function(resp){
this.callback.onSaveDone();
eval(resp.responseText);
if(rpcerror){
alert(rpcerror);
}else{
this.cPath.pathid=rpcresponse.pathid;
this.status.refreshTitle();
this.callback.onSaveSuccess(rpcresponse);
}
};
CRSaver.prototype.onSaveFailure=function(resp){
this.callback.onSaveDone();
alert("Failed to save route - please try again.");
};
function CRSearch(cr){
var _40a;
this.cache=new Array;
this.lastsearch="";
this.cr=cr;
}
CRSearch.prototype.execute=function(_40b){
$("gosearch").style.display="none";
CRShowProgress.start("searchindicator");
var _40c=this;
if(this.cache[_40b]!==undefined){
return this.showResults(this.cache[_40b]);
}
this.lastsearch=_40b;
var _40d=new Ajax.Request("/rpc/do/search",{method:"post",parameters:"key="+encodeURIComponent(_40b),onSuccess:function(resp){
_40c.AJAXResponse(resp);
},onFailure:function(){
_40c.restoreUI();
alert("Couldn't connect to server - please try again.");
}});
};
CRSearch.prototype.showResults=function(_40f){
if(_40f.length>0){
this.cityhash=new Array;
var _410;
_410="<div id=\"searchresults\"><table>";
for(var x=0;x<_40f.length;x++){
var res=_40f[x];
_410=_410+("<tr class=\""+(x%2?"odd":"")+"\"><td><a href=\"javascript://\" onclick=\"crsearch.selectCity("+res.id+");\">"+res.city.escapeHTML()+"</a></td><td>"+res.reg.escapeHTML()+"</td><td>"+res.country.escapeHTML()+"</td></tr>");
this.cityhash[res.id]=res;
}
_410+="</table></div>";
$("citysearchresults").update(_410);
}else{
$("citysearchresults").update("<p>No matching cities found.  If we don't have your city, try entering a major nearby city and drag the map over to your desired location.</p>");
}
};
CRSearch.prototype.restoreUI=function(){
$("gosearch").style.display="";
CRShowProgress.stop("searchindicator");
};
CRSearch.prototype.AJAXResponse=function(resp){
this.restoreUI();
eval(resp.responseText);
if(rpcerror){
alert(rpcerror);
}else{
this.cache[this.lastsearch]=rpcresponse;
this.showResults(rpcresponse);
}
};
CRSearch.prototype.selectCity=function(id){
var _415=this.cityhash[id].country+" > "+this.cityhash[id].reg+" > "+this.cityhash[id].city;
this.cr.selectCity(id,this.cityhash[id].lng,this.cityhash[id].lat,_415);
};
function CRProximity(cr){
this.cr=cr;
}
CRProximity.prototype.searchRoutes=function(_417,_418){
this.canvas=_418;
var _419=this;
var _41a=new Ajax.Request("/rpc/do/getnearby",{method:"post",parameters:"bounds="+encodeURIComponent(_417.toJSONString())+"&pathid="+this.cr.cPath.pathid,onComplete:function(resp){
_419.AJAXResponse(resp);
}});
};
CRProximity.prototype.AJAXResponse=function(resp){
eval(resp.responseText);
if(rpcerror){
alert(rpcerror);
}else{
if(rpcresponse.length>0){
this.routehash=new Array;
var _41d;
_41d="<table id=\"nearbyroutes\">";
for(var x=0;x<rpcresponse.length;x++){
var res=rpcresponse[x];
_41d=_41d+("<tr class=\""+(x%2?"odd":"")+"\"><td><a href=\"javascript://\" id=\"nearroute"+res.routeid+"\">"+res.title.escapeHTML()+"</a></td></tr>");
this.routehash[res.id]=res;
}
_41d+="</table><p style=\"display:none\" id=\"nrloadmsg\">Loading Route...</p>";
this.canvas.innerHTML=_41d;
var _420=this.canvas.getElementsByTagName("a");
var self=this;
for(var x=0;x<_420.length;x++){
Event.observe(_420[x],"click",this.routeSelected.bindAsEventListener(this),false);
}
}else{
this.canvas.innerHTML="<p>No routes found nearby.</p>";
}
}
};
CRProximity.prototype.routeSelected=function(what){
var _423=Event.element(what).id;
var _424=_423.substring(9,_423.length);
$("nearbyroutes").style.display="none";
$("nrloadmsg").style.display="inline";
var _425=this;
var _426=new Ajax.Request("/rpc/do/loadroute",{method:"post",parameters:"routeid="+_424,onComplete:function(resp){
_425.routeLoaded(resp);
}});
};
CRProximity.prototype.routeLoaded=function(resp){
$("nearbyroutes").style.display="";
$("nrloadmsg").style.display="none";
eval(resp.responseText);
if(rpcerror){
alert(rpcerror);
}else{
this.cr.overlayNearbyRoute(rpcresponse);
}
};
function CRTagging(){
this.chosen=new Array;
this.anti=new Array;
this.loadDefaults();
this.states=2;
}
CRTagging.prototype.loadDefaults=function(){
var _429=$("routetags").getElementsByTagName("a");
for(var x=0;x<_429.length;x++){
var bits=_429[x].id.split("_");
var _42c=parseInt(bits[1]);
if(Element.hasClassName(_429[x],"on")){
this.chosen.push(_42c);
}
}
};
CRTagging.prototype.tag=function(_42d){
if($("savetagnote")){
$("savetagnote").style.display="block";
}
var bits=_42d.id.split("_");
var _42f=parseInt(bits[1]);
if(this.chosen.indexOf(_42f)>-1){
if(this.states==3){
if(this.anti.indexOf(_42f)==-1){
Element.addClassName(_42d,"anti");
this.anti.push(_42f);
_42d.blur();
return;
}
}
Element.addClassName(_42d,"off");
Element.removeClassName(_42d,"on");
Element.removeClassName(_42d,"anti");
this.chosen=this.chosen.without(_42f);
}else{
Element.addClassName(_42d,"on");
Element.removeClassName(_42d,"off");
this.chosen.push(_42f);
}
_42d.blur();
};
CRTagging.prototype.getChosenTags=function(){
return this.chosen;
};
var tagger;
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(swf,id,w,h,ver,c,_436,_437,_438,_439,_43a){
if(!document.getElementById){
return;
}
this.DETECT_KEY=_43a?_43a:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(swf){
this.setAttribute("swf",swf);
}
if(id){
this.setAttribute("id",id);
}
if(w){
this.setAttribute("width",w);
}
if(h){
this.setAttribute("height",h);
}
if(ver){
this.setAttribute("version",new deconcept.PlayerVersion(ver.toString().split(".")));
}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(c){
this.addParam("bgcolor",c);
}
var q=_437?_437:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_436);
this.setAttribute("doExpressInstall",false);
var xir=(_438)?_438:window.location;
this.setAttribute("xiRedirectUrl",xir);
this.setAttribute("redirectUrl","");
if(_439){
this.setAttribute("redirectUrl",_439);
}
};
deconcept.SWFObject.prototype={setAttribute:function(name,_43e){
this.attributes[name]=_43e;
},getAttribute:function(name){
return this.attributes[name];
},addParam:function(name,_441){
this.params[name]=_441;
},getParams:function(){
return this.params;
},addVariable:function(name,_443){
this.variables[name]=_443;
},getVariable:function(name){
return this.variables[name];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _445=new Array();
var key;
var _447=this.getVariables();
for(key in _447){
_445.push(key+"="+_447[key]);
}
return _445;
},getSWFHTML:function(){
var _448="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");
}
_448="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_448+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _449=this.getParams();
for(var key in _449){
_448+=[key]+"=\""+_449[key]+"\" ";
}
var _44b=this.getVariablePairs().join("&");
if(_44b.length>0){
_448+="flashvars=\""+_44b+"\"";
}
_448+="/>";
}else{
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","ActiveX");
}
_448="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_448+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _449=this.getParams();
for(var key in _449){
_448+="<param name=\""+key+"\" value=\""+_449[key]+"\" />";
}
var _44b=this.getVariablePairs().join("&");
if(_44b.length>0){
_448+="<param name=\"flashvars\" value=\""+_44b+"\" />";
}
_448+="</object>";
}
return _448;
},write:function(_44c){
if(this.getAttribute("useExpressInstall")){
var _44d=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_44d)&&!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 _44c=="string")?document.getElementById(_44c):_44c;
n.innerHTML=this.getSWFHTML();
return true;
}else{
if(this.getAttribute("redirectUrl")!=""){
document.location.replace(this.getAttribute("redirectUrl"));
}
}
return false;
}};
deconcept.SWFObjectUtil.getPlayerVersion=function(){
var _44f=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){
_44f=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));
}
}else{
try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
}
catch(e){
try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_44f=new deconcept.PlayerVersion([6,0,21]);
axo.AllowScriptAccess="always";
}
catch(e){
if(_44f.major==6){
return _44f;
}
}
try{
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
}
catch(e){
}
}
if(axo!=null){
_44f=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
}
}
return _44f;
};
deconcept.PlayerVersion=function(_452){
this.major=_452[0]!=null?parseInt(_452[0]):0;
this.minor=_452[1]!=null?parseInt(_452[1]):0;
this.rev=_452[2]!=null?parseInt(_452[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(_454){
var q=document.location.search||document.location.hash;
if(q){
var _456=q.substring(1).split("&");
for(var i=0;i<_456.length;i++){
if(_456[i].substring(0,_456[i].indexOf("="))==_454){
return _456[i].substring((_456[i].indexOf("=")+1));
}
}
}
return "";
}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){
if(window.opera||!document.all){
return;
}
var _458=document.getElementsByTagName("OBJECT");
for(var i=0;i<_458.length;i++){
_458[i].style.display="none";
for(var x in _458[i]){
if(typeof _458[i][x]=="function"){
_458[i][x]=function(){
};
}
}
}
};
deconcept.SWFObjectUtil.prepUnload=function(){
__flash_unloadHandler=function(){
};
__flash_savedUnloadHandler=function(){
};
if(typeof window.onunload=="function"){
var _45b=window.onunload;
window.onunload=function(){
deconcept.SWFObjectUtil.cleanupSWFs();
_45b();
};
}else{
window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;
}
};
if(typeof window.onbeforeunload=="function"){
var oldBeforeUnload=window.onbeforeunload;
window.onbeforeunload=function(){
deconcept.SWFObjectUtil.prepUnload();
oldBeforeUnload();
};
}else{
window.onbeforeunload=deconcept.SWFObjectUtil.prepUnload;
}
if(Array.prototype.push==null){
Array.prototype.push=function(item){
this[this.length]=item;
return this.length;
};
}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject;
var SWFObject=deconcept.SWFObject;
function BikelyEGraph(){
this.width=650;
this.height=300;
}
BikelyEGraph.prototype.showGraph=function(path){
var _45e=path.getPoints();
if(readCookie("units")=="unitsmi"){
this.ismiles=true;
}else{
this.ismiles=false;
}
if(_45e.length==0){
return alert("There are no points in this route!");
}
this.graphpts=new Array;
var _45f=0;
for(x=0;x<_45e.length;x++){
var pnt=_45e[x];
if(x>0){
_45f+=pnt.distanceFrom(_45e[x-1]);
}
if(pnt.bkElev==undefined||pnt.bkElev==NaN){
pnt.bkElev=0;
}
this.graphpts.push({x:_45f,y:pnt.bkElev});
}
this.fo=new SycuseFlyOut(document.body,null,"Elevation",700,360);
this.fo.closeonclick=false;
this.fo.centered=true;
this.fo.canvas.innerHTML="<div id=\"elevationFO\"><div id=\"elevationgraph\">If you can read this, you probably need to install or upgrade Macromedia Flash to version 8.</div><p style=\"float:right\"><button type=\"button\" id=\"btnCloseElevGraph\" class=\"SFbutton\">Close graph \xbb</button></p><p>Total climb: <span id=\"totalrise\"></span>  Total descent: <span id=\"totalfall\"></span></p></div>";
this.fo.onLoadContent=this.renderGraph.bindAsEventListener(this);
this.fo.show();
var _461=(this.ismiles?"ft":"m");
$("totalfall").innerHTML=Math.round(this.totalfall)+_461;
$("totalrise").innerHTML=Math.round(this.totalrise)+_461;
Event.observe("btnCloseElevGraph","click",this.closeGraph.bindAsEventListener(this),false);
};
BikelyEGraph.prototype.renderGraph=function(){
out=this.generatePoints(this.graphpts);
xml=this.buildXML(out);
var fo=new deconcept.SWFObject("/Line.swf","Line",this.width,this.height-18,"8","#ffffff");
fo.addVariable("wmode","transparent");
fo.addVariable("quality","high");
fo.addVariable("dataXML",xml);
fo.addVariable("chartWidth",this.width);
fo.addVariable("chartHeight",this.height);
fo.write("elevationgraph");
};
BikelyEGraph.prototype.closeGraph=function(){
this.fo.hide();
this.fo.canvas.innerHTML="";
delete this.fo;
};
BikelyEGraph.prototype.buildXML=function(out){
var _464=(this.ismiles?"ft":"m");
var xml="<graph bgColor='FFFFFF' showBorder='0' canvasBgColor='FFFFFF' caption='Route Elevation' subcaption='' showAnchors='0' xAxisName='Distance' yAxisName='Elevation' numberPrefix='' numberSuffix='"+_464+"' showNames='1' animation='0' showValues='0' yAxisMinValue='"+Math.round(this.emin)+"' formatNumberScale='1'>";
while(out[0]){
var _466=out.shift();
var _467="00";
var _468="00";
var hue=Math.round(_466.grad*100)+155;
var hex=parseInt(hue).toString(16);
if(hex.length==1){
hex="0"+hex;
}
if(_466.up){
_467=hex;
}else{
_468=hex;
}
xml+="<set ";
if(_466.label){
if(this.ismiles){
xml+="name='"+Math.round(_466.label/1609.34,1)+"mi' ";
}else{
xml+="name='"+Math.round(_466.label/1000,1)+"km' ";
}
}
xml+="value='"+Math.round(_466.elev)+"' color='"+_467+_468+"00' />\n";
}
xml+="</graph>";
return xml;
};
BikelyEGraph.prototype.generatePoints=function(_46b){
var _46c=(this.ismiles?3.2808399:1);
var dist=_46b.last().x;
this.emin=1000000;
var emax=-1000000;
for(var x=0;x<_46b.length;x++){
var p=_46b[x];
this.emin=Math.min(this.emin,p.y);
emax=Math.max(emax,p.y);
}
this.emin=(this.emin-3)*_46c;
var sets=Math.min(250,(_46b.length+15));
var _472=10;
var _473=Math.round(sets/_472);
var _474=dist/(sets+1);
var out=new Array;
var _476={x:-1};
var _477=0;
var _478=0;
var _479=false;
for(y=0;y<=dist;y+=_474){
if(y>=_476.x){
var _47a=_46b.shift();
var _476=_46b[0];
if(_476==undefined){
break;
}
while(y>=_476.x){
var _47a=_46b.shift();
var _476=_46b[0];
if(_476==undefined){
break;
}
}
if(_476==undefined){
break;
}
var _47b=_47a.y;
var _47c=(_476.x-_47a.x)/_474;
var _47d=(_476.y-_47a.y)/_47c;
var _47e=(_476.y-_47a.y)/(_476.x-_47a.x);
}else{
_47b+=_47d;
}
var set={elev:_47b*_46c,grad:Math.abs(_47e),up:(_47e>0)};
if(out.length%_473==0){
set.label=Math.round(y);
}
if(_479){
var _480=set.elev-out.last().elev;
if(_480>0){
_477+=_480;
}else{
_478+=-1*_480;
}
}
out.push(set);
_479=true;
}
if(_46b.length>0){
var _47a=_46b.shift();
var _47b=_47a.y*_46c;
var _480=_47b-out.last().elev;
if(_480>0){
_477+=_480;
}else{
_478+=-1*_480;
}
}
this.totalrise=_477;
this.totalfall=_478;
return out;
};
CRFaves=function(_481){
this.isfave=_481.isfave;
this.routeid=_481.pathid;
this.trigger=$("btnFave");
this.inprogress=false;
SycuseBind(this.trigger,this,this.onFaveClick);
SycuseBind(this.trigger,this,this.onFaveMouseOver,"mouseover");
SycuseBind(this.trigger,this,this.onFaveMouseOut,"mouseout");
this.updateUI();
this.trigger.style.visibility="visible";
};
CRFaves.prototype={onFaveClick:function(){
if(this.inprogress){
return;
}
if(this.isfave){
this.setFaveMode(0);
}else{
this.setFaveMode(1);
}
this.trigger.blur();
},onFaveMouseOver:function(){
if(this.inprogress){
return;
}
if(this.isfave){
this.showImg("/css/heart_out.gif");
}else{
this.showImg("/css/heart.gif");
}
},onFaveMouseOut:function(){
if(this.inprogress){
return;
}
if(this.isfave){
this.showImg("/css/heart.gif");
}else{
this.showImg("/css/heart_add.gif");
}
},setFaveMode:function(mode){
this.inprogress=true;
this.isfave=mode;
this.showImg("/indicator.gif");
var _483=this;
var url="/rpc/do/makefave/routeid/"+this.routeid+"/mode/"+mode;
var _485=new Ajax.Request(url,{method:"post",parameters:"blah=blah",onComplete:function(resp){
_483.AJAXResponse(resp);
}});
delete _485;
},AJAXResponse:function(resp){
this.updateUI();
this.inprogress=false;
},updateUI:function(){
if(this.isfave){
this.trigger.title="Click to remove this route from your favorites";
this.showImg("/css/heart.gif");
}else{
this.trigger.title="Click to add this route to your favorites";
this.showImg("/css/heart_add.gif");
}
},showImg:function(img){
this.trigger.style.backgroundImage="url("+img+")";
}};
CRWaypointManager=function(_489,cr){
this.route=_489;
this.cr=cr;
this.waypoints=new Array;
};
CRWaypointManager.prototype={createNew:function(what){
var wpt;
eval("var wpt = new CRWaypoint_"+what+"(this.route, this.cr);");
wpt.setLocation(this.cr.map.getCenter());
wpt.showIcon();
wpt.showEditForm();
this.waypoints.push(wpt);
}};
CRWaypoint_photo=function(_48d,cr){
this.route=_48d;
this.cr=cr;
this.location=null;
};
CRWaypoint_photo.prototype={setLocation:function(_48f){
this.location=_48f;
},showIcon:function(){
var icon=new GIcon();
icon.image="http://labs.google.com/ridefinder/images/mm_20_red.png";
icon.shadow="http://labs.google.com/ridefinder/images/mm_20_shadow.png";
icon.iconSize=new GSize(12,20);
icon.shadowSize=new GSize(22,20);
icon.iconAnchor=new GPoint(6,20);
icon.infoWindowAnchor=new GPoint(5,1);
this.gmarker=new GMarker(this.location,{"icon":icon,draggable:true,bouncy:true,bounceGravity:5});
this.cr.map.addOverlay(this.gmarker);
},showEditForm:function(){
var aup=new AlbAJAXUploader("/fileupload",this.cr.getUserId()+"_"+"fsasdfdsf");
this.gmarker.openInfoWindowHtml(aup.createForm());
}};
AlbAJAXUploader=function(_492,_493){
this.action=_492;
this.id=_493;
};
AlbAJAXUploader.prototype={createForm:function(){
var _494=document.createElement("DIV");
var form=document.createElement("FORM");
form.action=this.action;
form.method="post";
form.enctype="multipart/form-data";
form.innerHTML="<p>File: <input type=\"file\" name=\"uploadfile\" /></p>\t\t<input type=\"submit\" value=\"Upload\" name=\"btnUploadFile\" />";
this.form=form;
this.container=_494;
_494.appendChild(form);
Event.observe(form,"submit",this.createIFRAME.bindAsEventListener(this),false);
this.status=document.createElement("DIV");
_494.appendChild(this.status);
return _494;
},createIFRAME:function(){
this.form.style.display="none";
this.status.innerHTML="Uploading... please wait...";
var d=document.createElement("DIV");
var _497="iframe_"+this.id;
d.innerHTML="<iframe style=\"display:none\" src=\"about:blank\" id=\""+_497+"\" name=\""+_497+"\"></iframe>";
document.body.appendChild(d);
this.form.setAttribute("target",_497);
this.iframe=$(_497);
Event.observe(this.iframe,"load",this.uploadComplete.bindAsEventListener(this),false);
},uploadComplete:function(e){
this.status.innerHTML="Upload complete!";
alert(this.iframe.innerHTML);
}};
CRRatings=function(_499){
$("frmRouteRatings").style.display="block";
this.elem=$("selRateRoute");
if(_499.uRating>=0){
this.elem.selectedIndex=_499.uRating+1;
}
SycuseBind(this.elem,this,this.onRatingChange,"change");
this.routeid=_499.pathid;
};
CRRatings.prototype={onRatingChange:function(evt){
var _49b=$F(this.elem);
if(_49b<0){
return;
}
var _49c=this;
var url="/rpc/do/rateroute/routeid/"+this.routeid+"/rating/"+_49b;
CRShowProgress.start("icoRatingProgress");
var _49e=new Ajax.Request(url,{method:"post",parameters:"blah=blah",onComplete:function(resp){
_49c.AJAXResponse(resp);
}});
delete _49e;
},AJAXResponse:function(resp){
CRShowProgress.stop("icoRatingProgress");
this.inprogress=false;
}};
CRMapTabHelp=function(_4a1){
this.openwin=null;
this.buttons=_4a1;
this.init();
};
CRMapTabHelp.prototype={showHelp:function(_4a2,_4a3){
this.close();
var _4a4=$("i"+_4a2+"Help");
if(_4a4){
this.openwin=_4a4;
Effect.Appear(_4a4,{duration:0.3});
if(_4a3){
this.trapper=this.close.bindAsEventListener(this);
Event.observe(document,"click",this.trapper,false);
}
}
},close:function(){
if(this.openwin){
this.openwin.style.display="none";
this.openwin=null;
Event.stopObserving(document,"click",this.trapper,false);
}
},init:function(){
for(var x=0;x<this.buttons.length;x++){
var _4a6=this.buttons[x];
var _4a7=$("i"+_4a6+"Help");
if(_4a7){
var _4a8=document.createElement("img");
_4a8.className="helpclosebutton";
_4a8.style.styleFloat=_4a8.style.cssFloat="right";
_4a8.style.cursor="pointer";
_4a8.style.margin="0 0 4px 4px";
_4a8.src="/js/flyout-close.gif";
var _4a9=document.createElement("a");
_4a9.appendChild(_4a8);
_4a9.title="Close";
_4a7.insertBefore(_4a9,_4a7.firstChild);
Event.observe(_4a8,"click",this.close.bindAsEventListener(this),false);
var _4aa=document.createElement("img");
_4aa.style.styleFloat=_4aa.style.cssFloat="right";
_4aa.style.cursor="pointer";
_4aa.src="/css/icons/helpme.gif";
var _4ab=document.createElement("a");
_4ab.appendChild(_4aa);
_4ab.title="Get Help";
var tab=$("i"+_4a6);
tab.insertBefore(_4ab,tab.firstChild);
_4aa.tabname=_4a6;
Event.observe(_4aa,"click",this.toggleHelp.bindAsEventListener(this),false);
}
}
},toggleHelp:function(what){
if(this.openwin){
return this.close();
}
var _4ae=Event.element(what).tabname;
this.showHelp(_4ae,false);
}};
CRMapTabs=function(_4af,map,_4b1,_4b2){
this.status=_4af;
this.map=map;
this.editable=_4b1;
this.autoshowhelp=new Array;
this.help=null;
this.lasttab=null;
this.tabsopen=true;
this.buttonsEditable=["Locate","Draw","Describe","Hide"];
this.buttonsExploring=["Explore","Hide"];
this.createControl();
this.init(_4b2);
};
CRMapTabs.prototype={selectTab:function(name){
this.buttons.each(function(item){
var _4b5="tabbtn"+item;
if(name==item){
$(_4b5).parentNode.className="active";
}else{
$(_4b5).parentNode.className="";
}
});
this.help.close();
if(name=="Hide"){
if(this.tabsopen){
this.status.show("i"+name);
Element.update($("tabbtnHide"),"v");
$("status").className="tabshidden";
this.tabsopen=false;
return;
}else{
this.selectTab(this.lasttab);
}
}else{
this.status.show("i"+name);
this.lasttab=name;
if(this.autoshowhelp[name]){
this.help.showHelp(name,true);
this.autoshowhelp[name]=false;
}
if(!this.tabsopen){
Element.update($("tabbtnHide"),"^");
$("status").className="";
this.tabsopen=true;
}
}
},init:function(_4b6){
this.map.addControl(new BMapTabControl());
this.setupPanels();
var self=this;
this.buttons.each(function(item){
var btn=$("tabbtn"+item);
Event.observe(btn,"click",self.tabClicked.bindAsEventListener(self),false);
btn.parentNode.style.display="block";
self.autoshowhelp[item]=_4b6;
});
this.help=new CRMapTabHelp(this.buttons);
},setupPanels:function(){
var _4ba=$("curpoint");
_4ba.parentNode.removeChild(_4ba);
if(this.editable){
$("iDrawNav").appendChild(_4ba);
this.buttons=this.buttonsEditable;
}else{
$("iExploreNav").appendChild(_4ba);
this.buttons=this.buttonsExploring;
}
_4ba.style.display="block";
},createControl:function(){
BMapTabControl.prototype=new GControl(false,true);
BMapTabControl.prototype.initialize=function(map){
var _4bc=document.createElement("div");
var _4bd=$("status");
_4bd.parentNode.removeChild(_4bd);
_4bc.appendChild(_4bd);
_4bd.style.display="block";
map.getContainer().appendChild(_4bc);
return _4bc;
};
BMapTabControl.prototype.getDefaultPosition=function(map){
return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(0,0));
};
},tabClicked:function(what){
var elem=Event.element(what);
this.selectTab(elem.id.substr(6));
elem.blur();
}};
function BMapTabControl(){
}
CRButtonBar=function(){
};
CRButtonBar.prototype={isDrawing:function(){
$("btnStartDraw").style.display="none";
$("btnStopDraw").style.display="block";
},isNotDrawing:function(){
$("btnStopDraw").style.display="none";
$("btnStartDraw").style.display="block";
}};
var CRShowProgress={start:function(what){
$(what).style.display="inline";
$(what).style.visibility="visible";
setTimeout(function(){
$(what).src=$(what).src;
},80);
},stop:function(what){
$(what).style.display="none";
}};
CRGoogleAd=function(map){
if(!$("googleads")){
return;
}
this.map=map;
this.createControl();
this.map.addControl(new BGoogleAdControl());
this.addCloseButton();
};
CRGoogleAd.prototype={createControl:function(){
BGoogleAdControl.prototype=new GControl(false,true);
BGoogleAdControl.prototype.initialize=function(map){
var _4c5=document.createElement("div");
var gad=$("googleads");
gad.parentNode.removeChild(gad);
_4c5.appendChild(gad);
gad.style.display="block";
map.getContainer().appendChild(_4c5);
return _4c5;
};
BGoogleAdControl.prototype.getDefaultPosition=function(map){
return new GControlPosition(G_ANCHOR_BOTTOM_RIGHT,new GSize(0,15));
};
},addCloseButton:function(){
var _4c8=$("btnHideAds");
Event.observe(_4c8,"click",this.close.bindAsEventListener(this),false);
},close:function(){
$("googleads").style.display="none";
}};
function BGoogleAdControl(){
}
var tagger;
function LPBehave(){
if($("country")){
Event.observe($("country"),"change",this.onCountrySelect.bindAsEventListener(this),false);
this.ajax=null;
}
if($("tags_is")){
tagger=new LPTagSuggest;
}
}
LPBehave.prototype.onCountrySelect=function(evt){
if(this.ajax){
this.ajax.transport.abort();
}
$("region").style.cursor="wait";
$("region").disabled=true;
var self=this;
this.ajax=new Ajax.Updater("regionholder","/rpc/do/getregions",{method:"post",parameters:"countryid="+$F("country"),onSuccess:function(xhr){
self.done();
},onFailure:function(xhr){
self.done();
},evalScripts:false});
};
LPBehave.prototype.done=function(){
$("region").style.cursor="";
this.ajax=null;
$("region").disabled=false;
};
function LPTagSuggest(){
this.init();
}
LPTagSuggest.prototype={init:function(){
var _4cd=this.onTagInputFocus.bindAsEventListener(this);
var _4ce=this.onTagInputBlur.bindAsEventListener(this);
Event.observe($("tags_is"),"focus",_4cd,false);
Event.observe($("tags_isnot"),"focus",_4cd,false);
Event.observe($("tags_is"),"blur",_4ce,false);
Event.observe($("tags_isnot"),"blur",_4ce,false);
this.tagbox=$("routetags");
this.tagbox.style.position="absolute";
this.tagbox.style.width="265px";
this.tagbox.style.border="1px solid #999";
this.tagbox.style.padding="5px";
this.tagbox.style.backgroundColor="#ffffff";
},onTagInputFocus:function(e){
clearTimeout(this.hidetimer);
var elem=Event.element(e);
Position.clone(elem,this.tagbox,{setHeight:false,offsetTop:elem.offsetHeight-6});
this.tagbox.style.display="block";
this.currentelem=elem;
},onTagInputBlur:function(e){
var elem=Event.element(e);
var tb=this.tagbox;
this.hidetimer=setTimeout("$('routetags').style.display = 'none';",250);
},tag:function(what){
var _4d5=this.currentelem.value.length==0?"":",";
this.currentelem.value=this.currentelem.value+_4d5+what.innerHTML;
this.currentelem.focus();
}};
SycuseSocialBookmark=function(what,_4d7){
if(_4d7==undefined){
_4d7=1;
}
this.clickevents=new Array;
this.applyTo(what,_4d7);
};
SycuseSocialBookmark.prototype={applyTo:function(_4d8,_4d9,url,_4db){
var what=$(_4d8);
if(what){
var _4dd=what.getElementsByTagName("a");
if(url==undefined){
url=location.href;
}
if(_4db==undefined){
_4db=document.title;
}
url=encodeURIComponent(url);
_4db=encodeURIComponent(_4db);
for(var x=0;x<_4dd.length;x++){
var anc=_4dd[x];
if(anc.rel.substr(0,2)=="SB"){
if(_4d9){
this.setHREF(anc,url,_4db);
}else{
this.addWarning(anc);
}
}
}
}
},setHREF:function(anc,url,_4e2){
if(this.clickevents[anc.id]){
Event.stopObserving(anc,"click",this.clickevents[anc.id],false);
this.clickevents[anc.id]=null;
}
switch(anc.rel){
case "SBdelicious":
anc.href="http://del.icio.us/post?v=4&url="+url+"&title="+_4e2;
break;
case "SBdigg":
anc.href="http://digg.com/submit?phase=2&url="+url;
break;
case "SBreddit":
anc.href="http://reddit.com/submit?url="+url+"&title="+_4e2;
break;
case "SBfurl":
anc.href="http://www.furl.net/storeIt.jsp?t="+_4e2+"&u="+url;
break;
case "SBnetscape":
anc.href="http://www.netscape.com/submit/?U="+url+"&T="+_4e2;
break;
}
},addWarning:function(anc){
anc.href="javascript://";
this.clickevents[anc.id]=this.showWarning.bindAsEventListener(this);
Event.observe(anc,"click",this.clickevents[anc.id],false);
},showWarning:function(){
alert("You must make this route publically visible before sharing it with others.");
}};
var cssdropdown={disappeardelay:250,disablemenuclick:false,enableswipe:1,enableiframeshim:1,dropmenuobj:null,ie:document.all,firefox:document.getElementById&&!document.all,swipetimer:undefined,bottomclip:0,getposOffset:function(what,_4e5){
var _4e6=(_4e5=="left")?what.offsetLeft:what.offsetTop;
var _4e7=what.offsetParent;
while(_4e7!=null){
_4e6=(_4e5=="left")?_4e6+_4e7.offsetLeft:_4e6+_4e7.offsetTop;
_4e7=_4e7.offsetParent;
}
return _4e6;
},swipeeffect:function(){
if(this.bottomclip<parseInt(this.dropmenuobj.offsetHeight)){
this.bottomclip+=20+(this.bottomclip/20);
this.dropmenuobj.style.clip="rect(0 auto "+this.bottomclip+"px 0)";
}else{
return;
}
this.swipetimer=setTimeout("cssdropdown.swipeeffect()",5);
},showhide:function(obj,e){
if(this.ie||this.firefox){
this.dropmenuobj.style.left=this.dropmenuobj.style.top="-500px";
}
if(e.type=="click"&&obj.visibility==hidden||e.type=="mouseover"){
if(this.enableswipe==1){
if(typeof this.swipetimer!="undefined"){
clearTimeout(this.swipetimer);
}
obj.clip="rect(0 auto 0 0)";
this.bottomclip=0;
this.swipeeffect();
}
obj.visibility="visible";
}else{
if(e.type=="click"){
obj.visibility="hidden";
}
}
},iecompattest:function(){
return (document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;
},clearbrowseredge:function(obj,_4eb){
var _4ec=0;
if(_4eb=="rightedge"){
var _4ed=this.ie&&!window.opera?this.iecompattest().scrollLeft+this.iecompattest().clientWidth-15:window.pageXOffset+window.innerWidth-15;
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetWidth;
if(_4ed-this.dropmenuobj.x<this.dropmenuobj.contentmeasure){
_4ec=this.dropmenuobj.contentmeasure-obj.offsetWidth;
}
}else{
var _4ee=this.ie&&!window.opera?this.iecompattest().scrollTop:window.pageYOffset;
var _4ed=this.ie&&!window.opera?this.iecompattest().scrollTop+this.iecompattest().clientHeight-15:window.pageYOffset+window.innerHeight-18;
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetHeight;
if(_4ed-this.dropmenuobj.y<this.dropmenuobj.contentmeasure){
_4ec=this.dropmenuobj.contentmeasure+obj.offsetHeight;
if((this.dropmenuobj.y-_4ee)<this.dropmenuobj.contentmeasure){
_4ec=this.dropmenuobj.y+obj.offsetHeight-_4ee;
}
}
}
return _4ec;
},dropit:function(obj,e,_4f1){
if(this.dropmenuobj!=null){
this.dropmenuobj.style.visibility="hidden";
}
this.clearhidemenu();
if(this.ie||this.firefox){
obj.onmouseout=function(){
cssdropdown.delayhidemenu();
};
obj.onclick=function(){
return !cssdropdown.disablemenuclick;
};
this.dropmenuobj=document.getElementById(_4f1);
this.dropmenuobj.onmouseover=function(){
cssdropdown.clearhidemenu();
};
this.dropmenuobj.onmouseout=function(e){
cssdropdown.dynamichide(e);
};
Event.observe(this.dropmenuobj,"click",function(e){
var elem=Event.element(e);
if(elem.tagName=="INPUT"){
cssdropdown.focussedinput=elem;
}else{
cssdropdown.delayhidemenu();
}
},false);
this.showhide(this.dropmenuobj.style,e);
this.dropmenuobj.x=this.getposOffset(obj,"left");
this.dropmenuobj.y=this.getposOffset(obj,"top");
this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj,"rightedge")+"px";
this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj,"bottomedge")+obj.offsetHeight+1+"px";
this.positionshim();
}
},positionshim:function(){
if(this.enableiframeshim&&typeof this.shimobject!="undefined"){
if(this.dropmenuobj.style.visibility=="visible"){
this.shimobject.style.width=this.dropmenuobj.offsetWidth+"px";
this.shimobject.style.height=this.dropmenuobj.offsetHeight+"px";
this.shimobject.style.left=this.dropmenuobj.style.left;
this.shimobject.style.top=this.dropmenuobj.style.top;
}
this.shimobject.style.display=(this.dropmenuobj.style.visibility=="visible")?"block":"none";
}
},hideshim:function(){
if(this.enableiframeshim&&typeof this.shimobject!="undefined"){
this.shimobject.style.display="none";
}
},contains_firefox:function(a,b){
if(b){
try{
while(b.parentNode){
if((b=b.parentNode)==a){
return true;
}
}
}
catch(err){
}
}
return false;
},dynamichide:function(e){
var _4f8=window.event?window.event:e;
if(this.ie&&!this.dropmenuobj.contains(_4f8.toElement)){
this.delayhidemenu();
}else{
if(this.firefox&&e.currentTarget!=_4f8.relatedTarget&&!this.contains_firefox(_4f8.currentTarget,_4f8.relatedTarget)){
this.delayhidemenu();
}
}
},delayhidemenu:function(){
this.delayhide=setTimeout("cssdropdown.dropmenuobj.style.visibility='hidden'; cssdropdown.hideshim()",this.disappeardelay);
if(cssdropdown.focussedinput){
try{
cssdropdown.focussedinput.blur();
}
catch(err){
}
cssdropdown.focussedinput=null;
}
},clearhidemenu:function(){
if(this.delayhide!="undefined"){
clearTimeout(this.delayhide);
}
},startchrome:function(){
for(var ids=0;ids<arguments.length;ids++){
var _4fa=document.getElementById(arguments[ids]).getElementsByTagName("a");
for(var i=0;i<_4fa.length;i++){
if(_4fa[i].getAttribute("rel")){
var _4fc=_4fa[i].getAttribute("rel");
_4fa[i].onmouseover=function(e){
var _4fe=typeof e!="undefined"?e:window.event;
cssdropdown.dropit(this,_4fe,this.getAttribute("rel"));
};
}
}
}
if(window.createPopup&&!window.XmlHttpRequest){
this.shimobject=document.createElement("<iframe scrolling='no' frameborder='0'"+"style='position:absolute; top:0px;"+"left:0px; display:none'></iframe>");
this.shimobject.id="iframeshim";
this.shimobject.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
window.document.body.appendChild(this.shimobject);
}
}};
var ProtoTip={xCord:0,yCord:0,obj:null,tooltipTagNames:["a","span","acronym","abbr"],attachTooltipBehavior:function(){
if(!document.getElementById||!document.createElement||!document.getElementsByTagName){
return;
}
Event.observe(document,"mousemove",ProtoTip.updateXY,false);
if(document.captureEvents){
document.captureEvents(Event.MOUSEMOVE);
}
for(var i=0,_500;_500=ProtoTip.tooltipTagNames[i];i++){
var _501=document.getElementsByTagName(_500);
for(var j=0,_503;_503=_501[j];j++){
if(_503.tagName!="SPAN"||Element.hasClassName(_503,"hover")){
if(_503.title.length>0&&!_503.getAttribute("tip")){
Event.observe(_503,"mouseover",ProtoTip.tipOver,false);
Event.observe(_503,"click",ProtoTip.tipOut,false);
Event.observe(_503,"mouseout",ProtoTip.tipOut,false);
_503.setAttribute("tip",_503.title);
_503.removeAttribute("title");
var _504=$A(_503.getElementsByTagName("img"));
_504.each(function(elem){
if(elem.alt){
elem.alt="";
}
});
}
}
}
}
},updateXY:function(e){
ProtoTip.xCord=Event.pointerX(e);
ProtoTip.yCord=Event.pointerY(e);
},tipOut:function(e){
if(window.tID){
clearTimeout(tID);
}
var div=$("toolTip");
if(div!=null){
div.parentNode.removeChild($("ttShadow"));
div.parentNode.removeChild(div);
}
},checkNode:function(obj){
for(var i=0,_50b;_50b=ProtoTip.tooltipTagNames[i];i++){
if(obj.nodeName.toLowerCase()==_50b){
return obj;
}
}
return obj.parentNode;
},tipOver:function(e){
ProtoTip.obj=Event.element(e);
tID=setTimeout("ProtoTip.tipShow()",200);
},tipShow:function(){
var _50d=ProtoTip.checkNode(ProtoTip.obj);
var _50e="";
var _50f="";
var _510=document.createElement("div");
_510.id="toolTip";
_510.style.display="none";
Element.addClassName(_510,"toolTip");
document.body.appendChild(_510);
_510.innerHTML="<p id='ttText'>"+_50d.getAttribute("tip")+"</p>";
ttshadow=_510.cloneNode(true);
ttshadow.id="ttShadow";
document.body.appendChild(ttshadow);
var top=ProtoTip.yCord+15;
var left=ProtoTip.xCord+10;
if(!Position.within(document.body,left+80,10)){
_510.style.right="2px";
ttshadow.style.right="0px";
}else{
_510.style.left=left+"px";
ttshadow.style.left=(left+4)+"px";
}
_510.style.top=top+"px";
ttshadow.style.top=(top+4)+"px";
_510.style.display="";
ttshadow.style.display="";
ProtoTip.tipelement=_510;
_510.style.opacity=".1";
_510.style.filter="alpha(opacity:10)";
ProtoTip.tipFade("toolTip",10);
ProtoTip.tipFade("ttShadow",10,45);
},tipFade:function(_513,opac,max){
if(!max){
max=99;
}
var _516=$(_513);
if(!_516){
return;
}
var _517=opac+13;
if(_517<=max){
_516.style.display="";
_516.style.opacity="."+_517;
_516.style.filter="alpha(opacity:"+_517+")";
var _518=setTimeout("ProtoTip.tipFade('"+_513+"', "+_517+", "+max+")",10);
}else{
_516.style.opacity="0."+max;
_516.style.filter="alpha(opacity:"+max+")";
}
}};
var FastInit={done:false,onload:function(){
if(FastInit.done){
return;
}
FastInit.done=true;
FastInit.actions.each(function(func){
func();
});
},actions:$A([]),addOnLoad:function(){
for(var x=0;x<arguments.length;x++){
var func=arguments[x];
if(!func||typeof func!="function"){
continue;
}
FastInit.actions.push(func);
}
},listen:function(){
if(/WebKit|khtml/i.test(navigator.userAgent)){
FastInit._timer=setInterval(function(){
if(/loaded|complete/.test(document.readyState)){
clearInterval(FastInit._timer);
delete FastInit._timer;
FastInit.onload();
}
},10);
}else{
if(document.addEventListener){
document.addEventListener("DOMContentLoaded",FastInit.onload,false);
}else{
if(!FastInit._iew32){
Event.observe(window,"load",FastInit.onload);
}
}
}
},_timer:null,_iew32:false};
FastInit.listen();

