var bugRiddenCrashPronePieceOfJunk=(navigator.userAgent.indexOf("MSIE 5")!=-1&&navigator.userAgent.indexOf("Mac")!=-1);
var W3CDOM=(!bugRiddenCrashPronePieceOfJunk&&typeof document.getElementsByTagName!="undefined"&&typeof document.createElement!="undefined");
var registerEventListener=undefined;
if(typeof addEvent!="undefined"){
registerEventListener=function(_1,_2,_3){
addEvent(_1,_2,_3);
return true;
};
}else{
if(window.addEventListener){
registerEventListener=function(_4,_5,_6){
_4.addEventListener(_5,_6,false);
return true;
};
}else{
if(window.attachEvent){
registerEventListener=function(_7,_8,_9){
var _a=_7.attachEvent("on"+_8,_9);
return _a;
};
}else{
registerEventListener=function(_b,_c,_d){
return false;
};
}
}
}
var unRegisterEventListener=undefined;
if(typeof removeEvent!="undefined"){
unRegisterEventListener=function(_e,_f,_10){
removeEvent(element,_f,_10);
return true;
};
}else{
if(window.removeEventListener){
unRegisterEventListener=function(_11,_12,_13){
_11.removeEventListener(_12,_13,false);
return true;
};
}else{
if(window.detachEvent){
unRegisterEventListener=function(_14,_15,_16){
var _17=_14.detachEvent("on"+_15,_16);
return _17;
};
}else{
unRegisterEventListener=function(_18,_19,_1a){
return false;
};
}
}
}
var registerPloneFunction=undefined;
if(typeof addDOMLoadEvent!="undefined"){
registerPloneFunction=function(_1b){
registerEventListener(window,"domload",_1b);
};
}else{
registerPloneFunction=function(_1c){
registerEventListener(window,"load",_1c);
};
}
function getContentArea(){
if(W3CDOM){
var _1d=document.getElementById("region-content");
if(!_1d){
_1d=document.getElementById("content");
}
return _1d;
}
}
var portal_url="http://127.0.0.1:8098/campux";
var form_modified_message="Your entries have not been saved. All changes you have made will be lost";
var form_resubmit_message="You already clicked on the submit button. Do you really want to submit the information again?";
function wrapNode(_1e,_1f,_20){
var _21=document.createElement(_1f);
_21.className=_20;
var _22=_1e.parentNode.replaceChild(_21,_1e);
_21.appendChild(_22);
}
function nodeContained(_23,_24){
var _25=_23.parentNode;
while(_25!=document){
if(_25==_24){
return true;
}
_25=_25.parentNode;
}
return false;
}
function findContainer(_26,_27){
while(_26!=null){
if(_27(_26)){
return _26;
}
_26=_26.parentNode;
}
return false;
}
function hasClassName(_28,_29){
return new RegExp("\\b"+_29+"\\b").test(_28.className);
}
function addClassName(_2a,_2b){
if(!_2a.className){
_2a.className=_2b;
}else{
if(!hasClassName(_2a,_2b)){
var _2c=_2a.className+" "+_2b;
_2a.className=_2c.split(/\s+/).join(" ");
}
}
}
function removeClassName(_2d,_2e){
var _2f=_2d.className;
if(_2f){
_2f=_2f.replace(new RegExp("\\b"+_2e+"\\b"),"");
_2f=_2f.replace(/\s+/g," ");
_2d.className=_2f.replace(/\s+$/g,"");
}
}
function replaceClassName(_30,_31,_32,_33){
if(_33&&!hasClassName(_30,_31)){
addClassName(_30,_32);
}else{
var _34=_30.className;
if(_34){
_34=_34.replace(new RegExp("\\b"+_31+"\\b"),_32);
_34=_34.replace(/\s+/g," ");
_30.className=_34.replace(/\s+$/g,"");
}
}
}
function walkTextNodes(_35,_36,_37){
if(!_35){
return false;
}
if(_35.hasChildNodes){
for(var i=0;i<_35.childNodes.length;i++){
walkTextNodes(_35.childNodes[i],_36,_37);
}
if(_35.nodeType==3){
_36(_35,_37);
}
}
}
function getInnerTextCompatible(_39){
var _3a=new Array();
walkTextNodes(_39,function(n,d){
d.push(n.nodeValue);
},_3a);
return _3a.join("");
}
function getInnerTextFast(_3d){
if(_3d.innerText){
return _3d.innerText;
}else{
return getInnerTextCompatible(_3d);
}
}
function sortNodes(_3e,_3f,_40){
if(!W3CDOM){
return false;
}
var _41=function(_42){
this.value=_3f(_42);
this.cloned_node=_42.cloneNode(true);
this.toString=function(){
if(this.value.toString){
return this.value.toString();
}else{
return this.value;
}
};
};
var _43=new Array();
for(var i=0;i<_3e.length;i++){
_43.push(new _41(_3e[i]));
}
if(_40){
_43.sort(_40);
}else{
_43.sort();
}
for(var i=0;i<_43.length;i++){
var _45=_3e[i];
_45.parentNode.replaceChild(_43[i].cloned_node,_45);
}
}
function createCookie(_46,_47,_48){
if(_48){
var _49=new Date();
_49.setTime(_49.getTime()+(_48*24*60*60*1000));
var _4a="; expires="+_49.toGMTString();
}else{
_4a="";
}
document.cookie=_46+"="+escape(_47)+_4a+"; path=/;";
}
function readCookie(_4b){
var _4c=_4b+"=";
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(_4c)==0){
return unescape(c.substring(_4c.length,c.length));
}
}
return null;
}
function selectAll(id,_51){
if(_51==null){
checkboxes=document.getElementsByName(id);
for(i=0;i<checkboxes.length;i++){
checkboxes[i].checked=true;
}
}else{
for(i=0;i<document.forms[_51].elements.length;i++){
if(document.forms[_51].elements[i].name==id){
document.forms[_51].elements[i].checked=true;
}
}
}
}
function deselectAll(id,_53){
if(_53==null){
checkboxes=document.getElementsByName(id);
for(i=0;i<checkboxes.length;i++){
checkboxes[i].checked=false;
}
}else{
for(i=0;i<document.forms[_53].elements.length;i++){
if(document.forms[_53].elements[i].name==id){
document.forms[_53].elements[i].checked=false;
}
}
}
}
function toggleSelect(_54,id,_56,_57){
id=id||"ids:list";
if(_54.isSelected==null){
_56=_56||false;
_54.isSelected=_56;
}
if(_54.isSelected==false){
_54.setAttribute("src",portal_url+"/select_none_icon.gif");
_54.isSelected=true;
return selectAll(id,_57);
}else{
_54.setAttribute("src",portal_url+"/select_all_icon.gif");
_54.isSelected=false;
return deselectAll(id,_57);
}
}
function hackPush(el){
this[this.length]=el;
}
function hackPop(){
var N=this.length-1,el=this[N];
this.length=N;
return el;
}
function hackShift(){
var one=this[0],N=this.length;
for(var i=1;i<N;i++){
this[i-1]=this[i];
}
this.length=N-1;
return one;
}
var testPushPop=new Array();
if(testPushPop.push){
}else{
Array.prototype.push=hackPush;
Array.prototype.pop=hackPop;
Array.prototype.shift=hackShift;
}
function cookiesEnabled(){
var c="areYourCookiesEnabled=0";
document.cookie=c;
var dc=document.cookie;
if(dc.indexOf(c)==-1){
return 0;
}
c="areYourCookiesEnabled=1";
document.cookie=c;
dc=document.cookie;
if(dc.indexOf(c)==-1){
return 0;
}
document.cookie="areYourCookiesEnabled=; expires=Thu, 01-Jan-70 00:00:01 GMT";
return 1;
}
function setLoginVars(_60,_61,_62,_63,_64,_65){
if(_64){
el=document.getElementById(_64);
if(el){
el.value=1;
}
}
if(_65){
el=document.getElementById(_65);
if(el){
el.value=cookiesEnabled();
}
}
if(_60&&_61){
user_name=document.getElementById(_60);
alt_user_name=document.getElementById(_61);
if(user_name&&alt_user_name){
alt_user_name.value=user_name.value;
}
}
if(_62&&_63){
password=document.getElementById(_62);
empty_password=document.getElementById(_63);
if(password&&empty_password){
if(password.value.length==0){
empty_password.value="1";
}else{
empty_password.value="0";
}
}
}
return 1;
}
function showCookieMessage(_66){
msg=document.getElementById(_66);
if(msg){
if(cookiesEnabled()){
msg.style.display="none";
}else{
msg.style.display="block";
}
}
}
function showEnableCookiesMessage(){
showCookieMessage("enable_cookies_message");
}
registerPloneFunction(showEnableCookiesMessage);
function inputSubmitOnClick(_67){
if(!_67){
var _67=window.event;
}
if(hasClassName(this,"submitting")){
return confirm(window.form_resubmit_message);
}else{
addClassName(this,"submitting");
}
return true;
}
function registerSubmitHandler(){
var _68=cpxQuery("input[type=submit]");
for(var i=0;i<_68.length;i++){
var _6a=_68[i];
if(!_6a.onclick){
_6a.onclick=inputSubmitOnClick;
}
}
}
registerPloneFunction(registerSubmitHandler);
Ext={};
function cpxQuery(_6b,_6c){
match=Ext.query(_6b,_6c);
return match;
}
function cpxQueryOne(_6d,_6e){
match=Ext.DomQuery.selectNode(_6d,_6e);
return match;
}
function cpxQueryWindowOne(_6f){
match=Ext.DomQuery.selectNode(_6f);
if(!match&&window.parent){
match=Ext.DomQuery.selectNode(_6f,window.parent.document);
}
return match;
}
var cssQuery=cpxQuery;
Ext.DomQuery=function(){
var _70={},_71={},_72={};
var _73=/\S/;
var _74=/^\s*(.*?)\s*$/;
var _75=/\{(\d+)\}/g;
var _76=/^(\s?[\/>]\s?|\s|$)/;
var _77=/^(#)?([\w-\*]+)/;
function child(p,_79){
var i=0;
var n=p.firstChild;
while(n){
if(n.nodeType==1){
if(++i==_79){
return n;
}
}
n=n.nextSibling;
}
return null;
}
function next(n){
while((n=n.nextSibling)&&n.nodeType!=1){
}
return n;
}
function prev(n){
while((n=n.previousSibling)&&n.nodeType!=1){
}
return n;
}
function clean(d){
var n=d.firstChild,ni=-1;
while(n){
var nx=n.nextSibling;
if(n.nodeType==3&&!_73.test(n.nodeValue)){
d.removeChild(n);
}else{
n.nodeIndex=++ni;
}
n=nx;
}
return this;
}
function byClassName(c,a,v,re,cn){
if(!v){
return c;
}
var r=[];
for(var i=0,ci;ci=c[i];i++){
cn=ci.className;
if(cn&&(" "+cn+" ").indexOf(v)!=-1){
r[r.length]=ci;
}
}
return r;
}
function attrValue(n,_8b){
if(!n.tagName&&typeof n.length!="undefined"){
n=n[0];
}
if(!n){
return null;
}
if(_8b=="for"){
return n.htmlFor;
}
if(_8b=="class"||_8b=="className"){
return n.className;
}
return n.getAttribute(_8b)||n[_8b];
}
function getNodes(ns,_8d,_8e){
var _8f=[],cs;
if(!ns){
return _8f;
}
_8d=_8d?_8d.replace(_74,"$1"):"";
_8e=_8e||"*";
if(typeof ns.getElementsByTagName!="undefined"){
ns=[ns];
}
if(_8d!="/"&&_8d!=">"){
for(var i=0,ni;ni=ns[i];i++){
cs=ni.getElementsByTagName(_8e);
for(var j=0,ci;ci=cs[j];j++){
_8f[_8f.length]=ci;
}
}
}else{
for(var i=0,ni;ni=ns[i];i++){
var cn=ni.getElementsByTagName(_8e);
for(var j=0,cj;cj=cn[j];j++){
if(cj.parentNode==ni){
_8f[_8f.length]=cj;
}
}
}
}
return _8f;
}
function concat(a,b){
if(b.slice){
return a.concat(b);
}
for(var i=0,l=b.length;i<l;i++){
a[a.length]=b[i];
}
return a;
}
function byTag(cs,_9c){
if(cs.tagName||cs==document){
cs=[cs];
}
if(!_9c){
return cs;
}
var r=[];
_9c=_9c.toLowerCase();
for(var i=0,ci;ci=cs[i];i++){
if(ci.nodeType==1&&ci.tagName.toLowerCase()==_9c){
r[r.length]=ci;
}
}
return r;
}
function byId(cs,_a1,id){
if(cs.tagName||cs==document){
cs=[cs];
}
if(!id){
return cs;
}
var r=[];
for(var i=0,ci;ci=cs[i];i++){
if(ci&&ci.id==id){
r[r.length]=ci;
return r;
}
}
return r;
}
function byAttribute(cs,_a7,_a8,op,_aa){
var r=[],st=_aa=="{";
var f=Ext.DomQuery.operators[op];
for(var i=0;ci=cs[i];i++){
var a;
if(st){
a=Ext.DomQuery.getStyle(ci,_a7);
}else{
if(_a7=="class"||_a7=="className"){
a=ci.className;
}else{
if(_a7=="for"){
a=ci.htmlFor;
}else{
if(_a7=="href"){
a=ci.getAttribute("href",2);
}else{
a=ci.getAttribute(_a7);
}
}
}
}
if((f&&f(a,_a8))||(!f&&a)){
r[r.length]=ci;
}
}
return r;
}
function byPseudo(cs,_b1,_b2){
return Ext.DomQuery.pseudos[_b1](cs,_b2);
}
var _b3=window.ActiveXObject?true:false;
var key=30803;
function nodupIEXml(cs){
var d=++key;
cs[0].setAttribute("_nodup",d);
var r=[cs[0]];
for(var i=1,len=cs.length;i<len;i++){
var c=cs[i];
if(!c.getAttribute("_nodup")!=d){
c.setAttribute("_nodup",d);
r[r.length]=c;
}
}
for(var i=0,len=cs.length;i<len;i++){
cs[i].removeAttribute("_nodup");
}
return r;
}
function nodup(cs){
if(!cs){
return [];
}
var len=cs.length,c,i,r=cs,cj;
if(!len||typeof cs.nodeType!="undefined"||len==1){
return cs;
}
if(_b3&&typeof cs[0].selectSingleNode!="undefined"){
return nodupIEXml(cs);
}
var d=++key;
cs[0]._nodup=d;
for(i=1;c=cs[i];i++){
if(c._nodup!=d){
c._nodup=d;
}else{
r=[];
for(var j=0;j<i;j++){
r[r.length]=cs[j];
}
for(j=i+1;cj=cs[j];j++){
if(cj._nodup!=d){
cj._nodup=d;
r[r.length]=cj;
}
}
return r;
}
}
return r;
}
function quickDiffIEXml(c1,c2){
var d=++key;
for(var i=0,len=c1.length;i<len;i++){
c1[i].setAttribute("_qdiff",d);
}
var r=[];
for(var i=0,len=c2.length;i<len;i++){
if(c2[i].getAttribute("_qdiff")!=d){
r[r.length]=c2[i];
}
}
for(var i=0,len=c1.length;i<len;i++){
c1[i].removeAttribute("_qdiff");
}
return r;
}
function quickDiff(c1,c2){
var _cb=c1.length;
if(!_cb){
return c2;
}
if(_b3&&c1[0].selectSingleNode){
return quickDiffIEXml(c1,c2);
}
var d=++key;
for(var i=0;i<_cb;i++){
c1[i]._qdiff=d;
}
var r=[];
for(var i=0,len=c2.length;i<len;i++){
if(c2[i]._qdiff!=d){
r[r.length]=c2[i];
}
}
return r;
}
function quickId(ns,_d1,_d2,id){
if(ns==_d2){
var d=_d2.ownerDocument||_d2;
return d.getElementById(id);
}
ns=getNodes(ns,_d1,"*");
return byId(ns,null,id);
}
return {getStyle:function(el,_d6){
return Ext.fly(el).getStyle(_d6);
},compile:function(_d7,_d8){
while(_d7.substr(0,1)=="/"){
_d7=_d7.substr(1);
}
_d8=_d8||"select";
var fn=["var f = function(root){\n var mode; var n = root || document;\n"];
var q=_d7,_db,lq;
var tk=Ext.DomQuery.matchers;
var _de=tk.length;
var mm;
while(q&&lq!=q){
lq=q;
var tm=q.match(_77);
if(_d8=="select"){
if(tm){
if(tm[1]=="#"){
fn[fn.length]="n = quickId(n, mode, root, \""+tm[2]+"\");";
}else{
fn[fn.length]="n = getNodes(n, mode, \""+tm[2]+"\");";
}
q=q.replace(tm[0],"");
}else{
if(q.substr(0,1)!="@"){
fn[fn.length]="n = getNodes(n, mode, \"*\");";
}
}
}else{
if(tm){
if(tm[1]=="#"){
fn[fn.length]="n = byId(n, null, \""+tm[2]+"\");";
}else{
fn[fn.length]="n = byTag(n, \""+tm[2]+"\");";
}
q=q.replace(tm[0],"");
}
}
while(!(mm=q.match(_76))){
var _e1=false;
for(var j=0;j<_de;j++){
var t=tk[j];
var m=q.match(t.re);
if(m){
fn[fn.length]=t.select.replace(_75,function(x,i){
return m[i];
});
q=q.replace(m[0],"");
_e1=true;
break;
}
}
if(!_e1){
throw "Error parsing selector, parsing failed at \""+q+"\"";
}
}
if(mm[1]){
fn[fn.length]="mode=\""+mm[1]+"\";";
q=q.replace(mm[1],"");
}
}
fn[fn.length]="return nodup(n);\n}";
eval(fn.join(""));
return f;
},select:function(_e7,_e8,_e9){
if(!_e8||_e8==document){
_e8=document;
}
if(typeof _e8=="string"){
_e8=document.getElementById(_e8);
}
var _ea=_e7.split(",");
var _eb=[];
for(var i=0,len=_ea.length;i<len;i++){
var p=_ea[i].replace(_74,"$1");
if(!_70[p]){
_70[p]=Ext.DomQuery.compile(p);
if(!_70[p]){
throw p+" is not a valid selector";
}
}
var _ef=_70[p](_e8);
if(_ef&&_ef!=document){
_eb=_eb.concat(_ef);
}
}
return _eb;
},selectNode:function(_f0,_f1){
return Ext.DomQuery.select(_f0,_f1)[0];
},selectValue:function(_f2,_f3,_f4){
_f2=_f2.replace(_74,"$1");
if(!_72[_f2]){
_72[_f2]=Ext.DomQuery.compile(_f2,"select");
}
var n=_72[_f2](_f3);
n=n[0]?n[0]:n;
var v=(n&&n.firstChild?n.firstChild.nodeValue:null);
return (v===null?_f4:v);
},selectNumber:function(_f7,_f8,_f9){
var v=Ext.DomQuery.selectValue(_f7,_f8,_f9||0);
return parseFloat(v);
},is:function(el,ss){
if(typeof el=="string"){
el=document.getElementById(el);
}
var _fd=(el instanceof Array);
var _fe=Ext.DomQuery.filter(_fd?el:[el],ss);
return _fd?(_fe.length==el.length):(_fe.length>0);
},filter:function(els,ss,_101){
ss=ss.replace(_74,"$1");
if(!_71[ss]){
_71[ss]=Ext.DomQuery.compile(ss,"simple");
}
var _102=_71[ss](els);
return _101?quickDiff(_102,els):_102;
},matchers:[{re:/^\.([\w-]+)/,select:"n = byClassName(n, null, \" {1} \");"},{re:/^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,select:"n = byPseudo(n, \"{1}\", \"{2}\");"},{re:/^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,select:"n = byAttribute(n, \"{2}\", \"{4}\", \"{3}\", \"{1}\");"},{re:/^#([\w-]+)/,select:"n = byId(n, null, \"{1}\");"},{re:/^@([\w-]+)/,select:"return {firstChild:{nodeValue:attrValue(n, \"{1}\")}};"}],operators:{"=":function(a,v){
return a==v;
},"!=":function(a,v){
return a!=v;
},"^=":function(a,v){
return a&&a.substr(0,v.length)==v;
},"$=":function(a,v){
return a&&a.substr(a.length-v.length)==v;
},"*=":function(a,v){
return a&&a.indexOf(v)!==-1;
},"%=":function(a,v){
return (a%v)==0;
}},pseudos:{"first-child":function(c){
var r=[],n;
for(var i=0,ci;ci=n=c[i];i++){
while((n=n.previousSibling)&&n.nodeType!=1){
}
if(!n){
r[r.length]=ci;
}
}
return r;
},"last-child":function(c){
var r=[];
for(var i=0,ci;ci=n=c[i];i++){
while((n=n.nextSibling)&&n.nodeType!=1){
}
if(!n){
r[r.length]=ci;
}
}
return r;
},"nth-child":function(c,a){
var r=[];
if(a!="odd"&&a!="even"){
for(var i=0,ci;ci=c[i];i++){
var m=child(ci.parentNode,a);
if(m==ci){
r[r.length]=m;
}
}
return r;
}
var p;
for(var i=0,l=c.length;i<l;i++){
var cp=c[i].parentNode;
if(cp!=p){
clean(cp);
p=cp;
}
}
for(var i=0,ci;ci=c[i];i++){
var m=false;
if(a=="odd"){
m=((ci.nodeIndex+1)%2==1);
}else{
if(a=="even"){
m=((ci.nodeIndex+1)%2==0);
}
}
if(m){
r[r.length]=ci;
}
}
return r;
},"only-child":function(c){
var r=[];
for(var i=0,ci;ci=c[i];i++){
if(!prev(ci)&&!next(ci)){
r[r.length]=ci;
}
}
return r;
},"empty":function(c){
var r=[];
for(var i=0,ci;ci=c[i];i++){
var cns=ci.childNodes,j=0,cn,_12c=true;
while(cn=cns[j]){
++j;
if(cn.nodeType==1||cn.nodeType==3){
_12c=false;
break;
}
}
if(_12c){
r[r.length]=ci;
}
}
return r;
},"contains":function(c,v){
var r=[];
for(var i=0,ci;ci=c[i];i++){
if(ci.innerHTML.indexOf(v)!==-1){
r[r.length]=ci;
}
}
return r;
},"nodeValue":function(c,v){
var r=[];
for(var i=0,ci;ci=c[i];i++){
if(ci.firstChild&&ci.firstChild.nodeValue==v){
r[r.length]=ci;
}
}
return r;
},"checked":function(c){
var r=[];
for(var i=0,ci;ci=c[i];i++){
if(ci.checked==true){
r[r.length]=ci;
}
}
return r;
},"not":function(c,ss){
return Ext.DomQuery.filter(c,ss,true);
},"odd":function(c){
return this["nth-child"](c,"odd");
},"even":function(c){
return this["nth-child"](c,"even");
},"nth":function(c,a){
return c[a-1]||[];
},"first":function(c){
return c[0]||[];
},"last":function(c){
return c[c.length-1]||[];
},"has":function(c,ss){
var s=Ext.DomQuery.select;
var r=[];
for(var i=0,ci;ci=c[i];i++){
if(s(ss,ci).length>0){
r[r.length]=ci;
}
}
return r;
},"next":function(c,ss){
var is=Ext.DomQuery.is;
var r=[];
for(var i=0,ci;ci=c[i];i++){
var n=next(ci);
if(n&&is(n,ss)){
r[r.length]=ci;
}
}
return r;
},"prev":function(c,ss){
var is=Ext.DomQuery.is;
var r=[];
for(var i=0,ci;ci=c[i];i++){
var n=prev(ci);
if(n&&is(n,ss)){
r[r.length]=ci;
}
}
return r;
}}};
}();
Ext.query=Ext.DomQuery.select;
var Prototype={Version:"1.5.0",BrowserFeatures:{XPath:!!document.evaluate},ScriptFragment:"(?:<script.*?>)((\n|\r|.)*?)(?:</script>)",emptyFunction:function(){
},K:function(x){
return x;
}};
var Class={create:function(){
return function(){
this.initialize.apply(this,arguments);
};
}};
var Abstract=new Object();
Object.extend=function(_158,_159){
for(var _15a in _159){
_158[_15a]=_159[_15a];
}
return _158;
};
Object.extend(Object,{inspect:function(_15b){
try{
if(_15b===undefined){
return "undefined";
}
if(_15b===null){
return "null";
}
return _15b.inspect?_15b.inspect():_15b.toString();
}
catch(e){
if(e instanceof RangeError){
return "...";
}
throw e;
}
},keys:function(_15c){
var keys=[];
for(var _15e in _15c){
keys.push(_15e);
}
return keys;
},values:function(_15f){
var _160=[];
for(var _161 in _15f){
_160.push(_15f[_161]);
}
return _160;
},clone:function(_162){
return Object.extend({},_162);
}});
Function.prototype.bind=function(){
var _163=this,args=$A(arguments),_165=args.shift();
return function(){
return _163.apply(_165,args.concat($A(arguments)));
};
};
Function.prototype.bindAsEventListener=function(_166){
var _167=this,args=$A(arguments),_166=args.shift();
return function(_169){
return _167.apply(_166,[(_169||window.event)].concat(args).concat($A(arguments)));
};
};
Object.extend(Number.prototype,{toColorPart:function(){
var _16a=this.toString(16);
if(this<16){
return "0"+_16a;
}
return _16a;
},succ:function(){
return this+1;
},times:function(_16b){
$R(0,this,true).each(_16b);
return this;
}});
var Try={these:function(){
var _16c;
for(var i=0,_16e=arguments.length;i<_16e;i++){
var _16f=arguments[i];
try{
_16c=_16f();
break;
}
catch(e){
}
}
return _16c;
}};
var PeriodicalExecuter=Class.create();
PeriodicalExecuter.prototype={initialize:function(_170,_171){
this.callback=_170;
this.frequency=_171;
this.currentlyExecuting=false;
this.registerCallback();
},registerCallback:function(){
this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},stop:function(){
if(!this.timer){
return;
}
clearInterval(this.timer);
this.timer=null;
},onTimerEvent:function(){
if(!this.currentlyExecuting){
try{
this.currentlyExecuting=true;
this.callback(this);
}
finally{
this.currentlyExecuting=false;
}
}
}};
String.interpret=function(_172){
return _172==null?"":String(_172);
};
Object.extend(String.prototype,{gsub:function(_173,_174){
var _175="",_176=this,_177;
_174=arguments.callee.prepareReplacement(_174);
while(_176.length>0){
if(_177=_176.match(_173)){
_175+=_176.slice(0,_177.index);
_175+=String.interpret(_174(_177));
_176=_176.slice(_177.index+_177[0].length);
}else{
_175+=_176,_176="";
}
}
return _175;
},sub:function(_178,_179,_17a){
_179=this.gsub.prepareReplacement(_179);
_17a=_17a===undefined?1:_17a;
return this.gsub(_178,function(_17b){
if(--_17a<0){
return _17b[0];
}
return _179(_17b);
});
},scan:function(_17c,_17d){
this.gsub(_17c,_17d);
return this;
},truncate:function(_17e,_17f){
_17e=_17e||30;
_17f=_17f===undefined?"...":_17f;
return this.length>_17e?this.slice(0,_17e-_17f.length)+_17f: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 _180=new RegExp(Prototype.ScriptFragment,"img");
var _181=new RegExp(Prototype.ScriptFragment,"im");
return (this.match(_180)||[]).collect(function(_182){
return (_182.match(_181)||["",""])[1];
});
},evalScripts:function(){
return this.extractScripts().collect(function(_183){
return eval(_183);
});
},escapeHTML:function(){
var div=document.createElement("div");
var text=document.createTextNode(this);
div.appendChild(text);
return div.innerHTML;
},unescapeHTML:function(){
var div=document.createElement("div");
div.innerHTML=this.stripTags();
return div.childNodes[0]?(div.childNodes.length>1?$A(div.childNodes).inject("",function(memo,node){
return memo+node.nodeValue;
}):div.childNodes[0].nodeValue):"";
},toQueryParams:function(_189){
var _18a=this.strip().match(/([^?#]*)(#.*)?$/);
if(!_18a){
return {};
}
return _18a[1].split(_189||"&").inject({},function(hash,pair){
if((pair=pair.split("="))[0]){
var name=decodeURIComponent(pair[0]);
var _18e=pair[1]?decodeURIComponent(pair[1]):undefined;
if(hash[name]!==undefined){
if(hash[name].constructor!=Array){
hash[name]=[hash[name]];
}
if(_18e){
hash[name].push(_18e);
}
}else{
hash[name]=_18e;
}
}
return hash;
});
},toArray:function(){
return this.split("");
},succ:function(){
return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1);
},camelize:function(){
var _18f=this.split("-"),len=_18f.length;
if(len==1){
return _18f[0];
}
var _191=this.charAt(0)=="-"?_18f[0].charAt(0).toUpperCase()+_18f[0].substring(1):_18f[0];
for(var i=1;i<len;i++){
_191+=_18f[i].charAt(0).toUpperCase()+_18f[i].substring(1);
}
return _191;
},capitalize:function(){
return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase();
},underscore:function(){
return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase();
},dasherize:function(){
return this.gsub(/_/,"-");
},inspect:function(_193){
var _194=this.replace(/\\/g,"\\\\");
if(_193){
return "\""+_194.replace(/"/g,"\\\"")+"\"";
}else{
return "'"+_194.replace(/'/g,"\\'")+"'";
}
}});
String.prototype.gsub.prepareReplacement=function(_195){
if(typeof _195=="function"){
return _195;
}
var _196=new Template(_195);
return function(_197){
return _196.evaluate(_197);
};
};
String.prototype.parseQuery=String.prototype.toQueryParams;
var Template=Class.create();
Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;
Template.prototype={initialize:function(_198,_199){
this.template=_198.toString();
this.pattern=_199||Template.Pattern;
},evaluate:function(_19a){
return this.template.gsub(this.pattern,function(_19b){
var _19c=_19b[1];
if(_19c=="\\"){
return _19b[2];
}
return _19c+String.interpret(_19a[_19b[3]]);
});
}};
var $break=new Object();
var $continue=new Object();
var Enumerable={each:function(_19d){
var _19e=0;
try{
this._each(function(_19f){
try{
_19d(_19f,_19e++);
}
catch(e){
if(e!=$continue){
throw e;
}
}
});
}
catch(e){
if(e!=$break){
throw e;
}
}
return this;
},eachSlice:function(_1a0,_1a1){
var _1a2=-_1a0,_1a3=[],_1a4=this.toArray();
while((_1a2+=_1a0)<_1a4.length){
_1a3.push(_1a4.slice(_1a2,_1a2+_1a0));
}
return _1a3.collect(_1a1);
},all:function(_1a5){
var _1a6=true;
this.each(function(_1a7,_1a8){
_1a6=_1a6&&!!(_1a5||Prototype.K)(_1a7,_1a8);
if(!_1a6){
throw $break;
}
});
return _1a6;
},any:function(_1a9){
var _1aa=false;
this.each(function(_1ab,_1ac){
if(_1aa=!!(_1a9||Prototype.K)(_1ab,_1ac)){
throw $break;
}
});
return _1aa;
},collect:function(_1ad){
var _1ae=[];
this.each(function(_1af,_1b0){
_1ae.push((_1ad||Prototype.K)(_1af,_1b0));
});
return _1ae;
},detect:function(_1b1){
var _1b2;
this.each(function(_1b3,_1b4){
if(_1b1(_1b3,_1b4)){
_1b2=_1b3;
throw $break;
}
});
return _1b2;
},findAll:function(_1b5){
var _1b6=[];
this.each(function(_1b7,_1b8){
if(_1b5(_1b7,_1b8)){
_1b6.push(_1b7);
}
});
return _1b6;
},grep:function(_1b9,_1ba){
var _1bb=[];
this.each(function(_1bc,_1bd){
var _1be=_1bc.toString();
if(_1be.match(_1b9)){
_1bb.push((_1ba||Prototype.K)(_1bc,_1bd));
}
});
return _1bb;
},include:function(_1bf){
var _1c0=false;
this.each(function(_1c1){
if(_1c1==_1bf){
_1c0=true;
throw $break;
}
});
return _1c0;
},inGroupsOf:function(_1c2,_1c3){
_1c3=_1c3===undefined?null:_1c3;
return this.eachSlice(_1c2,function(_1c4){
while(_1c4.length<_1c2){
_1c4.push(_1c3);
}
return _1c4;
});
},inject:function(memo,_1c6){
this.each(function(_1c7,_1c8){
memo=_1c6(memo,_1c7,_1c8);
});
return memo;
},invoke:function(_1c9){
var args=$A(arguments).slice(1);
return this.collect(function(_1cb){
return _1cb[_1c9].apply(_1cb,args);
});
},max:function(_1cc){
var _1cd;
this.each(function(_1ce,_1cf){
_1ce=(_1cc||Prototype.K)(_1ce,_1cf);
if(_1cd==undefined||_1ce>=_1cd){
_1cd=_1ce;
}
});
return _1cd;
},min:function(_1d0){
var _1d1;
this.each(function(_1d2,_1d3){
_1d2=(_1d0||Prototype.K)(_1d2,_1d3);
if(_1d1==undefined||_1d2<_1d1){
_1d1=_1d2;
}
});
return _1d1;
},partition:function(_1d4){
var _1d5=[],_1d6=[];
this.each(function(_1d7,_1d8){
((_1d4||Prototype.K)(_1d7,_1d8)?_1d5:_1d6).push(_1d7);
});
return [_1d5,_1d6];
},pluck:function(_1d9){
var _1da=[];
this.each(function(_1db,_1dc){
_1da.push(_1db[_1d9]);
});
return _1da;
},reject:function(_1dd){
var _1de=[];
this.each(function(_1df,_1e0){
if(!_1dd(_1df,_1e0)){
_1de.push(_1df);
}
});
return _1de;
},sortBy:function(_1e1){
return this.collect(function(_1e2,_1e3){
return {value:_1e2,criteria:_1e1(_1e2,_1e3)};
}).sort(function(left,_1e5){
var a=left.criteria,b=_1e5.criteria;
return a<b?-1:a>b?1:0;
}).pluck("value");
},toArray:function(){
return this.collect();
},zip:function(){
var _1e8=Prototype.K,args=$A(arguments);
if(typeof args.last()=="function"){
_1e8=args.pop();
}
var _1ea=[this].concat(args).collect($A);
return this.collect(function(_1eb,_1ec){
return _1e8(_1ea.pluck(_1ec));
});
},size:function(){
return this.toArray().length;
},inspect:function(){
return "#<Enumerable:"+this.toArray().inspect()+">";
}};
Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});
var $A=Array.from=function(_1ed){
if(!_1ed){
return [];
}
if(_1ed.toArray){
return _1ed.toArray();
}else{
var _1ee=[];
for(var i=0,_1f0=_1ed.length;i<_1f0;i++){
_1ee.push(_1ed[i]);
}
return _1ee;
}
};
Object.extend(Array.prototype,Enumerable);
if(!Array.prototype._reverse){
Array.prototype._reverse=Array.prototype.reverse;
}
Object.extend(Array.prototype,{_each:function(_1f1){
for(var i=0,_1f3=this.length;i<_1f3;i++){
_1f1(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(_1f4){
return _1f4!=null;
});
},flatten:function(){
return this.inject([],function(_1f5,_1f6){
return _1f5.concat(_1f6&&_1f6.constructor==Array?_1f6.flatten():[_1f6]);
});
},without:function(){
var _1f7=$A(arguments);
return this.select(function(_1f8){
return !_1f7.include(_1f8);
});
},indexOf:function(_1f9){
for(var i=0,_1fb=this.length;i<_1fb;i++){
if(this[i]==_1f9){
return i;
}
}
return -1;
},reverse:function(_1fc){
return (_1fc!==false?this:this.toArray())._reverse();
},reduce:function(){
return this.length>1?this:this[0];
},uniq:function(){
return this.inject([],function(_1fd,_1fe){
return _1fd.include(_1fe)?_1fd:_1fd.concat([_1fe]);
});
},clone:function(){
return [].concat(this);
},size:function(){
return this.length;
},inspect:function(){
return "["+this.collect(Object.inspect).join(", ")+"]";
}});
Array.prototype.toArray=Array.prototype.clone;
function $w(_1ff){
_1ff=_1ff.strip();
return _1ff?_1ff.split(/\s+/):[];
}
if(window.opera){
Array.prototype.concat=function(){
var _200=[];
for(var i=0,_202=this.length;i<_202;i++){
_200.push(this[i]);
}
for(var i=0,_202=arguments.length;i<_202;i++){
if(arguments[i].constructor==Array){
for(var j=0,_204=arguments[i].length;j<_204;j++){
_200.push(arguments[i][j]);
}
}else{
_200.push(arguments[i]);
}
}
return _200;
};
}
var Hash=function(obj){
Object.extend(this,obj||{});
};
Object.extend(Hash,{toQueryString:function(obj){
var _207=[];
this.prototype._each.call(obj,function(pair){
if(!pair.key){
return;
}
if(pair.value&&pair.value.constructor==Array){
var _209=pair.value.compact();
if(_209.length<2){
pair.value=_209.reduce();
}else{
key=encodeURIComponent(pair.key);
_209.each(function(_20a){
_20a=_20a!=undefined?encodeURIComponent(_20a):"";
_207.push(key+"="+encodeURIComponent(_20a));
});
return;
}
}
if(pair.value==undefined){
pair[1]="";
}
_207.push(pair.collect(encodeURIComponent).join("="));
});
return _207.join("&");
}});
Object.extend(Hash.prototype,Enumerable);
Object.extend(Hash.prototype,{_each:function(_20b){
for(var key in this){
var _20d=this[key];
if(_20d&&_20d==Hash.prototype[key]){
continue;
}
var pair=[key,_20d];
pair.key=key;
pair.value=_20d;
_20b(pair);
}
},keys:function(){
return this.pluck("key");
},values:function(){
return this.pluck("value");
},merge:function(hash){
return $H(hash).inject(this,function(_210,pair){
_210[pair.key]=pair.value;
return _210;
});
},remove:function(){
var _212;
for(var i=0,_214=arguments.length;i<_214;i++){
var _215=this[arguments[i]];
if(_215!==undefined){
if(_212===undefined){
_212=_215;
}else{
if(_212.constructor!=Array){
_212=[_212];
}
_212.push(_215);
}
}
delete this[arguments[i]];
}
return _212;
},toQueryString:function(){
return Hash.toQueryString(this);
},inspect:function(){
return "#<Hash:{"+this.collect(function(pair){
return pair.collect(Object.inspect).join(": ");
}).join(", ")+"}>";
}});
function $H(_217){
if(_217&&_217.constructor==Hash){
return _217;
}
return new Hash(_217);
}
ObjectRange=Class.create();
Object.extend(ObjectRange.prototype,Enumerable);
Object.extend(ObjectRange.prototype,{initialize:function(_218,end,_21a){
this.start=_218;
this.end=end;
this.exclusive=_21a;
},_each:function(_21b){
var _21c=this.start;
while(this.include(_21c)){
_21b(_21c);
_21c=_21c.succ();
}
},include:function(_21d){
if(_21d<this.start){
return false;
}
if(this.exclusive){
return _21d<this.end;
}
return _21d<=this.end;
}});
var $R=function(_21e,end,_220){
return new ObjectRange(_21e,end,_220);
};
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(_221){
this.responders._each(_221);
},register:function(_222){
if(!this.include(_222)){
this.responders.push(_222);
}
},unregister:function(_223){
this.responders=this.responders.without(_223);
},dispatch:function(_224,_225,_226,json){
this.each(function(_228){
if(typeof _228[_224]=="function"){
try{
_228[_224].apply(_228,[_225,_226,json]);
}
catch(e){
}
}
});
}};
Object.extend(Ajax.Responders,Enumerable);
Ajax.Responders.register({onCreate:function(){
Ajax.activeRequestCount++;
},onComplete:function(){
Ajax.activeRequestCount--;
}});
Ajax.Base=function(){
};
Ajax.Base.prototype={setOptions:function(_229){
this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:""};
Object.extend(this.options,_229||{});
this.options.method=this.options.method.toLowerCase();
if(typeof this.options.parameters=="string"){
this.options.parameters=this.options.parameters.toQueryParams();
}
}};
Ajax.Request=Class.create();
Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
Ajax.Request.prototype=Object.extend(new Ajax.Base(),{_complete:false,initialize:function(url,_22b){
this.transport=Ajax.getTransport();
this.setOptions(_22b);
this.request(url);
},request:function(url){
this.url=url;
this.method=this.options.method;
var _22d=this.options.parameters;
if(!["get","post"].include(this.method)){
_22d["_method"]=this.method;
this.method="post";
}
_22d=Hash.toQueryString(_22d);
if(_22d&&/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
_22d+="&_=";
}
if(this.method=="get"&&_22d){
this.url+=(this.url.indexOf("?")>-1?"&":"?")+_22d;
}
try{
Ajax.Responders.dispatch("onCreate",this,this.transport);
this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);
if(this.options.asynchronous){
setTimeout(function(){
this.respondToReadyState(1);
}.bind(this),10);
}
this.transport.onreadystatechange=this.onStateChange.bind(this);
this.setRequestHeaders();
var body=this.method=="post"?(this.options.postBody||_22d):null;
this.transport.send(body);
if(!this.options.asynchronous&&this.transport.overrideMimeType){
this.onStateChange();
}
}
catch(e){
this.dispatchException(e);
}
},onStateChange:function(){
var _22f=this.transport.readyState;
if(_22f>1&&!((_22f==4)&&this._complete)){
this.respondToReadyState(this.transport.readyState);
}
},setRequestHeaders:function(){
var _230={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,"Accept":"text/javascript, text/html, application/xml, text/xml, */*"};
if(this.method=="post"){
_230["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");
if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){
_230["Connection"]="close";
}
}
if(typeof this.options.requestHeaders=="object"){
var _231=this.options.requestHeaders;
if(typeof _231.push=="function"){
for(var i=0,_233=_231.length;i<_233;i+=2){
_230[_231[i]]=_231[i+1];
}
}else{
$H(_231).each(function(pair){
_230[pair.key]=pair.value;
});
}
}
for(var name in _230){
this.transport.setRequestHeader(name,_230[name]);
}
},success:function(){
return !this.transport.status||(this.transport.status>=200&&this.transport.status<300);
},respondToReadyState:function(_236){
var _237=Ajax.Request.Events[_236];
var _238=this.transport,json=this.evalJSON();
if(_237=="Complete"){
try{
this._complete=true;
(this.options["on"+this.transport.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(_238,json);
}
catch(e){
this.dispatchException(e);
}
if((this.getHeader("Content-type")||"text/javascript").strip().match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i)){
this.evalResponse();
}
}
try{
(this.options["on"+_237]||Prototype.emptyFunction)(_238,json);
Ajax.Responders.dispatch("on"+_237,this,_238,json);
}
catch(e){
this.dispatchException(e);
}
if(_237=="Complete"){
this.transport.onreadystatechange=Prototype.emptyFunction;
}
},getHeader:function(name){
try{
return this.transport.getResponseHeader(name);
}
catch(e){
return null;
}
},evalJSON:function(){
try{
var json=this.getHeader("X-JSON");
return json?eval("("+json+")"):null;
}
catch(e){
return null;
}
},evalResponse:function(){
try{
return eval(this.transport.responseText);
}
catch(e){
this.dispatchException(e);
}
},dispatchException:function(_23c){
(this.options.onException||Prototype.emptyFunction)(this,_23c);
Ajax.Responders.dispatch("onException",this,_23c);
}});
Ajax.Updater=Class.create();
Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(_23d,url,_23f){
this.container={success:(_23d.success||_23d),failure:(_23d.failure||(_23d.success?null:_23d))};
this.transport=Ajax.getTransport();
this.setOptions(_23f);
var _240=this.options.onComplete||Prototype.emptyFunction;
this.options.onComplete=(function(_241,_242){
this.updateContent();
_240(_241,_242);
}).bind(this);
this.request(url);
},updateContent:function(){
var _243=this.container[this.success()?"success":"failure"];
var _244=this.transport.responseText;
if(!this.options.evalScripts){
_244=_244.stripScripts();
}
if(_243=$(_243)){
if(this.options.insertion){
new this.options.insertion(_243,_244);
}else{
_243.update(_244);
}
}
if(this.success()){
if(this.onComplete){
setTimeout(this.onComplete.bind(this),10);
}
}
}});
Ajax.PeriodicalUpdater=Class.create();
Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(_245,url,_247){
this.setOptions(_247);
this.onComplete=this.options.onComplete;
this.frequency=(this.options.frequency||2);
this.decay=(this.options.decay||1);
this.updater={};
this.container=_245;
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(_248){
if(this.options.decay){
this.decay=(_248.responseText==this.lastText?this.decay*this.options.decay:1);
this.lastText=_248.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 $(_249){
if(arguments.length>1){
for(var i=0,_24b=[],_24c=arguments.length;i<_24c;i++){
_24b.push($(arguments[i]));
}
return _24b;
}
if(typeof _249=="string"){
_249=document.getElementById(_249);
}
return Element.extend(_249);
}
if(Prototype.BrowserFeatures.XPath){
document._getElementsByXPath=function(_24d,_24e){
var _24f=[];
var _250=document.evaluate(_24d,$(_24e)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for(var i=0,_252=_250.snapshotLength;i<_252;i++){
_24f.push(_250.snapshotItem(i));
}
return _24f;
};
}
document.getElementsByClassName=function(_253,_254){
if(Prototype.BrowserFeatures.XPath){
var q=".//*[contains(concat(' ', @class, ' '), ' "+_253+" ')]";
return document._getElementsByXPath(q,_254);
}else{
var _256=($(_254)||document.body).getElementsByTagName("*");
var _257=[],_258;
for(var i=0,_25a=_256.length;i<_25a;i++){
_258=_256[i];
if(Element.hasClassName(_258,_253)){
_257.push(Element.extend(_258));
}
}
return _257;
}
};
if(!window.Element){
var Element=new Object();
}
Element.extend=function(_25b){
if(!_25b||_nativeExtensions||_25b.nodeType==3){
return _25b;
}
if(!_25b._extended&&_25b.tagName&&_25b!=window){
var _25c=Object.clone(Element.Methods),_25d=Element.extend.cache;
if(_25b.tagName=="FORM"){
Object.extend(_25c,Form.Methods);
}
if(["INPUT","TEXTAREA","SELECT"].include(_25b.tagName)){
Object.extend(_25c,Form.Element.Methods);
}
Object.extend(_25c,Element.Methods.Simulated);
for(var _25e in _25c){
var _25f=_25c[_25e];
if(typeof _25f=="function"&&!(_25e in _25b)){
_25b[_25e]=_25d.findOrStore(_25f);
}
}
}
_25b._extended=true;
return _25b;
};
Element.extend.cache={findOrStore:function(_260){
return this[_260]=this[_260]||function(){
return _260.apply(null,[this].concat($A(arguments)));
};
}};
Element.Methods={visible:function(_261){
return $(_261).style.display!="none";
},toggle:function(_262){
_262=$(_262);
Element[Element.visible(_262)?"hide":"show"](_262);
return _262;
},hide:function(_263){
$(_263).style.display="none";
return _263;
},show:function(_264){
$(_264).style.display="";
return _264;
},remove:function(_265){
_265=$(_265);
_265.parentNode.removeChild(_265);
return _265;
},update:function(_266,html){
html=typeof html=="undefined"?"":html.toString();
$(_266).innerHTML=html.stripScripts();
setTimeout(function(){
html.evalScripts();
},10);
return _266;
},replace:function(_268,html){
_268=$(_268);
html=typeof html=="undefined"?"":html.toString();
if(_268.outerHTML){
_268.outerHTML=html.stripScripts();
}else{
var _26a=_268.ownerDocument.createRange();
_26a.selectNodeContents(_268);
_268.parentNode.replaceChild(_26a.createContextualFragment(html.stripScripts()),_268);
}
setTimeout(function(){
html.evalScripts();
},10);
return _268;
},inspect:function(_26b){
_26b=$(_26b);
var _26c="<"+_26b.tagName.toLowerCase();
$H({"id":"id","className":"class"}).each(function(pair){
var _26e=pair.first(),_26f=pair.last();
var _270=(_26b[_26e]||"").toString();
if(_270){
_26c+=" "+_26f+"="+_270.inspect(true);
}
});
return _26c+">";
},recursivelyCollect:function(_271,_272){
_271=$(_271);
var _273=[];
while(_271=_271[_272]){
if(_271.nodeType==1){
_273.push(Element.extend(_271));
}
}
return _273;
},ancestors:function(_274){
return $(_274).recursivelyCollect("parentNode");
},descendants:function(_275){
return $A($(_275).getElementsByTagName("*"));
},immediateDescendants:function(_276){
if(!(_276=$(_276).firstChild)){
return [];
}
while(_276&&_276.nodeType!=1){
_276=_276.nextSibling;
}
if(_276){
return [_276].concat($(_276).nextSiblings());
}
return [];
},previousSiblings:function(_277){
return $(_277).recursivelyCollect("previousSibling");
},nextSiblings:function(_278){
return $(_278).recursivelyCollect("nextSibling");
},siblings:function(_279){
_279=$(_279);
return _279.previousSiblings().reverse().concat(_279.nextSiblings());
},match:function(_27a,_27b){
if(typeof _27b=="string"){
_27b=new Selector(_27b);
}
return _27b.match($(_27a));
},up:function(_27c,_27d,_27e){
return Selector.findElement($(_27c).ancestors(),_27d,_27e);
},down:function(_27f,_280,_281){
return Selector.findElement($(_27f).descendants(),_280,_281);
},previous:function(_282,_283,_284){
return Selector.findElement($(_282).previousSiblings(),_283,_284);
},next:function(_285,_286,_287){
return Selector.findElement($(_285).nextSiblings(),_286,_287);
},getElementsBySelector:function(){
var args=$A(arguments),_289=$(args.shift());
return Selector.findChildElements(_289,args);
},getElementsByClassName:function(_28a,_28b){
return document.getElementsByClassName(_28b,_28a);
},readAttribute:function(_28c,name){
_28c=$(_28c);
if(document.all&&!window.opera){
var t=Element._attributeTranslations;
if(t.values[name]){
return t.values[name](_28c,name);
}
if(t.names[name]){
name=t.names[name];
}
var _28f=_28c.attributes[name];
if(_28f){
return _28f.nodeValue;
}
}
return _28c.getAttribute(name);
},getHeight:function(_290){
return $(_290).getDimensions().height;
},getWidth:function(_291){
return $(_291).getDimensions().width;
},classNames:function(_292){
return new Element.ClassNames(_292);
},hasClassName:function(_293,_294){
if(!(_293=$(_293))){
return;
}
var _295=_293.className;
if(_295.length==0){
return false;
}
if(_295==_294||_295.match(new RegExp("(^|\\s)"+_294+"(\\s|$)"))){
return true;
}
return false;
},addClassName:function(_296,_297){
if(!(_296=$(_296))){
return;
}
Element.classNames(_296).add(_297);
return _296;
},removeClassName:function(_298,_299){
if(!(_298=$(_298))){
return;
}
Element.classNames(_298).remove(_299);
return _298;
},toggleClassName:function(_29a,_29b){
if(!(_29a=$(_29a))){
return;
}
Element.classNames(_29a)[_29a.hasClassName(_29b)?"remove":"add"](_29b);
return _29a;
},observe:function(){
Event.observe.apply(Event,arguments);
return $A(arguments).first();
},stopObserving:function(){
Event.stopObserving.apply(Event,arguments);
return $A(arguments).first();
},cleanWhitespace:function(_29c){
_29c=$(_29c);
var node=_29c.firstChild;
while(node){
var _29e=node.nextSibling;
if(node.nodeType==3&&!/\S/.test(node.nodeValue)){
_29c.removeChild(node);
}
node=_29e;
}
return _29c;
},empty:function(_29f){
return $(_29f).innerHTML.match(/^\s*$/);
},descendantOf:function(_2a0,_2a1){
_2a0=$(_2a0),_2a1=$(_2a1);
while(_2a0=_2a0.parentNode){
if(_2a0==_2a1){
return true;
}
}
return false;
},scrollTo:function(_2a2){
_2a2=$(_2a2);
var pos=Position.cumulativeOffset(_2a2);
window.scrollTo(pos[0],pos[1]);
return _2a2;
},getStyle:function(_2a4,_2a5){
_2a4=$(_2a4);
if(["float","cssFloat"].include(_2a5)){
_2a5=(typeof _2a4.style.styleFloat!="undefined"?"styleFloat":"cssFloat");
}
_2a5=_2a5.camelize();
var _2a6=_2a4.style[_2a5];
if(!_2a6){
if(document.defaultView&&document.defaultView.getComputedStyle){
var css=document.defaultView.getComputedStyle(_2a4,null);
_2a6=css?css[_2a5]:null;
}else{
if(_2a4.currentStyle){
_2a6=_2a4.currentStyle[_2a5];
}
}
}
if((_2a6=="auto")&&["width","height"].include(_2a5)&&(_2a4.getStyle("display")!="none")){
_2a6=_2a4["offset"+_2a5.capitalize()]+"px";
}
if(window.opera&&["left","top","right","bottom"].include(_2a5)){
if(Element.getStyle(_2a4,"position")=="static"){
_2a6="auto";
}
}
if(_2a5=="opacity"){
if(_2a6){
return parseFloat(_2a6);
}
if(_2a6=(_2a4.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){
if(_2a6[1]){
return parseFloat(_2a6[1])/100;
}
}
return 1;
}
return _2a6=="auto"?null:_2a6;
},setStyle:function(_2a8,_2a9){
_2a8=$(_2a8);
for(var name in _2a9){
var _2ab=_2a9[name];
if(name=="opacity"){
if(_2ab==1){
_2ab=(/Gecko/.test(navigator.userAgent)&&!/Konqueror|Safari|KHTML/.test(navigator.userAgent))?0.999999:1;
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_2a8.style.filter=_2a8.getStyle("filter").replace(/alpha\([^\)]*\)/gi,"");
}
}else{
if(_2ab==""){
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_2a8.style.filter=_2a8.getStyle("filter").replace(/alpha\([^\)]*\)/gi,"");
}
}else{
if(_2ab<0.00001){
_2ab=0;
}
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_2a8.style.filter=_2a8.getStyle("filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+_2ab*100+")";
}
}
}
}else{
if(["float","cssFloat"].include(name)){
name=(typeof _2a8.style.styleFloat!="undefined")?"styleFloat":"cssFloat";
}
}
_2a8.style[name.camelize()]=_2ab;
}
return _2a8;
},getDimensions:function(_2ac){
_2ac=$(_2ac);
var _2ad=$(_2ac).getStyle("display");
if(_2ad!="none"&&_2ad!=null){
return {width:_2ac.offsetWidth,height:_2ac.offsetHeight};
}
var els=_2ac.style;
var _2af=els.visibility;
var _2b0=els.position;
var _2b1=els.display;
els.visibility="hidden";
els.position="absolute";
els.display="block";
var _2b2=_2ac.clientWidth;
var _2b3=_2ac.clientHeight;
els.display=_2b1;
els.position=_2b0;
els.visibility=_2af;
return {width:_2b2,height:_2b3};
},makePositioned:function(_2b4){
_2b4=$(_2b4);
var pos=Element.getStyle(_2b4,"position");
if(pos=="static"||!pos){
_2b4._madePositioned=true;
_2b4.style.position="relative";
if(window.opera){
_2b4.style.top=0;
_2b4.style.left=0;
}
}
return _2b4;
},undoPositioned:function(_2b6){
_2b6=$(_2b6);
if(_2b6._madePositioned){
_2b6._madePositioned=undefined;
_2b6.style.position=_2b6.style.top=_2b6.style.left=_2b6.style.bottom=_2b6.style.right="";
}
return _2b6;
},makeClipping:function(_2b7){
_2b7=$(_2b7);
if(_2b7._overflow){
return _2b7;
}
_2b7._overflow=_2b7.style.overflow||"auto";
if((Element.getStyle(_2b7,"overflow")||"visible")!="hidden"){
_2b7.style.overflow="hidden";
}
return _2b7;
},undoClipping:function(_2b8){
_2b8=$(_2b8);
if(!_2b8._overflow){
return _2b8;
}
_2b8.style.overflow=_2b8._overflow=="auto"?"":_2b8._overflow;
_2b8._overflow=null;
return _2b8;
}};
Object.extend(Element.Methods,{childOf:Element.Methods.descendantOf});
Element._attributeTranslations={};
Element._attributeTranslations.names={colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",datetime:"dateTime",accesskey:"accessKey",tabindex:"tabIndex",enctype:"encType",maxlength:"maxLength",readonly:"readOnly",longdesc:"longDesc"};
Element._attributeTranslations.values={_getAttr:function(_2b9,_2ba){
return _2b9.getAttribute(_2ba,2);
},_flag:function(_2bb,_2bc){
return $(_2bb).hasAttribute(_2bc)?_2bc:null;
},style:function(_2bd){
return _2bd.style.cssText.toLowerCase();
},title:function(_2be){
var node=_2be.getAttributeNode("title");
return node.specified?node.nodeValue:null;
}};
Object.extend(Element._attributeTranslations.values,{href:Element._attributeTranslations.values._getAttr,src:Element._attributeTranslations.values._getAttr,disabled:Element._attributeTranslations.values._flag,checked:Element._attributeTranslations.values._flag,readonly:Element._attributeTranslations.values._flag,multiple:Element._attributeTranslations.values._flag});
Element.Methods.Simulated={hasAttribute:function(_2c0,_2c1){
var t=Element._attributeTranslations;
_2c1=t.names[_2c1]||_2c1;
return $(_2c0).getAttributeNode(_2c1).specified;
}};
if(document.all&&!window.opera){
Element.Methods.update=function(_2c3,html){
_2c3=$(_2c3);
html=typeof html=="undefined"?"":html.toString();
var _2c5=_2c3.tagName.toUpperCase();
if(["THEAD","TBODY","TR","TD"].include(_2c5)){
var div=document.createElement("div");
switch(_2c5){
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(_2c3.childNodes).each(function(node){
_2c3.removeChild(node);
});
depth.times(function(){
div=div.firstChild;
});
$A(div.childNodes).each(function(node){
_2c3.appendChild(node);
});
}else{
_2c3.innerHTML=html.stripScripts();
}
setTimeout(function(){
html.evalScripts();
},10);
return _2c3;
};
}
Object.extend(Element,Element.Methods);
var _nativeExtensions=false;
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
["","Form","Input","TextArea","Select"].each(function(tag){
var _2ca="HTML"+tag+"Element";
if(window[_2ca]){
return;
}
var _2cb=window[_2ca]={};
_2cb.prototype=document.createElement(tag?tag.toLowerCase():"div").__proto__;
});
}
Element.addMethods=function(_2cc){
Object.extend(Element.Methods,_2cc||{});
function copy(_2cd,_2ce,_2cf){
_2cf=_2cf||false;
var _2d0=Element.extend.cache;
for(var _2d1 in _2cd){
var _2d2=_2cd[_2d1];
if(!_2cf||!(_2d1 in _2ce)){
_2ce[_2d1]=_2d0.findOrStore(_2d2);
}
}
}
if(typeof HTMLElement!="undefined"){
copy(Element.Methods,HTMLElement.prototype);
copy(Element.Methods.Simulated,HTMLElement.prototype,true);
copy(Form.Methods,HTMLFormElement.prototype);
[HTMLInputElement,HTMLTextAreaElement,HTMLSelectElement].each(function(_2d3){
copy(Form.Element.Methods,_2d3.prototype);
});
_nativeExtensions=true;
}
};
var Toggle=new Object();
Toggle.display=Element.toggle;
Abstract.Insertion=function(_2d4){
this.adjacency=_2d4;
};
Abstract.Insertion.prototype={initialize:function(_2d5,_2d6){
this.element=$(_2d5);
this.content=_2d6.stripScripts();
if(this.adjacency&&this.element.insertAdjacentHTML){
try{
this.element.insertAdjacentHTML(this.adjacency,this.content);
}
catch(e){
var _2d7=this.element.tagName.toUpperCase();
if(["TBODY","TR"].include(_2d7)){
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(){
_2d6.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(_2d9){
_2d9.each((function(_2da){
this.element.parentNode.insertBefore(_2da,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(_2db){
_2db.reverse(false).each((function(_2dc){
this.element.insertBefore(_2dc,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(_2dd){
_2dd.each((function(_2de){
this.element.appendChild(_2de);
}).bind(this));
}});
Insertion.After=Class.create();
Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){
this.range.setStartAfter(this.element);
},insertContent:function(_2df){
_2df.each((function(_2e0){
this.element.parentNode.insertBefore(_2e0,this.element.nextSibling);
}).bind(this));
}});
Element.ClassNames=Class.create();
Element.ClassNames.prototype={initialize:function(_2e1){
this.element=$(_2e1);
},_each:function(_2e2){
this.element.className.split(/\s+/).select(function(name){
return name.length>0;
})._each(_2e2);
},set:function(_2e4){
this.element.className=_2e4;
},add:function(_2e5){
if(this.include(_2e5)){
return;
}
this.set($A(this).concat(_2e5).join(" "));
},remove:function(_2e6){
if(!this.include(_2e6)){
return;
}
this.set($A(this).without(_2e6).join(" "));
},toString:function(){
return $A(this).join(" ");
}};
Object.extend(Element.ClassNames.prototype,Enumerable);
var Selector=Class.create();
Selector.prototype={initialize:function(_2e7){
this.params={classNames:[]};
this.expression=_2e7.toString().strip();
this.parseExpression();
this.compileMatcher();
},parseExpression:function(){
function abort(_2e8){
throw "Parse error in selector: "+_2e8;
}
if(this.expression==""){
abort("empty expression");
}
var _2e9=this.params,expr=this.expression,_2eb,_2ec,_2ed,rest;
while(_2eb=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){
_2e9.attributes=_2e9.attributes||[];
_2e9.attributes.push({name:_2eb[2],operator:_2eb[3],value:_2eb[4]||_2eb[5]||""});
expr=_2eb[1];
}
if(expr=="*"){
return this.params.wildcard=true;
}
while(_2eb=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)){
_2ec=_2eb[1],_2ed=_2eb[2],rest=_2eb[3];
switch(_2ec){
case "#":
_2e9.id=_2ed;
break;
case ".":
_2e9.classNames.push(_2ed);
break;
case "":
case undefined:
_2e9.tagName=_2ed.toUpperCase();
break;
default:
abort(expr.inspect());
}
expr=rest;
}
if(expr.length>0){
abort(expr.inspect());
}
},buildMatchExpression:function(){
var _2ef=this.params,_2f0=[],_2f1;
if(_2ef.wildcard){
_2f0.push("true");
}
if(_2f1=_2ef.id){
_2f0.push("element.readAttribute(\"id\") == "+_2f1.inspect());
}
if(_2f1=_2ef.tagName){
_2f0.push("element.tagName.toUpperCase() == "+_2f1.inspect());
}
if((_2f1=_2ef.classNames).length>0){
for(var i=0,_2f3=_2f1.length;i<_2f3;i++){
_2f0.push("element.hasClassName("+_2f1[i].inspect()+")");
}
}
if(_2f1=_2ef.attributes){
_2f1.each(function(_2f4){
var _2f5="element.readAttribute("+_2f4.name.inspect()+")";
var _2f6=function(_2f7){
return _2f5+" && "+_2f5+".split("+_2f7.inspect()+")";
};
switch(_2f4.operator){
case "=":
_2f0.push(_2f5+" == "+_2f4.value.inspect());
break;
case "~=":
_2f0.push(_2f6(" ")+".include("+_2f4.value.inspect()+")");
break;
case "|=":
_2f0.push(_2f6("-")+".first().toUpperCase() == "+_2f4.value.toUpperCase().inspect());
break;
case "!=":
_2f0.push(_2f5+" != "+_2f4.value.inspect());
break;
case "":
case undefined:
_2f0.push("element.hasAttribute("+_2f4.name.inspect()+")");
break;
default:
throw "Unknown operator "+_2f4.operator+" in selector";
}
});
}
return _2f0.join(" && ");
},compileMatcher:function(){
this.match=new Function("element","if (!element.tagName) return false;       element = $(element);       return "+this.buildMatchExpression());
},findElements:function(_2f8){
var _2f9;
if(_2f9=$(this.params.id)){
if(this.match(_2f9)){
if(!_2f8||Element.childOf(_2f9,_2f8)){
return [_2f9];
}
}
}
_2f8=(_2f8||document).getElementsByTagName(this.params.tagName||"*");
var _2fa=[];
for(var i=0,_2fc=_2f8.length;i<_2fc;i++){
if(this.match(_2f9=_2f8[i])){
_2fa.push(Element.extend(_2f9));
}
}
return _2fa;
},toString:function(){
return this.expression;
}};
Object.extend(Selector,{matchElements:function(_2fd,_2fe){
var _2ff=new Selector(_2fe);
return _2fd.select(_2ff.match.bind(_2ff)).collect(Element.extend);
},findElement:function(_300,_301,_302){
if(typeof _301=="number"){
_302=_301,_301=false;
}
return Selector.matchElements(_300,_301||"*")[_302||0];
},findChildElements:function(_303,_304){
return _304.collect(function(_305){
return _305.match(/[^\s"]+(?:"[^"]*"[^\s"]+)*/g).inject([null],function(_306,expr){
var _308=new Selector(expr);
return _306.inject([],function(_309,_30a){
return _309.concat(_308.findElements(_30a||_303));
});
});
}).flatten();
}});
function $$(){
return Selector.findChildElements(document,$A(arguments));
}
var Form={reset:function(form){
$(form).reset();
return form;
},serializeElements:function(_30c,_30d){
var data=_30c.inject({},function(_30f,_310){
if(!_310.disabled&&_310.name){
var key=_310.name,_312=$(_310).getValue();
if(_312!=undefined){
if(_30f[key]){
if(_30f[key].constructor!=Array){
_30f[key]=[_30f[key]];
}
_30f[key].push(_312);
}else{
_30f[key]=_312;
}
}
}
return _30f;
});
return _30d?data:Hash.toQueryString(data);
}};
Form.Methods={serialize:function(form,_314){
return Form.serializeElements(Form.getElements(form),_314);
},getElements:function(form){
return $A($(form).getElementsByTagName("*")).inject([],function(_316,_317){
if(Form.Element.Serializers[_317.tagName.toLowerCase()]){
_316.push(Element.extend(_317));
}
return _316;
});
},getInputs:function(form,_319,name){
form=$(form);
var _31b=form.getElementsByTagName("input");
if(!_319&&!name){
return $A(_31b).collect(Element.extend);
}
for(var i=0,_31d=[],_31e=_31b.length;i<_31e;i++){
var _31f=_31b[i];
if((_319&&_31f.type!=_319)||(name&&_31f.name!=name)){
continue;
}
_31d.push(Element.extend(_31f));
}
return _31d;
},disable:function(form){
form=$(form);
form.getElements().each(function(_321){
_321.blur();
_321.disabled="true";
});
return form;
},enable:function(form){
form=$(form);
form.getElements().each(function(_323){
_323.disabled="";
});
return form;
},findFirstElement:function(form){
return $(form).getElements().find(function(_325){
return _325.type!="hidden"&&!_325.disabled&&["input","select","textarea"].include(_325.tagName.toLowerCase());
});
},focusFirstElement:function(form){
form=$(form);
form.findFirstElement().activate();
return form;
}};
Object.extend(Form,Form.Methods);
Form.Element={focus:function(_327){
$(_327).focus();
return _327;
},select:function(_328){
$(_328).select();
return _328;
}};
Form.Element.Methods={serialize:function(_329){
_329=$(_329);
if(!_329.disabled&&_329.name){
var _32a=_329.getValue();
if(_32a!=undefined){
var pair={};
pair[_329.name]=_32a;
return Hash.toQueryString(pair);
}
}
return "";
},getValue:function(_32c){
_32c=$(_32c);
var _32d=_32c.tagName.toLowerCase();
return Form.Element.Serializers[_32d](_32c);
},clear:function(_32e){
$(_32e).value="";
return _32e;
},present:function(_32f){
return $(_32f).value!="";
},activate:function(_330){
_330=$(_330);
_330.focus();
if(_330.select&&(_330.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(_330.type))){
_330.select();
}
return _330;
},disable:function(_331){
_331=$(_331);
_331.disabled=true;
return _331;
},enable:function(_332){
_332=$(_332);
_332.blur();
_332.disabled=false;
return _332;
}};
Object.extend(Form.Element,Form.Element.Methods);
var Field=Form.Element;
var $F=Form.Element.getValue;
Form.Element.Serializers={input:function(_333){
switch(_333.type.toLowerCase()){
case "checkbox":
case "radio":
return Form.Element.Serializers.inputSelector(_333);
default:
return Form.Element.Serializers.textarea(_333);
}
},inputSelector:function(_334){
return _334.checked?_334.value:null;
},textarea:function(_335){
return _335.value;
},select:function(_336){
return this[_336.type=="select-one"?"selectOne":"selectMany"](_336);
},selectOne:function(_337){
var _338=_337.selectedIndex;
return _338>=0?this.optionValue(_337.options[_338]):null;
},selectMany:function(_339){
var _33a,_33b=_339.length;
if(!_33b){
return null;
}
for(var i=0,_33a=[];i<_33b;i++){
var opt=_339.options[i];
if(opt.selected){
_33a.push(this.optionValue(opt));
}
}
return _33a;
},optionValue:function(opt){
return Element.extend(opt).hasAttribute("value")?opt.value:opt.text;
}};
Abstract.TimedObserver=function(){
};
Abstract.TimedObserver.prototype={initialize:function(_33f,_340,_341){
this.frequency=_340;
this.element=$(_33f);
this.callback=_341;
this.lastValue=this.getValue();
this.registerCallback();
},registerCallback:function(){
setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},onTimerEvent:function(){
var _342=this.getValue();
var _343=("string"==typeof this.lastValue&&"string"==typeof _342?this.lastValue!=_342:String(this.lastValue)!=String(_342));
if(_343){
this.callback(this.element,_342);
this.lastValue=_342;
}
}};
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(_344,_345){
this.element=$(_344);
this.callback=_345;
this.lastValue=this.getValue();
if(this.element.tagName.toLowerCase()=="form"){
this.registerFormCallbacks();
}else{
this.registerCallback(this.element);
}
},onElementEvent:function(){
var _346=this.getValue();
if(this.lastValue!=_346){
this.callback(this.element,_346);
this.lastValue=_346;
}
},registerFormCallbacks:function(){
Form.getElements(this.element).each(this.registerCallback.bind(this));
},registerCallback:function(_347){
if(_347.type){
switch(_347.type.toLowerCase()){
case "checkbox":
case "radio":
Event.observe(_347,"click",this.onElementEvent.bind(this));
break;
default:
Event.observe(_347,"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(_348){
return _348.target||_348.srcElement;
},isLeftClick:function(_349){
return (((_349.which)&&(_349.which==1))||((_349.button)&&(_349.button==1)));
},pointerX:function(_34a){
return _34a.pageX||(_34a.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
},pointerY:function(_34b){
return _34b.pageY||(_34b.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
},stop:function(_34c){
if(_34c.preventDefault){
_34c.preventDefault();
_34c.stopPropagation();
}else{
_34c.returnValue=false;
_34c.cancelBubble=true;
}
},findElement:function(_34d,_34e){
var _34f=Event.element(_34d);
while(_34f.parentNode&&(!_34f.tagName||(_34f.tagName.toUpperCase()!=_34e.toUpperCase()))){
_34f=_34f.parentNode;
}
return _34f;
},observers:false,_observeAndCache:function(_350,name,_352,_353){
if(!this.observers){
this.observers=[];
}
if(_350.addEventListener){
this.observers.push([_350,name,_352,_353]);
_350.addEventListener(name,_352,_353);
}else{
if(_350.attachEvent){
this.observers.push([_350,name,_352,_353]);
_350.attachEvent("on"+name,_352);
}
}
},unloadCache:function(){
if(!Event.observers){
return;
}
for(var i=0,_355=Event.observers.length;i<_355;i++){
Event.stopObserving.apply(this,Event.observers[i]);
Event.observers[i][0]=null;
}
Event.observers=false;
},observe:function(_356,name,_358,_359){
_356=$(_356);
_359=_359||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_356.attachEvent)){
name="keydown";
}
Event._observeAndCache(_356,name,_358,_359);
},stopObserving:function(_35a,name,_35c,_35d){
_35a=$(_35a);
_35d=_35d||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_35a.detachEvent)){
name="keydown";
}
if(_35a.removeEventListener){
_35a.removeEventListener(name,_35c,_35d);
}else{
if(_35a.detachEvent){
try{
_35a.detachEvent("on"+name,_35c);
}
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(_35e){
var _35f=0,_360=0;
do{
_35f+=_35e.scrollTop||0;
_360+=_35e.scrollLeft||0;
_35e=_35e.parentNode;
}while(_35e);
return [_360,_35f];
},cumulativeOffset:function(_361){
var _362=0,_363=0;
do{
_362+=_361.offsetTop||0;
_363+=_361.offsetLeft||0;
_361=_361.offsetParent;
}while(_361);
return [_363,_362];
},positionedOffset:function(_364){
var _365=0,_366=0;
do{
_365+=_364.offsetTop||0;
_366+=_364.offsetLeft||0;
_364=_364.offsetParent;
if(_364){
if(_364.tagName=="BODY"){
break;
}
var p=Element.getStyle(_364,"position");
if(p=="relative"||p=="absolute"){
break;
}
}
}while(_364);
return [_366,_365];
},offsetParent:function(_368){
if(_368.offsetParent){
return _368.offsetParent;
}
if(_368==document.body){
return _368;
}
while((_368=_368.parentNode)&&_368!=document.body){
if(Element.getStyle(_368,"position")!="static"){
return _368;
}
}
return document.body;
},within:function(_369,x,y){
if(this.includeScrollOffsets){
return this.withinIncludingScrolloffsets(_369,x,y);
}
this.xcomp=x;
this.ycomp=y;
this.offset=this.cumulativeOffset(_369);
return (y>=this.offset[1]&&y<this.offset[1]+_369.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+_369.offsetWidth);
},withinIncludingScrolloffsets:function(_36c,x,y){
var _36f=this.realOffset(_36c);
this.xcomp=x+_36f[0]-this.deltaX;
this.ycomp=y+_36f[1]-this.deltaY;
this.offset=this.cumulativeOffset(_36c);
return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+_36c.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+_36c.offsetWidth);
},overlap:function(mode,_371){
if(!mode){
return 0;
}
if(mode=="vertical"){
return ((this.offset[1]+_371.offsetHeight)-this.ycomp)/_371.offsetHeight;
}
if(mode=="horizontal"){
return ((this.offset[0]+_371.offsetWidth)-this.xcomp)/_371.offsetWidth;
}
},page:function(_372){
var _373=0,_374=0;
var _375=_372;
do{
_373+=_375.offsetTop||0;
_374+=_375.offsetLeft||0;
if(_375.offsetParent==document.body){
if(Element.getStyle(_375,"position")=="absolute"){
break;
}
}
}while(_375=_375.offsetParent);
_375=_372;
do{
if(!window.opera||_375.tagName=="BODY"){
_373-=_375.scrollTop||0;
_374-=_375.scrollLeft||0;
}
}while(_375=_375.parentNode);
return [_374,_373];
},clone:function(_376,_377){
var _378=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});
_376=$(_376);
var p=Position.page(_376);
_377=$(_377);
var _37a=[0,0];
var _37b=null;
if(Element.getStyle(_377,"position")=="absolute"){
_37b=Position.offsetParent(_377);
_37a=Position.page(_37b);
}
if(_37b==document.body){
_37a[0]-=document.body.offsetLeft;
_37a[1]-=document.body.offsetTop;
}
if(_378.setLeft){
_377.style.left=(p[0]-_37a[0]+_378.offsetLeft)+"px";
}
if(_378.setTop){
_377.style.top=(p[1]-_37a[1]+_378.offsetTop)+"px";
}
if(_378.setWidth){
_377.style.width=_376.offsetWidth+"px";
}
if(_378.setHeight){
_377.style.height=_376.offsetHeight+"px";
}
},absolutize:function(_37c){
_37c=$(_37c);
if(_37c.style.position=="absolute"){
return;
}
Position.prepare();
var _37d=Position.positionedOffset(_37c);
var top=_37d[1];
var left=_37d[0];
var _380=_37c.clientWidth;
var _381=_37c.clientHeight;
_37c._originalLeft=left-parseFloat(_37c.style.left||0);
_37c._originalTop=top-parseFloat(_37c.style.top||0);
_37c._originalWidth=_37c.style.width;
_37c._originalHeight=_37c.style.height;
_37c.style.position="absolute";
_37c.style.top=top+"px";
_37c.style.left=left+"px";
_37c.style.width=_380+"px";
_37c.style.height=_381+"px";
},relativize:function(_382){
_382=$(_382);
if(_382.style.position=="relative"){
return;
}
Position.prepare();
_382.style.position="relative";
var top=parseFloat(_382.style.top||0)-(_382._originalTop||0);
var left=parseFloat(_382.style.left||0)-(_382._originalLeft||0);
_382.style.top=top+"px";
_382.style.left=left+"px";
_382.style.height=_382._originalHeight;
_382.style.width=_382._originalWidth;
}};
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
Position.cumulativeOffset=function(_385){
var _386=0,_387=0;
do{
_386+=_385.offsetTop||0;
_387+=_385.offsetLeft||0;
if(_385.offsetParent==document.body){
if(Element.getStyle(_385,"position")=="absolute"){
break;
}
}
_385=_385.offsetParent;
}while(_385);
return [_387,_386];
};
}
Element.addMethods();
var Scriptaculous={Version:"1.7.0",require:function(_388){
document.write("<script type=\"text/javascript\" src=\""+_388+"\"></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");
}
}};
Scriptaculous.load();
var Builder={NODEMAP:{AREA:"map",CAPTION:"table",COL:"table",COLGROUP:"table",LEGEND:"fieldset",OPTGROUP:"select",OPTION:"select",PARAM:"object",TBODY:"table",TD:"table",TFOOT:"table",TH:"table",THEAD:"table",TR:"table"},node:function(_389){
_389=_389.toUpperCase();
var _38a=this.NODEMAP[_389]||"div";
var _38b=document.createElement(_38a);
try{
_38b.innerHTML="<"+_389+"></"+_389+">";
}
catch(e){
}
var _38c=_38b.firstChild||null;
if(_38c&&(_38c.tagName.toUpperCase()!=_389)){
_38c=_38c.getElementsByTagName(_389)[0];
}
if(!_38c){
_38c=document.createElement(_389);
}
if(!_38c){
return;
}
if(arguments[1]){
if(this._isStringOrNumber(arguments[1])||(arguments[1] instanceof Array)){
this._children(_38c,arguments[1]);
}else{
var _38d=this._attributes(arguments[1]);
if(_38d.length){
try{
_38b.innerHTML="<"+_389+" "+_38d+"></"+_389+">";
}
catch(e){
}
_38c=_38b.firstChild||null;
if(!_38c){
_38c=document.createElement(_389);
for(attr in arguments[1]){
_38c[attr=="class"?"className":attr]=arguments[1][attr];
}
}
if(_38c.tagName.toUpperCase()!=_389){
_38c=_38b.getElementsByTagName(_389)[0];
}
}
}
}
if(arguments[2]){
this._children(_38c,arguments[2]);
}
return _38c;
},_text:function(text){
return document.createTextNode(text);
},ATTR_MAP:{"className":"class","htmlFor":"for"},_attributes:function(_38f){
var _390=[];
for(attribute in _38f){
_390.push((attribute in this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+"=\""+_38f[attribute].toString().escapeHTML()+"\"");
}
return _390.join(" ");
},_children:function(_391,_392){
if(typeof _392=="object"){
_392.flatten().each(function(e){
if(typeof e=="object"){
_391.appendChild(e);
}else{
if(Builder._isStringOrNumber(e)){
_391.appendChild(Builder._text(e));
}
}
});
}else{
if(Builder._isStringOrNumber(_392)){
_391.appendChild(Builder._text(_392));
}
}
},_isStringOrNumber:function(_394){
return (typeof _394=="string"||typeof _394=="number");
},build:function(html){
var _396=this.node("div");
$(_396).update(html.strip());
return _396.down();
},dump:function(_397){
if(typeof _397!="object"&&typeof _397!="function"){
_397=window;
}
var tags=("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY "+"BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET "+"FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+"KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+"PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+"TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);
tags.each(function(tag){
_397[tag]=function(){
return Builder.node.apply(Builder,[tag].concat($A(arguments)));
};
});
}};
String.prototype.parseColor=function(){
var _39a="#";
if(this.slice(0,4)=="rgb("){
var cols=this.slice(4,this.length-1).split(",");
var i=0;
do{
_39a+=parseInt(cols[i]).toColorPart();
}while(++i<3);
}else{
if(this.slice(0,1)=="#"){
if(this.length==4){
for(var i=1;i<4;i++){
_39a+=(this.charAt(i)+this.charAt(i)).toLowerCase();
}
}
if(this.length==7){
_39a=this.toLowerCase();
}
}
}
return (_39a.length==7?_39a:(arguments[0]||this));
};
Element.collectTextNodes=function(_39d){
return $A($(_39d).childNodes).collect(function(node){
return (node.nodeType==3?node.nodeValue:(node.hasChildNodes()?Element.collectTextNodes(node):""));
}).flatten().join("");
};
Element.collectTextNodesIgnoreClass=function(_39f,_3a0){
return $A($(_39f).childNodes).collect(function(node){
return (node.nodeType==3?node.nodeValue:((node.hasChildNodes()&&!Element.hasClassName(node,_3a0))?Element.collectTextNodesIgnoreClass(node,_3a0):""));
}).flatten().join("");
};
Element.setContentZoom=function(_3a2,_3a3){
_3a2=$(_3a2);
_3a2.setStyle({fontSize:(_3a3/100)+"em"});
if(navigator.appVersion.indexOf("AppleWebKit")>0){
window.scrollBy(0,0);
}
return _3a2;
};
Element.getOpacity=function(_3a4){
return $(_3a4).getStyle("opacity");
};
Element.setOpacity=function(_3a5,_3a6){
return $(_3a5).setStyle({opacity:_3a6});
};
Element.getInlineOpacity=function(_3a7){
return $(_3a7).style.opacity||"";
};
Element.forceRerendering=function(_3a8){
try{
_3a8=$(_3a8);
var n=document.createTextNode(" ");
_3a8.appendChild(n);
_3a8.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(_3ac){
if(typeof Builder=="undefined"){
throw ("Effect.tagifyText requires including script.aculo.us' builder.js library");
}
var _3ad="position:relative";
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_3ad+=";zoom:1";
}
_3ac=$(_3ac);
$A(_3ac.childNodes).each(function(_3ae){
if(_3ae.nodeType==3){
_3ae.nodeValue.toArray().each(function(_3af){
_3ac.insertBefore(Builder.node("span",{style:_3ad},_3af==" "?String.fromCharCode(160):_3af),_3ae);
});
Element.remove(_3ae);
}
});
},multiple:function(_3b0,_3b1){
var _3b2;
if(((typeof _3b0=="object")||(typeof _3b0=="function"))&&(_3b0.length)){
_3b2=_3b0;
}else{
_3b2=$(_3b0).childNodes;
}
var _3b3=Object.extend({speed:0.1,delay:0},arguments[2]||{});
var _3b4=_3b3.delay;
$A(_3b2).each(function(_3b5,_3b6){
new _3b1(_3b5,Object.extend(_3b3,{delay:_3b6*_3b3.speed+_3b4}));
});
},PAIRS:{"slide":["SlideDown","SlideUp"],"blind":["BlindDown","BlindUp"],"appear":["Appear","Fade"]},toggle:function(_3b7,_3b8){
_3b7=$(_3b7);
_3b8=(_3b8||"appear").toLowerCase();
var _3b9=Object.extend({queue:{position:"end",scope:(_3b7.id||"global"),limit:1}},arguments[2]||{});
Effect[_3b7.visible()?Effect.PAIRS[_3b8][1]:Effect.PAIRS[_3b8][0]](_3b7,_3b9);
}};
var Effect2=Effect;
Effect.Transitions={linear:Prototype.K,sinoidal:function(pos){
return (-Math.cos(pos*Math.PI)/2)+0.5;
},reverse:function(pos){
return 1-pos;
},flicker:function(pos){
return ((-Math.cos(pos*Math.PI)/4)+0.75)+Math.random()/4;
},wobble:function(pos){
return (-Math.cos(pos*Math.PI*(9*pos))/2)+0.5;
},pulse:function(pos,_3bf){
_3bf=_3bf||5;
return (Math.round((pos%(1/_3bf))*_3bf)==0?((pos*_3bf*2)-Math.floor(pos*_3bf*2)):1-((pos*_3bf*2)-Math.floor(pos*_3bf*2)));
},none:function(pos){
return 0;
},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(_3c2){
this.effects._each(_3c2);
},add:function(_3c3){
var _3c4=new Date().getTime();
var _3c5=(typeof _3c3.options.queue=="string")?_3c3.options.queue:_3c3.options.queue.position;
switch(_3c5){
case "front":
this.effects.findAll(function(e){
return e.state=="idle";
}).each(function(e){
e.startOn+=_3c3.finishOn;
e.finishOn+=_3c3.finishOn;
});
break;
case "with-last":
_3c4=this.effects.pluck("startOn").max()||_3c4;
break;
case "end":
_3c4=this.effects.pluck("finishOn").max()||_3c4;
break;
}
_3c3.startOn+=_3c4;
_3c3.finishOn+=_3c4;
if(!_3c3.options.queue.limit||(this.effects.length<_3c3.options.queue.limit)){
this.effects.push(_3c3);
}
if(!this.interval){
this.interval=setInterval(this.loop.bind(this),15);
}
},remove:function(_3c8){
this.effects=this.effects.reject(function(e){
return e==_3c8;
});
if(this.effects.length==0){
clearInterval(this.interval);
this.interval=null;
}
},loop:function(){
var _3ca=new Date().getTime();
for(var i=0,len=this.effects.length;i<len;i++){
if(this.effects[i]){
this.effects[i].loop(_3ca);
}
}
}});
Effect.Queues={instances:$H(),get:function(_3cd){
if(typeof _3cd!="string"){
return _3cd;
}
if(!this.instances[_3cd]){
this.instances[_3cd]=new Effect.ScopedQueue();
}
return this.instances[_3cd];
}};
Effect.Queue=Effect.Queues.get("global");
Effect.DefaultOptions={transition:Effect.Transitions.sinoidal,duration:1,fps:60,sync:false,from:0,to:1,delay:0,queue:"parallel"};
Effect.Base=function(){
};
Effect.Base.prototype={position:null,start:function(_3ce){
this.options=Object.extend(Object.extend({},Effect.DefaultOptions),_3ce||{});
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(_3cf){
if(_3cf>=this.startOn){
if(_3cf>=this.finishOn){
this.render(1);
this.cancel();
this.event("beforeFinish");
if(this.finish){
this.finish();
}
this.event("afterFinish");
return;
}
var pos=(_3cf-this.startOn)/(this.finishOn-this.startOn);
var _3d1=Math.round(pos*this.options.fps*this.options.duration);
if(_3d1>this.currentFrame){
this.render(pos);
this.currentFrame=_3d1;
}
}
},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(_3d3){
if(this.options[_3d3+"Internal"]){
this.options[_3d3+"Internal"](this);
}
if(this.options[_3d3]){
this.options[_3d3](this);
}
},inspect:function(){
var data=$H();
for(property in this){
if(typeof this[property]!="function"){
data[property]=this[property];
}
}
return "#<Effect:"+data.inspect()+",options:"+$H(this.options).inspect()+">";
}};
Effect.Parallel=Class.create();
Object.extend(Object.extend(Effect.Parallel.prototype,Effect.Base.prototype),{initialize:function(_3d5){
this.effects=_3d5||[];
this.start(arguments[1]);
},update:function(_3d6){
this.effects.invoke("render",_3d6);
},finish:function(_3d7){
this.effects.each(function(_3d8){
_3d8.render(1);
_3d8.cancel();
_3d8.event("beforeFinish");
if(_3d8.finish){
_3d8.finish(_3d7);
}
_3d8.event("afterFinish");
});
}});
Effect.Event=Class.create();
Object.extend(Object.extend(Effect.Event.prototype,Effect.Base.prototype),{initialize:function(){
var _3d9=Object.extend({duration:0},arguments[0]||{});
this.start(_3d9);
},update:Prototype.emptyFunction});
Effect.Opacity=Class.create();
Object.extend(Object.extend(Effect.Opacity.prototype,Effect.Base.prototype),{initialize:function(_3da){
this.element=$(_3da);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
if(/MSIE/.test(navigator.userAgent)&&!window.opera&&(!this.element.currentStyle.hasLayout)){
this.element.setStyle({zoom:1});
}
var _3db=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});
this.start(_3db);
},update:function(_3dc){
this.element.setOpacity(_3dc);
}});
Effect.Move=Class.create();
Object.extend(Object.extend(Effect.Move.prototype,Effect.Base.prototype),{initialize:function(_3dd){
this.element=$(_3dd);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _3de=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});
this.start(_3de);
},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(_3df){
this.element.setStyle({left:Math.round(this.options.x*_3df+this.originalLeft)+"px",top:Math.round(this.options.y*_3df+this.originalTop)+"px"});
}});
Effect.MoveBy=function(_3e0,_3e1,_3e2){
return new Effect.Move(_3e0,Object.extend({x:_3e2,y:_3e1},arguments[3]||{}));
};
Effect.Scale=Class.create();
Object.extend(Object.extend(Effect.Scale.prototype,Effect.Base.prototype),{initialize:function(_3e3,_3e4){
this.element=$(_3e3);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _3e5=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_3e4},arguments[2]||{});
this.start(_3e5);
},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 _3e7=this.element.getStyle("font-size")||"100%";
["em","px","%","pt"].each(function(_3e8){
if(_3e7.indexOf(_3e8)>0){
this.fontSize=parseFloat(_3e7);
this.fontSizeType=_3e8;
}
}.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(_3e9){
var _3ea=(this.options.scaleFrom/100)+(this.factor*_3e9);
if(this.options.scaleContent&&this.fontSize){
this.element.setStyle({fontSize:this.fontSize*_3ea+this.fontSizeType});
}
this.setDimensions(this.dims[0]*_3ea,this.dims[1]*_3ea);
},finish:function(_3eb){
if(this.restoreAfterFinish){
this.element.setStyle(this.originalStyle);
}
},setDimensions:function(_3ec,_3ed){
var d={};
if(this.options.scaleX){
d.width=Math.round(_3ed)+"px";
}
if(this.options.scaleY){
d.height=Math.round(_3ec)+"px";
}
if(this.options.scaleFromCenter){
var topd=(_3ec-this.dims[0])/2;
var _3f0=(_3ed-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-_3f0+"px";
}
}else{
if(this.options.scaleY){
d.top=-topd+"px";
}
if(this.options.scaleX){
d.left=-_3f0+"px";
}
}
}
this.element.setStyle(d);
}});
Effect.Highlight=Class.create();
Object.extend(Object.extend(Effect.Highlight.prototype,Effect.Base.prototype),{initialize:function(_3f1){
this.element=$(_3f1);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _3f2=Object.extend({startcolor:"#ffff99"},arguments[1]||{});
this.start(_3f2);
},setup:function(){
if(this.element.getStyle("display")=="none"){
this.cancel();
return;
}
this.oldStyle={};
if(!this.options.keepBackgroundImage){
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(_3f5){
this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(m,v,i){
return m+(Math.round(this._base[i]+(this._delta[i]*_3f5)).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(_3f9){
this.element=$(_3f9);
this.start(arguments[1]||{});
},setup:function(){
Position.prepare();
var _3fa=Position.cumulativeOffset(this.element);
if(this.options.offset){
_3fa[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=(_3fa[1]>max?max:_3fa[1])-this.scrollStart;
},update:function(_3fc){
Position.prepare();
window.scrollTo(Position.deltaX,this.scrollStart+(_3fc*this.delta));
}});
Effect.Fade=function(_3fd){
_3fd=$(_3fd);
var _3fe=_3fd.getInlineOpacity();
var _3ff=Object.extend({from:_3fd.getOpacity()||1,to:0,afterFinishInternal:function(_400){
if(_400.options.to!=0){
return;
}
_400.element.hide().setStyle({opacity:_3fe});
}},arguments[1]||{});
return new Effect.Opacity(_3fd,_3ff);
};
Effect.Appear=function(_401){
_401=$(_401);
var _402=Object.extend({from:(_401.getStyle("display")=="none"?0:_401.getOpacity()||0),to:1,afterFinishInternal:function(_403){
_403.element.forceRerendering();
},beforeSetup:function(_404){
_404.element.setOpacity(_404.options.from).show();
}},arguments[1]||{});
return new Effect.Opacity(_401,_402);
};
Effect.Puff=function(_405){
_405=$(_405);
var _406={opacity:_405.getInlineOpacity(),position:_405.getStyle("position"),top:_405.style.top,left:_405.style.left,width:_405.style.width,height:_405.style.height};
return new Effect.Parallel([new Effect.Scale(_405,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(_405,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(_407){
Position.absolutize(_407.effects[0].element);
},afterFinishInternal:function(_408){
_408.effects[0].element.hide().setStyle(_406);
}},arguments[1]||{}));
};
Effect.BlindUp=function(_409){
_409=$(_409);
_409.makeClipping();
return new Effect.Scale(_409,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(_40a){
_40a.element.hide().undoClipping();
}},arguments[1]||{}));
};
Effect.BlindDown=function(_40b){
_40b=$(_40b);
var _40c=_40b.getDimensions();
return new Effect.Scale(_40b,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_40c.height,originalWidth:_40c.width},restoreAfterFinish:true,afterSetup:function(_40d){
_40d.element.makeClipping().setStyle({height:"0px"}).show();
},afterFinishInternal:function(_40e){
_40e.element.undoClipping();
}},arguments[1]||{}));
};
Effect.SwitchOff=function(_40f){
_40f=$(_40f);
var _410=_40f.getInlineOpacity();
return new Effect.Appear(_40f,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(_411){
new Effect.Scale(_411.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(_412){
_412.element.makePositioned().makeClipping();
},afterFinishInternal:function(_413){
_413.element.hide().undoClipping().undoPositioned().setStyle({opacity:_410});
}});
}},arguments[1]||{}));
};
Effect.DropOut=function(_414){
_414=$(_414);
var _415={top:_414.getStyle("top"),left:_414.getStyle("left"),opacity:_414.getInlineOpacity()};
return new Effect.Parallel([new Effect.Move(_414,{x:0,y:100,sync:true}),new Effect.Opacity(_414,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(_416){
_416.effects[0].element.makePositioned();
},afterFinishInternal:function(_417){
_417.effects[0].element.hide().undoPositioned().setStyle(_415);
}},arguments[1]||{}));
};
Effect.Shake=function(_418){
_418=$(_418);
var _419={top:_418.getStyle("top"),left:_418.getStyle("left")};
return new Effect.Move(_418,{x:20,y:0,duration:0.05,afterFinishInternal:function(_41a){
new Effect.Move(_41a.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_41b){
new Effect.Move(_41b.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_41c){
new Effect.Move(_41c.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_41d){
new Effect.Move(_41d.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_41e){
new Effect.Move(_41e.element,{x:-20,y:0,duration:0.05,afterFinishInternal:function(_41f){
_41f.element.undoPositioned().setStyle(_419);
}});
}});
}});
}});
}});
}});
};
Effect.SlideDown=function(_420){
_420=$(_420).cleanWhitespace();
var _421=_420.down().getStyle("bottom");
var _422=_420.getDimensions();
return new Effect.Scale(_420,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:_422.height,originalWidth:_422.width},restoreAfterFinish:true,afterSetup:function(_423){
_423.element.makePositioned();
_423.element.down().makePositioned();
if(window.opera){
_423.element.setStyle({top:""});
}
_423.element.makeClipping().setStyle({height:"0px"}).show();
},afterUpdateInternal:function(_424){
_424.element.down().setStyle({bottom:(_424.dims[0]-_424.element.clientHeight)+"px"});
},afterFinishInternal:function(_425){
_425.element.undoClipping().undoPositioned();
_425.element.down().undoPositioned().setStyle({bottom:_421});
}},arguments[1]||{}));
};
Effect.SlideUp=function(_426){
_426=$(_426).cleanWhitespace();
var _427=_426.down().getStyle("bottom");
return new Effect.Scale(_426,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_428){
_428.element.makePositioned();
_428.element.down().makePositioned();
if(window.opera){
_428.element.setStyle({top:""});
}
_428.element.makeClipping().show();
},afterUpdateInternal:function(_429){
_429.element.down().setStyle({bottom:(_429.dims[0]-_429.element.clientHeight)+"px"});
},afterFinishInternal:function(_42a){
_42a.element.hide().undoClipping().undoPositioned().setStyle({bottom:_427});
_42a.element.down().undoPositioned();
}},arguments[1]||{}));
};
Effect.Squish=function(_42b){
return new Effect.Scale(_42b,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(_42c){
_42c.element.makeClipping();
},afterFinishInternal:function(_42d){
_42d.element.hide().undoClipping();
}});
};
Effect.Grow=function(_42e){
_42e=$(_42e);
var _42f=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});
var _430={top:_42e.style.top,left:_42e.style.left,height:_42e.style.height,width:_42e.style.width,opacity:_42e.getInlineOpacity()};
var dims=_42e.getDimensions();
var _432,_433;
var _434,_435;
switch(_42f.direction){
case "top-left":
_432=_433=_434=_435=0;
break;
case "top-right":
_432=dims.width;
_433=_435=0;
_434=-dims.width;
break;
case "bottom-left":
_432=_434=0;
_433=dims.height;
_435=-dims.height;
break;
case "bottom-right":
_432=dims.width;
_433=dims.height;
_434=-dims.width;
_435=-dims.height;
break;
case "center":
_432=dims.width/2;
_433=dims.height/2;
_434=-dims.width/2;
_435=-dims.height/2;
break;
}
return new Effect.Move(_42e,{x:_432,y:_433,duration:0.01,beforeSetup:function(_436){
_436.element.hide().makeClipping().makePositioned();
},afterFinishInternal:function(_437){
new Effect.Parallel([new Effect.Opacity(_437.element,{sync:true,to:1,from:0,transition:_42f.opacityTransition}),new Effect.Move(_437.element,{x:_434,y:_435,sync:true,transition:_42f.moveTransition}),new Effect.Scale(_437.element,100,{scaleMode:{originalHeight:dims.height,originalWidth:dims.width},sync:true,scaleFrom:window.opera?1:0,transition:_42f.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(_438){
_438.effects[0].element.setStyle({height:"0px"}).show();
},afterFinishInternal:function(_439){
_439.effects[0].element.undoClipping().undoPositioned().setStyle(_430);
}},_42f));
}});
};
Effect.Shrink=function(_43a){
_43a=$(_43a);
var _43b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});
var _43c={top:_43a.style.top,left:_43a.style.left,height:_43a.style.height,width:_43a.style.width,opacity:_43a.getInlineOpacity()};
var dims=_43a.getDimensions();
var _43e,_43f;
switch(_43b.direction){
case "top-left":
_43e=_43f=0;
break;
case "top-right":
_43e=dims.width;
_43f=0;
break;
case "bottom-left":
_43e=0;
_43f=dims.height;
break;
case "bottom-right":
_43e=dims.width;
_43f=dims.height;
break;
case "center":
_43e=dims.width/2;
_43f=dims.height/2;
break;
}
return new Effect.Parallel([new Effect.Opacity(_43a,{sync:true,to:0,from:1,transition:_43b.opacityTransition}),new Effect.Scale(_43a,window.opera?1:0,{sync:true,transition:_43b.scaleTransition,restoreAfterFinish:true}),new Effect.Move(_43a,{x:_43e,y:_43f,sync:true,transition:_43b.moveTransition})],Object.extend({beforeStartInternal:function(_440){
_440.effects[0].element.makePositioned().makeClipping();
},afterFinishInternal:function(_441){
_441.effects[0].element.hide().undoClipping().undoPositioned().setStyle(_43c);
}},_43b));
};
Effect.Pulsate=function(_442){
_442=$(_442);
var _443=arguments[1]||{};
var _444=_442.getInlineOpacity();
var _445=_443.transition||Effect.Transitions.sinoidal;
var _446=function(pos){
return _445(1-Effect.Transitions.pulse(pos,_443.pulses));
};
_446.bind(_445);
return new Effect.Opacity(_442,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(_448){
_448.element.setStyle({opacity:_444});
}},_443),{transition:_446}));
};
Effect.Fold=function(_449){
_449=$(_449);
var _44a={top:_449.style.top,left:_449.style.left,width:_449.style.width,height:_449.style.height};
_449.makeClipping();
return new Effect.Scale(_449,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(_44b){
new Effect.Scale(_449,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(_44c){
_44c.element.hide().undoClipping().setStyle(_44a);
}});
}},arguments[1]||{}));
};
Effect.Morph=Class.create();
Object.extend(Object.extend(Effect.Morph.prototype,Effect.Base.prototype),{initialize:function(_44d){
this.element=$(_44d);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _44e=Object.extend({style:{}},arguments[1]||{});
if(typeof _44e.style=="string"){
if(_44e.style.indexOf(":")==-1){
var _44f="",_450="."+_44e.style;
$A(document.styleSheets).reverse().each(function(_451){
if(_451.cssRules){
cssRules=_451.cssRules;
}else{
if(_451.rules){
cssRules=_451.rules;
}
}
$A(cssRules).reverse().each(function(rule){
if(_450==rule.selectorText){
_44f=rule.style.cssText;
throw $break;
}
});
if(_44f){
throw $break;
}
});
this.style=_44f.parseStyle();
_44e.afterFinishInternal=function(_453){
_453.element.addClassName(_453.options.style);
_453.transforms.each(function(_454){
if(_454.style!="opacity"){
_453.element.style[_454.style.camelize()]="";
}
});
};
}else{
this.style=_44e.style.parseStyle();
}
}else{
this.style=$H(_44e.style);
}
this.start(_44e);
},setup:function(){
function parseColor(_455){
if(!_455||["rgba(0, 0, 0, 0)","transparent"].include(_455)){
_455="#ffffff";
}
_455=_455.parseColor();
return $R(0,2).map(function(i){
return parseInt(_455.slice(i*2+1,i*2+3),16);
});
}
this.transforms=this.style.map(function(pair){
var _458=pair[0].underscore().dasherize(),_459=pair[1],unit=null;
if(_459.parseColor("#zzzzzz")!="#zzzzzz"){
_459=_459.parseColor();
unit="color";
}else{
if(_458=="opacity"){
_459=parseFloat(_459);
if(/MSIE/.test(navigator.userAgent)&&!window.opera&&(!this.element.currentStyle.hasLayout)){
this.element.setStyle({zoom:1});
}
}else{
if(Element.CSS_LENGTH.test(_459)){
var _45b=_459.match(/^([\+\-]?[0-9\.]+)(.*)$/),_459=parseFloat(_45b[1]),unit=(_45b.length==3)?_45b[2]:null;
}
}
}
var _45c=this.element.getStyle(_458);
return $H({style:_458,originalValue:unit=="color"?parseColor(_45c):parseFloat(_45c||0),targetValue:unit=="color"?parseColor(_459):_459,unit:unit});
}.bind(this)).reject(function(_45d){
return ((_45d.originalValue==_45d.targetValue)||(_45d.unit!="color"&&(isNaN(_45d.originalValue)||isNaN(_45d.targetValue))));
});
},update:function(_45e){
var _45f=$H(),_460=null;
this.transforms.each(function(_461){
_460=_461.unit=="color"?$R(0,2).inject("#",function(m,v,i){
return m+(Math.round(_461.originalValue[i]+(_461.targetValue[i]-_461.originalValue[i])*_45e)).toColorPart();
}):_461.originalValue+Math.round(((_461.targetValue-_461.originalValue)*_45e)*1000)/1000+_461.unit;
_45f[_461.style]=_460;
});
this.element.setStyle(_45f);
}});
Effect.Transform=Class.create();
Object.extend(Effect.Transform.prototype,{initialize:function(_465){
this.tracks=[];
this.options=arguments[1]||{};
this.addTracks(_465);
},addTracks:function(_466){
_466.each(function(_467){
var data=$H(_467).values().first();
this.tracks.push($H({ids:$H(_467).keys().first(),effect:Effect.Morph,options:{style:data}}));
}.bind(this));
return this;
},play:function(){
return new Effect.Parallel(this.tracks.map(function(_469){
var _46a=[$(_469.ids)||$$(_469.ids)].flatten();
return _46a.map(function(e){
return new _469.effect(e,Object.extend({sync:true},_469.options));
});
}).flatten(),this.options);
}});
Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle "+"borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth "+"borderRightColor borderRightStyle borderRightWidth borderSpacing "+"borderTopColor borderTopStyle borderTopWidth bottom clip color "+"fontSize fontWeight height left letterSpacing lineHeight "+"marginBottom marginLeft marginRight marginTop markerOffset maxHeight "+"maxWidth minHeight minWidth opacity outlineColor outlineOffset "+"outlineWidth paddingBottom paddingLeft paddingRight paddingTop "+"right textIndent top width wordSpacing zIndex");
Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;
String.prototype.parseStyle=function(){
var _46c=Element.extend(document.createElement("div"));
_46c.innerHTML="<div style=\""+this+"\"></div>";
var _46d=_46c.down().style,_46e=$H();
Element.CSS_PROPERTIES.each(function(_46f){
if(_46d[_46f]){
_46e[_46f]=_46d[_46f];
}
});
if(/MSIE/.test(navigator.userAgent)&&!window.opera&&this.indexOf("opacity")>-1){
_46e.opacity=this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1];
}
return _46e;
};
Element.morph=function(_470,_471){
new Effect.Morph(_470,Object.extend({style:_471},arguments[2]||{}));
return _470;
};
["setOpacity","getOpacity","getInlineOpacity","forceRerendering","setContentZoom","collectTextNodes","collectTextNodesIgnoreClass","morph"].each(function(f){
Element.Methods[f]=Element[f];
});
Element.Methods.visualEffect=function(_473,_474,_475){
s=_474.gsub(/_/,"-").camelize();
effect_class=s.charAt(0).toUpperCase()+s.substring(1);
new Effect[effect_class](_473,_475);
return $(_473);
};
Element.addMethods();
if(typeof Effect=="undefined"){
throw ("controls.js requires including script.aculo.us' effects.js library");
}
var Autocompleter={};
Autocompleter.Base=function(){
};
Autocompleter.Base.prototype={baseInitialize:function(_476,_477,_478){
this.element=$(_476);
this.update=$(_477);
this.hasFocus=false;
this.changed=false;
this.active=false;
this.index=0;
this.entryCount=0;
if(this.setOptions){
this.setOptions(_478);
}else{
this.options=_478||{};
}
this.options.paramName=this.options.paramName||this.element.name;
this.options.tokens=this.options.tokens||[];
this.options.frequency=this.options.frequency||0.4;
this.options.minChars=this.options.minChars||1;
this.options.onShow=this.options.onShow||function(_479,_47a){
if(!_47a.style.position||_47a.style.position=="absolute"){
_47a.style.position="absolute";
Position.clone(_479,_47a,{setHeight:false,offsetTop:_479.offsetHeight});
}
Effect.Appear(_47a,{duration:0.15});
};
this.options.onHide=this.options.onHide||function(_47b,_47c){
new Effect.Fade(_47c,{duration:0.15});
};
if(typeof (this.options.tokens)=="string"){
this.options.tokens=new Array(this.options.tokens);
}
this.observer=null;
this.element.setAttribute("autocomplete","off");
Element.hide(this.update);
Event.observe(this.element,"blur",this.onBlur.bindAsEventListener(this));
Event.observe(this.element,"keypress",this.onKeyPress.bindAsEventListener(this));
},show:function(){
if(Element.getStyle(this.update,"display")=="none"){
this.options.onShow(this.element,this.update);
}
if(!this.iefix&&(navigator.appVersion.indexOf("MSIE")>0)&&(navigator.userAgent.indexOf("Opera")<0)&&(Element.getStyle(this.update,"position")=="absolute")){
new Insertion.After(this.update,"<iframe id=\""+this.update.id+"_iefix\" "+"style=\"display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);\" "+"src=\"javascript:false;\" frameborder=\"0\" scrolling=\"no\"></iframe>");
this.iefix=$(this.update.id+"_iefix");
}
if(this.iefix){
setTimeout(this.fixIEOverlapping.bind(this),50);
}
},fixIEOverlapping:function(){
Position.clone(this.update,this.iefix,{setTop:(!this.update.style.height)});
this.iefix.style.zIndex=1;
this.update.style.zIndex=2;
Element.show(this.iefix);
},hide:function(){
this.stopIndicator();
if(Element.getStyle(this.update,"display")!="none"){
this.options.onHide(this.element,this.update);
}
if(this.iefix){
Element.hide(this.iefix);
}
},startIndicator:function(){
if(this.options.indicator){
Element.show(this.options.indicator);
}
},stopIndicator:function(){
if(this.options.indicator){
Element.hide(this.options.indicator);
}
},onKeyPress:function(_47d){
if(this.active){
switch(_47d.keyCode){
case Event.KEY_TAB:
case Event.KEY_RETURN:
this.selectEntry();
Event.stop(_47d);
case Event.KEY_ESC:
this.hide();
this.active=false;
Event.stop(_47d);
return;
case Event.KEY_LEFT:
case Event.KEY_RIGHT:
return;
case Event.KEY_UP:
this.markPrevious();
this.render();
if(navigator.appVersion.indexOf("AppleWebKit")>0){
Event.stop(_47d);
}
return;
case Event.KEY_DOWN:
this.markNext();
this.render();
if(navigator.appVersion.indexOf("AppleWebKit")>0){
Event.stop(_47d);
}
return;
}
}else{
if(_47d.keyCode==Event.KEY_TAB||_47d.keyCode==Event.KEY_RETURN||(navigator.appVersion.indexOf("AppleWebKit")>0&&_47d.keyCode==0)){
return;
}
}
this.changed=true;
this.hasFocus=true;
if(this.observer){
clearTimeout(this.observer);
}
this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000);
},activate:function(){
this.changed=false;
this.hasFocus=true;
this.getUpdatedChoices();
},onHover:function(_47e){
var _47f=Event.findElement(_47e,"LI");
if(this.index!=_47f.autocompleteIndex){
this.index=_47f.autocompleteIndex;
this.render();
}
Event.stop(_47e);
},onClick:function(_480){
var _481=Event.findElement(_480,"LI");
this.index=_481.autocompleteIndex;
this.selectEntry();
this.hide();
},onBlur:function(_482){
setTimeout(this.hide.bind(this),250);
this.hasFocus=false;
this.active=false;
},render:function(){
if(this.entryCount>0){
for(var i=0;i<this.entryCount;i++){
this.index==i?Element.addClassName(this.getEntry(i),"selected"):Element.removeClassName(this.getEntry(i),"selected");
}
if(this.hasFocus){
this.show();
this.active=true;
}
}else{
this.active=false;
this.hide();
}
},markPrevious:function(){
if(this.index>0){
this.index--;
}else{
this.index=this.entryCount-1;
}
this.getEntry(this.index).scrollIntoView(true);
},markNext:function(){
if(this.index<this.entryCount-1){
this.index++;
}else{
this.index=0;
}
this.getEntry(this.index).scrollIntoView(false);
},getEntry:function(_484){
return this.update.firstChild.childNodes[_484];
},getCurrentEntry:function(){
return this.getEntry(this.index);
},selectEntry:function(){
this.active=false;
this.updateElement(this.getCurrentEntry());
},updateElement:function(_485){
if(this.options.updateElement){
this.options.updateElement(_485);
return;
}
var _486="";
if(this.options.select){
var _487=document.getElementsByClassName(this.options.select,_485)||[];
if(_487.length>0){
_486=Element.collectTextNodes(_487[0],this.options.select);
}
}else{
_486=Element.collectTextNodesIgnoreClass(_485,"informal");
}
var _488=this.findLastToken();
if(_488!=-1){
var _489=this.element.value.substr(0,_488+1);
var _48a=this.element.value.substr(_488+1).match(/^\s+/);
if(_48a){
_489+=_48a[0];
}
this.element.value=_489+_486;
}else{
this.element.value=_486;
}
this.element.focus();
if(this.options.afterUpdateElement){
this.options.afterUpdateElement(this.element,_485);
}
},updateChoices:function(_48b){
if(!this.changed&&this.hasFocus){
this.update.innerHTML=_48b;
Element.cleanWhitespace(this.update);
Element.cleanWhitespace(this.update.down());
if(this.update.firstChild&&this.update.down().childNodes){
this.entryCount=this.update.down().childNodes.length;
for(var i=0;i<this.entryCount;i++){
var _48d=this.getEntry(i);
_48d.autocompleteIndex=i;
this.addObservers(_48d);
}
}else{
this.entryCount=0;
}
this.stopIndicator();
this.index=0;
if(this.entryCount==1&&this.options.autoSelect){
this.selectEntry();
this.hide();
}else{
this.render();
}
}
},addObservers:function(_48e){
Event.observe(_48e,"mouseover",this.onHover.bindAsEventListener(this));
Event.observe(_48e,"click",this.onClick.bindAsEventListener(this));
},onObserverEvent:function(){
this.changed=false;
if(this.getToken().length>=this.options.minChars){
this.startIndicator();
this.getUpdatedChoices();
}else{
this.active=false;
this.hide();
}
},getToken:function(){
var _48f=this.findLastToken();
if(_48f!=-1){
var ret=this.element.value.substr(_48f+1).replace(/^\s+/,"").replace(/\s+$/,"");
}else{
var ret=this.element.value;
}
return /\n/.test(ret)?"":ret;
},findLastToken:function(){
var _491=-1;
for(var i=0;i<this.options.tokens.length;i++){
var _493=this.element.value.lastIndexOf(this.options.tokens[i]);
if(_493>_491){
_491=_493;
}
}
return _491;
}};
Ajax.Autocompleter=Class.create();
Object.extend(Object.extend(Ajax.Autocompleter.prototype,Autocompleter.Base.prototype),{initialize:function(_494,_495,url,_497){
this.baseInitialize(_494,_495,_497);
this.options.asynchronous=true;
this.options.onComplete=this.onComplete.bind(this);
this.options.defaultParams=this.options.parameters||null;
this.url=url;
},getUpdatedChoices:function(){
entry=encodeURIComponent(this.options.paramName)+"="+encodeURIComponent(this.getToken());
this.options.parameters=this.options.callback?this.options.callback(this.element,entry):entry;
if(this.options.defaultParams){
this.options.parameters+="&"+this.options.defaultParams;
}
new Ajax.Request(this.url,this.options);
},onComplete:function(_498){
this.updateChoices(_498.responseText);
}});
Autocompleter.Local=Class.create();
Autocompleter.Local.prototype=Object.extend(new Autocompleter.Base(),{initialize:function(_499,_49a,_49b,_49c){
this.baseInitialize(_499,_49a,_49c);
this.options.array=_49b;
},getUpdatedChoices:function(){
this.updateChoices(this.options.selector(this));
},setOptions:function(_49d){
this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(_49e){
var ret=[];
var _4a0=[];
var _4a1=_49e.getToken();
var _4a2=0;
for(var i=0;i<_49e.options.array.length&&ret.length<_49e.options.choices;i++){
var elem=_49e.options.array[i];
var _4a5=_49e.options.ignoreCase?elem.toLowerCase().indexOf(_4a1.toLowerCase()):elem.indexOf(_4a1);
while(_4a5!=-1){
if(_4a5==0&&elem.length!=_4a1.length){
ret.push("<li><strong>"+elem.substr(0,_4a1.length)+"</strong>"+elem.substr(_4a1.length)+"</li>");
break;
}else{
if(_4a1.length>=_49e.options.partialChars&&_49e.options.partialSearch&&_4a5!=-1){
if(_49e.options.fullSearch||/\s/.test(elem.substr(_4a5-1,1))){
_4a0.push("<li>"+elem.substr(0,_4a5)+"<strong>"+elem.substr(_4a5,_4a1.length)+"</strong>"+elem.substr(_4a5+_4a1.length)+"</li>");
break;
}
}
}
_4a5=_49e.options.ignoreCase?elem.toLowerCase().indexOf(_4a1.toLowerCase(),_4a5+1):elem.indexOf(_4a1,_4a5+1);
}
}
if(_4a0.length){
ret=ret.concat(_4a0.slice(0,_49e.options.choices-ret.length));
}
return "<ul>"+ret.join("")+"</ul>";
}},_49d||{});
}});
Field.scrollFreeActivate=function(_4a6){
setTimeout(function(){
Field.activate(_4a6);
},1);
};
Ajax.InPlaceEditor=Class.create();
Ajax.InPlaceEditor.defaultHighlightColor="#FFFF99";
Ajax.InPlaceEditor.prototype={initialize:function(_4a7,url,_4a9){
this.url=url;
this.element=$(_4a7);
this.options=Object.extend({paramName:"value",okButton:true,okText:"ok",cancelLink:true,cancelText:"cancel",savingText:"Saving...",clickToEditText:"Click to edit",okText:"ok",rows:1,onComplete:function(_4aa,_4ab){
new Effect.Highlight(_4ab,{startcolor:this.options.highlightcolor});
},onFailure:function(_4ac){
alert("Error communicating with the server: "+_4ac.responseText.stripTags());
},callback:function(form){
return Form.serialize(form);
},handleLineBreaks:true,loadingText:"Loading...",savingClassName:"inplaceeditor-saving",loadingClassName:"inplaceeditor-loading",formClassName:"inplaceeditor-form",highlightcolor:Ajax.InPlaceEditor.defaultHighlightColor,highlightendcolor:"#FFFFFF",externalControl:null,submitOnBlur:false,ajaxOptions:{},evalScripts:false},_4a9||{});
if(!this.options.formId&&this.element.id){
this.options.formId=this.element.id+"-inplaceeditor";
if($(this.options.formId)){
this.options.formId=null;
}
}
if(this.options.externalControl){
this.options.externalControl=$(this.options.externalControl);
}
this.originalBackground=Element.getStyle(this.element,"background-color");
if(!this.originalBackground){
this.originalBackground="transparent";
}
this.element.title=this.options.clickToEditText;
this.onclickListener=this.enterEditMode.bindAsEventListener(this);
this.mouseoverListener=this.enterHover.bindAsEventListener(this);
this.mouseoutListener=this.leaveHover.bindAsEventListener(this);
Event.observe(this.element,"click",this.onclickListener);
Event.observe(this.element,"mouseover",this.mouseoverListener);
Event.observe(this.element,"mouseout",this.mouseoutListener);
if(this.options.externalControl){
Event.observe(this.options.externalControl,"click",this.onclickListener);
Event.observe(this.options.externalControl,"mouseover",this.mouseoverListener);
Event.observe(this.options.externalControl,"mouseout",this.mouseoutListener);
}
},enterEditMode:function(evt){
if(this.saving){
return;
}
if(this.editing){
return;
}
this.editing=true;
this.onEnterEditMode();
if(this.options.externalControl){
Element.hide(this.options.externalControl);
}
Element.hide(this.element);
this.createForm();
this.element.parentNode.insertBefore(this.form,this.element);
if(!this.options.loadTextURL){
Field.scrollFreeActivate(this.editField);
}
if(evt){
Event.stop(evt);
}
return false;
},createForm:function(){
this.form=document.createElement("form");
this.form.id=this.options.formId;
Element.addClassName(this.form,this.options.formClassName);
this.form.onsubmit=this.onSubmit.bind(this);
this.createEditField();
if(this.options.textarea){
var br=document.createElement("br");
this.form.appendChild(br);
}
if(this.options.okButton){
okButton=document.createElement("input");
okButton.type="submit";
okButton.value=this.options.okText;
okButton.className="editor_ok_button";
this.form.appendChild(okButton);
}
if(this.options.cancelLink){
cancelLink=document.createElement("a");
cancelLink.href="#";
cancelLink.appendChild(document.createTextNode(this.options.cancelText));
cancelLink.onclick=this.onclickCancel.bind(this);
cancelLink.className="editor_cancel";
this.form.appendChild(cancelLink);
}
},hasHTMLLineBreaks:function(_4b0){
if(!this.options.handleLineBreaks){
return false;
}
return _4b0.match(/<br/i)||_4b0.match(/<p>/i);
},convertHTMLLineBreaks:function(_4b1){
return _4b1.replace(/<br>/gi,"\n").replace(/<br\/>/gi,"\n").replace(/<\/p>/gi,"\n").replace(/<p>/gi,"");
},createEditField:function(){
var text;
if(this.options.loadTextURL){
text=this.options.loadingText;
}else{
text=this.getText();
}
var obj=this;
if(this.options.rows==1&&!this.hasHTMLLineBreaks(text)){
this.options.textarea=false;
var _4b4=document.createElement("input");
_4b4.obj=this;
_4b4.type="text";
_4b4.name=this.options.paramName;
_4b4.value=text;
_4b4.style.backgroundColor=this.options.highlightcolor;
_4b4.className="editor_field";
var size=this.options.size||this.options.cols||0;
if(size!=0){
_4b4.size=size;
}
if(this.options.submitOnBlur){
_4b4.onblur=this.onSubmit.bind(this);
}
this.editField=_4b4;
}else{
this.options.textarea=true;
var _4b6=document.createElement("textarea");
_4b6.obj=this;
_4b6.name=this.options.paramName;
_4b6.value=this.convertHTMLLineBreaks(text);
_4b6.rows=this.options.rows;
_4b6.cols=this.options.cols||40;
_4b6.className="editor_field";
if(this.options.submitOnBlur){
_4b6.onblur=this.onSubmit.bind(this);
}
this.editField=_4b6;
}
if(this.options.loadTextURL){
this.loadExternalText();
}
this.form.appendChild(this.editField);
},getText:function(){
return this.element.innerHTML;
},loadExternalText:function(){
Element.addClassName(this.form,this.options.loadingClassName);
this.editField.disabled=true;
new Ajax.Request(this.options.loadTextURL,Object.extend({asynchronous:true,onComplete:this.onLoadedExternalText.bind(this)},this.options.ajaxOptions));
},onLoadedExternalText:function(_4b7){
Element.removeClassName(this.form,this.options.loadingClassName);
this.editField.disabled=false;
this.editField.value=_4b7.responseText.stripTags();
Field.scrollFreeActivate(this.editField);
},onclickCancel:function(){
this.onComplete();
this.leaveEditMode();
return false;
},onFailure:function(_4b8){
this.options.onFailure(_4b8);
if(this.oldInnerHTML){
this.element.innerHTML=this.oldInnerHTML;
this.oldInnerHTML=null;
}
return false;
},onSubmit:function(){
var form=this.form;
var _4ba=this.editField.value;
this.onLoading();
if(this.options.evalScripts){
new Ajax.Request(this.url,Object.extend({parameters:this.options.callback(form,_4ba),onComplete:this.onComplete.bind(this),onFailure:this.onFailure.bind(this),asynchronous:true,evalScripts:true},this.options.ajaxOptions));
}else{
new Ajax.Updater({success:this.element,failure:null},this.url,Object.extend({parameters:this.options.callback(form,_4ba),onComplete:this.onComplete.bind(this),onFailure:this.onFailure.bind(this)},this.options.ajaxOptions));
}
if(arguments.length>1){
Event.stop(arguments[0]);
}
return false;
},onLoading:function(){
this.saving=true;
this.removeForm();
this.leaveHover();
this.showSaving();
},showSaving:function(){
this.oldInnerHTML=this.element.innerHTML;
this.element.innerHTML=this.options.savingText;
Element.addClassName(this.element,this.options.savingClassName);
this.element.style.backgroundColor=this.originalBackground;
Element.show(this.element);
},removeForm:function(){
if(this.form){
if(this.form.parentNode){
Element.remove(this.form);
}
this.form=null;
}
},enterHover:function(){
if(this.saving){
return;
}
this.element.style.backgroundColor=this.options.highlightcolor;
if(this.effect){
this.effect.cancel();
}
Element.addClassName(this.element,this.options.hoverClassName);
},leaveHover:function(){
if(this.options.backgroundColor){
this.element.style.backgroundColor=this.oldBackground;
}
Element.removeClassName(this.element,this.options.hoverClassName);
if(this.saving){
return;
}
this.effect=new Effect.Highlight(this.element,{startcolor:this.options.highlightcolor,endcolor:this.options.highlightendcolor,restorecolor:this.originalBackground});
},leaveEditMode:function(){
Element.removeClassName(this.element,this.options.savingClassName);
this.removeForm();
this.leaveHover();
this.element.style.backgroundColor=this.originalBackground;
Element.show(this.element);
if(this.options.externalControl){
Element.show(this.options.externalControl);
}
this.editing=false;
this.saving=false;
this.oldInnerHTML=null;
this.onLeaveEditMode();
},onComplete:function(_4bb){
this.leaveEditMode();
this.options.onComplete.bind(this)(_4bb,this.element);
},onEnterEditMode:function(){
},onLeaveEditMode:function(){
},dispose:function(){
if(this.oldInnerHTML){
this.element.innerHTML=this.oldInnerHTML;
}
this.leaveEditMode();
Event.stopObserving(this.element,"click",this.onclickListener);
Event.stopObserving(this.element,"mouseover",this.mouseoverListener);
Event.stopObserving(this.element,"mouseout",this.mouseoutListener);
if(this.options.externalControl){
Event.stopObserving(this.options.externalControl,"click",this.onclickListener);
Event.stopObserving(this.options.externalControl,"mouseover",this.mouseoverListener);
Event.stopObserving(this.options.externalControl,"mouseout",this.mouseoutListener);
}
}};
Ajax.InPlaceCollectionEditor=Class.create();
Object.extend(Ajax.InPlaceCollectionEditor.prototype,Ajax.InPlaceEditor.prototype);
Object.extend(Ajax.InPlaceCollectionEditor.prototype,{createEditField:function(){
if(!this.cached_selectTag){
var _4bc=document.createElement("select");
var _4bd=this.options.collection||[];
var _4be;
_4bd.each(function(e,i){
_4be=document.createElement("option");
_4be.value=(e instanceof Array)?e[0]:e;
if((typeof this.options.value=="undefined")&&((e instanceof Array)?this.element.innerHTML==e[1]:e==_4be.value)){
_4be.selected=true;
}
if(this.options.value==_4be.value){
_4be.selected=true;
}
_4be.appendChild(document.createTextNode((e instanceof Array)?e[1]:e));
_4bc.appendChild(_4be);
}.bind(this));
this.cached_selectTag=_4bc;
}
this.editField=this.cached_selectTag;
if(this.options.loadTextURL){
this.loadExternalText();
}
this.form.appendChild(this.editField);
this.options.callback=function(form,_4c2){
return "value="+encodeURIComponent(_4c2);
};
}});
Form.Element.DelayedObserver=Class.create();
Form.Element.DelayedObserver.prototype={initialize:function(_4c3,_4c4,_4c5){
this.delay=_4c4||0.5;
this.element=$(_4c3);
this.callback=_4c5;
this.timer=null;
this.lastValue=$F(this.element);
Event.observe(this.element,"keyup",this.delayedListener.bindAsEventListener(this));
},delayedListener:function(_4c6){
if(this.lastValue==$F(this.element)){
return;
}
if(this.timer){
clearTimeout(this.timer);
}
this.timer=setTimeout(this.onTimerEvent.bind(this),this.delay*1000);
this.lastValue=$F(this.element);
},onTimerEvent:function(){
this.timer=null;
this.callback(this.element,$F(this.element));
}};
DivMultiplier=Class.create();
DivMultiplier.prototype={initialize:function(_4c7,_4c8){
var dt=_4c7;
var _4c7=$(_4c7);
this.div_template=Object.clone(_4c7);
this.div_container=$(_4c7.parentNode);
this.more_button=$(_4c8);
if(this.more_button){
this.more_button.observe("click",this.clone_item.bind(this));
}
var _4ca=this.div_container.childNodes;
for(var i=0;i<_4ca.length;i++){
var _4cc=_4ca[i];
if(_4cc.tagName=="DIV"){
this.bind_remove(_4cc);
}
}
},bind_remove:function(_4cd){
var _4cd=$(_4cd);
var _4ce=cpxQueryOne("button#remove",_4cd);
if(_4ce){
$(_4ce).observe("click",this.remove.bind(this,_4cd));
}
},clone_item:function(){
var tpl=this.div_template.innerHTML;
tpl="<div>"+tpl+"</div>";
new Insertion.Bottom(this.div_container,tpl);
var _4d0=$(this.div_container.lastChild);
_4d0.className=this.div_template.className;
this.bind_remove(_4d0);
if(this.after_clone_hook){
this.after_clone_hook(_4d0);
}
make_active_text_fields_orange(_4d0);
TooltipGenerator.instance.refresh_observers();
var _4d1=cpxQueryOne("input",_4d0);
if(_4d1){
$(_4d1).activate();
}
return _4d0;
},remove:function(_4d2){
_4d2.remove();
if(!this.div_container.innerHTML.strip()){
this.clone_item();
}
},clear:function(){
this.div_container.innerHTML="";
this.clone_item();
}};
function encode_utf8(_4d3){
_4d3=_4d3.replace(/\r\n/g,"\n");
var _4d4="";
for(var n=0;n<_4d3.length;n++){
var c=_4d3.charCodeAt(n);
if(c<128){
_4d4+=String.fromCharCode(c);
}else{
if((c>127)&&(c<2048)){
_4d4+=String.fromCharCode((c>>6)|192);
_4d4+=String.fromCharCode((c&63)|128);
}else{
_4d4+=String.fromCharCode((c>>12)|224);
_4d4+=String.fromCharCode(((c>>6)&63)|128);
_4d4+=String.fromCharCode((c&63)|128);
}
}
}
return _4d4;
}
function decode_utf8(_4d7){
var _4d8="";
var i=0;
var c=c1=c2=0;
while(i<_4d7.length){
c=_4d7.charCodeAt(i);
if(c<128){
_4d8+=String.fromCharCode(c);
i++;
}else{
if((c>191)&&(c<224)){
c2=_4d7.charCodeAt(i+1);
_4d8+=String.fromCharCode(((c&31)<<6)|(c2&63));
i+=2;
}else{
c2=_4d7.charCodeAt(i+1);
c3=_4d7.charCodeAt(i+2);
_4d8+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));
i+=3;
}
}
}
return _4d8;
}
hash_last_history_index=0;
hash_replace_count=0;
_hash_state_handlers=new Array();
_hash_change_handlers=new Array();
function _hash_dumy(){
}
function hash_escape(_4db){
return escape(escape(_4db));
}
function hash_unescape(_4dc){
return unescape(unescape(_4dc));
}
function hash_save(id,_4de,_4df){
var href=window.location.href;
var hash=window.location.hash;
if(hash&&hash[0]=="#"){
hash=hash.slice(1);
}
hash=hash_unescape(hash);
var _4e2=hash;
var _4e3=hash.indexOf(id);
if(_4e3>=0){
if(_4e3>0){
_4e3-=1;
}
end_index=hash.indexOf("#",_4e3+1);
if(end_index<0){
end_index=hash.length;
}
hash=hash.slice(0,_4e3)+hash.slice(end_index);
}
if(hash){
hash+="#";
}
if(id){
hash+=id+"="+_4de;
}
if(_4e2){
_4e3=href.indexOf("#");
href=href.slice(0,_4e3);
}
if(hash&&hash[0]=="#"){
hash=hash.slice(1);
}
var _4e4=hash;
hash="#"+hash_escape(hash);
href+=hash;
if(_4df){
return href;
}
before=window.history.length;
window.location.replace(href);
after=window.history.length;
hash_replace_count+=(after-before);
field=cpxQuery("input[name='url.hash.marker']");
for(var i=0;i<field.length;i++){
field[i].value=_4e4;
}
for(j=0;j<_hash_change_handlers.length;j++){
_hash_change_handlers[j](_4e4);
}
return href;
}
function _hash_reload_state(_4e6){
var _4e7=cpxQueryOne("input[name='url.hash.marker']");
var _4e8=window.history.length;
var _4e9=0;
var _4ea=hash_save;
hash_save=_hash_dumy;
var _4eb=false;
var hash=window.location.hash;
if(!hash&&_4e7){
hash=_4e7.value;
_4eb=true;
}else{
hash=hash_unescape(hash);
}
if(hash&&hash[0]=="#"){
hash=hash.slice(1);
}
var _4ed=hash.split("#");
if(!_4e6){
_4e6=function(id,_4ef){
for(var j=0;j<_hash_state_handlers.length;j++){
_hash_state_handlers[j](id,_4ef);
}
};
}
for(var ic=0;ic<_4ed.length;ic++){
var _4f2=_4ed[ic];
if(!_4f2){
continue;
}
var _4f3=_4f2.indexOf("=");
var id=_4f2.slice(0,_4f3);
var _4f5=_4f2.slice(_4f3+1);
_4e6(id,_4f5);
}
hash_save=_4ea;
if(_4eb&&hash.length>2){
window.location.href+="#"+hash_escape(hash);
}
for(j=0;j<_hash_change_handlers.length;j++){
_hash_change_handlers[j](hash);
}
var _4f6=cpxQuery("input[name='url.hash.marker']");
for(var i=0;i<_4f6.length;i++){
_4f6[i].value=hash;
}
}
function hash_register_handler(_4f8){
_hash_state_handlers.push(_4f8);
}
function hash_register_change_handler(_4f9){
_hash_change_handlers.push(_4f9);
}
function hash_go_back(){
if(hash_replace_count>0){
delta=-hash_replace_count-1;
}else{
if(window.history.length!=hash_last_history_index){
delta=hash_last_history_index-window.history.length-1;
}else{
delta=-1;
}
}
window.history.go(delta);
}
function _scroll_reload_state(id,_4fb){
if(id.slice(0,4)!="scrl"){
return;
}
el_name=_4fb;
el_name=el_name.replace("/","#");
el=$(cpxQueryOne(el_name));
if(el){
el.scrollTo();
}
}
hash_register_handler(_scroll_reload_state);
registerPloneFunction(function(){
_hash_reload_state();
});
ajax_load_register=Object();
function ajax_query_escape(_4fc){
_4fc=_4fc.replace(window.location.protocol+"//","").replace(window.location.host+"/","");
return _4fc;
}
function ajax_query_unescape(_4fd){
separator=_4fd.indexOf("?")>=0&&"&"||"?";
_4fd=window.location.protocol+"//"+window.location.host+"/"+_4fd;
return _4fd;
}
function ajax_load(_4fe,_4ff,_500,_501,_502){
_501=_501||"eq";
var _503=String(_4fe).toQueryParams();
var eq=_503[_501]||"";
if(!_4ff){
hash_save(_501+eq,ajax_query_escape(_4fe));
}
var _505=_4fe;
var _506=_505.indexOf("?");
var _503="";
if(_506>=0){
_503=_505.slice(_506);
_505=_505.slice(0,_506);
}
eq=eq.replace("/","#");
if(!ajax_load_register[eq]){
ajax_load_register[eq]=1;
}else{
ajax_load_register[eq]+=1;
}
sequence=ajax_load_register[eq];
function make_success(eq,seq){
function on_success(req){
if(req.responseText.indexOf("__ac_name")>=0){
setTimeout(function(){
loc=window.location;
loc.href=loc.href;
},10);
return;
}
if(ajax_load_register[eq]>seq){
return;
}
if(eq){
dest=$(cpxQueryWindowOne(eq));
var txt=req.responseText;
if(txt){
txt+="<script type=\"text/javascript\"><!--";
txt+="after_rendering();";
txt+="//--></script>";
}
dest.update(txt);
field=cpxQuery("input[name='url.hash.marker']",dest);
if(field.length>0){
hash=window.location.hash;
hash=hash_unescape(hash);
if(hash&&hash[0]=="#"){
hash=hash.slice(1);
}
for(var i=0;i<field.length;i++){
field[i].value=hash;
}
}
}
if(_500){
setTimeout(12,_500(unescape(eq),req.responseText));
}
if(!_4ff){
frame=window.parent;
if(!frame){
frame=window;
}
messages=cpxQuery("div.campux_message_box",frame.document);
for(i=0;i<messages.length;i++){
messages[i].style.display="none";
}
}
}
return on_success;
}
function make_show_error(_50d,_50e){
function on_error(_50f){
var _510=_50d;
if(_50e){
_510+=_50e+"&ajax_error="+_50f.status;
}else{
_510+="?ajax_error="+_50f.status;
}
window.location.href=_510;
}
return on_error;
}
if(_502){
if(typeof _502!=typeof ""){
_502=eq;
}
if(_502){
var dest=cpxQueryWindowOne(_502);
if(dest){
$(dest).update("<img src=\""+Prototype.portal_url()+"ajax_loader_medium.gif\"/>");
}
}
}
new Ajax.Request(_505,{onSuccess:make_success(eq,sequence),onFailure:make_show_error(_505,_503),onException:function(i,e){
},parameters:_503});
}
function _ajax_reload_state(id,_514){
if(id.slice(0,2)!="eq"){
return;
}
if(_514){
ajax_load(ajax_query_unescape(_514));
}
}
function show_eq(eq){
$(cpxQueryOne(eq)).show();
}
hash_register_handler(_ajax_reload_state);
var tab_scroll_to_top=false;
function tab_change(_516){
var tab=cpxQueryOne("ul.tab-header a#"+_516);
var ul=tab.parentNode.parentNode;
var _519=cpxQueryOne(".current-tab a",ul);
if(_519.id!=_516){
tab_deactivate(_519.id);
tab_activate(_516);
hash_save("tb"+ul.id,_516);
}
}
function tab_deactivate(_51a){
var _51b=false;
var tabs=cpxQuery("ul.tab-header a");
for(var i=0;i<tabs.length;i++){
if(tabs[i].id==_51a){
_51b=true;
removeClassName(tabs[i].parentNode,"current-tab");
}
}
if(_51b){
var _51e=cpxQuery("div#"+_51a)[0];
if(_51e){
addClassName(_51e,"inactive");
removeClassName(_51e,"active");
}
}
}
function tab_activate(_51f){
var _520=false;
var tabs=cpxQuery("ul.tab-header a");
for(var i=0;i<tabs.length;i++){
if(tabs[i].id==_51f){
_520=true;
addClassName(tabs[i].parentNode,"current-tab");
}
}
if(_520){
var _523=cpxQueryOne("div#"+_51f);
if(_523){
addClassName(_523,"active");
removeClassName(_523,"inactive");
if(tab_scroll_to_top){
Element.scrollTo(tabs[0]);
}
}
}
}
_tabs_prepared=false;
function tab_reprepare(){
_tabs_prepared=false;
tab_prepare();
}
function tab_prepare(){
if(_tabs_prepared){
return;
}
_tabs_prepared=true;
tabs=cpxQuery("ul.tab-header");
for(i=0;i<tabs.length;i++){
tab_parent=tabs[i];
li_as=cpxQuery("li a",tab_parent);
predefined=cpxQueryOne("li.current-tab",tab_parent);
for(j=1;j<li_as.length;j++){
tab=li_as[j];
if(!tab.href){
if(!predefined){
tab_deactivate(tab.id);
}
tab.href="javascript:tab_change('"+tab.id+"');";
}
}
tab=li_as[0];
if(!tab.href){
if(!predefined){
tab_activate(tab.id);
}
tab.href="javascript:tab_change('"+tab.id+"');";
}
}
}
function _tab_reload_state(id,_525){
if(id.slice(0,2)!="tb"){
return;
}
tab_prepare();
tab_change(_525);
}
registerPloneFunction(tab_prepare);
hash_register_handler(_tab_reload_state);
function fp_click(_526,_527){
isActive=(_526.className.indexOf("inactive")>=0)?1:0;
fp_show(_526,_527,isActive);
if(_527.id){
hash_save("fp"+_527.id,isActive);
}
}
function fp_show(_528,_529,_52a){
if(typeof (_52a)=="string"){
_52a=parseInt(_52a);
}
if(_52a){
removeClassName(_528,"inactive");
addClassName(_528,"active");
new Effect.BlindDown(_529,{duration:0.5});
}else{
new Effect.BlindUp(_529,{duration:0.5});
removeClassName(_528,"active");
addClassName(_528,"inactive");
}
}
function fp_prepare(){
function make_event(_52b,_52c){
function call_event(){
fp_click(_52b,_52c);
}
return call_event;
}
panels=cpxQuery("div.folder-panel");
for(i=0;i<panels.length;i++){
children=panels[i].childNodes;
last_header="";
for(j=0;j<children.length;j++){
child=children[j];
if(child.nodeName.toLowerCase()=="h3"){
last_header=child;
}
if(child.nodeName.toLowerCase()=="div"&&last_header){
last_header.onclick=make_event(last_header,child);
}
}
}
}
function _fp_reload_state(id,_52e){
if(id.slice(0,2)!="fp"){
return;
}
content=cpxQuery("div.folder-panel div#"+id.slice(2));
if(content.length==0){
return;
}
sibling=content[0].previousSibling;
while(sibling.nodeName.toLowerCase()!="h3"){
sibling=sibling.previousSibling;
}
fp_show(sibling,content[0],_52e);
}
registerPloneFunction(fp_prepare);
hash_register_handler(_fp_reload_state);
thread_functions=false;
function set_default_button(_52f,_530){
default_button=$(cpxQueryOne(_52f));
form=$(default_button.form);
inputs=form.getInputs();
call_default_button=function(evt){
if(evt.keyCode==Event.KEY_RETURN){
evt.returnValue=false;
Event.stop(evt);
if(!_530){
default_button.click();
}
}
};
for(i=0;i<inputs.length;i++){
element=$(inputs[i]);
if(element!=default_button){
element.observe("keydown",call_default_button);
}
}
}
function check_group(_532,_533){
var _534=cpxQuery(_533+" input[type='checkbox']");
function on_click_group(evt){
var box=$(Event.element(evt));
if(!box.checked){
_532.checked=box.checked;
}
}
for(j=0;j<_534.length;j++){
var box=$(_534[j]);
if(box!=_532){
box.checked=_532.checked;
if(!box.feed_back_check){
box.observe("click",on_click_group);
box.feed_back_check=true;
}
}
}
}
function redirection_goto(url){
current_url=escape(window.location.href);
if(url.indexOf("?")>=0){
url+="&";
}else{
url+="?";
}
url+="redirection="+current_url;
window.location.href=url;
}
function hidden_load(url){
ajax_load(url,true,function(){
window.location.href=window.location.href;
if(window.location.hash){
window.location.reload(true);
}
});
}
function get_top(el){
result=el.offsetTop;
el=el.offsetParent;
while(el!=null&&el.nodeName){
result+=el.offsetTop;
el=el.offsetParent;
}
return result;
}
function get_left(el){
result=el.offsetLeft;
el=el.offsetParent;
while(el!=null&&el.nodeName){
result+=el.offsetLeft;
el=el.offsetParent;
}
return result;
}
function find_form(_53c){
return findContainer(_53c,function(node){
return node.nodeName=="FORM";
});
}
function button_defocus(){
var _53e=cpxQuery("input[type='submit'],input[type='button']");
for(i=0;i<_53e.length;i++){
_53e[i].onfocus=function(){
this.blur();
};
}
}
registerPloneFunction(button_defocus);
function change_offline_state(_53f,_540){
ajax_load(_53f+"?offline="+_540,true);
var _541=cpxQueryOne("a#appear-online");
var _542=cpxQueryOne("a#appear-offline");
if(_540){
_542.hide();
_541.show();
}else{
_541.hide();
_542.show();
}
}
Prototype.ScriptFragment="(?:<script(\n|\r|.)*?>)((\n|\r|.)*?)(?:</script>)";
String.prototype.evalScripts=function(){
return this.extractScripts().collect(function(_543){
_543=_543.strip();
if(_543.slice(0,4)=="<!--"){
_543=_543.slice(4);
}
try{
return eval(_543);
}
catch(e){
alert("misc_tools.extractScripts exception!\n"+e+"\n"+_543);
}
return 0;
});
};
String.prototype.extractScripts=function(){
var _544=new RegExp(Prototype.ScriptFragment,"img");
var _545=new RegExp(Prototype.ScriptFragment,"im");
return (this.match(_544)||[]).collect(function(_546){
return (_546.match(_545)||["",""])[2];
});
};
function rateplace(_547){
if(_547!=0){
$("hidden_star_rating").value=_547;
}else{
$("hidden_star_rating").value="";
}
showstars(_547);
}
function showstars(_548){
Element.setStyle("current-star-rating",{width:""+(20*_548)+"%"});
}
function showstarsfromvalue(){
showstars($("hidden_star_rating").value);
}
function make_active_text_fields_orange(_549){
function onblur(evt){
var el=$(Event.element(evt));
Element.removeClassName(el,"focused");
}
function onfocus(evt){
var el=$(Event.element(evt));
Element.addClassName(el,"focused");
}
function make_orange(_54e){
for(var i=0;i<_54e.length;i++){
var el=$(_54e[i]);
Event.observe(el,"blur",onblur);
Event.observe(el,"focus",onfocus);
}
}
make_orange(cpxQuery("textarea",_549));
make_orange(cpxQuery("input[type='text']",_549));
make_orange(cpxQuery("input[type='password']",_549));
make_orange(cpxQuery("input[type='file']",_549));
}
Prototype.after_rendering_funcs=new Array();
function execute_after_rendering(func){
Prototype.after_rendering_funcs.push(func);
}
function after_rendering(){
var _552=Prototype.after_rendering_funcs;
while(_552.length>0){
_552.shift()();
}
}
registerPloneFunction(function(){
make_active_text_fields_orange();
});
registerPloneFunction(function(){
after_rendering();
});
Prototype.portal_url=function(){
var link=cpxQueryOne("head link[title=\"Front page\"]");
return link.href+"/";
};
function setFocus(_554){
if(!W3CDOM){
return false;
}
if(typeof (_554)!="string"){
_554="div.error";
}
var _555=cpxQuery(_554);
for(i=0;i<_555.length;i++){
error_div=_555[i];
var _556=cpxQuery("input[type='text']",error_div);
if(_556.length==0){
_556=cpxQuery("input[type='password']",error_div);
}
if(_556.length==0){
_556=cpxQuery("textarea",error_div);
}
if(_556.length==0){
_556=cpxQuery("select",error_div);
}
if(_556.length>0){
var _557=_556[0];
var _558=null;
function find_tab(node){
if(node.className&&Element.hasClassName(node,"tab-content")){
return true;
}
_558=node;
}
var tab=findContainer(_557,find_tab);
if(tab){
tab_change(_558.id);
}
_557.focus();
return;
}
}
var _55b=$(cpxQueryOne("input#__ac_name"));
if(_55b){
_55b.focus();
_55b.select();
}
}
registerPloneFunction(setFocus);
function language_menu_initialize(){
var _55c=new Object();
_55c.menu_active=false;
_55c.in_selected=false;
_55c.in_menu=false;
_55c.just_in_selected=false;
_55c.just_in_menu=false;
_55c.show_menu=function(){
if(!_55c.menu_active){
new Effect.Appear("lng_menu_wrapper",{duration:0.2});
}
_55c.menu_active=true;
};
_55c.hide_menu=function(){
if(_55c.menu_active){
new Effect.Fade("lng_menu_wrapper",{duration:0.2});
}
_55c.menu_active=false;
};
_55c.mouseover_selected=function(){
_55c.in_selected=true;
_55c.just_in_selected=true;
window.setTimeout(_55c._mouseover_selected,300);
};
_55c._mouseover_selected=function(){
if(_55c.just_in_selected){
if(_55c.in_selected){
_55c.show_menu();
}
}
};
_55c.mouseout_selected=function(){
_55c.just_in_selected=false;
window.setTimeout(_55c._mouseout_selected,500);
};
_55c._mouseout_selected=function(){
if(!_55c.just_in_selected){
_55c.in_selected=false;
if(!_55c.in_menu){
_55c.hide_menu();
}
}
};
_55c.mouseover_menu=function(){
_55c.in_menu=true;
_55c.just_in_menu=true;
};
_55c.mouseout_menu=function(){
_55c.just_in_menu=false;
window.setTimeout(_55c._mouseout_menu,500);
};
_55c._mouseout_menu=function(){
if(!_55c.just_in_menu){
_55c.in_menu=false;
if(!_55c.in_selected){
_55c.hide_menu();
}
}
};
_55c.click_menu=function(){
_55c.in_menu=false;
_55c.hide_menu();
};
if($("selectedlang")){
Event.observe("selectedlang","click",_55c._mouseover_selected);
Event.observe("selectedlang","mouseover",_55c.mouseover_selected);
Event.observe("selectedlang","mouseout",_55c.mouseout_selected);
Event.observe("language_menu","mouseover",_55c.mouseover_menu);
Event.observe("language_menu","mouseout",_55c.mouseout_menu);
var _55d=$("language_menu").getElementsByTagName("a");
for(var i=0;i<_55d.length;i++){
Event.observe(_55d[i],"click",_55c.click_menu);
}
}
}
registerPloneFunction(language_menu_initialize);
TooltipGenerator=Class.create();
TooltipGenerator.prototype={initialize:function(){
TooltipGenerator.instance=this;
this.refresh_observers();
},refresh_observers:function(){
var _55f=cpxQuery("div.field");
for(var i=0;i<_55f.length;i++){
this.refresh_field(_55f[i]);
}
},refresh_field:function(_561){
var _562=$(cpxQueryOne("div.formHelpContent",_561));
if(!_562){
return;
}
var _563=this.onfocus.bind(this);
var _564=this.onblur.bind(this);
function set_observers(_565){
for(var i=0;i<_565.length;i++){
var el=$(_565[i]);
if(!el.help_field){
Event.observe(el,"blur",_564);
Event.observe(el,"focus",_563);
}
el.help_field=_562;
}
return _565.length;
}
var _568=0;
_568+=set_observers(cpxQuery("textarea",_561));
_568+=set_observers(cpxQuery("input[type='text']",_561));
_568+=set_observers(cpxQuery("input[type='password']",_561));
if(!_568){
var _569=$(_562.parentNode);
removeClassName(_569,"formHelp");
addClassName(_562,"formHelpClassic");
removeClassName(_562,"formHelpContent");
_569.style.display="inline";
_562.style.display="inline";
}
},onfocus:function(evt){
var el=$(Event.element(evt));
el.help_field.has_focus=true;
el.help_field.style.opacity=1;
if(el.help_field.innerHTML.length<100){
el.help_field.style.marginTop="20px";
el.help_field.style.paddingBottom="20px";
}
var _56c=Position.positionedOffset(el);
var _56d=Element.getWidth(el);
var _56e=$(el.help_field);
var _56f=$(_56e.parentNode);
_56f.setStyle({left:(_56c[0]+_56d)+"px",top:(_56c[1]-45)+"px"});
new Effect.Appear(_56e,{duration:0.5});
},onblur:function(evt){
var el=$(Event.element(evt));
el.help_field.has_focus=false;
window.setTimeout(this._blur.bind(this,el),100);
},_blur:function(el){
if(!el.help_field.has_focus){
el.help_field.hide();
}
}};
registerPloneFunction(function(){
new TooltipGenerator();
});
function helpimg(_573){
var _574=new Object();
var _575=_573.parentNode;
_574.formHelp=cpxQuery("div.formHelpContent",_575)[0];
if(!_574.formHelp){
return;
}
_574.has_focus=false;
_574.mouseover=function(){
_574.has_focus=true;
window.setTimeout(_574._mouseover,300);
};
_574.mouseout=function(){
_574.has_focus=false;
window.setTimeout(_574._mouseout,500);
};
_574._mouseover=function(){
if(_574.has_focus){
new Effect.Appear(_574.formHelp,{duration:0.3});
}
};
_574._mouseout=function(){
if(!_574.has_focus){
new Effect.Fade(_574.formHelp,{duration:0.3});
}
};
Event.observe(_573,"mouseover",_574.mouseover);
Event.observe(_573,"mouseout",_574.mouseout);
}
function help_popup_initialize(){
var _576=cpxQuery("span.help-popup-img");
for(var i=0;i<_576.length;i++){
helpimg(_576[i]);
}
}
registerPloneFunction(help_popup_initialize);
may_live_in_frame=true;
function avoid_frame_load(){
if(location!=top.location&&!may_live_in_frame){
if(location.pathname.search("framebreakout$")>0){
return;
}
location.href="framebreakout?href="+location.href;
}
}
registerPloneFunction(avoid_frame_load);
INACTIVE=-1;
WAIT_FOR_DRAG=0;
DRAGGING=1;
EditGallery=Class.create();
Object.extend(EditGallery.prototype,{initialize:function(_578){
body=$(document.body);
body.observe("selectstart",this.cancelEvent.bind(this));
body.observe("dragstart",this.cancelEvent.bind(this));
body.observe("mouseup",this.dragDropEnd.bind(this));
body.observe("mousemove",this.dragDropMove.bindAsEventListener(this));
window.onresize=this.getDivCoordinates.bind(this);
this.pics=$(cpxQuery("input#pictures")[0]);
this.divXPositions=new Array();
this.divYPositions=new Array();
this.divWidth=new Array();
this.divHeight=new Array();
this.mode=INACTIVE;
this.destinationObject=false;
this.activeImage=false;
this.tmpLeft=0;
this.tmpTop=0;
this.eventDiff_x=0;
this.eventDiff_y=0;
var _579=cpxQuery("div#page-limitor")[0];
this.containerOffset_x=get_left(_579);
this.containerOffset_y=get_top(_579);
this.offsetX_marker=-3;
this.offsetY_marker=0;
this.firefoxOffsetX_marker=-3;
this.firefoxOffsetY_marker=-2;
MSIE=navigator.userAgent.indexOf("MSIE")>=0?true:false;
navigatorVersion=navigator.appVersion.replace(/.*?MSIE (\d\.\d).*/g,"$1")/1;
if(navigatorVersion<6&&MSIE){
this.offsetX_marker-=23;
this.offsetY_marker-=10;
}
this.dragDropDiv=document.getElementById("dragDropContent");
this.insertionMarker=document.getElementById("insertionMarker");
picture_destroy_message=cpxQuery("div#album_remove_picture_text")[0].innerHTML;
picture_destroy_message=new String(picture_destroy_message);
this.picture_destroy_message=$(picture_destroy_message).strip();
this.remove_url=_578;
this.titles={};
},init_divs:function(){
divs=cpxQuery("div.imageBox_theImage");
for(i=0;i<divs.length;i++){
idiv=$(divs[i]);
idiv.observe("mousedown",this.selectImage.bindAsEventListener(this,idiv));
label=$(cpxQuery("div.imageBox_label",idiv.parentNode)[0]);
label.observe("mousedown",this.selectImage.bindAsEventListener(this,idiv));
delete_button=$(cpxQuery("input#delete",idiv)[0]);
delete_button.observe("click",this.remove_image.bind(this,idiv));
}
this.getDivCoordinates();
},cancelEvent:function(){
return false;
},getDivCoordinates:function(){
var divs=document.getElementsByTagName("DIV");
for(var no=0;no<divs.length;no++){
if(divs[no].className=="imageBox"||divs[no].className=="imageBoxHighlighted"&&divs[no].id){
this.divXPositions[divs[no].id]=get_left(divs[no]);
this.divYPositions[divs[no].id]=get_top(divs[no]);
this.divWidth[divs[no].id]=divs[no].offsetWidth;
this.divHeight[divs[no].id]=divs[no].offsetHeight;
}
}
},dragDropEnd:function(){
this.mode=INACTIVE;
this.dragDropDiv.style.display="none";
this.insertionMarker.style.display="none";
if(this.destinationObject&&this.destinationObject!=this.activeImage){
var _57c=this.destinationObject.parentNode;
_57c.insertBefore(this.activeImage,this.destinationObject);
this.unselect_image();
this.destinationObject=false;
this.getDivCoordinates();
}
return false;
},dragDropMove:function(e){
if(this.mode==INACTIVE){
return;
}
if(this.mode==WAIT_FOR_DRAG&&(Math.abs(this.tmpLeft-e.clientX)>5||Math.abs(this.tmpTop-e.clientY)>5)){
this.start_drag(e);
this.mode=DRAGGING;
}
if(this.mode!=DRAGGING){
return;
}
var _57e=e.clientX+document.documentElement.scrollLeft-this.eventDiff_x;
var _57f=e.clientY+document.documentElement.scrollTop-this.eventDiff_y;
this.dragDropDiv.style.top=(_57f-this.containerOffset_y)+"px";
this.dragDropDiv.style.left=(_57e-this.containerOffset_x)+"px";
_57e=_57e+this.eventDiff_x;
_57f=_57f+this.eventDiff_y;
if(!Event.isLeftClick(e)){
this.dragDropEnd();
}
Event.stop(e);
var _580=false;
for(var prop in this.divXPositions){
if(this.divXPositions[prop]/1<_57e/1&&(this.divXPositions[prop]/1+this.divWidth[prop]*0.7)>_57e/1&&this.divYPositions[prop]/1<_57f/1&&(this.divYPositions[prop]/1+this.divWidth[prop])>_57f/1){
if(document.all){
offsetX=this.offsetX_marker;
offsetY=this.offsetY_marker;
}else{
offsetX=this.firefoxOffsetX_marker;
offsetY=this.firefoxOffsetY_marker;
}
offsetX-=this.containerOffset_x;
offsetY-=this.containerOffset_y;
this.insertionMarker.style.top=this.divYPositions[prop]+offsetY+"px";
this.insertionMarker.style.left=this.divXPositions[prop]+offsetX+"px";
this.insertionMarker.style.display="block";
this.destinationObject=document.getElementById(prop);
_580=true;
break;
}
}
if(!_580){
this.insertionMarker.style.display="none";
this.destinationObject=false;
}
return true;
},selectImage:function(e,idiv){
this.unselect_image();
var obj=idiv.parentNode;
obj.className="imageBoxHighlighted";
this.activeImage=obj;
this.mode=WAIT_FOR_DRAG;
this.tmpLeft=e.clientX;
this.tmpTop=e.clientY;
edit_title_el=$(cpxQuery("input#edit_title",obj)[0]);
show_title_el=$(cpxQuery("span#show_title",obj)[0]);
show_title_el.hide();
edit_title_el.show();
edit_title_el.focus();
Event.stop(e);
return false;
},unselect_image:function(){
if(!this.activeImage){
return;
}
this.activeImage.className="imageBox";
edit_title_el=$(cpxQuery("input#edit_title",this.activeImage)[0]);
show_title_el=$(cpxQuery("span#show_title",this.activeImage)[0]);
if(edit_title_el.value){
show_title_el.innerHTML=edit_title_el.value;
}
edit_title_el.hide();
show_title_el.show();
this.activeImage=false;
},start_drag:function(e){
this.getDivCoordinates();
var _586=this.dragDropDiv.getElementsByTagName("DIV");
if(_586.length>0){
this.dragDropDiv.removeChild(_586[0]);
}
this.dragDropDiv.style.display="block";
var _587=this.activeImage.cloneNode(true);
_587.className="imageBox";
_587.id="";
this.dragDropDiv.appendChild(_587);
leftPos=e.clientX-this.containerOffset_x;
topPos=e.clientY-this.containerOffset_y;
this.dragDropDiv.style.top=topPos+"px";
this.dragDropDiv.style.left=leftPos+"px";
},remove_image:function(idiv){
parentObj=$(idiv.parentNode);
if(!window.confirm(this.picture_destroy_message)){
return false;
}
new Ajax.Request(this.remove_url+parentObj.id,{"method":"get"});
parentObj.remove();
this.getDivCoordinates();
},reload_pictures:function(_589){
inputs=cpxQuery("input.image-edit-title");
for(i=0;i<inputs.length;i++){
ip=$(inputs[i]);
this.titles[ip.parentNode.parentNode.id]=ip.value;
}
ajax_load(_589,true,this.post_reload.bind(this));
},post_reload:function(){
this.init_divs();
for(tid in this.titles){
if(!tid){
continue;
}
img_frame=cpxQuery("div#"+tid);
if(img_frame.length<=0){
continue;
}
img_frame=img_frame[0];
edit_title_el=$(cpxQuery("input#edit_title",img_frame)[0]);
show_title_el=$(cpxQuery("span#show_title",img_frame)[0]);
show_title_el.innerHTML=edit_title_el.value=this.titles[tid];
}
},save_pictures:function(){
var _58a="";
var _58b=document.getElementsByTagName("DIV");
for(var no=0;no<_58b.length;no++){
if(_58b[no].className=="imageBox"||_58b[no].className=="imageBoxHighlighted"){
if(_58a.length>0){
_58a=_58a+"|";
}
_58a=_58a+_58b[no].id;
}
}
this.pics.value=_58a;
}});
HideShow=Class.create();
Object.extend(Object.extend(HideShow.prototype,Effect.Base.prototype),{initialize:function(_58d,pic){
_58d=$(_58d);
if(!_58d){
throw (Effect._elementDoesNotExistError);
}
this.inner=_58d;
outer=_58d.parentNode;
_58d.style.backgroundImage=outer.style.backgroundImage;
_58d.setOpacity(1);
outer.style.backgroundImage=pic;
this.pic=pic;
var _58f={from:1,to:0,duration:0.8};
this.start(_58f);
},update:function(_590){
this.inner.setOpacity(_590);
},finish:function(){
this.inner.style.backgroundImage=this.pic;
}});
ScrollGallery=Class.create();
Object.extend(ScrollGallery.prototype,{initialize:function(_591){
this.executer=new PeriodicalExecuter(this.periodic_action.bind(this),0.02);
this.reinitialize(_591);
},reinitialize:function(_592){
this.gallery=$(_592);
this.content=$(cpxQuery("div.content",this.gallery)[0]);
this.left_arrow=$(cpxQuery("img#left-arrow",this.gallery)[0]);
this.right_arrow=$(cpxQuery("img#right-arrow",this.gallery)[0]);
if(this.left_arrow){
this.bound_left_enter=this.left_enter.bind(this);
this.bound_left_leave=this.left_leave.bind(this);
this.left_arrow.observe("mouseover",this.bound_left_enter);
this.left_arrow.observe("mouseout",this.bound_left_leave);
}
if(this.right_arrow){
this.bound_right_enter=this.right_enter.bind(this);
this.bound_right_leave=this.right_leave.bind(this);
this.right_arrow.observe("mouseover",this.bound_right_enter);
this.right_arrow.observe("mouseout",this.bound_right_leave);
}
content_width=parseInt(this.content.style.width);
container_width=420;
this.scroll_width=content_width-container_width;
this.scroller=0;
},periodic_action:function(){
if(this.scroller){
this.scroller();
}
},stop:function(){
this.stop_scroll();
if(this.left_arrow){
this.left_arrow.stopObserving("mouseover",this.bound_left_enter);
this.left_arrow.stopObserving("mouseout",this.bound_left_leave);
}
if(this.right_arrow){
this.right_arrow.stopObserving("mouseover",this.bound_right_enter);
this.right_arrow.stopObserving("mouseout",this.bound_right_leave);
}
},stop_scroll:function(){
if(this.scroller){
this.scroller=0;
}
},start_scroll:function(_593){
if(this.scroller!=_593){
this.scroller=_593;
}
},left_enter:function(){
this.left_arrow.src="arrow_left_over.gif";
this.start_scroll(this.left_scroll);
},left_leave:function(){
this.left_arrow.src="arrow_left.gif";
this.stop_scroll();
},right_enter:function(){
this.right_arrow.src="arrow_right_over.gif";
this.start_scroll(this.right_scroll);
},right_leave:function(){
this.right_arrow.src="arrow_right.gif";
this.stop_scroll();
},right_scroll:function(){
width=-this.scroll_width;
position=parseInt(this.content.style.left)||0;
if(position>width){
position-=5;
position=Math.max(position,width);
this.content.style.left=position+"px";
}else{
this.stop_scroll();
}
},left_scroll:function(){
position=parseInt(this.content.style.left)||0;
if(position<0){
position+=5;
position=Math.min(position,0);
this.content.style.left=position+"px";
}else{
this.stop_scroll();
}
}});
TagSetter=Class.create();
Object.extend(TagSetter.prototype,{tag_width:25,tag_height:25,initialize:function(){
this.tag_menu=$(cpxQueryOne("div.tag-menu"));
this.link_menu=$(cpxQueryOne("div.link-menu"));
var _594=$(cpxQueryOne("input#cancel",this.tag_menu));
_594.observe("click",this.cancel_tag.bind(this));
var _595=$(cpxQueryOne("input#search_text",this.tag_menu));
new Form.Element.Observer(_595,0.5,this.live_search.bind(this));
this.link_menu.observe("mouseover",this.activate_menu.bind(this,0));
this.link_menu.observe("mouseout",this.deactivate_menu.bind(this));
var _596=$(cpxQueryOne("input#delete",this.link_menu));
_596.observe("click",this.delete_link.bind(this));
this.picture=$(cpxQueryOne("div.picture-big"));
this.offset=Position.cumulativeOffset(this.picture);
this.picture.observe("mouseover",this.activate_all_tags.bind(this));
this.picture.observe("mouseout",this.deactivate_all_tags.bind(this));
this.check_tags();
},start:function(_597){
this.picture.setStyle({cursor:"crosshair"});
this.bound_tag=this.tag.bind(this);
this.picture.observe("click",this.bound_tag);
this.home_url=_597;
},tag:function(ev){
Position.prepare();
if(/Safari/.test(navigator.userAgent)){
version=/AppleWebKit\/(\d+)/.exec(navigator.userAgent);
if(version&&parseInt(version[1])<500){
Position.deltaX=0;
Position.deltaY=0;
}
}
var x=ev.clientX+Position.deltaX-this.offset[0];
var y=ev.clientY+Position.deltaY-this.offset[1];
x+=-this.tag_width/2;
y+=-this.tag_height/2;
this.div=$(document.createElement("div"));
this.div.addClassName("picture-tag");
this.div.setStyle({left:x+"px",top:y+"px"});
this.picture.appendChild(this.div);
x+=this.tag_width+10;
ajax_load(this.home_url+"/friends_tag_list_snip?eq=div/tag-menu-content&picture="+this.picture.id,true);
this.tag_menu.setStyle({left:x+"px",top:y+"px",display:"block"});
this.picture.setStyle({cursor:"auto"});
this.picture.stopObserving("click",this.bound_tag);
var _59b=$(cpxQueryOne("input#search_text",this.tag_menu));
_59b.focus();
},cancel_tag:function(){
this.div.remove();
this.div=0;
this.tag_menu.hide();
this.picture.setStyle({cursor:"auto"});
this.picture.stopObserving("click",this.bound_tag);
},make_link:function(_59c){
var _59d=$(cpxQueryOne("form#picture-form"));
var _59e=$(cpxQueryOne("input#picture_tags",_59d));
_59e.value="1";
function add_input(name,_5a0){
var _5a1=$(document.createElement("input"));
_5a1.type="hidden";
_5a1.name=name;
_5a1.value=_5a0;
_59d.appendChild(_5a1);
}
add_input("tag.left:records",parseInt(this.div.getStyle("left")));
add_input("tag.top:records",parseInt(this.div.getStyle("top")));
add_input("tag.home_id:records",_59c);
_59d.submit();
},check_tags:function(){
tags=cpxQuery("div.tagged-name a");
for(var i=0;i<tags.length;i++){
var tag=$(tags[i]);
tag.observe("mouseover",this.activate_tag.bind(this,tag));
tag.observe("mouseout",this.deactivate_tag.bind(this,tag));
}
var tags=$(cpxQuery("div.picture-tag-outer a",this.picture));
for(var i=0;i<tags.length;i++){
var tag=$(tags[i]);
tag.observe("mouseover",this.activate_menu.bind(this,tag));
tag.observe("mouseout",this.deactivate_menu.bind(this));
}
},activate_tag:function(tag){
if(this.active_tag!=tag){
this.active_tag=tag;
var _5a6=$(cpxQueryOne("div.picture-tag-outer a#"+tag.id,this.picture));
_5a6.show();
}
},deactivate_tag:function(tag){
var _5a8=$(cpxQueryOne("div.picture-tag-outer a#"+tag.id,this.picture));
_5a8.hide();
this.active_tag=0;
},activate_all_tags:function(tag){
if(!this.active_tag){
this.active_tag=1;
var tags=$(cpxQuery("div.picture-tag-outer a",this.picture));
for(var i=0;i<tags.length;i++){
$(tags[i]).show();
}
}
},deactivate_all_tags:function(tag){
this.active_tag=0;
setTimeout(this.hide_all_tags.bind(this),100);
},hide_all_tags:function(){
if(!this.active_tag){
var tags=$(cpxQuery("div.picture-tag-outer a",this.picture));
for(var i=0;i<tags.length;i++){
$(tags[i]).hide();
}
}
},activate_menu:function(tag){
if(!this.active_link_menu){
this.active_link_menu=1;
this.active_tag=1;
if(!tag){
return;
}
this.current_tag_id=tag.id;
var _5b0=tag.parentNode;
var _5b1=Position.positionedOffset(_5b0);
var x=_5b1[0]+this.tag_width+10;
var y=_5b1[1];
var _5b4=$(cpxQueryOne("a#link",this.link_menu));
var _5b5=$(cpxQueryOne("a#creator",this.link_menu));
var _5b5=$(cpxQueryOne("a#creator",this.link_menu));
var _5b6=$(cpxQueryOne("input#delete",this.link_menu));
var _5b7=$(cpxQueryOne("form#picture-form"));
var _5b8=$(cpxQueryOne("input#picture_tags",_5b7));
var _5b9=$(cpxQueryOne("div#"+this.current_tag_id,_5b7));
_5b4.href=tag.href;
_5b4.update(tag.title);
_5b5.href=$(cpxQueryOne("input#creator_url",_5b9)).value;
_5b5.update($(cpxQueryOne("input#creator",_5b9)).value);
if($(cpxQueryOne("input#may_delete",_5b9)).value){
_5b6.show();
}else{
_5b6.hide();
}
this.link_menu.setStyle({left:x+"px",top:y+"px",display:"block"});
}
},deactivate_menu:function(tag){
this.active_link_menu=0;
this.active_tag=0;
setTimeout(this.hide_link_menu.bind(this),100);
setTimeout(this.hide_all_tags.bind(this),100);
},hide_link_menu:function(){
if(!this.active_link_menu){
this.link_menu.hide();
}
},delete_link:function(){
var _5bb=$(cpxQueryOne("form#picture-form"));
var _5bc=$(cpxQueryOne("input#picture_tags",_5bb));
var _5bd=$(cpxQueryOne("div#"+this.current_tag_id,_5bb));
_5bc.value="1";
_5bd.remove();
_5bb.submit();
},live_search:function(el,_5bf){
var _5c0=cpxQueryOne("div#tag-menu-content",this.tag_menu);
var _5c1=cpxQuery("a",_5c0);
_5bf=_5bf.toUpperCase();
for(var i=0;i<_5c1.length;i++){
var _5c3=$(_5c1[i]);
if(_5c3.innerHTML.toUpperCase().indexOf(_5bf)>=0){
_5c3.show();
}else{
_5c3.hide();
}
}
}});
function change_slides(){
dia_divs=cpxQuery("div.dia");
for(i=0;i<dia_divs.length;i++){
var dia=$(dia_divs[i]);
var _5c5=cpxQuery("div.inner",dia);
var _5c6=$(cpxQuery("input#pictures",dia)[0]);
var _5c7=$(cpxQuery("input#url",dia)[0]).value;
var _5c8=$(cpxQuery("input#post_url",dia)[0]).value;
var _5c9=$(cpxQuery("input#creators_url",dia)[0]).value;
var eq=$(cpxQuery("input#container",dia)[0]).value;
var pics=_5c6.value.split("|");
pics=pics.findAll(Boolean);
slide_count=_5c5.length;
if(pics.length<=slide_count){
continue;
}
for(j=0;j<slide_count;j++){
pic=pics.shift();
pics.push(pic);
thumbnail_url="url("+_5c7+"/"+pic+"/data_medium)";
var _5cc=$(_5c5[j]);
var _5cd=$(_5cc.parentNode.parentNode);
_5cd.href="javascript:picture_load('"+_5c7+"/"+pic+"/picture_snip"+eq+_5c8+"', '"+_5c9+"')";
new HideShow(_5cc,thumbnail_url);
}
_5c6.value=pics.join("|");
}
}
gallery_scroller=0;
function post_picture_load(eq){
try{
var _5cf=cpxQueryOne(eq);
var _5d0=cpxQueryOne(".scroll-gallery",_5cf);
if(!_5d0){
return;
}
if(!gallery_scroller){
gallery_scroller=new ScrollGallery(_5d0);
}else{
gallery_scroller.reinitialize(_5d0);
}
var _5d1=$(cpxQueryOne("#album-back"));
if(_5d1){
_5d1.show();
}
gallery_hash_change();
var el=$(cpxQueryOne("div#albums"));
if(el){
el.scrollTo();
}
}
catch(e){
alert(e);
}
}
function gallery_hash_change(){
redirection=$(cpxQueryOne("input#picture-redirection"));
if(redirection){
href=hash_save("scrl","div/albums",true);
redirection.value=href;
}
}
var picture_cache={};
function cache_picture(url){
if(!url){
return;
}
if(!picture_cache[url]){
pic=new Image();
pic.src=url;
picture_cache[url]=pic;
}
}
function picture_load(_5d4,_5d5){
if(_5d5=="-"){
return;
}
if(!_5d5||location.href.indexOf(_5d5)>=0){
var sep;
if(gallery_scroller){
sep=_5d4.indexOf("?")>0?"&":"?";
_5d4+=sep+"left="+parseInt(gallery_scroller.content.style.left)||0;
}
if(_5d4.indexOf("pq=div/albums")<0){
sep=_5d4.indexOf("?")>0?"&":"?";
_5d4+=sep+"pq=div/albums";
}
ajax_load(_5d4,false,post_picture_load,"pq","div.picture-big");
}else{
qmark=_5d4.indexOf("?");
if(qmark>0){
picture_url=_5d4.slice(0,qmark);
}
location.href=_5d5+"#"+escape("pqdiv/albums="+_5d4+"?pq=div/albums"+"#scrl=div/albums");
}
}
function album_load(_5d7){
ajax_load(_5d7,true,function(eq){
eq=eq.replace("#","/");
hash_save("pq"+eq,"");
back_link=cpxQuery("#album-back");
if(back_link.length){
back_link=$(back_link[0]);
back_link.hide();
}
},"pq");
}
function _picture_reload_state(id,_5da){
if(id.slice(0,2)!="pq"){
return;
}
if(_5da){
ajax_load(ajax_query_unescape(_5da),true,post_picture_load,"pq");
}
}
hash_register_handler(_picture_reload_state);
var edit_refresh_url="";
function open_edit_layer(_5db,_5dc){
edit_refresh_url=_5dc;
setTimeout(function(){
var _5dd=$(cpxQueryOne("div#iframe-layer"));
var _5de=$(cpxQueryOne("div#dimmer-layer"));
var _5df=$(cpxQueryOne("div#iframe-layer iframe"));
var page=$(cpxQueryOne("div#page"));
var _5e1=Math.max(page.getHeight(),screen.height);
var _5e2={height:_5e1+"px"};
_5de.setStyle(_5e2);
_5dd.setStyle(_5e2);
_5dd.setStyle({visibility:"hidden"});
_5dd.show();
sep=(_5db.indexOf("?")>0)?"&":"?";
_5df.src=_5db+sep+"window_mode=open";
},1);
}
function adjust_edit_frame(){
var _5e3=$(cpxQueryOne("div#window-frame"));
var dim=_5e3.getDimensions();
var pos=window.parent.Position;
pos.prepare();
var w=window.parent;
var _5e7=w.innerHeight||(w.document.documentElement.clientHeight||w.document.body.clientHeight);
var top=Math.max((_5e7-dim.height)/2+pos.deltaY,pos.deltaY);
_5e3.setStyle({top:top+"px"});
}
function appear_edit_frame(){
var _5e9=window.parent.document;
var _5ea=$(cpxQueryOne("div#dimmer-layer",_5e9));
var _5eb=$(cpxQueryOne("div#iframe-layer",_5e9));
var _5ec=$(cpxQueryOne("div#window-frame"));
_5ea.show();
_5eb.setStyle({visibility:"visible"});
new Effect.Appear(_5ec);
}
function fade_edit_frame(mode){
var _5ee=window.parent.document;
var _5ef=$(cpxQueryOne("div#iframe-layer",_5ee));
var _5f0=$(cpxQueryOne("div#dimmer-layer",_5ee));
var _5f1=window.parent.edit_refresh_url;
if(mode=="close_refresh"&&_5f1){
if(typeof _5f1=="string"){
ajax_load(_5f1,true,0,false,true);
}else{
if(typeof _5f1=="function"){
_5f1(window.document);
}
}
}
_5ef.hide();
_5f0.hide();
}
function reload_page(){
location.href=location.href;
}
function _edit_layer_reload_state(id,_5f3){
if(id=="el"&&_5f3){
setTimeout(function(){
hash_save("el","");
open_edit_layer(_5f3,reload_page);
},1);
}
}
hash_register_handler(_edit_layer_reload_state);
LiveSearch=Class.create();
Object.extend(LiveSearch.prototype,{initialize:function(_5f4,_5f5,_5f6){
this.fields=_5f4;
this.search_callback=_5f5;
this.no_search_callback=_5f6;
this.old_values={};
for(var f in this.fields){
this.old_values[f]=this.fields[f].getValue();
}
hash_register_handler(this.reload_state.bind(this));
new PeriodicalExecuter(this.search.bind(this),0.5);
},search:function(){
var _5f8=false;
for(f in this.fields){
var _5f9=this.fields[f].getValue();
if(this.old_values[f]!=_5f9){
_5f8=true;
this.old_values[f]=_5f9;
}
}
if(!_5f8){
return;
}
var _5fa=new Array();
var _5fb=new Array();
for(f in this.fields){
var _5fc=this.fields[f];
if(_5fc.type=="checkbox"&&!_5fc.checked){
continue;
}
if(_5fc.type=="text"&&!_5fc.value){
continue;
}
if(_5fc.type=="select-one"&&!_5fc.value){
continue;
}
_5fa.push(_5fc.name+"="+_5fc.value);
_5fb.push(f+"="+_5fc.value);
}
if(_5fa.length){
_5fa=_5fa.join("&");
hash_save("ps",_5fb.join("&"));
if(this.search_callback){
this.search_callback(_5fa);
}
}else{
hash_save("ps","");
if(this.no_search_callback){
this.no_search_callback();
}
}
},reload_state:function(id,_5fe){
if(id.slice(0,2)!="ps"){
return;
}
if(_5fe){
_5fe=String(_5fe).toQueryParams();
for(k in _5fe){
this.fields[k].value=_5fe[k];
}
this.search();
}
}});
form_token="1";
function set_form_token(){
form_submits=cpxQuery("input[name='form.submitted']");
for(i=0;i<form_submits.length;i++){
form_submits[i].value=form_token;
}
}
registerPloneFunction(set_form_token);

