var Prototype={Version:"1.6.0.2",Browser:{IE:!!(window.attachEvent&&navigator.userAgent.indexOf("Opera")===-1),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)},BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement("div").__proto__&&document.createElement("div").__proto__!==document.createElement("form").__proto__},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a;
}};
if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false;
}var Class={create:function(){var f=null,d=$A(arguments);
if(Object.isFunction(d[0])){f=d.shift();
}function a(){this.initialize.apply(this,arguments);
}Object.extend(a,Class.Methods);
a.superclass=f;
a.subclasses=[];
if(f){var b=function(){};
b.prototype=f.prototype;
a.prototype=new b;
f.subclasses.push(a);
}for(var c=0;
c<d.length;
c++){a.addMethods(d[c]);
}if(!a.prototype.initialize){a.prototype.initialize=Prototype.emptyFunction;
}a.prototype.constructor=a;
return a;
}};
Class.Methods={addMethods:function(h){var c=this.superclass&&this.superclass.prototype;
var b=Object.keys(h);
if(!Object.keys({toString:true}).length){b.push("toString","valueOf");
}for(var a=0,d=b.length;
a<d;
a++){var g=b[a],f=h[g];
if(c&&Object.isFunction(f)&&f.argumentNames()[0]=="$super"){var j=f,f=Object.extend((function(k){return function(){return c[k].apply(this,arguments);
};
})(g).wrap(j),{valueOf:function(){return j;
},toString:function(){return j.toString();
}});
}this.prototype[g]=f;
}return this;
}};
var Abstract={};
Object.extend=function(a,c){for(var b in c){a[b]=c[b];
}return a;
};
Object.extend(Object,{inspect:function(a){try{if(Object.isUndefined(a)){return"undefined";
}if(a===null){return"null";
}return a.inspect?a.inspect():String(a);
}catch(b){if(b instanceof RangeError){return"...";
}throw b;
}},toJSON:function(a){var c=typeof a;
switch(c){case"undefined":case"function":case"unknown":return;
case"boolean":return a.toString();
}if(a===null){return"null";
}if(a.toJSON){return a.toJSON();
}if(Object.isElement(a)){return;
}var b=[];
for(var f in a){var d=Object.toJSON(a[f]);
if(!Object.isUndefined(d)){b.push(f.toJSON()+": "+d);
}}return"{"+b.join(", ")+"}";
},toQueryString:function(a){return $H(a).toQueryString();
},toHTML:function(a){return a&&a.toHTML?a.toHTML():String.interpret(a);
},keys:function(a){var b=[];
for(var c in a){b.push(c);
}return b;
},values:function(b){var a=[];
for(var c in b){a.push(b[c]);
}return a;
},clone:function(a){return Object.extend({},a);
},isElement:function(a){return a&&a.nodeType==1;
},isArray:function(a){return a!=null&&typeof a=="object"&&"splice" in a&&"join" in a;
},isHash:function(a){return a instanceof Hash;
},isFunction:function(a){return typeof a=="function";
},isString:function(a){return typeof a=="string";
},isNumber:function(a){return typeof a=="number";
},isUndefined:function(a){return typeof a=="undefined";
}});
Object.extend(Function.prototype,{argumentNames:function(){if(this._argumentNames){return this._argumentNames;
}var a=this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip");
return a.length==1&&!a[0]?[]:a;
},bind:function(){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this;
}var a=this,c=$A(arguments),b=c.shift();
return function(){return a.apply(b,c.concat($A(arguments)));
};
},bindAsEventListener:function(){var a=this,c=$A(arguments),b=c.shift();
return function(d){return a.apply(b,[d||window.event].concat(c));
};
},curry:function(){if(!arguments.length){return this;
}var a=this,b=$A(arguments);
return function(){return arguments.length?a.apply(this,b.concat($A(arguments))):a.apply(this,b);
};
},delay:function(){var a=this,b=$A(arguments),c=b.shift()*1000;
return window.setTimeout(function(){return a.apply(a,b);
},c);
},wrap:function(b){var a=this;
return function(){return arguments.length?b.apply(this,[a.bind(this)].concat($A(arguments))):b.call(this,a.bind(this));
};
},methodize:function(){if(this._methodized){return this._methodized;
}var a=this;
return this._methodized=function(){return arguments.length?a.apply(null,[this].concat($A(arguments))):a.call(null,this);
};
}});
Function.prototype.defer=Function.prototype.delay.curry(0.01);
Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+'Z"';
};
var Try={these:function(){var c;
for(var b=0,d=arguments.length;
b<d;
b++){var a=arguments[b];
try{c=a();
break;
}catch(f){}}return c;
}};
RegExp.prototype.match=RegExp.prototype.test;
RegExp.escape=function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1");
};
var PeriodicalExecuter=Class.create({initialize:function(b,a){this.callback=b;
this.frequency=a;
this.currentlyExecuting=false;
this.registerCallback();
},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},execute:function(){this.callback(this);
},stop:function(){if(!this.timer){return;
}clearInterval(this.timer);
this.timer=null;
},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;
this.execute();
}finally{this.currentlyExecuting=false;
}}}});
Object.extend(String,{interpret:function(a){return a==null?"":String(a);
},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});
Object.extend(String.prototype,{gsub:function(f,c){var a="",d=this,b;
c=arguments.callee.prepareReplacement(c);
while(d.length>0){if(b=d.match(f)){a+=d.slice(0,b.index);
a+=String.interpret(c(b));
d=d.slice(b.index+b[0].length);
}else{a+=d,d="";
}}return a;
},sub:function(c,a,b){a=this.gsub.prepareReplacement(a);
b=Object.isUndefined(b)?1:b;
return this.gsub(c,function(d){if(--b<0){return d[0];
}return a(d);
});
},scan:function(b,a){this.gsub(b,a);
return String(this);
},truncate:function(b,a){b=b||30;
a=Object.isUndefined(a)?"...":a;
return this.length>b?this.slice(0,b-a.length)+a:String(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 c=new RegExp(Prototype.ScriptFragment,"ig");
var b=new RegExp(Prototype.ScriptFragment,"i");
var a=new RegExp("<!--\\s*"+Prototype.ScriptFragment+"\\s*-->","i");
return function(){if(this.indexOf("<script")==-1){return[];
}return(this.replace(a,"").match(c)||[]).map(function(d){return(d.match(b)||["",""])[1];
});
};
})(),evalScripts:function(){return this.extractScripts().map(function(script){return eval(script);
});
},escapeHTML:function(){var a=arguments.callee;
a.text.data=this;
return a.container.innerHTML.replace(/"/g,"&quot;");
},unescapeHTML:function(){var a=document.createElement("div");
a.innerHTML="<pre>"+this.stripTags()+"</pre>";
a=a.firstChild;
return a.childNodes[0]?(a.childNodes.length>1?$A(a.childNodes).inject("",function(b,c){return b+c.nodeValue;
}):a.childNodes[0].nodeValue):"";
},toQueryParams:function(b){var a=this.strip().match(/([^?#]*)(#.*)?$/);
if(!a){return{};
}return a[1].split(b||"&").inject({},function(f,g){if((g=g.split("="))[0]){var c=decodeURIComponent(g.shift());
var d=g.length>1?g.join("="):g[0];
if(d!=undefined){d=decodeURIComponent(d);
}if(c in f){if(!Object.isArray(f[c])){f[c]=[f[c]];
}f[c].push(d);
}else{f[c]=d;
}}return f;
});
},toArray:function(){return this.split("");
},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1);
},times:function(a){return a<1?"":new Array(a+1).join(this);
},camelize:function(){var d=this.split("-"),a=d.length;
if(a==1){return d[0];
}var c=this.charAt(0)=="-"?d[0].charAt(0).toUpperCase()+d[0].substring(1):d[0];
for(var b=1;
b<a;
b++){c+=d[b].charAt(0).toUpperCase()+d[b].substring(1);
}return c;
},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(b){var a=this.gsub(/[\x00-\x1f\\]/,function(c){var d=String.specialChar[c[0]];
return d?d:"\\u00"+c[0].charCodeAt().toPaddedString(2,16);
});
if(b){return'"'+a.replace(/"/g,'\\"')+'"';
}return"'"+a.replace(/'/g,"\\'")+"'";
},toJSON:function(){return this.inspect(true);
},unfilterJSON:function(a){return this.sub(a||Prototype.JSONFilter,"#{1}");
},isJSON:function(){var a=this;
if(a.blank()){return false;
}a=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");
return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(a);
},evalJSON:function(sanitize){var json=this.unfilterJSON();
try{if(!sanitize||json.isJSON()){return eval("("+json+")");
}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect());
},include:function(a){return this.indexOf(a)>-1;
},startsWith:function(a){return this.indexOf(a)===0;
},endsWith:function(a){var b=this.length-a.length;
return b>=0&&this.lastIndexOf(a)===b;
},empty:function(){return this=="";
},blank:function(){return/^\s*$/.test(this);
},interpolate:function(a,b){return new Template(this,b).evaluate(a);
}});
String.prototype.gsub.prepareReplacement=function(b){if(Object.isFunction(b)){return b;
}var a=new Template(b);
return function(c){return a.evaluate(c);
};
};
String.prototype.parseQuery=String.prototype.toQueryParams;
Object.extend(String.prototype.escapeHTML,{container:document.createElement("pre"),text:document.createTextNode("")});
String.prototype.escapeHTML.container.appendChild(String.prototype.escapeHTML.text);
if("1\n2".unescapeHTML()==="1\r2"){String.prototype.unescapeHTML=String.prototype.unescapeHTML.wrap(function(a){return a().replace(/\r/g,"\n");
});
}if(">".escapeHTML()!=="&gt;"){(function(){var a=String.prototype.escapeHTML;
Object.extend(String.prototype.escapeHTML=a.wrap(function(b){return b().replace(/>/g,"&gt;");
}),{container:a.container,text:a.text});
})();
}if("&".escapeHTML()!=="&amp;"){Object.extend(String.prototype.escapeHTML,{container:document.createElement("xmp"),text:document.createTextNode("")});
String.prototype.escapeHTML.container.appendChild(String.prototype.escapeHTML.text);
}var Template=Class.create({initialize:function(a,b){this.template=a.toString();
this.pattern=b||Template.Pattern;
},evaluate:function(a){if(Object.isFunction(a.toTemplateReplacements)){a=a.toTemplateReplacements();
}return this.template.gsub(this.pattern,function(d){if(a==null){return"";
}var g=d[1]||"";
if(g=="\\"){return d[2];
}var b=a,h=d[3];
var f=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;
d=f.exec(h);
if(d==null){return g;
}while(d!=null){var c=d[1].startsWith("[")?d[2].gsub("\\\\]","]"):d[1];
b=b[c];
if(null==b||""==d[3]){break;
}h=h.substring("["==d[3]?d[1].length:d[0].length);
d=f.exec(h);
}return g+String.interpret(b);
});
}});
Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;
var $break={};
var Enumerable={each:function(c,b){var a=0;
c=c.bind(b);
try{this._each(function(f){c(f,a++);
});
}catch(d){if(d!=$break){throw d;
}}return this;
},eachSlice:function(d,c,b){c=c?c.bind(b):Prototype.K;
var a=-d,f=[],g=this.toArray();
while((a+=d)<g.length){f.push(g.slice(a,a+d));
}return f.collect(c,b);
},all:function(c,b){c=c?c.bind(b):Prototype.K;
var a=true;
this.each(function(f,d){a=a&&!!c(f,d);
if(!a){throw $break;
}});
return a;
},any:function(c,b){c=c?c.bind(b):Prototype.K;
var a=false;
this.each(function(f,d){if(a=!!c(f,d)){throw $break;
}});
return a;
},collect:function(c,b){c=c?c.bind(b):Prototype.K;
var a=[];
this.each(function(f,d){a.push(c(f,d));
});
return a;
},detect:function(c,b){c=c.bind(b);
var a;
this.each(function(f,d){if(c(f,d)){a=f;
throw $break;
}});
return a;
},findAll:function(c,b){c=c.bind(b);
var a=[];
this.each(function(f,d){if(c(f,d)){a.push(f);
}});
return a;
},grep:function(d,c,b){c=c?c.bind(b):Prototype.K;
var a=[];
if(Object.isString(d)){d=new RegExp(d);
}this.each(function(g,f){if(d.match(g)){a.push(c(g,f));
}});
return a;
},include:function(a){if(Object.isFunction(this.indexOf)){if(this.indexOf(a)!=-1){return true;
}}var b=false;
this.each(function(c){if(c==a){b=true;
throw $break;
}});
return b;
},inGroupsOf:function(b,a){a=Object.isUndefined(a)?null:a;
return this.eachSlice(b,function(c){while(c.length<b){c.push(a);
}return c;
});
},inject:function(a,c,b){c=c.bind(b);
this.each(function(f,d){a=c(a,f,d);
});
return a;
},invoke:function(b){var a=$A(arguments).slice(1);
return this.map(function(c){return c[b].apply(c,a);
});
},max:function(c,b){c=c?c.bind(b):Prototype.K;
var a;
this.each(function(f,d){f=c(f,d);
if(a==null||f>=a){a=f;
}});
return a;
},min:function(c,b){c=c?c.bind(b):Prototype.K;
var a;
this.each(function(f,d){f=c(f,d);
if(a==null||f<a){a=f;
}});
return a;
},partition:function(d,b){d=d?d.bind(b):Prototype.K;
var c=[],a=[];
this.each(function(g,f){(d(g,f)?c:a).push(g);
});
return[c,a];
},pluck:function(b){var a=[];
this.each(function(c){a.push(c[b]);
});
return a;
},reject:function(c,b){c=c.bind(b);
var a=[];
this.each(function(f,d){if(!c(f,d)){a.push(f);
}});
return a;
},sortBy:function(b,a){b=b.bind(a);
return this.map(function(d,c){return{value:d,criteria:b(d,c)};
}).sort(function(g,f){var d=g.criteria,c=f.criteria;
return d<c?-1:d>c?1:0;
}).pluck("value");
},toArray:function(){return this.map();
},zip:function(){var b=Prototype.K,a=$A(arguments);
if(Object.isFunction(a.last())){b=a.pop();
}var c=[this].concat(a).map($A);
return this.map(function(f,d){return b(c.pluck(d));
});
},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,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any});
function $A(c){if(!c){return[];
}if(c.toArray){return c.toArray();
}var b=c.length||0,a=new Array(b);
while(b--){a[b]=c[b];
}return a;
}if(Prototype.Browser.WebKit){$A=function(c){if(!c){return[];
}if(!(Object.isFunction(c)&&c=="[object NodeList]")&&c.toArray){return c.toArray();
}var b=c.length||0,a=new Array(b);
while(b--){a[b]=c[b];
}return a;
};
}Array.from=$A;
Object.extend(Array.prototype,Enumerable);
if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse;
}Object.extend(Array.prototype,{_each:function(b){for(var a=0,c=this.length;
a<c;
a++){b(this[a]);
}},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(a){return a!=null;
});
},flatten:function(){return this.inject([],function(b,a){return b.concat(Object.isArray(a)?a.flatten():[a]);
});
},without:function(){var a=$A(arguments);
return this.select(function(b){return !a.include(b);
});
},reverse:function(a){return(a!==false?this:this.toArray())._reverse();
},reduce:function(){return this.length>1?this:this[0];
},uniq:function(a){return this.inject([],function(d,c,b){if(0==b||(a?d.last()!=c:!d.include(c))){d.push(c);
}return d;
});
},intersect:function(a){return this.uniq().findAll(function(b){return a.detect(function(c){return b===c;
});
});
},clone:function(){return[].concat(this);
},size:function(){return this.length;
},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]";
},toJSON:function(){var a=[];
this.each(function(b){var c=Object.toJSON(b);
if(!Object.isUndefined(c)){a.push(c);
}});
return"["+a.join(", ")+"]";
}});
if(Object.isFunction(Array.prototype.forEach)){Array.prototype._each=Array.prototype.forEach;
}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(c,a){a||(a=0);
var b=this.length;
if(a<0){a=b+a;
}for(;
a<b;
a++){if(this[a]===c){return a;
}}return -1;
};
}if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(b,a){a=isNaN(a)?this.length:(a<0?this.length+a:a)+1;
var c=this.slice(0,a).reverse().indexOf(b);
return(c<0)?c:a-c-1;
};
}Array.prototype.toArray=Array.prototype.clone;
function $w(a){if(!Object.isString(a)){return[];
}a=a.strip();
return a?a.split(/\s+/):[];
}if(Prototype.Browser.Opera){Array.prototype.concat=function(){var f=[];
for(var b=0,c=this.length;
b<c;
b++){f.push(this[b]);
}for(var b=0,c=arguments.length;
b<c;
b++){if(Object.isArray(arguments[b])){for(var a=0,d=arguments[b].length;
a<d;
a++){f.push(arguments[b][a]);
}}else{f.push(arguments[b]);
}}return f;
};
}Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16);
},succ:function(){return this+1;
},times:function(a){$R(0,this,true).each(a);
return this;
},toPaddedString:function(c,b){var a=this.toString(b||10);
return"0".times(c-a.length)+a;
},toJSON:function(){return isFinite(this)?this.toString():"null";
}});
$w("abs round ceil floor").each(function(a){Number.prototype[a]=Math[a].methodize();
});
function $H(a){return new Hash(a);
}var Hash=Class.create(Enumerable,(function(){function a(b,c){if(Object.isUndefined(c)){return b;
}return b+"="+encodeURIComponent(String.interpret(c));
}return{initialize:function(b){this._object=Object.isHash(b)?b.toObject():Object.clone(b);
},_each:function(c){for(var b in this._object){var d=this._object[b],f=[b,d];
f.key=b;
f.value=d;
c(f);
}},set:function(b,c){return this._object[b]=c;
},get:function(b){return this._object[b];
},unset:function(b){var c=this._object[b];
delete this._object[b];
return c;
},toObject:function(){return Object.clone(this._object);
},keys:function(){return this.pluck("key");
},values:function(){return this.pluck("value");
},index:function(c){var b=this.detect(function(d){return d.value===c;
});
return b&&b.key;
},merge:function(b){return this.clone().update(b);
},update:function(b){return new Hash(b).inject(this,function(c,d){c.set(d.key,d.value);
return c;
});
},toQueryString:function(){return this.map(function(d){var c=encodeURIComponent(d.key),b=d.value;
if(b&&typeof b=="object"){if(Object.isArray(b)){return b.map(a.curry(c)).join("&");
}}return a(c,b);
}).join("&");
},inspect:function(){return"#<Hash:{"+this.map(function(b){return b.map(Object.inspect).join(": ");
}).join(", ")+"}>";
},toJSON:function(){return Object.toJSON(this.toObject());
},clone:function(){return new Hash(this);
}};
})());
Hash.prototype.toTemplateReplacements=Hash.prototype.toObject;
Hash.from=$H;
var ObjectRange=Class.create(Enumerable,{initialize:function(c,a,b){this.start=c;
this.end=a;
this.exclusive=b;
},_each:function(a){var b=this.start;
while(this.include(b)){a(b);
b=b.succ();
}},include:function(a){if(a<this.start){return false;
}if(this.exclusive){return a<this.end;
}return a<=this.end;
}});
var $R=function(c,a,b){return new ObjectRange(c,a,b);
};
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(a){this.responders._each(a);
},register:function(a){if(!this.include(a)){this.responders.push(a);
}},unregister:function(a){this.responders=this.responders.without(a);
},dispatch:function(d,b,c,a){this.each(function(f){if(Object.isFunction(f[d])){try{f[d].apply(f,[b,c,a]);
}catch(g){}}});
}};
Object.extend(Ajax.Responders,Enumerable);
Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++;
},onComplete:function(){Ajax.activeRequestCount--;
}});
Ajax.Base=Class.create({initialize:function(a){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};
Object.extend(this.options,a||{});
this.options.method=this.options.method.toLowerCase();
if(Object.isString(this.options.parameters)){this.options.parameters=this.options.parameters.toQueryParams();
}else{if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject();
}}}});
Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:Object.extend(function($super,b,a){$super(a);
this.transport=Ajax.getTransport();
this.request(b);
},{_argumentNames:["$super","url","options"]}),request:function(b){this.url=b;
this.method=this.options.method;
var d=Object.clone(this.options.parameters);
if(!["get","post"].include(this.method)){d._method=this.method;
this.method="post";
}this.parameters=d;
if(d=Object.toQueryString(d)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+d;
}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){d+="&_=";
}}}try{var a=new Ajax.Response(this);
if(this.options.onCreate){this.options.onCreate(a);
}Ajax.Responders.dispatch("onCreate",this,a);
this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);
if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1);
}this.transport.onreadystatechange=this.onStateChange.bind(this);
this.setRequestHeaders();
this.body=this.method=="post"?(this.options.postBody||d):null;
this.transport.send(this.body);
if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange();
}}catch(c){this.dispatchException(c);
}},onStateChange:function(){var a=this.transport.readyState;
if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState);
}},setRequestHeaders:function(){var f={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};
if(this.method=="post"){f["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){f.Connection="close";
}}if(typeof this.options.requestHeaders=="object"){var c=this.options.requestHeaders;
if(Object.isFunction(c.push)){for(var b=0,d=c.length;
b<d;
b+=2){f[c[b]]=c[b+1];
}}else{$H(c).each(function(g){f[g.key]=g.value;
});
}}for(var a in f){this.transport.setRequestHeader(a,f[a]);
}},success:function(){var a=this.getStatus();
return !a||(a>=200&&a<300);
},getStatus:function(){try{var a=this.transport.status||0;
return(Prototype.Browser.IE&&a==1223)?204:a;
}catch(b){return 0;
}},respondToReadyState:function(a){var c=Ajax.Request.Events[a],b=new Ajax.Response(this);
if(c=="Complete"){try{this._complete=true;
(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(b,b.headerJSON);
}catch(d){this.dispatchException(d);
}var f=b.getHeader("Content-type");
if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&f&&f.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse();
}}try{(this.options["on"+c]||Prototype.emptyFunction)(b,b.headerJSON);
Ajax.Responders.dispatch("on"+c,this,b,b.headerJSON);
}catch(d){this.dispatchException(d);
}if(c=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction;
}},isSameOrigin:function(){var a=this.url.match(/^\s*https?:\/\/[^\/]*/);
return !a||(a[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}));
},getHeader:function(a){try{return this.transport.getResponseHeader(a)||null;
}catch(b){return null;
}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON());
}catch(e){this.dispatchException(e);
}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);
Ajax.Responders.dispatch("onException",this,a);
}});
Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
Ajax.Response=Class.create({initialize:function(c){this.request=c;
var d=this.transport=c.transport,a=this.readyState=d.readyState;
if((a>2&&!Prototype.Browser.IE)||a==4){this.status=this.getStatus();
this.statusText=this.getStatusText();
this.responseText=String.interpret(d.responseText);
this.headerJSON=this._getHeaderJSON();
}if(a==4){var b=d.responseXML;
this.responseXML=Object.isUndefined(b)?null:b;
this.responseJSON=this._getResponseJSON();
}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||"";
}catch(a){return"";
}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders();
}catch(a){return null;
}},getResponseHeader:function(a){return this.transport.getResponseHeader(a);
},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders();
},_getHeaderJSON:function(){var a=this.getHeader("X-JSON");
if(!a){return null;
}a=decodeURIComponent(escape(a));
try{return a.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin());
}catch(b){this.request.dispatchException(b);
}},_getResponseJSON:function(){var a=this.request.options;
if(!a.evalJSON||(a.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null;
}try{return this.responseText.evalJSON(a.sanitizeJSON||!this.request.isSameOrigin());
}catch(b){this.request.dispatchException(b);
}}});
Ajax.Updater=Class.create(Ajax.Request,{initialize:Object.extend(function($super,a,c,b){this.container={success:(a.success||a),failure:(a.failure||(a.success?null:a))};
b=Object.clone(b);
var d=b.onComplete;
b.onComplete=(function(f,g){this.updateContent(f.responseText);
if(Object.isFunction(d)){d(f,g);
}}).bind(this);
$super(c,b);
},{_argumentNames:["$super","container","url","options"]}),updateContent:function(d){var c=this.container[this.success()?"success":"failure"],a=this.options;
if(!a.evalScripts){d=d.stripScripts();
}if(c=$(c)){if(a.insertion){if(Object.isString(a.insertion)){var b={};
b[a.insertion]=d;
c.insert(b);
}else{a.insertion(c,d);
}}else{c.update(d);
}}}});
Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:Object.extend(function($super,a,c,b){$super(b);
this.onComplete=this.options.onComplete;
this.frequency=(this.options.frequency||2);
this.decay=(this.options.decay||1);
this.updater={};
this.container=a;
this.url=c;
this.start();
},{_argumentNames:["$super","container","url","options"]}),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(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);
this.lastText=a.responseText;
}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency);
},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options);
}});
function $(b){if(arguments.length>1){for(var a=0,d=[],c=arguments.length;
a<c;
a++){d.push($(arguments[a]));
}return d;
}if(Object.isString(b)){b=document.getElementById(b);
}return Element.extend(b);
}var DocumentMethods={};
if(Prototype.BrowserFeatures.XPath){DocumentMethods._getElementsByXPath=function(g,a){var c=[];
var f=this.evaluate(g,$(a)||this,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for(var b=0,d=f.snapshotLength;
b<d;
b++){c.push(Element.extend(f.snapshotItem(b)));
}return c;
};
}if(!window.Node){var Node={};
}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12});
}(function(){var a=this.Element;
this.Element=function(d,c){c=c||{};
d=d.toLowerCase();
var b=Element.cache;
if(Prototype.Browser.IE&&(c.name||c.type)){d="<"+d+(c.name?' name="'+c.name+'"':"")+(c.type?' type="'+c.type+'"':"")+">";
delete c.name;
delete c.type;
return Element.writeAttribute(document.createElement(d),c);
}if(!b[d]){b[d]=Element.extend(document.createElement(d));
}return Element.writeAttribute(b[d].cloneNode(false),c);
};
Object.extend(this.Element,a||{});
if(a){this.Element.prototype=a.prototype;
}}).call(window);
Element.cache={};
Element.Methods={visible:function(a){return $(a).style.display!="none";
},toggle:function(a){a=$(a);
Element[Element.visible(a)?"hide":"show"](a);
return a;
},hide:function(a){$(a).style.display="none";
return a;
},show:function(a){$(a).style.display="";
return a;
},remove:function(a){a=$(a);
a.parentNode.removeChild(a);
return a;
},update:function(a,b){a=$(a);
if(b&&b.toElement){b=b.toElement();
}if(Object.isElement(b)){return a.update().insert(b);
}b=Object.toHTML(b);
a.innerHTML=b.stripScripts();
b.evalScripts.bind(b).defer();
return a;
},replace:function(b,c){b=$(b);
if(c&&c.toElement){c=c.toElement();
}else{if(!Object.isElement(c)){c=Object.toHTML(c);
var a=$D(b).createRange();
a.selectNode(b);
c.evalScripts.bind(c).defer();
c=a.createContextualFragment(c.stripScripts());
}}b.parentNode.replaceChild(c,b);
return b;
},insert:function(c,f){c=$(c);
if(Object.isString(f)||Object.isNumber(f)||Object.isElement(f)||(f&&(f.toElement||f.toHTML))){f={bottom:f};
}var d,g,b,h;
for(var a in f){d=f[a];
a=a.toLowerCase();
g=Element._insertionTranslations[a];
if(d&&d.toElement){d=d.toElement();
}if(Object.isElement(d)){g(c,d);
continue;
}d=Object.toHTML(d);
b=((a=="before"||a=="after")?c.parentNode:c).tagName.toUpperCase();
h=Element._getContentFromAnonymousElement(b,d.stripScripts());
if(a=="top"||a=="after"){h.reverse();
}h.each(g.curry(c));
d.evalScripts.bind(d).defer();
}return c;
},wrap:function(b,c,a){b=$(b);
if(Object.isElement(c)){$(c).writeAttribute(a||{});
}else{if(Object.isString(c)){c=new Element(c,a);
}else{c=new Element("div",c);
}}if(b.parentNode){b.parentNode.replaceChild(c,b);
}c.appendChild(b);
return c;
},inspect:function(b){b=$(b);
var a="<"+b.tagName.toLowerCase();
$H({id:"id",className:"class"}).each(function(g){var f=g.first(),c=g.last();
var d=(b[f]||"").toString();
if(d){a+=" "+c+"="+d.inspect(true);
}});
return a+">";
},recursivelyCollect:function(a,c){a=$(a);
var b=[];
while(a=a[c]){if(a.nodeType==1){b.push(Element.extend(a));
}}return b;
},ancestors:function(a){return $(a).recursivelyCollect("parentNode");
},descendants:function(a){return $(a).select("*");
},firstDescendant:function(a){a=$(a).firstChild;
while(a&&a.nodeType!=1){a=a.nextSibling;
}return $(a);
},immediateDescendants:function(a){if(!(a=$(a).firstChild)){return[];
}while(a&&a.nodeType!=1){a=a.nextSibling;
}if(a){return[a].concat($(a).nextSiblings());
}return[];
},previousSiblings:function(a){return $(a).recursivelyCollect("previousSibling");
},nextSiblings:function(a){return $(a).recursivelyCollect("nextSibling");
},siblings:function(a){a=$(a);
return a.previousSiblings().reverse().concat(a.nextSiblings());
},match:function(b,a){if(Object.isString(a)){a=new Selector(a);
}return a.match($(b));
},up:function(b,d,a){b=$(b);
if(arguments.length==1){return $(b.parentNode);
}var c=b.ancestors();
return Object.isNumber(d)?c[d]:Selector.findElement(c,d,a);
},down:function(b,c,a){b=$(b);
if(arguments.length==1){return b.firstDescendant();
}return Object.isNumber(c)?b.descendants()[c]:b.select(c)[a||0];
},previous:function(b,d,a){b=$(b);
if(arguments.length==1){return $(Selector.handlers.previousElementSibling(b));
}var c=b.previousSiblings();
return Object.isNumber(d)?c[d]:Selector.findElement(c,d,a);
},next:function(c,d,b){c=$(c);
if(arguments.length==1){return $(Selector.handlers.nextElementSibling(c));
}var a=c.nextSiblings();
return Object.isNumber(d)?a[d]:Selector.findElement(a,d,b);
},select:function(){var a=$A(arguments),b=$(a.shift());
return Selector.findChildElements(b,a);
},adjacent:function(){var a=$A(arguments),b=$(a.shift());
return Selector.findChildElements(b.parentNode,a).without(b);
},identify:function(b){b=$(b);
var c=b.readAttribute("id"),a=arguments.callee;
if(c){return c;
}do{c="anonymous_element_"+a.counter++;
}while($(c));
b.writeAttribute("id",c);
return c;
},readAttribute:function(d,a){d=$(d);
var c=Element._attributeTranslations.read;
if(c.names[a]){a=c.names[a];
}if(Prototype.Browser.IE){var b=d.tagName.toUpperCase();
if(b=="FORM"&&!/^((child|parent)Node|(next|previous)Sibling)$/.test(a)&&d.children[a]){d=$(d.cloneNode(false));
}if(b=="IFRAME"&&a=="type"){return d.getAttribute(a,1);
}if(c.values[a]){return c.values[a](d,a);
}if(a.include(":")){return(!d.attributes||!d.attributes[a])?null:d.attributes[a].value;
}}else{if(c.values[a]){return c.values[a](d,a);
}}return d.getAttribute(a);
},writeAttribute:function(f,c,g){f=$(f);
var b={},d=Element._attributeTranslations.write;
if(typeof c=="object"){b=c;
}else{b[c]=Object.isUndefined(g)?true:g;
}for(var a in b){c=d.names[a]||a;
g=b[a];
if(d.values[a]){c=d.values[a](f,g);
}if(g===false||g===null){f.removeAttribute(c);
}else{if(g===true){f.setAttribute(c,c);
}else{f.setAttribute(c,g);
}}}return f;
},getHeight:function(a){return $(a).getDimensions().height;
},getWidth:function(a){return $(a).getDimensions().width;
},classNames:function(a){return new Element.ClassNames(a);
},hasClassName:function(a,b){if(!(a=$(a))){return;
}var c=a.className;
return(c.length>0&&(c==b||new RegExp("(^|\\s)"+b+"(\\s|$)").test(c)));
},addClassName:function(a,b){if(!(a=$(a))){return;
}if(!a.hasClassName(b)){a.className+=(a.className?" ":"")+b;
}return a;
},removeClassName:function(a,b){if(!(a=$(a))){return;
}a.className=a.className.replace(new RegExp("(^|\\s+)"+b+"(\\s+|$)")," ").strip();
return a;
},toggleClassName:function(a,b){if(!(a=$(a))){return;
}return a[a.hasClassName(b)?"removeClassName":"addClassName"](b);
},cleanWhitespace:function(b){b=$(b);
var c=b.firstChild;
while(c){var a=c.nextSibling;
if(c.nodeType==3&&!/\S/.test(c.nodeValue)){b.removeChild(c);
}c=a;
}return b;
},empty:function(a){return $(a).innerHTML.blank();
},descendantOf:function(b,a){b=$(b),a=$(a);
if(b.compareDocumentPosition){return(b.compareDocumentPosition(a)&8)===8;
}if(a.contains){return a.contains(b)&&a!==b;
}while(b=b.parentNode){if(b==a){return true;
}}return false;
},scrollTo:function(a){a=$(a);
var b=a.cumulativeOffset();
window.scrollTo(b[0],b[1]);
return a;
},getStyle:function(b,c){b=$(b);
c=c=="float"?"cssFloat":c.camelize();
var d=b.style[c];
if(!d){var a=$D(b).defaultView.getComputedStyle(b,null);
d=a?a[c]:null;
}if(c=="opacity"){return d?parseFloat(d):1;
}return d=="auto"?null:d;
},getOpacity:function(a){return $(a).getStyle("opacity");
},setStyle:function(b,c){b=$(b);
var f=b.style,a;
if(Object.isString(c)){b.style.cssText+=";"+c;
return c.include("opacity")?b.setOpacity(c.match(/opacity:\s*(\d?\.?\d*)/)[1]):b;
}for(var d in c){if(d=="opacity"){b.setOpacity(c[d]);
}else{f[(d=="float"||d=="cssFloat")?(Object.isUndefined(f.styleFloat)?"cssFloat":"styleFloat"):d]=c[d];
}}return b;
},setOpacity:function(a,b){a=$(a);
a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;
return a;
},getDimensions:function(c){c=$(c);
var h=c.getStyle("display"),f={width:c.offsetWidth,height:c.offsetHeight};
if(h==="none"||h===null||f.width===0||f.height===0){var b=c.style,g=b.visibility,d=b.position,a=b.display;
b.visibility="hidden";
b.position="absolute";
b.display="block";
f={width:c.offsetWidth,height:c.offsetHeight};
b.display=a;
b.position=d;
b.visibility=g;
}return f;
},makePositioned:function(a){a=$(a);
var b=Element.getStyle(a,"position");
if(b=="static"||!b){a._madePositioned=true;
a.style.position="relative";
if(window.opera){a.style.top=0;
a.style.left=0;
}}return a;
},undoPositioned:function(a){a=$(a);
if(a._madePositioned){a._madePositioned=undefined;
a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right="";
}return a;
},makeClipping:function(a){a=$(a);
if(a._overflow){return a;
}a._overflow=Element.getStyle(a,"overflow")||"auto";
if(a._overflow!=="hidden"){a.style.overflow="hidden";
}return a;
},undoClipping:function(a){a=$(a);
if(!a._overflow){return a;
}a.style.overflow=a._overflow=="auto"?"":a._overflow;
a._overflow=null;
return a;
},cumulativeOffset:function(b){var a=0,c=0;
do{a+=b.offsetTop||0;
c+=b.offsetLeft||0;
b=b.offsetParent;
}while(b);
return Element._returnOffset(c,a);
},positionedOffset:function(b){var a=0,d=0;
do{a+=b.offsetTop||0;
d+=b.offsetLeft||0;
b=b.offsetParent;
if(b){if(b.tagName=="BODY"){break;
}var c=Element.getStyle(b,"position");
if(c!=="static"){break;
}}}while(b);
return Element._returnOffset(d,a);
},absolutize:function(b){b=$(b);
if(Element.getStyle(b,"position")=="absolute"){return b;
}var f=Element.positionedOffset(b),d=Element.getDimensions(b),h=f.top,g=f.left,c=d.width,a=d.height;
Object.extend(b,{_originalLeft:g-parseFloat(b.style.left||0),_originalTop:h-parseFloat(b.style.top||0),_originalWidth:Element.getStyle(b,"width"),_originalHeight:Element.getStyle(b,"height"),_originalMarginTop:Element.getStyle(b,"marginTop"),_originalMarginLeft:Element.getStyle(b,"marginLeft")});
Element.setStyle(b,{position:"absolute",top:h+"px",left:g+"px",width:c+"px",height:a+"px",marginTop:"0px",marginLeft:"0px"});
return b;
},relativize:function(b){b=$(b);
if(Element.getStyle(b,"position")==="relative"){return b;
}if(!b._originalTop){var g=b.outerHTML&&b.innerHTML.blank();
if(g){b.innerHTML="\x00";
}Object.extend(b,{_originalTop:b.offsetTop||0,_originalLeft:b.offsetLeft||0,_originalWidth:Element.getStyle(b,"width"),_originalHeight:Element.getStyle(b,"height"),_originalMarginTop:Element.getStyle(b,"marginTop"),_originalMarginLeft:Element.getStyle(b,"marginLeft")});
if(g){b.innerHTML="";
}}Element.setStyle(b,{position:"relative",width:b._originalWidth,height:b._originalHeight,marginTop:b._originalMarginTop,marginLeft:b._originalMarginLeft});
var c=b.positionedOffset(),f=b._originalTop-c.top,d=b._originalLeft-c.left;
var a=/^(auto|)$/;
if(!a.test(b.style.top)){f+=b._originalTop;
}if(!a.test(b.style.left)){d+=b._originalLeft;
}Element.setStyle(b,{top:f+"px",left:d+"px"});
return b;
},getOffsetParent:function(b){b=$(b);
var c=$D(b);
if(b.sourceIndex<1){return $(c.body);
}var d=b.offsetParent,a=c.documentElement;
if(d&&d!==a&&Element.getStyle(d,"position")!=="static"){return $(d);
}while((b=b.parentNode)&&b!==a&&b!==c){if(Element.getStyle(b,"position")!=="static"){return $(b);
}}return $(c.body);
}};
Object.extend(Element.Methods,(function(){function b(d,f){return parseFloat(Element.getStyle(d,f))||0;
}function a(d){var g=Element.getOffsetParent(d),f=$D(d);
if(g===f.body&&(d.sourceIndex<1||!d.offsetParent)){return false;
}if(d.sourceIndex>0&&d.offsetParent===f.documentElement){return d.offsetParent;
}return g;
}function c(g,l,m){var h={},f;
if(m==="height"){f=$w("borderTopWidth marginTop paddingTop borderBottomWidth marginBottom paddingBottom");
}else{f=$w("borderLeftWidth marginLeft paddingLeft borderRightWidth marginRight paddingRight");
}h[m]=Element.getDimensions(l)[m];
for(var d=0,k,j;
k=f[d];
d++){if(k.include("margin")){j=b(g,k);
h[k]=j+(b(l,k)-j)+"px";
}else{j=b(l,k);
h[k]=j+"px";
h[m]-=j;
}}h[m]+="px";
Element.setStyle(g,h);
}return{cumulativeScrollOffset:function(f){var d=0,h=0,g=$D(f);
do{if(Element.getStyle(f,"position")==="fixed"){break;
}if(f==g.body&&((f.scrollTop&&f.parentNode.scrollTop)||(f.scrollLeft&&f.parentNode.scrollLeft))){continue;
}d+=f.scrollTop||0;
h+=f.scrollLeft||0;
}while((f=f.parentNode)&&f.nodeType===1);
return Element._returnOffset(h,d);
},cumulativeOffset:function(f){f=$(f);
var d=0,g=0;
do{d+=f.offsetTop||0;
g+=f.offsetLeft||0;
}while(f=a(f));
return Element._returnOffset(g,d);
},positionedOffset:function(f){f=$(f);
var d=0,h=0,g=$D(f);
do{d+=f.offsetTop||0;
h+=f.offsetLeft||0;
f=a(f);
}while(f&&f!==g.body&&Element.getStyle(f,"position")==="static");
return Element._returnOffset(h,d);
},viewportOffset:function(k){k=$(k);
var l,g=k,d=0,j=0,h=$D(k);
do{d+=g.offsetTop||0;
j+=g.offsetLeft||0;
l=a(g);
if(l===h.body&&Element.getStyle(g,"position")==="absolute"){break;
}}while(g=l);
var f=Element.cumulativeScrollOffset(k);
d-=f.top-(k.scrollTop||0);
j-=f.left-(k.scrollLeft||0);
return Element._returnOffset(j,d);
},clonePosition:function(f,h){f=$(f);
h=$(h);
var d=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});
var g,l=[0,0];
if(Element.getStyle(f,"position")=="absolute"){var k=$D(f);
g=Element.getOffsetParent(f);
l=Element.viewportOffset(g);
l[0]-=g.scrollLeft;
l[1]-=g.scrollTop;
if(g==k.body){l[0]-=k.body.offsetLeft;
l[1]-=k.body.offsetTop;
}}var j=Element.viewportOffset(h);
if(d.setWidth){c(f,h,"width");
}if(d.setHeight){c(f,h,"height");
}if(d.setLeft){f.style.left=(j[0]-l[0]+d.offsetLeft+"px");
}if(d.setTop){f.style.top=(j[1]-l[1]+d.offsetTop+"px");
}return f;
}};
})());
Element.Methods.identify.counter=1;
Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});
Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}},read:{names:{},values:{_flag:function(a,b){return $(a).hasAttribute(b)?b:null;
}}}};
(function(a){Object.extend(a,{disabled:a._flag,checked:a._flag,readonly:a._flag,multiple:a._flag});
})(Element._attributeTranslations.read.values);
if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(d,b,c){switch(c){case"left":case"top":case"right":case"bottom":if(d(b,"position")==="static"){return null;
}case"height":case"width":if(!Element.visible(b)){return null;
}var f=parseInt(d(b,c),10);
if(f!==b["offset"+c.capitalize()]){return f+"px";
}var a;
if(c==="height"){a=["border-top-width","padding-top","padding-bottom","border-bottom-width"];
}else{a=["border-left-width","padding-left","padding-right","border-right-width"];
}return a.inject(f,function(g,h){var j=d(b,h);
return j===null?g:g-parseInt(j,10);
})+"px";
default:return d(b,c);
}});
Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(c,a,b){if(b==="title"){return $(a).title;
}return c(a,b);
});
}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(c,b){b=$(b);
var a=b.getStyle("position");
if(a!=="static"){return c(b);
}b.setStyle({position:"relative"});
var d=c(b);
b.setStyle({position:a});
return d;
});
$w("positionedOffset viewportOffset").each(function(a){Element.Methods[a]=Element.Methods[a].wrap(function(f,c){c=$(c);
var b=c.getStyle("position");
if(b!=="static"){return f(c);
}var d=c.getOffsetParent();
if(d&&d.getStyle("position")==="fixed"){d.setStyle({zoom:1});
}c.setStyle({position:"relative"});
var g=f(c);
c.setStyle({position:b});
return g;
});
});
Element.Methods.getStyle=function(a,b){a=$(a);
b=(b=="float"||b=="cssFloat")?"styleFloat":b.camelize();
var c=a.style[b];
if(!c&&a.currentStyle){c=a.currentStyle[b];
}if(b=="opacity"){if(c=(a.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(c[1]){return parseFloat(c[1])/100;
}}return 1;
}if(c=="auto"){if((b=="width"||b=="height")&&(a.getStyle("display")!="none")){return a["offset"+b.capitalize()]+"px";
}return null;
}return c;
};
Element.Methods.setOpacity=function(b,f){function g(h){return h.replace(/alpha\([^\)]*\)/gi,"");
}b=$(b);
var a=b.currentStyle;
if((a&&!a.hasLayout)||(!a&&b.style.zoom=="normal")){b.style.zoom=1;
}var d=b.getStyle("filter"),c=b.style;
if(f==1||f===""){(d=g(d))?c.filter=d:c.removeAttribute("filter");
return b;
}else{if(f<0.00001){f=0;
}}c.filter=g(d)+"alpha(opacity="+(f*100)+")";
return b;
};
(function(a){a.has={};
a.write.names={};
$w("cellPadding cellSpacing colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(b){var c=b.toLowerCase();
a.has[c]=b;
a.read.names[c]=b;
a.write.names[c]=b;
});
[a.write.names,a.read.names].each(function(b){Object.extend(b,{"class":"className","for":"htmlFor"});
});
})(Element._attributeTranslations);
Object.extend(Element._attributeTranslations.read.values,{_getAttr:function(a,b){return a.getAttribute(b,2);
},_getAttrNode:function(a,c){var b=a.getAttributeNode(c);
return b?b.value:"";
},_getEv:function(a,b){b=a.getAttribute(b);
return b?b.toString().slice(23,-2):null;
},style:function(a){return a.style.cssText.toLowerCase();
},title:function(a){return a.title;
}});
Object.extend(Element._attributeTranslations.write.values,{checked:function(a,b){a.checked=!!b;
},encType:function(a,b){a.getAttributeNode("encType").value=b;
},style:function(a,b){a.style.cssText=b?b:"";
}});
(function(a){delete a.readonly;
Object.extend(a,{href:a._getAttr,src:a._getAttr,type:a._getAttr,action:a._getAttrNode,onload:a._getEv,onunload:a._getEv,onclick:a._getEv,ondblclick:a._getEv,onmousedown:a._getEv,onmouseup:a._getEv,onmouseover:a._getEv,onmousemove:a._getEv,onmouseout:a._getEv,onfocus:a._getEv,onblur:a._getEv,onkeypress:a._getEv,onkeydown:a._getEv,onkeyup:a._getEv,onsubmit:a._getEv,onreset:a._getEv,onselect:a._getEv,onchange:a._getEv,readOnly:a._flag.wrap(function(d,b,c){c=d(b,c);
return c?"readonly":null;
})});
})(Element._attributeTranslations.read.values);
}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(a,b){a=$(a);
a.style.opacity=(b==1)?0.999999:(b==="")?"":(b<0.00001)?0:b;
return a;
};
}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(a,b){a=$(a);
a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;
if(b==1){if(a.tagName.toUpperCase()=="IMG"&&a.width){a.width++;
a.width--;
}else{try{var d=$D(a).createTextNode(" ");
a.appendChild(d);
a.removeChild(d);
}catch(c){}}}return a;
};
Element.Methods.cumulativeOffset=function(c){var b=0,d=0;
var a=$D(c).body;
do{b+=c.offsetTop||0;
d+=c.offsetLeft||0;
if(c.offsetParent==a){if(Element.getStyle(c,"position")=="absolute"){break;
}}c=c.offsetParent;
}while(c);
return Element._returnOffset(d,b);
};
}}}}if(Prototype.Browser.IE||Prototype.Browser.Opera){Element.Methods.update=function(b,c){b=$(b);
if(c&&c.toElement){c=c.toElement();
}if(Object.isElement(c)){return b.update().insert(c);
}c=Object.toHTML(c);
var a=b.tagName.toUpperCase();
if(a in Element._insertionTranslations.tags){$A(b.childNodes).each(function(d){b.removeChild(d);
});
Element._getContentFromAnonymousElement(a,c.stripScripts()).each(function(d){b.appendChild(d);
});
}else{b.innerHTML=c.stripScripts();
}c.evalScripts.bind(c).defer();
return b;
};
}if(Prototype.Browser.IE){Element.Methods.update=Element.Methods.update.wrap(function(c,a,b){Element.select(a,"*").each(Event.stopObserving);
return c(a,b);
});
}if("outerHTML" in document.createElement("div")){Element.Methods.replace=function(c,f){c=$(c);
if(f&&f.toElement){f=f.toElement();
}if(Object.isElement(f)){c.parentNode.replaceChild(f,c);
return c;
}f=Object.toHTML(f);
var d=c.parentNode,b=d.tagName.toUpperCase();
if(Element._insertionTranslations.tags[b]||Prototype.Browser.IE){var g=c.next();
var a=Element._getContentFromAnonymousElement(b,f.stripScripts());
d.removeChild(c);
if(g){a.each(function(h){d.insertBefore(h,g);
});
}else{a.each(function(h){d.appendChild(h);
});
}}else{c.outerHTML=f.stripScripts();
}f.evalScripts.bind(f).defer();
return c;
};
}Element._returnOffset=function(b,c){var a=[b,c];
a.left=b;
a.top=c;
return a;
};
Element._getContentFromAnonymousElement=function(c,b){var d=new Element("div"),a=Element._insertionTranslations.tags[c];
if(a){d.innerHTML=a[0]+b+a[1];
a[2].times(function(){d=d.firstChild;
});
}else{d.innerHTML=b;
}return $A(d.childNodes);
};
Element._insertionTranslations={before:function(a,b){a.parentNode.insertBefore(b,a);
},top:function(a,b){a.insertBefore(b,a.firstChild);
},bottom:function(a,b){a.appendChild(b);
},after:function(a,b){a.parentNode.insertBefore(b,a.nextSibling);
},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};
(function(){Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD});
}).call(Element._insertionTranslations);
Element.Methods.Simulated={hasAttribute:function(a,c){c=Element._attributeTranslations.has[c]||c;
var b=a.getAttributeNode(c);
return !!(b&&b.specified);
}};
Element.Methods.ByTag={};
Object.extend(Element,Element.Methods);
if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement("div").__proto__){window.HTMLElement={};
window.HTMLElement.prototype=document.createElement("div").__proto__;
Prototype.BrowserFeatures.ElementExtensions=true;
}Element.extend=(function(){if(Prototype.BrowserFeatures.SpecificElementExtensions){return Prototype.K;
}var a={},b=Element.Methods.ByTag;
var c=Object.extend(function(g){if(!g||g._extendedByPrototype||g.nodeType!=1||g==window){return g;
}var d=Object.clone(a),f=g.tagName,j,h;
if(g.ownerDocument&&Object.isUndefined(g.ownerDocument.write)){return g;
}if(b[f]){Object.extend(d,b[f]);
}for(j in d){h=d[j];
if(Object.isFunction(h)&&!(j in g)){g[j]=h.methodize();
}}g._extendedByPrototype=Prototype.emptyFunction;
return g;
},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(a,Element.Methods);
Object.extend(a,Element.Methods.Simulated);
}}});
c.refresh();
return c;
})();
Element.hasAttribute=function(a,b){if(a.hasAttribute){return a.hasAttribute(b);
}return Element.Methods.Simulated.hasAttribute(a,b);
};
Element.addMethods=function(c){var j=Prototype.BrowserFeatures,d=Element.Methods.ByTag;
if(!c){Object.extend(Form,Form.Methods);
Object.extend(Form.Element,Form.Element.Methods);
Object.extend(Element.Methods.ByTag,{BUTTON:Object.clone(Form.Element.Methods),FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)});
}if(arguments.length==2){var b=c;
c=arguments[1];
}if(!b){Object.extend(Element.Methods,c||{});
}else{if(Object.isArray(b)){b.each(h);
}else{h(b);
}}function h(l){l=l.toUpperCase();
if(!Element.Methods.ByTag[l]){Element.Methods.ByTag[l]={};
}Object.extend(Element.Methods.ByTag[l],c);
}function a(n,m,l){l=l||false;
for(var p in n){var o=n[p];
if(!Object.isFunction(o)){continue;
}if(!l||!(p in m)){m[p]=o.methodize();
}}}function f(n){var l;
var m={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};
if(m[n]){l="HTML"+m[n]+"Element";
}if(window[l]){return window[l];
}l="HTML"+n+"Element";
if(window[l]){return window[l];
}l="HTML"+n.capitalize()+"Element";
if(window[l]){return window[l];
}window[l]={};
window[l].prototype=document.createElement(n).__proto__;
return window[l];
}if(j.ElementExtensions){a(Element.Methods,HTMLElement.prototype);
a(Element.Methods.Simulated,HTMLElement.prototype,true);
}if(j.SpecificElementExtensions){for(var k in Element.Methods.ByTag){var g=f(k);
if(Object.isUndefined(g)){continue;
}a(d[k],g.prototype);
}}Object.extend(Element,Element.Methods);
delete Element.ByTag;
if(Element.extend.refresh){Element.extend.refresh();
}Element.cache={};
};
document.viewport={getDimensions:function(){var a={},b=Prototype.Browser;
$w("width height").each(function(f){var c=f.capitalize();
if(b.WebKit&&!document.evaluate){a[f]=self["inner"+c];
}else{if(b.Opera&&parseFloat(window.opera.version())<9.5){a[f]=document.body["client"+c];
}else{a[f]=document.documentElement["client"+c];
}}});
return a;
},getWidth:function(){return this.getDimensions().width;
},getHeight:function(){return this.getDimensions().height;
},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop);
}};
var Selector=Class.create({initialize:function(a){this.expression=a.strip();
if(this.shouldUseSelectorsAPI()){this.mode="selectorsAPI";
}else{if(this.shouldUseXPath()){this.mode="xpath";
this.compileXPathMatcher();
}else{this.mode="normal";
this.compileMatcher();
}}},shouldUseXPath:function(){if(!Prototype.BrowserFeatures.XPath){return false;
}var a=this.expression;
if(Prototype.Browser.Opera&&parseFloat(window.opera.version())===9.5){return false;
}if(Prototype.Browser.WebKit&&(a.include("-of-type")||a.include(":empty"))){return false;
}if((/(\[[\w-]*?:|:checked)/).test(a)){return false;
}return true;
},shouldUseSelectorsAPI:function(){if(!Prototype.BrowserFeatures.SelectorsAPI){return false;
}if(!Selector._div){Selector._div=new Element("div");
}try{Selector._div.querySelector(this.expression);
}catch(a){return false;
}return true;
},compileMatcher:function(){var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;
if(Selector._cache[e]){this.matcher=Selector._cache[e];
return;
}this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];
while(e&&le!=e&&(/\S/).test(e)){le=e;
for(var i in ps){p=ps[i];
if(m=e.match(p)){this.matcher.push(Object.isFunction(c[i])?c[i](m):new Template(c[i]).evaluate(m));
e=e.replace(m[0],"");
break;
}}}this.matcher.push("return h.unique(n);\n}");
eval(this.matcher.join("\n"));
Selector._cache[this.expression]=this.matcher;
},compileXPathMatcher:function(){var f=this.expression,g=Selector.patterns,b=Selector.xpath,d,a;
if(Selector._cache[f]){this.xpath=Selector._cache[f];
return;
}this.matcher=[".//*"];
while(f&&d!=f&&(/\S/).test(f)){d=f;
for(var c in g){if(a=f.match(g[c])){this.matcher.push(Object.isFunction(b[c])?b[c](a):new Template(b[c]).evaluate(a));
f=f.replace(a[0],"");
break;
}}}this.xpath=this.matcher.join("");
Selector._cache[this.expression]=this.xpath;
},findElements:function(a){a=a||document;
var c=this.expression,b;
switch(this.mode){case"selectorsAPI":if(a!==$D(a)){var d=a.id,f=$(a).identify();
c="#"+f+" "+c;
}b=$A(a.querySelectorAll(c)).map(Element.extend);
a.id=d;
return b;
case"xpath":return $D(a)._getElementsByXPath(this.xpath,a);
default:return this.matcher(a);
}},match:function(j){this.tokens=[];
var o=this.expression,a=Selector.patterns,f=Selector.assertions;
var b,d,g;
while(o&&b!==o&&(/\S/).test(o)){b=o;
for(var k in a){d=a[k];
if(g=o.match(d)){if(f[k]){this.tokens.push([k,Object.clone(g)]);
o=o.replace(g[0],"");
}else{return this.findElements($D(j)).include(j);
}}}}var n=true,c,l;
for(var k=0,h;
h=this.tokens[k];
k++){c=h[0],l=h[1];
if(!Selector.assertions[c](j,l)){n=false;
break;
}}return n;
},toString:function(){return this.expression;
},inspect:function(){return"#<Selector:"+this.expression.inspect()+">";
}});
Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(a){if(a[1]=="*"){return"";
}return"[local-name()='"+a[1].toLowerCase()+"' or local-name()='"+a[1].toUpperCase()+"']";
},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(a){a[1]=a[1].toLowerCase();
return new Template("[@#{1}]").evaluate(a);
},attr:function(a){a[1]=a[1].toLowerCase();
a[3]=a[5]||a[6];
return new Template(Selector.xpath.operators[a[2]]).evaluate(a);
},pseudo:function(a){var b=Selector.xpath.pseudos[a[1]];
if(!b){return"";
}if(Object.isFunction(b)){return b(a);
}return new Template(Selector.xpath.pseudos[a[1]]).evaluate(a);
},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]",empty:"[count(*) = 0 and (count(text()) = 0)]",checked:"[@checked]",disabled:"[(@disabled) and (@type!='hidden')]",enabled:"[not(@disabled) and (@type!='hidden')]",not:function(b){var j=b[6],h=Selector.patterns,a=Selector.xpath,f,c;
var g=[];
while(j&&f!=j&&(/\S/).test(j)){f=j;
for(var d in h){if(b=j.match(h[d])){c=Object.isFunction(a[d])?a[d](b):new Template(a[d]).evaluate(b);
g.push("("+c.substring(1,c.length-1)+")");
j=j.replace(b[0],"");
break;
}}}return"[not("+g.join(" and ")+")]";
},"nth-child":function(a){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",a);
},"nth-last-child":function(a){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",a);
},"nth-of-type":function(a){return Selector.xpath.pseudos.nth("position() ",a);
},"nth-last-of-type":function(a){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",a);
},"first-of-type":function(a){a[6]="1";
return Selector.xpath.pseudos["nth-of-type"](a);
},"last-of-type":function(a){a[6]="1";
return Selector.xpath.pseudos["nth-last-of-type"](a);
},"only-of-type":function(a){var b=Selector.xpath.pseudos;
return b["first-of-type"](a)+b["last-of-type"](a);
},nth:function(h,f){var j,k=f[6],d;
if(k=="even"){k="2n+0";
}if(k=="odd"){k="2n+1";
}if(j=k.match(/^(\d+)$/)){return"["+h+"= "+j[1]+"]";
}if(j=k.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(j[1]=="-"){j[1]=-1;
}var g=j[1]?Number(j[1]):1;
var c=j[2]?Number(j[2]):0;
d="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";
return new Template(d).evaluate({fragment:h,a:g,b:c});
}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);      c = false;',className:'n = h.className(n, r, "#{1}", c);    c = false;',id:'n = h.id(n, r, "#{1}", c);           c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(a){a[3]=(a[5]||a[6]);
return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(a);
},pseudo:function(a){if(a[6]){a[6]=a[6].replace(/"/g,'\\"');
}return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(a);
},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/,attrPresence:/^\[((?:[\w]+:)?[\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/},assertions:{tagName:function(a,b){return b[1].toUpperCase()==a.tagName.toUpperCase();
},className:function(a,b){return Element.hasClassName(a,b[1]);
},id:function(a,b){return a.id===b[1];
},attrPresence:function(a,b){return Element.hasAttribute(a,b[1]);
},attr:function(b,c){var a=Element.readAttribute(b,c[1]);
return a&&Selector.operators[c[2]](a,c[5]||c[6]);
}},handlers:{concat:function(d,c){for(var f=0,g;
g=c[f];
f++){d.push(g);
}return d;
},mark:function(a){var d=Prototype.emptyFunction;
for(var b=0,c;
c=a[b];
b++){c._countedByPrototype=d;
}return a;
},unmark:function(a){for(var b=0,c;
c=a[b];
b++){c._countedByPrototype=undefined;
}return a;
},index:function(a,d,h){a._countedByPrototype=Prototype.emptyFunction;
if(d){for(var b=a.childNodes,f=b.length-1,c=1;
f>=0;
f--){var g=b[f];
if(g.nodeType==1&&(!h||g._countedByPrototype)){g.nodeIndex=c++;
}}}else{for(var f=0,c=1,b=a.childNodes;
g=b[f];
f++){if(g.nodeType==1&&(!h||g._countedByPrototype)){g.nodeIndex=c++;
}}}},unique:function(b){if(b.length==0){return b;
}var d=[],f;
for(var c=0,a=b.length;
c<a;
c++){if(!(f=b[c])._countedByPrototype){f._countedByPrototype=Prototype.emptyFunction;
d.push(Element.extend(f));
}}return Selector.handlers.unmark(d);
},descendant:function(a){var d=Selector.handlers;
for(var c=0,b=[],f;
f=a[c];
c++){d.concat(b,f.getElementsByTagName("*"));
}return b;
},child:function(a){var f=Selector.handlers;
for(var d=0,c=[],g;
g=a[d];
d++){for(var b=0,k;
k=g.childNodes[b];
b++){if(k.nodeType==1&&k.tagName!="!"){c.push(k);
}}}return c;
},adjacent:function(a){for(var c=0,b=[],f;
f=a[c];
c++){var d=this.nextElementSibling(f);
if(d){b.push(d);
}}return b;
},laterSibling:function(a){var d=Selector.handlers;
for(var c=0,b=[],f;
f=a[c];
c++){d.concat(b,Element.nextSiblings(f));
}return b;
},nextElementSibling:function(a){while(a=a.nextSibling){if(a.nodeType==1){return a;
}}return null;
},previousElementSibling:function(a){while(a=a.previousSibling){if(a.nodeType==1){return a;
}}return null;
},tagName:function(a,k,c,b){var l=c.toUpperCase();
var f=[],j=Selector.handlers;
if(a){if(b){if(b=="descendant"){for(var g=0,d;
d=a[g];
g++){j.concat(f,d.getElementsByTagName(c));
}return f;
}else{a=this[b](a);
}if(c=="*"){return a;
}}for(var g=0,d;
d=a[g];
g++){if(d.tagName.toUpperCase()===l){f.push(d);
}}return f;
}else{return k.getElementsByTagName(c);
}},id:function(a,l,b,c){var j=$(b),g=Selector.handlers,m=$D(l);
if(!j){var k=false;
if(Prototype.Browser.IE&&(l.sourceIndex<1||l===m)){k=true;
}else{if(Prototype.Browser.Opera&&(l.compareDocumentPosition(m)&1)===1){k=true;
}}if(k){var a=l.getElementsByTagName("*");
for(var f=0,d;
d=a[f];
f++){if(d.id===b){j=d;
break;
}}if(!j){return[];
}}else{return[];
}}if(!a&&l===m){return[j];
}if(a){if(c){if(c=="child"){for(var f=0,d;
d=a[f];
f++){if(j.parentNode==d){return[j];
}}}else{if(c=="descendant"){for(var f=0,d;
d=a[f];
f++){if(Element.descendantOf(j,d)){return[j];
}}}else{if(c=="adjacent"){for(var f=0,d;
d=a[f];
f++){if(Selector.handlers.previousElementSibling(j)==d){return[j];
}}}else{a=g[c](a);
}}}}for(var f=0,d;
d=a[f];
f++){if(d==j){return[j];
}}return[];
}return(j&&Element.descendantOf(j,l))?[j]:[];
},className:function(b,a,c,d){if(b&&d){b=this[d](b);
}return Selector.handlers.byClassName(b,a,c);
},byClassName:function(c,b,g){if(!c){c=Selector.handlers.descendant([b]);
}var j=" "+g+" ";
for(var f=0,d=[],h,a;
h=c[f];
f++){a=h.className;
if(a.length==0){continue;
}if(a==g||(" "+a+" ").include(j)){d.push(h);
}}return d;
},attrPresence:function(c,b,a,h){if(!c){c=b.getElementsByTagName("*");
}if(c&&h){c=this[h](c);
}var f=[];
for(var d=0,g;
g=c[d];
d++){if(Element.hasAttribute(g,a)){f.push(g);
}}return f;
},attr:function(a,k,j,l,c,b){if(!a){a=k.getElementsByTagName("*");
}if(a&&b){a=this[b](a);
}var m=Selector.operators[c],g=[];
for(var f=0,d;
d=a[f];
f++){var h=Element.readAttribute(d,j);
if(h===null){continue;
}if(m(h,l)){g.push(d);
}}return g;
},pseudo:function(b,c,f,a,d){if(b&&d){b=this[d](b);
}if(!b){b=a.getElementsByTagName("*");
}return Selector.pseudos[c](b,f,a);
}},pseudos:{"first-child":function(b,g,a){for(var d=0,c=[],f;
f=b[d];
d++){if(Selector.handlers.previousElementSibling(f)){continue;
}c.push(f);
}return c;
},"last-child":function(b,g,a){for(var d=0,c=[],f;
f=b[d];
d++){if(Selector.handlers.nextElementSibling(f)){continue;
}c.push(f);
}return c;
},"only-child":function(b,j,a){var f=Selector.handlers;
for(var d=0,c=[],g;
g=b[d];
d++){if(!f.previousElementSibling(g)&&!f.nextElementSibling(g)){c.push(g);
}}return c;
},"nth-child":function(b,c,a){return Selector.pseudos.nth(b,c,a);
},"nth-last-child":function(b,c,a){return Selector.pseudos.nth(b,c,a,true);
},"nth-of-type":function(b,c,a){return Selector.pseudos.nth(b,c,a,false,true);
},"nth-last-of-type":function(b,c,a){return Selector.pseudos.nth(b,c,a,true,true);
},"first-of-type":function(b,c,a){return Selector.pseudos.nth(b,"1",a,false,true);
},"last-of-type":function(b,c,a){return Selector.pseudos.nth(b,"1",a,true,true);
},"only-of-type":function(b,d,a){var c=Selector.pseudos;
return c["last-of-type"](c["first-of-type"](b,d,a),d,a);
},getIndices:function(d,c,f){if(d==0){return c>0?[c]:[];
}return $R(1,f).inject([],function(a,b){if(0==(b-c)%d&&(b-c)/d>=0){a.push(b);
}return a;
});
},nth:function(c,u,w,s,f){if(c.length==0){return[];
}if(u=="even"){u="2n+0";
}if(u=="odd"){u="2n+1";
}var r=Selector.handlers,q=[],d=[],k;
r.mark(c);
for(var p=0,g;
g=c[p];
p++){if(!g.parentNode._countedByPrototype){r.index(g.parentNode,s,f);
d.push(g.parentNode);
}}if(u.match(/^\d+$/)){u=Number(u);
for(var p=0,g;
g=c[p];
p++){if(g.nodeIndex==u){q.push(g);
}}}else{if(k=u.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(k[1]=="-"){k[1]=-1;
}var x=k[1]?Number(k[1]):1;
var v=k[2]?Number(k[2]):0;
var y=Selector.pseudos.getIndices(x,v,c.length);
for(var p=0,g,n=y.length;
g=c[p];
p++){for(var o=0;
o<n;
o++){if(g.nodeIndex==y[o]){q.push(g);
}}}}}r.unmark(c);
r.unmark(d);
return q;
},empty:function(b,g,a){for(var d=0,c=[],f;
f=b[d];
d++){if(f.tagName=="!"||f.firstChild){continue;
}c.push(f);
}return c;
},not:function(a,d,l){var j=Selector.handlers,n,c;
var k=new Selector(d).findElements(l);
j.mark(k);
for(var g=0,f=[],b;
b=a[g];
g++){if(!b._countedByPrototype){f.push(b);
}}j.unmark(k);
return f;
},enabled:function(b,g,a){for(var d=0,c=[],f;
f=b[d];
d++){if(!f.disabled&&(!f.type||f.type!=="hidden")){c.push(f);
}}return c;
},disabled:function(b,g,a){for(var d=0,c=[],f;
f=b[d];
d++){if(f.disabled){c.push(f);
}}return c;
},checked:function(b,g,a){for(var d=0,c=[],f;
f=b[d];
d++){if(f.checked){c.push(f);
}}return c;
}},operators:{"=":function(b,a){return b==a;
},"!=":function(b,a){return b!=a;
},"^=":function(b,a){return b==a||b&&b.startsWith(a);
},"$=":function(b,a){return b==a||b&&b.endsWith(a);
},"*=":function(b,a){return b==a||b&&b.include(a);
},"~=":function(b,a){return(" "+b+" ").include(" "+a+" ");
},"|=":function(b,a){return("-"+(b||"").toUpperCase()+"-").include("-"+(a||"").toUpperCase()+"-");
}},split:function(b){var a=[];
b.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(c){a.push(c[1].strip());
});
return a;
},matchElements:function(g,j){var f=$$(j),d=Selector.handlers;
d.mark(f);
for(var c=0,b=[],a;
a=g[c];
c++){if(a._countedByPrototype){b.push(a);
}}d.unmark(f);
return b;
},findElement:function(b,c,a){if(Object.isNumber(c)){a=c;
c=false;
}return Selector.matchElements(b,c||"*")[a||0];
},findChildElements:function(f,j){j=Selector.split(j.join(","));
var d=[],g=Selector.handlers;
for(var c=0,b=j.length,a;
c<b;
c++){a=new Selector(j[c].strip());
g.concat(d,a.findElements(f));
}return(b>1)?g.unique(d):d;
}});
if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(d,c){for(var f=0,g;
g=c[f];
f++){if(g.tagName!=="!"){d.push(g);
}}return d;
},unmark:function(a){for(var b=0,c;
c=a[b];
b++){c.removeAttribute("_countedByPrototype");
}return a;
}});
}function $$(){return Selector.findChildElements(document,$A(arguments));
}var Form={reset:function(a){$(a).reset();
return a;
},serializeElements:function(a,l){if(typeof l!=="object"){l={hash:!!l};
}else{if(Object.isUndefined(l.hash)){l.hash=true;
}}var k,j,g,b,h,c;
var f=l.submit;
var d=a.inject({},function(n,o){o=$(o);
k=o.name;
j=o.getValue();
g=o.type;
b=g==="image";
h=g==="submit"||b;
if(j===null){return n;
}if(o.disabled){return n;
}if(g==="file"||g==="reset"){return n;
}if(h&&(f===false||c||(f&&!(k===f||o===f)))){return n;
}if(h){c=true;
if(b){var p=k?k+".":"",m=l.x||0,q=l.y||0;
n[p+"x"]=m;
n[p+"y"]=q;
return n;
}}else{if(!k){return n;
}}if(k in n){if(!Object.isArray(n[k])){n[k]=[n[k]];
}n[k].push(j);
}else{n[k]=j;
}return n;
});
return l.hash?d:Object.toQueryString(d);
}};
Form.Methods={serialize:function(b,a){return Form.serializeElements(Form.getElements(b),a);
},getElements:function(a){return $A($(a).getElementsByTagName("*")).inject([],function(b,c){if(Form.Element.Serializers[c.tagName.toLowerCase()]){b.push(Element.extend(c));
}return b;
});
},getInputs:function(h,c,d){h=$(h);
var a=h.getElementsByTagName("input");
if(!c&&!d){return $A(a).map(Element.extend);
}for(var f=0,j=[],g=a.length;
f<g;
f++){var b=a[f];
if((c&&b.type!=c)||(d&&b.name!=d)){continue;
}j.push(Element.extend(b));
}return j;
},disable:function(a){a=$(a);
Form.getElements(a).invoke("disable");
return a;
},enable:function(a){a=$(a);
Form.getElements(a).invoke("enable");
return a;
},findFirstElement:function(b){var c=$(b).getElements().findAll(function(d){return"hidden"!=d.type&&!d.disabled;
});
var a=c.findAll(function(d){return d.hasAttribute("tabIndex")&&d.tabIndex>=0;
}).sortBy(function(d){return d.tabIndex;
}).first();
return a?a:c.find(function(d){return["button","input","select","textarea"].include(d.tagName.toLowerCase());
});
},focusFirstElement:function(a){a=$(a);
a.findFirstElement().activate();
return a;
},request:function(b,a){b=$(b),a=Object.clone(a||{});
var f=a.parameters,d=b.readAttribute("action")||"";
if(d.blank()){d=window.location.href;
}var c=a.submit;
delete a.submit;
a.parameters=b.serialize({submit:c,hash:true});
if(f){if(Object.isString(f)){f=f.toQueryParams();
}Object.extend(a.parameters,f);
}if(b.hasAttribute("method")&&!a.method){a.method=b.method;
}return new Ajax.Request(d,a);
}};
Form.Element={focus:function(a){$(a).focus();
return a;
},select:function(a){$(a).select();
return a;
}};
Form.Element.Methods={serialize:function(a){a=$(a);
if(!a.disabled&&a.name){var b=a.getValue();
if(b!=undefined){var c={};
c[a.name]=b;
return Object.toQueryString(c);
}}return"";
},getValue:function(a){if(!(a=$(a))){return null;
}var c=a.tagName.toLowerCase(),b=Form.Element.Serializers;
return b[c]?b[c](a):null;
},setValue:function(a,c){if(!(a=$(a))){return null;
}var d=a.tagName.toLowerCase(),b=Form.Element.Serializers;
if(b[d]){b[d](a,c);
}return a;
},clear:function(a){$(a).value="";
return a;
},present:function(a){return $(a).value!="";
},activate:function(a){a=$(a);
try{a.focus();
if(a.select&&(a.tagName.toLowerCase()!="input"||!["button","image","reset","submit"].include(a.type))){a.select();
}}catch(b){}return a;
},disable:function(a){a=$(a);
a.disabled=true;
return a;
},enable:function(a){a=$(a);
a.disabled=false;
return a;
}};
var Field=Form.Element;
var $F=Form.Element.Methods.getValue;
Form.Element.Serializers={input:function(a,b){switch(a.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(a,b);
default:return Form.Element.Serializers.textarea(a,b);
}},inputSelector:function(a,b){if(Object.isUndefined(b)){return a.checked?a.value:null;
}else{a.checked=!!b;
}},button:function(b,c){if(Object.isUndefined(c)){var a=Prototype.Browser.IE?b.outerHTML.match(/value\s*=\s*['"]([^'"]*)['"]/):[b.readAttribute("value")||b.value];
return(a&&a[1])?a[1]:(b.innerText||b.textContent);
}else{b.innerHTML=c;
}},textarea:function(a,b){if(Object.isUndefined(b)){return a.value;
}else{a.value=b;
}},select:function(c,g){if(Object.isUndefined(g)){return this[c.type=="select-one"?"selectOne":"selectMany"](c);
}else{var b,d,h=!Object.isArray(g);
for(var a=0,f=c.length;
a<f;
a++){b=c.options[a];
d=this.optionValue(b);
if(h){if(d==g){b.selected=true;
return;
}}else{b.selected=g.include(d);
}}}},selectOne:function(b){var a=b.selectedIndex;
return a>=0?this.optionValue(b.options[a]):null;
},selectMany:function(d){var a,f=d.length;
if(!f){return null;
}for(var c=0,a=[];
c<f;
c++){var b=d.options[c];
if(b.selected){a.push(this.optionValue(b));
}}return a;
},optionValue:function(a){return Element.extend(a).hasAttribute("value")?a.value:a.text;
}};
Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:Object.extend(function($super,a,b,c){$super(c,b);
this.element=$(a);
this.lastValue=this.getValue();
},{_argumentNames:["$super","element","frequency","callback"]}),execute:function(){var a=this.getValue();
if(Object.isString(this.lastValue)&&Object.isString(a)?this.lastValue!=a:String(this.lastValue)!=String(a)){this.callback(this.element,a);
this.lastValue=a;
}}});
Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element);
}});
Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element);
}});
Abstract.EventObserver=Class.create({initialize:function(a,b){this.element=$(a);
this.callback=b;
this.lastValue=this.getValue();
if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks();
}else{this.registerCallback(this.element);
}},onElementEvent:function(){var a=this.getValue();
if(this.lastValue!=a){this.callback(this.element,a);
this.lastValue=a;
}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this);
},registerCallback:function(a){if(a.type){switch(a.type.toLowerCase()){case"checkbox":case"radio":Event.observe(a,"click",this.onElementEvent.bind(this));
break;
default:Event.observe(a,"change",this.onElementEvent.bind(this));
break;
}}}});
Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element);
}});
Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element);
}});
if(!window.Event){var Event={};
}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,KEY_INSERT:45,cache:{},relatedTarget:function(b){var a;
switch(b.type){case"mouseover":case"mouseenter":a=b.fromElement;
break;
case"mouseout":case"mouseleave":a=b.toElement;
break;
default:return null;
}return Element.extend(a);
}});
Event.Methods=(function(){var a;
if(Prototype.Browser.IE){var b={0:1,1:4,2:2};
a=function(d,c){return d.button==b[c];
};
}else{if(Prototype.Browser.WebKit){a=function(d,c){switch(c){case 0:return d.which==1&&!d.metaKey;
case 1:return d.which==1&&d.metaKey;
default:return false;
}};
}else{a=function(d,c){return d.which?(d.which===c+1):(d.button===c);
};
}}return{isLeftClick:function(c){return a(c,0);
},isMiddleClick:function(c){return a(c,1);
},isRightClick:function(c){return a(c,2);
},element:function(f){f=Event.extend(f);
var d=f.target,g=f.currentTarget,c=f.type;
if(g&&g.tagName){if(["load","error"].include(c)||(g.tagName.toUpperCase()==="INPUT"&&g.type==="radio"&&c==="click")){d=g;
}}return Element.extend(d&&d.nodeType==Node.TEXT_NODE?d.parentNode:d);
},findElement:function(d,g){var c=Event.element(d);
if(!g){return c;
}var f=[c].concat(c.ancestors());
return Selector.findElement(f,g,0);
},pointer:function(f){var d=document.documentElement,c=document.body||{scrollLeft:0,scrollTop:0};
return{x:f.pageX||(f.clientX+(d.scrollLeft||c.scrollLeft)-(d.clientLeft||0)),y:f.pageY||(f.clientY+(d.scrollTop||c.scrollTop)-(d.clientTop||0))};
},pointerX:function(c){return Event.pointer(c).x;
},pointerY:function(c){return Event.pointer(c).y;
},stop:function(c){Event.extend(c);
c.preventDefault();
c.stopPropagation();
c.stopped=true;
}};
})();
Event.extend=(function(){var a=Object.keys(Event.Methods).inject({},function(b,c){b[c]=Event.Methods[c].methodize();
return b;
});
if(Prototype.Browser.IE){Object.extend(a,{stopPropagation:function(){this.cancelBubble=true;
},preventDefault:function(){this.returnValue=false;
},inspect:function(){return"[object Event]";
}});
return function(b){if(!b){return false;
}if(b._extendedByPrototype){return b;
}var c=Event.pointer(b);
Object.extend(b,{_extendedByPrototype:Prototype.emptyFunction,target:Element.extend(b.srcElement),relatedTarget:Event.relatedTarget(b),pageX:c.x,pageY:c.y});
return Object.extend(b,a);
};
}else{Event.prototype=Event.prototype||document.createEvent("HTMLEvents")["__proto__"];
Object.extend(Event.prototype,a);
return Prototype.K;
}})();
Object.extend(Event,(function(){var b=Event.cache;
function c(n){if(n===window){return 1;
}if(n._prototypeEventID){return n._prototypeEventID[0];
}return n._prototypeEventID=[arguments.callee.id++];
}c.id=2;
function j(n){if(n&&n.include(":")){return"dataavailable";
}if(!Prototype.Browser.IE){n={mouseenter:"mouseover",mouseleave:"mouseout"}[n]||n;
}return n;
}function a(n){return b[n]=b[n]||{};
}function h(p,n){var o=a(p);
return o[n]=o[n]||[];
}function l(p,o,q){var u=c(p),s=a(u);
if(!s.element){s.element=p;
}var n=h(u,o);
if(n.pluck("handler").include(q)){return false;
}var r=function(v){if(!Event||!Event.extend||(v.eventName&&v.eventName!=o)){return false;
}q.call(p,Event.extend(v));
};
if(!(Prototype.Browser.IE)&&(o=="mouseenter"||o=="mouseleave")){r=r.wrap(function(x,w){var v=w.relatedTarget;
var y=w.currentTarget;
if(v&&v.nodeType==Node.TEXT_NODE){v=v.parentNode;
}if(v&&v!=y&&!Element.descendantOf(v,y)){return x(w);
}});
}r.handler=q;
n.push(r);
return r;
}function m(q,o,p){var n=h(q,o);
return n.find(function(r){return r.handler==p;
});
}function f(q,n,o){var p=a(q);
if(!p[n]){return false;
}p[n]=p[n].without(m(q,n,o));
}function k(){var o,p;
for(var n in Event.cache){p=Event.cache[n];
Event.stopObserving(p.element);
p.element=null;
}}function g(){document.detachEvent("onstop",g);
k();
}function d(){if(document.readyState==="interactive"){document.attachEvent("onstop",g);
(function(){document.detachEvent("onstop",g);
}).defer();
}}if(window.attachEvent&&!window.addEventListener){window.attachEvent("onunload",k);
window.attachEvent("onbeforeunload",d);
}else{if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false);
}}return{observe:function(p,n,q){p=$(p);
var o=j(n);
var r=l(p,n,q);
if(!r){return p;
}if(p.addEventListener){p.addEventListener(o,r,false);
}else{p.attachEvent("on"+o,r);
}return p;
},stopObserving:function(p,n,q){p=$(p);
n=Object.isString(n)?n:null;
var u=c(p),s=b[u];
if(!s){return p;
}else{if(!q&&n){h(u,n).each(function(v){Event.stopObserving(p,n,v.handler);
});
return p;
}else{if(!n){Object.keys(s).without("element").each(function(v){Event.stopObserving(p,v);
});
return p;
}}}var r=m(u,n,q);
if(!r){return p;
}var o=j(n);
if(p.removeEventListener){p.removeEventListener(o,r,false);
}else{p.detachEvent("on"+o,r);
}f(u,n,q);
return p;
},fire:function(p,o,n){p=$(p);
if(p==document&&document.createEvent&&!p.dispatchEvent){p=document.documentElement;
}var q;
if(document.createEvent){q=document.createEvent("HTMLEvents");
q.initEvent("dataavailable",true,true);
}else{q=document.createEventObject();
q.eventType="ondataavailable";
}q.eventName=o;
q.memo=n||{};
if(document.createEvent){p.dispatchEvent(q);
}else{p.fireEvent(q.eventType,q);
}return Event.extend(q);
}};
})());
Object.extend(Event,Event.Methods);
Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});
Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize(),loaded:false});
(function(){var c;
function a(){if(document.loaded){return;
}if(c){window.clearInterval(c);
}document.loaded=true;
document.fire("dom:loaded");
}function b(){return true;
}if(document.addEventListener){if(Prototype.Browser.Opera){b=function(){var f=document.styleSheets,d=f.length;
while(d--){if(f[d].disabled){return false;
}}return true;
};
Event.observe(window,"load",function(){b=function(){return true;
};
});
}else{if(Prototype.Browser.WebKit){b=function(){var h=document.getElementsByTagName("style").length,d=document.getElementsByTagName("link");
for(var f=0,g;
g=d[f];
f++){if(g.getAttribute("rel")=="stylesheet"){h++;
}}return document.styleSheets.length>=h;
};
}}document.addEventListener("DOMContentLoaded",function(){if(!b()){return arguments.callee.defer();
}a();
},false);
}else{document.attachEvent("onreadystatechange",function(){if(document.readyState=="complete"){document.detachEvent("onreadystatechange",arguments.callee);
a();
}});
if(window==top){c=setInterval(function(){try{document.documentElement.doScroll("left");
}catch(d){return;
}a();
},10);
}}if(Prototype.Browser.WebKit&&(navigator.userAgent.match(/AppleWebKit\/(\d+)/)[1]<525)){c=setInterval(function(){if(/loaded|complete/.test(document.readyState)&&b()){a();
}},10);
}Event.observe(window,"load",a);
})();
Hash.toQueryString=Object.toQueryString;
var Toggle={display:Element.toggle};
Element.Methods.childOf=Element.Methods.descendantOf;
var Insertion={Before:function(a,b){return Element.insert(a,{before:b});
},Top:function(a,b){return Element.insert(a,{top:b});
},Bottom:function(a,b){return Element.insert(a,{bottom:b});
},After:function(a,b){return Element.insert(a,{after:b});
}};
var $continue=new Error('"throw $continue" is deprecated, use "return" instead');
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;
},within:function(b,a,c){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(b,a,c);
}this.xcomp=a;
this.ycomp=c;
this.offset=Element.cumulativeOffset(b);
return(c>=this.offset[1]&&c<this.offset[1]+b.offsetHeight&&a>=this.offset[0]&&a<this.offset[0]+b.offsetWidth);
},withinIncludingScrolloffsets:function(b,a,d){var c=Element.cumulativeScrollOffset(b);
this.xcomp=a+c[0]-this.deltaX;
this.ycomp=d+c[1]-this.deltaY;
this.offset=Element.cumulativeOffset(b);
return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+b.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+b.offsetWidth);
},overlap:function(b,a){if(!b){return 0;
}if(b=="vertical"){return((this.offset[1]+a.offsetHeight)-this.ycomp)/a.offsetHeight;
}if(b=="horizontal"){return((this.offset[0]+a.offsetWidth)-this.xcomp)/a.offsetWidth;
}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(a){Position.prepare();
return Element.absolutize(a);
},relativize:function(a){Position.prepare();
return Element.relativize(a);
},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(b,c,a){a=a||{};
return Element.clonePosition(c,b,a);
}};
if(!document.getElementsByClassName){DocumentMethods.getElementsByClassName=function(b){function a(c){return c.blank()?null:"[contains(concat(' ', @class, ' '), ' "+c+" ')]";
}b.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(c,f){f=f.toString().strip();
var d=/\s/.test(f)?$w(f).map(a).join(""):a(f);
return d?$D(c)._getElementsByXPath(".//*"+d,c):[];
}:function(f,g){g=g.toString().strip();
var h=[],j=(/\s/.test(g)?$w(g):null);
if(!j&&!g){return h;
}var c=$(f).getElementsByTagName("*");
g=" "+g+" ";
for(var d=0,l,k;
l=c[d];
d++){if(l.className&&(k=" "+l.className+" ")&&(k.include(g)||(j&&j.all(function(m){return !m.toString().blank()&&k.include(" "+m+" ");
})))){h.push(Element.extend(l));
}}return h;
};
return function(d,c){return $(c||document.body).getElementsByClassName(d);
};
}(Element.Methods);
}Object.extend(document,DocumentMethods);
function $D(a){if(!a){return document;
}if(a.getElementById){if(!a._extended){Object.extend(a,DocumentMethods)._extended=Prototype.emptyFunction;
}return a;
}if(a.ownerDocument&&a.ownerDocument.getElementById){return $D(a.ownerDocument);
}return document;
}$D(document);
Element.ClassNames=Class.create();
Element.ClassNames.prototype={initialize:function(a){this.element=$(a);
},_each:function(a){this.element.className.split(/\s+/).select(function(b){return b.length>0;
})._each(a);
},set:function(a){this.element.className=a;
},add:function(a){if(this.include(a)){return;
}this.set($A(this).concat(a).join(" "));
},remove:function(a){if(!this.include(a)){return;
}this.set($A(this).without(a).join(" "));
},toString:function(){return $A(this).join(" ");
}};
Object.extend(Element.ClassNames.prototype,Enumerable);
Element.addMethods();
var Scriptaculous={Version:"1.8.1",require:function(a){document.write('<script type="text/javascript" src="'+a+'"><\/script>');
},REQUIRED_PROTOTYPE:"1.6.0",load:function(){function a(b){var c=b.split(".");
return parseInt(c[0])*100000+parseInt(c[1])*1000+parseInt(c[2]);
}if((typeof Prototype=="undefined")||(typeof Element=="undefined")||(typeof Element.Methods=="undefined")||(a(Prototype.Version)<a(Scriptaculous.REQUIRED_PROTOTYPE))){throw ("script.aculo.us requires the Prototype JavaScript framework >= "+Scriptaculous.REQUIRED_PROTOTYPE);
}$A(document.getElementsByTagName("script")).findAll(function(b){return(b.src&&b.src.match(/scriptaculous\.js(\?.*)?$/));
}).each(function(c){var d=c.src.replace(/scriptaculous\.js(\?.*)?$/,"");
var b=c.src.match(/\?.*load=([a-z,]*)/);
(b?b[1]:"builder,effects,dragdrop,controls,slider,sound").split(",").each(function(f){Scriptaculous.require(d+f+".js");
});
});
}};
Scriptaculous.load();
String.prototype.parseColor=function(){var a="#";
if(this.slice(0,4)=="rgb("){var c=this.slice(4,this.length-1).split(",");
var b=0;
do{a+=parseInt(c[b]).toColorPart();
}while(++b<3);
}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var b=1;
b<4;
b++){a+=(this.charAt(b)+this.charAt(b)).toLowerCase();
}}if(this.length==7){a=this.toLowerCase();
}}}return(a.length==7?a:(arguments[0]||this));
};
Element.collectTextNodes=function(a){return $A($(a).childNodes).collect(function(b){return(b.nodeType==3?b.nodeValue:(b.hasChildNodes()?Element.collectTextNodes(b):""));
}).flatten().join("");
};
Element.collectTextNodesIgnoreClass=function(a,b){return $A($(a).childNodes).collect(function(c){return(c.nodeType==3?c.nodeValue:((c.hasChildNodes()&&!Element.hasClassName(c,b))?Element.collectTextNodesIgnoreClass(c,b):""));
}).flatten().join("");
};
Element.setContentZoom=function(a,b){a=$(a);
a.setStyle({fontSize:(b/100)+"em"});
if(Prototype.Browser.WebKit){window.scrollBy(0,0);
}return a;
};
Element.getInlineOpacity=function(a){return $(a).style.opacity||"";
};
Element.forceRerendering=function(a){try{a=$(a);
var c=document.createTextNode(" ");
a.appendChild(c);
a.removeChild(c);
}catch(b){}};
var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(a){return(-Math.cos(a*Math.PI)/2)+0.5;
},reverse:function(a){return 1-a;
},flicker:function(a){var a=((-Math.cos(a*Math.PI)/4)+0.75)+Math.random()/4;
return a>1?1:a;
},wobble:function(a){return(-Math.cos(a*Math.PI*(9*a))/2)+0.5;
},pulse:function(b,a){a=a||5;
return(((b%(1/a))*a).round()==0?((b*a*2)-(b*a*2).floor()):1-((b*a*2)-(b*a*2).floor()));
},spring:function(a){return 1-(Math.cos(a*4.5*Math.PI)*Math.exp(-a*6));
},none:function(a){return 0;
},full:function(a){return 1;
}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(a){var b="position:relative";
if(Prototype.Browser.IE){b+=";zoom:1";
}a=$(a);
$A(a.childNodes).each(function(c){if(c.nodeType==3){c.nodeValue.toArray().each(function(d){a.insertBefore(new Element("span",{style:b}).update(d==" "?String.fromCharCode(160):d),c);
});
Element.remove(c);
}});
},multiple:function(b,c){var f;
if(((typeof b=="object")||Object.isFunction(b))&&(b.length)){f=b;
}else{f=$(b).childNodes;
}var a=Object.extend({speed:0.1,delay:0},arguments[2]||{});
var d=a.delay;
$A(f).each(function(h,g){new c(h,Object.extend(a,{delay:g*a.speed+d}));
});
},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(b,c){b=$(b);
c=(c||"appear").toLowerCase();
var a=Object.extend({queue:{position:"end",scope:(b.id||"global"),limit:1}},arguments[2]||{});
Effect[b.visible()?Effect.PAIRS[c][1]:Effect.PAIRS[c][0]](b,a);
}};
Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;
Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];
this.interval=null;
},_each:function(a){this.effects._each(a);
},add:function(b){var c=new Date().getTime();
var a=Object.isString(b.options.queue)?b.options.queue:b.options.queue.position;
switch(a){case"front":this.effects.findAll(function(d){return d.state=="idle";
}).each(function(d){d.startOn+=b.finishOn;
d.finishOn+=b.finishOn;
});
break;
case"with-last":c=this.effects.pluck("startOn").max()||c;
break;
case"end":c=this.effects.pluck("finishOn").max()||c;
break;
}b.startOn+=c;
b.finishOn+=c;
if(!b.options.queue.limit||(this.effects.length<b.options.queue.limit)){this.effects.push(b);
}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15);
}},remove:function(a){this.effects=this.effects.reject(function(b){return b==a;
});
if(this.effects.length==0){clearInterval(this.interval);
this.interval=null;
}},loop:function(){var c=new Date().getTime();
for(var b=0,a=this.effects.length;
b<a;
b++){this.effects[b]&&this.effects[b].loop(c);
}}});
Effect.Queues={instances:$H(),get:function(a){if(!Object.isString(a)){return a;
}return this.instances.get(a)||this.instances.set(a,new Effect.ScopedQueue());
}};
Effect.Queue=Effect.Queues.get("global");
Effect.Base=Class.create({position:null,start:function(options){function codeForEvent(options,eventName){return((options[eventName+"Internal"]?"this.options."+eventName+"Internal(this);":"")+(options[eventName]?"this.options."+eventName+"(this);":""));
}if(options&&options.transition===false){options.transition=Effect.Transitions.linear;
}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),options||{});
this.currentFrame=0;
this.state="idle";
this.startOn=this.options.delay*1000;
this.finishOn=this.startOn+(this.options.duration*1000);
this.fromToDelta=this.options.to-this.options.from;
this.totalTime=this.finishOn-this.startOn;
this.totalFrames=this.options.fps*this.options.duration;
eval('this.render = function(pos){ if (this.state=="idle"){this.state="running";'+codeForEvent(this.options,"beforeSetup")+(this.setup?"this.setup();":"")+codeForEvent(this.options,"afterSetup")+'};if (this.state=="running"){pos=this.options.transition(pos)*'+this.fromToDelta+"+"+this.options.from+";this.position=pos;"+codeForEvent(this.options,"beforeUpdate")+(this.update?"this.update(pos);":"")+codeForEvent(this.options,"afterUpdate")+"}}");
this.event("beforeStart");
if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this);
}},loop:function(c){if(c>=this.startOn){if(c>=this.finishOn){this.render(1);
this.cancel();
this.event("beforeFinish");
if(this.finish){this.finish();
}this.event("afterFinish");
return;
}var b=(c-this.startOn)/this.totalTime,a=(b*this.totalFrames).round();
if(a>this.currentFrame){this.render(b);
this.currentFrame=a;
}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this);
}this.state="finished";
},event:function(a){if(this.options[a+"Internal"]){this.options[a+"Internal"](this);
}if(this.options[a]){this.options[a](this);
}},inspect:function(){var a=$H();
for(property in this){if(!Object.isFunction(this[property])){a.set(property,this[property]);
}}return"#<Effect:"+a.inspect()+",options:"+$H(this.options).inspect()+">";
}});
Effect.Parallel=Class.create(Effect.Base,{initialize:function(a){this.effects=a||[];
this.start(arguments[1]);
},update:function(a){this.effects.invoke("render",a);
},finish:function(a){this.effects.each(function(b){b.render(1);
b.cancel();
b.event("beforeFinish");
if(b.finish){b.finish(a);
}b.event("afterFinish");
});
}});
Effect.Tween=Class.create(Effect.Base,{initialize:function(c,g,f){c=Object.isString(c)?$(c):c;
var b=$A(arguments),d=b.last(),a=b.length==5?b[3]:null;
this.method=Object.isFunction(d)?d.bind(c):Object.isFunction(c[d])?c[d].bind(c):function(h){c[d]=h;
};
this.start(Object.extend({from:g,to:f},a||{}));
},update:function(a){this.method(a);
}});
Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}));
},update:Prototype.emptyFunction});
Effect.Opacity=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);
if(!this.element){throw (Effect._elementDoesNotExistError);
}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1});
}var a=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});
this.start(a);
},update:function(a){this.element.setOpacity(a);
}});
Effect.Move=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);
if(!this.element){throw (Effect._elementDoesNotExistError);
}var a=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});
this.start(a);
},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(a){this.element.setStyle({left:(this.options.x*a+this.originalLeft).round()+"px",top:(this.options.y*a+this.originalTop).round()+"px"});
}});
Effect.MoveBy=function(b,a,c){return new Effect.Move(b,Object.extend({x:c,y:a},arguments[3]||{}));
};
Effect.Scale=Class.create(Effect.Base,{initialize:function(b,c){this.element=$(b);
if(!this.element){throw (Effect._elementDoesNotExistError);
}var a=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:c},arguments[2]||{});
this.start(a);
},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;
this.elementPositioning=this.element.getStyle("position");
this.originalStyle={};
["top","left","width","height","fontSize"].each(function(b){this.originalStyle[b]=this.element.style[b];
}.bind(this));
this.originalTop=this.element.offsetTop;
this.originalLeft=this.element.offsetLeft;
var a=this.element.getStyle("font-size")||"100%";
["em","px","%","pt"].each(function(b){if(a.indexOf(b)>0){this.fontSize=parseFloat(a);
this.fontSizeType=b;
}}.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(a){var b=(this.options.scaleFrom/100)+(this.factor*a);
if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*b+this.fontSizeType});
}this.setDimensions(this.dims[0]*b,this.dims[1]*b);
},finish:function(a){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle);
}},setDimensions:function(a,f){var g={};
if(this.options.scaleX){g.width=f.round()+"px";
}if(this.options.scaleY){g.height=a.round()+"px";
}if(this.options.scaleFromCenter){var c=(a-this.dims[0])/2;
var b=(f-this.dims[1])/2;
if(this.elementPositioning=="absolute"){if(this.options.scaleY){g.top=this.originalTop-c+"px";
}if(this.options.scaleX){g.left=this.originalLeft-b+"px";
}}else{if(this.options.scaleY){g.top=-c+"px";
}if(this.options.scaleX){g.left=-b+"px";
}}}this.element.setStyle(g);
}});
Effect.Highlight=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);
if(!this.element){throw (Effect._elementDoesNotExistError);
}var a=Object.extend({startcolor:"#ffff99"},arguments[1]||{});
this.start(a);
},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(a){return parseInt(this.options.startcolor.slice(a*2+1,a*2+3),16);
}.bind(this));
this._delta=$R(0,2).map(function(a){return parseInt(this.options.endcolor.slice(a*2+1,a*2+3),16)-this._base[a];
}.bind(this));
},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(b,c,d){return b+((this._base[d]+(this._delta[d]*a)).round().toColorPart());
}.bind(this))});
},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}));
}});
Effect.ScrollTo=function(d){var c=arguments[1]||{},b=document.viewport.getScrollOffsets(),f=$(d).cumulativeOffset(),a=(window.height||document.body.scrollHeight)-document.viewport.getHeight();
if(c.offset){f[1]+=c.offset;
}return new Effect.Tween(null,b.top,f[1]>a?a:f[1],c,function(g){scrollTo(b.left,g.round());
});
};
Effect.Fade=function(c){c=$(c);
var a=c.getInlineOpacity();
var b=Object.extend({from:c.getOpacity()||1,to:0,afterFinishInternal:function(d){if(d.options.to!=0){return;
}d.element.hide().setStyle({opacity:a});
}},arguments[1]||{});
return new Effect.Opacity(c,b);
};
Effect.Appear=function(b){b=$(b);
var a=Object.extend({from:(b.getStyle("display")=="none"?0:b.getOpacity()||0),to:1,afterFinishInternal:function(c){c.element.forceRerendering();
},beforeSetup:function(c){c.element.setOpacity(c.options.from).show();
}},arguments[1]||{});
return new Effect.Opacity(b,a);
};
Effect.Puff=function(b){b=$(b);
var a={opacity:b.getInlineOpacity(),position:b.getStyle("position"),top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};
return new Effect.Parallel([new Effect.Scale(b,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(c){Position.absolutize(c.effects[0].element);
},afterFinishInternal:function(c){c.effects[0].element.hide().setStyle(a);
}},arguments[1]||{}));
};
Effect.BlindUp=function(a){a=$(a);
a.makeClipping();
return new Effect.Scale(a,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(b){b.element.hide().undoClipping();
}},arguments[1]||{}));
};
Effect.BlindDown=function(b){b=$(b);
var a=b.getDimensions();
return new Effect.Scale(b,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:a.height,originalWidth:a.width},restoreAfterFinish:true,afterSetupInternal:function(c){c.element.makeClipping().setStyle({height:"0px"}).show();
},afterFinishInternal:function(c){c.element.undoClipping();
}},arguments[1]||{}));
};
Effect.SwitchOff=function(b){b=$(b);
var a=b.getInlineOpacity();
return new Effect.Appear(b,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(c){new Effect.Scale(c.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(d){d.element.makePositioned().makeClipping();
},afterFinishInternal:function(d){d.element.hide().undoClipping().undoPositioned().setStyle({opacity:a});
}});
}},arguments[1]||{}));
};
Effect.DropOut=function(b){b=$(b);
var a={top:b.getStyle("top"),left:b.getStyle("left"),opacity:b.getInlineOpacity()};
return new Effect.Parallel([new Effect.Move(b,{x:0,y:100,sync:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(c){c.effects[0].element.makePositioned();
},afterFinishInternal:function(c){c.effects[0].element.hide().undoPositioned().setStyle(a);
}},arguments[1]||{}));
};
Effect.Shake=function(d){d=$(d);
var b=Object.extend({distance:20,duration:0.5},arguments[1]||{});
var f=parseFloat(b.distance);
var c=parseFloat(b.duration)/10;
var a={top:d.getStyle("top"),left:d.getStyle("left")};
return new Effect.Move(d,{x:f,y:0,duration:c,afterFinishInternal:function(g){new Effect.Move(g.element,{x:-f*2,y:0,duration:c*2,afterFinishInternal:function(h){new Effect.Move(h.element,{x:f*2,y:0,duration:c*2,afterFinishInternal:function(j){new Effect.Move(j.element,{x:-f*2,y:0,duration:c*2,afterFinishInternal:function(k){new Effect.Move(k.element,{x:f*2,y:0,duration:c*2,afterFinishInternal:function(l){new Effect.Move(l.element,{x:-f,y:0,duration:c,afterFinishInternal:function(m){m.element.undoPositioned().setStyle(a);
}});
}});
}});
}});
}});
}});
};
Effect.SlideDown=function(c){c=$(c).cleanWhitespace();
var a=c.down().getStyle("bottom");
var b=c.getDimensions();
return new Effect.Scale(c,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();
d.element.down().makePositioned();
if(window.opera){d.element.setStyle({top:""});
}d.element.makeClipping().setStyle({height:"0px"}).show();
},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"});
},afterFinishInternal:function(d){d.element.undoClipping().undoPositioned();
d.element.down().undoPositioned().setStyle({bottom:a});
}},arguments[1]||{}));
};
Effect.SlideUp=function(c){c=$(c).cleanWhitespace();
var a=c.down().getStyle("bottom");
var b=c.getDimensions();
return new Effect.Scale(c,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();
d.element.down().makePositioned();
if(window.opera){d.element.setStyle({top:""});
}d.element.makeClipping().show();
},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"});
},afterFinishInternal:function(d){d.element.hide().undoClipping().undoPositioned();
d.element.down().undoPositioned().setStyle({bottom:a});
}},arguments[1]||{}));
};
Effect.Squish=function(a){return new Effect.Scale(a,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(b){b.element.makeClipping();
},afterFinishInternal:function(b){b.element.hide().undoClipping();
}});
};
Effect.Grow=function(c){c=$(c);
var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});
var a={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};
var h=c.getDimensions();
var j,g;
var f,d;
switch(b.direction){case"top-left":j=g=f=d=0;
break;
case"top-right":j=h.width;
g=d=0;
f=-h.width;
break;
case"bottom-left":j=f=0;
g=h.height;
d=-h.height;
break;
case"bottom-right":j=h.width;
g=h.height;
f=-h.width;
d=-h.height;
break;
case"center":j=h.width/2;
g=h.height/2;
f=-h.width/2;
d=-h.height/2;
break;
}return new Effect.Move(c,{x:j,y:g,duration:0.01,beforeSetup:function(k){k.element.hide().makeClipping().makePositioned();
},afterFinishInternal:function(k){new Effect.Parallel([new Effect.Opacity(k.element,{sync:true,to:1,from:0,transition:b.opacityTransition}),new Effect.Move(k.element,{x:f,y:d,sync:true,transition:b.moveTransition}),new Effect.Scale(k.element,100,{scaleMode:{originalHeight:h.height,originalWidth:h.width},sync:true,scaleFrom:window.opera?1:0,transition:b.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(l){l.effects[0].element.setStyle({height:"0px"}).show();
},afterFinishInternal:function(l){l.effects[0].element.undoClipping().undoPositioned().setStyle(a);
}},b));
}});
};
Effect.Shrink=function(c){c=$(c);
var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});
var a={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};
var g=c.getDimensions();
var f,d;
switch(b.direction){case"top-left":f=d=0;
break;
case"top-right":f=g.width;
d=0;
break;
case"bottom-left":f=0;
d=g.height;
break;
case"bottom-right":f=g.width;
d=g.height;
break;
case"center":f=g.width/2;
d=g.height/2;
break;
}return new Effect.Parallel([new Effect.Opacity(c,{sync:true,to:0,from:1,transition:b.opacityTransition}),new Effect.Scale(c,window.opera?1:0,{sync:true,transition:b.scaleTransition,restoreAfterFinish:true}),new Effect.Move(c,{x:f,y:d,sync:true,transition:b.moveTransition})],Object.extend({beforeStartInternal:function(h){h.effects[0].element.makePositioned().makeClipping();
},afterFinishInternal:function(h){h.effects[0].element.hide().undoClipping().undoPositioned().setStyle(a);
}},b));
};
Effect.Pulsate=function(c){c=$(c);
var b=arguments[1]||{};
var a=c.getInlineOpacity();
var f=b.transition||Effect.Transitions.sinoidal;
var d=function(g){return f(1-Effect.Transitions.pulse(g,b.pulses));
};
d.bind(f);
return new Effect.Opacity(c,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(g){g.element.setStyle({opacity:a});
}},b),{transition:d}));
};
Effect.Fold=function(b){b=$(b);
var a={top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};
b.makeClipping();
return new Effect.Scale(b,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(c){new Effect.Scale(b,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(d){d.element.hide().undoClipping().setStyle(a);
}});
}},arguments[1]||{}));
};
Effect.Morph=Class.create(Effect.Base,{initialize:function(c){this.element=$(c);
if(!this.element){throw (Effect._elementDoesNotExistError);
}var a=Object.extend({style:{}},arguments[1]||{});
if(!Object.isString(a.style)){this.style=$H(a.style);
}else{if(a.style.include(":")){this.style=a.style.parseStyle();
}else{this.element.addClassName(a.style);
this.style=$H(this.element.getStyles());
this.element.removeClassName(a.style);
var b=this.element.getStyles();
this.style=this.style.reject(function(d){return d.value==b[d.key];
});
a.afterFinishInternal=function(d){d.element.addClassName(d.options.style);
d.transforms.each(function(f){d.element.style[f.style]="";
});
};
}}this.start(a);
},setup:function(){function a(b){if(!b||["rgba(0, 0, 0, 0)","transparent"].include(b)){b="#ffffff";
}b=b.parseColor();
return $R(0,2).map(function(c){return parseInt(b.slice(c*2+1,c*2+3),16);
});
}this.transforms=this.style.map(function(h){var g=h[0],f=h[1],d=null;
if(f.parseColor("#zzzzzz")!="#zzzzzz"){f=f.parseColor();
d="color";
}else{if(g=="opacity"){f=parseFloat(f);
if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1});
}}else{if(Element.CSS_LENGTH.test(f)){var c=f.match(/^([\+\-]?[0-9\.]+)(.*)$/);
f=parseFloat(c[1]);
d=(c.length==3)?c[2]:null;
}}}var b=this.element.getStyle(g);
return{style:g.camelize(),originalValue:d=="color"?a(b):parseFloat(b||0),targetValue:d=="color"?a(f):f,unit:d};
}.bind(this)).reject(function(b){return((b.originalValue==b.targetValue)||(b.unit!="color"&&(isNaN(b.originalValue)||isNaN(b.targetValue))));
});
},update:function(a){var d={},b,c=this.transforms.length;
while(c--){d[(b=this.transforms[c]).style]=b.unit=="color"?"#"+(Math.round(b.originalValue[0]+(b.targetValue[0]-b.originalValue[0])*a)).toColorPart()+(Math.round(b.originalValue[1]+(b.targetValue[1]-b.originalValue[1])*a)).toColorPart()+(Math.round(b.originalValue[2]+(b.targetValue[2]-b.originalValue[2])*a)).toColorPart():(b.originalValue+(b.targetValue-b.originalValue)*a).toFixed(3)+(b.unit===null?"":b.unit);
}this.element.setStyle(d,true);
}});
Effect.Transform=Class.create({initialize:function(a){this.tracks=[];
this.options=arguments[1]||{};
this.addTracks(a);
},addTracks:function(a){a.each(function(b){b=$H(b);
var c=b.values().first();
this.tracks.push($H({ids:b.keys().first(),effect:Effect.Morph,options:{style:c}}));
}.bind(this));
return this;
},play:function(){return new Effect.Parallel(this.tracks.map(function(a){var d=a.get("ids"),c=a.get("effect"),b=a.get("options");
var f=[$(d)||$$(d)].flatten();
return f.map(function(g){return new c(g,Object.extend({sync:true},b));
});
}).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.__parseStyleElement=document.createElement("div");
String.prototype.parseStyle=function(){var b,a=$H();
if(Prototype.Browser.WebKit){b=new Element("div",{style:this}).style;
}else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';
b=String.__parseStyleElement.childNodes[0].style;
}Element.CSS_PROPERTIES.each(function(c){if(b[c]){a.set(c,b[c]);
}});
if(Prototype.Browser.IE&&this.include("opacity")){a.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]);
}return a;
};
if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(b){var a=document.defaultView.getComputedStyle($(b),null);
return Element.CSS_PROPERTIES.inject({},function(c,d){c[d]=a[d];
return c;
});
};
}else{Element.getStyles=function(b){b=$(b);
var a=b.currentStyle,c;
c=Element.CSS_PROPERTIES.inject({},function(d,f){d[f]=a[f];
return d;
});
if(!c.opacity){c.opacity=b.getOpacity();
}return c;
};
}Effect.Methods={morph:function(a,b){a=$(a);
new Effect.Morph(a,Object.extend({style:b},arguments[2]||{}));
return a;
},visualEffect:function(c,f,b){c=$(c);
var d=f.dasherize().camelize(),a=d.charAt(0).toUpperCase()+d.substring(1);
new Effect[a](c,b);
return c;
},highlight:function(b,a){b=$(b);
new Effect.Highlight(b,a);
return b;
}};
$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(a){Effect.Methods[a]=function(c,b){c=$(c);
Effect[a.charAt(0).toUpperCase()+a.substring(1)](c,b);
return c;
};
});
$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(a){Effect.Methods[a]=Element[a];
});
Element.addMethods(Effect.Methods);
if(Object.isUndefined(Effect)){throw ("dragdrop.js requires including script.aculo.us' effects.js library");
}var Droppables={drops:[],remove:function(a){this.drops=this.drops.reject(function(b){return b.element==$(a);
});
},add:function(b){b=$(b);
var a=Object.extend({greedy:true,hoverclass:null,tree:false},arguments[1]||{});
if(a.containment){a._containers=[];
var c=a.containment;
if(Object.isArray(c)){c.each(function(d){a._containers.push($(d));
});
}else{a._containers.push($(c));
}}if(a.accept){a.accept=[a.accept].flatten();
}Element.makePositioned(b);
a.element=b;
this.drops.push(a);
},findDeepestChild:function(a){deepest=a[0];
for(i=1;
i<a.length;
++i){if(Element.isParent(a[i].element,deepest.element)){deepest=a[i];
}}return deepest;
},isContained:function(b,a){var c;
if(a.tree){c=b.treeNode;
}else{c=b.parentNode;
}return a._containers.detect(function(d){return c==d;
});
},isAffected:function(a,c,b){return((b.element!=c)&&((!b._containers)||this.isContained(c,b))&&((!b.accept)||(Element.classNames(c).detect(function(d){return b.accept.include(d);
})))&&Position.within(b.element,a[0],a[1]));
},deactivate:function(a){if(a.hoverclass){Element.removeClassName(a.element,a.hoverclass);
}this.last_active=null;
},activate:function(a){if(a.hoverclass){Element.addClassName(a.element,a.hoverclass);
}this.last_active=a;
},show:function(a,c){if(!this.drops.length){return;
}var b,d=[];
this.drops.each(function(f){if(Droppables.isAffected(a,c,f)){d.push(f);
}});
if(d.length>0){b=Droppables.findDeepestChild(d);
}if(this.last_active&&this.last_active!=b){this.deactivate(this.last_active);
}if(b){Position.within(b.element,a[0],a[1]);
if(b.onHover){b.onHover(c,b.element,Position.overlap(b.overlap,b.element));
}if(b!=this.last_active){Droppables.activate(b);
}}},fire:function(b,a){if(!this.last_active){return;
}Position.prepare();
if(this.isAffected([Event.pointerX(b),Event.pointerY(b)],a,this.last_active)){if(this.last_active.onDrop){this.last_active.onDrop(a,this.last_active.element,b);
return true;
}}},reset:function(){if(this.last_active){this.deactivate(this.last_active);
}}};
var Draggables={drags:[],observers:[],register:function(a){if(this.drags.length==0){this.eventMouseUp=this.endDrag.bindAsEventListener(this);
this.eventMouseMove=this.updateDrag.bindAsEventListener(this);
this.eventKeypress=this.keyPress.bindAsEventListener(this);
Event.observe(document,"mouseup",this.eventMouseUp);
Event.observe(document,"mousemove",this.eventMouseMove);
Event.observe(document,"keypress",this.eventKeypress);
}this.drags.push(a);
},unregister:function(a){this.drags=this.drags.reject(function(b){return b==a;
});
if(this.drags.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp);
Event.stopObserving(document,"mousemove",this.eventMouseMove);
Event.stopObserving(document,"keypress",this.eventKeypress);
}},activate:function(a){if(a.options.delay){this._timeout=setTimeout(function(){Draggables._timeout=null;
window.focus();
Draggables.activeDraggable=a;
}.bind(this),a.options.delay);
}else{window.focus();
this.activeDraggable=a;
}},deactivate:function(){this.activeDraggable=null;
},updateDrag:function(a){if(!this.activeDraggable){return;
}var b=[Event.pointerX(a),Event.pointerY(a)];
if(this._lastPointer&&(this._lastPointer.inspect()==b.inspect())){return;
}this._lastPointer=b;
this.activeDraggable.updateDrag(a,b);
},endDrag:function(a){if(this._timeout){clearTimeout(this._timeout);
this._timeout=null;
}if(!this.activeDraggable){return;
}this._lastPointer=null;
this.activeDraggable.endDrag(a);
this.activeDraggable=null;
},keyPress:function(a){if(this.activeDraggable){this.activeDraggable.keyPress(a);
}},addObserver:function(a){this.observers.push(a);
this._cacheObserverCallbacks();
},removeObserver:function(a){this.observers=this.observers.reject(function(b){return b.element==a;
});
this._cacheObserverCallbacks();
},notify:function(b,a,c){if(this[b+"Count"]>0){this.observers.each(function(d){if(d[b]){d[b](b,a,c);
}});
}if(a.options[b]){a.options[b](a,c);
}},_cacheObserverCallbacks:function(){["onStart","onEnd","onDrag"].each(function(a){Draggables[a+"Count"]=Draggables.observers.select(function(b){return b[a];
}).length;
});
}};
var Draggable=Class.create({initialize:function(b){var c={handle:false,reverteffect:function(g,f,d){var h=Math.sqrt(Math.abs(f^2)+Math.abs(d^2))*0.02;
new Effect.Move(g,{x:-d,y:-f,duration:h,queue:{scope:"_draggable",position:"end"}});
},endeffect:function(f){var d=Object.isNumber(f._opacity)?f._opacity:1;
new Effect.Opacity(f,{duration:0.2,from:0.7,to:d,queue:{scope:"_draggable",position:"end"},afterFinish:function(){Draggable._dragging[f]=false;
}});
},zindex:1000,revert:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false,delay:0};
if(!arguments[1]||Object.isUndefined(arguments[1].endeffect)){Object.extend(c,{starteffect:function(d){d._opacity=Element.getOpacity(d);
Draggable._dragging[d]=true;
new Effect.Opacity(d,{duration:0.2,from:d._opacity,to:0.7});
}});
}var a=Object.extend(c,arguments[1]||{});
this.element=$(b);
if(a.handle&&Object.isString(a.handle)){this.handle=this.element.down("."+a.handle,0);
}if(!this.handle){this.handle=$(a.handle);
}if(!this.handle){this.handle=this.element;
}if(a.scroll&&!a.scroll.scrollTo&&!a.scroll.outerHTML){a.scroll=$(a.scroll);
this._isScrollChild=Element.childOf(this.element,a.scroll);
}Element.makePositioned(this.element);
this.options=a;
this.dragging=false;
this.eventMouseDown=this.initDrag.bindAsEventListener(this);
Event.observe(this.handle,"mousedown",this.eventMouseDown);
Draggables.register(this);
},destroy:function(){Event.stopObserving(this.handle,"mousedown",this.eventMouseDown);
Draggables.unregister(this);
},currentDelta:function(){return([parseInt(Element.getStyle(this.element,"left")||"0"),parseInt(Element.getStyle(this.element,"top")||"0")]);
},initDrag:function(a){if(!Object.isUndefined(Draggable._dragging[this.element])&&Draggable._dragging[this.element]){return;
}if(Event.isLeftClick(a)){var c=Event.element(a);
if((tag_name=c.tagName.toUpperCase())&&(tag_name=="INPUT"||tag_name=="SELECT"||tag_name=="OPTION"||tag_name=="BUTTON"||tag_name=="TEXTAREA"||tag_name=="EMBED"||tag_name=="OBJECT")){return;
}if(tag_name=="A"&&(" "+c.className+" ").indexOf(" move ")<0){return;
}var b=[Event.pointerX(a),Event.pointerY(a)];
var d=Position.cumulativeOffset(this.element);
this.offset=[b[0]-d[0],b[1]-d[1]];
Draggables.activate(this);
Event.stop(a);
}},startDrag:function(b){this.dragging=true;
if(!this.delta){this.delta=this.currentDelta();
}if(this.options.zindex){this.originalZ=Element.getStyle(this.element,"z-index")||"";
this.element.style.zIndex=this.options.zindex;
}if(this.options.ghosting){this._clone=this.element.cloneNode(true);
this._originallyAbsolute=(this.element.getStyle("position")=="absolute");
if(!this._originallyAbsolute){Position.absolutize(this.element);
}this.element.parentNode.insertBefore(this._clone,this.element);
}if(this.options.scroll){if(this.options.scroll==window){var a=this._getWindowScroll(this.options.scroll);
this.originalScrollLeft=a.left;
this.originalScrollTop=a.top;
}else{this.originalScrollLeft=this.options.scroll.scrollLeft;
this.originalScrollTop=this.options.scroll.scrollTop;
}}Draggables.notify("onStart",this,b);
if(this.options.starteffect){this.options.starteffect(this.element);
}},updateDrag:function(event,pointer){if(!this.dragging){this.startDrag(event);
}if(!this.options.quiet){Position.prepare();
Droppables.show(pointer,this.element);
}Draggables.notify("onDrag",this,event);
this.draw(pointer);
if(this.options.change){this.options.change(this);
}if(this.options.scroll){this.stopScrolling();
var p;
if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){p=[left,top,left+width,top+height];
}}else{p=Position.page(this.options.scroll);
p[0]+=this.options.scroll.scrollLeft+Position.deltaX;
p[1]+=this.options.scroll.scrollTop+Position.deltaY;
p.push(p[0]+this.options.scroll.offsetWidth);
p.push(p[1]+this.options.scroll.offsetHeight);
}var speed=[0,0];
if(pointer[0]<(p[0]+this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[0]+this.options.scrollSensitivity);
}if(pointer[1]<(p[1]+this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[1]+this.options.scrollSensitivity);
}if(pointer[0]>(p[2]-this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[2]-this.options.scrollSensitivity);
}if(pointer[1]>(p[3]-this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[3]-this.options.scrollSensitivity);
}this.startScrolling(speed);
}if(Prototype.Browser.WebKit){window.scrollBy(0,0);
}if(Prototype.Browser.IE){document.selection.clear();
}Event.stop(event);
},finishDrag:function(b,g){this.dragging=false;
if(this.options.quiet){Position.prepare();
var f=[Event.pointerX(b),Event.pointerY(b)];
Droppables.show(f,this.element);
}if(this.options.ghosting){if(!this._originallyAbsolute){Position.relativize(this.element);
}delete this._originallyAbsolute;
Element.remove(this._clone);
this._clone=null;
}var h=false;
if(g){h=Droppables.fire(b,this.element);
if(!h){h=false;
}}if(h&&this.options.onDropped){this.options.onDropped(this.element);
}Draggables.notify("onEnd",this,b);
var a=this.options.revert;
if(a&&Object.isFunction(a)){a=a(this.element);
}var c=this.currentDelta();
if(a&&this.options.reverteffect){if(h==0||a!="failure"){this.options.reverteffect(this.element,c[1]-this.delta[1],c[0]-this.delta[0]);
}}else{this.delta=c;
}if(this.options.zindex){this.element.style.zIndex=this.originalZ;
}if(this.options.endeffect){this.options.endeffect(this.element);
}Draggables.deactivate(this);
Droppables.reset();
},keyPress:function(a){if(a.keyCode!=Event.KEY_ESC){return;
}this.finishDrag(a,false);
Event.stop(a);
},endDrag:function(a){if(!this.dragging){return;
}this.stopScrolling();
this.finishDrag(a,true);
Event.stop(a);
},draw:function(a){var h=Position.cumulativeOffset(this.element);
if(this.options.ghosting){var c=Position.realOffset(this.element);
h[0]+=c[0]-Position.deltaX;
h[1]+=c[1]-Position.deltaY;
}var g=this.currentDelta();
h[0]-=g[0];
h[1]-=g[1];
if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){h[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;
h[1]-=this.options.scroll.scrollTop-this.originalScrollTop;
}var f=[0,1].map(function(d){return(a[d]-h[d]-this.offset[d]);
}.bind(this));
if(this.options.snap){if(Object.isFunction(this.options.snap)){f=this.options.snap(f[0],f[1],this);
}else{if(Object.isArray(this.options.snap)){f=f.map(function(d,j){return(d/this.options.snap[j]).round()*this.options.snap[j];
}.bind(this));
}else{f=f.map(function(d){return(d/this.options.snap).round()*this.options.snap;
}.bind(this));
}}}var b=this.element.style;
if((!this.options.constraint)||(this.options.constraint=="horizontal")){b.left=f[0]+"px";
}if((!this.options.constraint)||(this.options.constraint=="vertical")){b.top=f[1]+"px";
}if(b.visibility=="hidden"){b.visibility="";
}},stopScrolling:function(){if(this.scrollInterval){clearInterval(this.scrollInterval);
this.scrollInterval=null;
Draggables._lastScrollPointer=null;
}},startScrolling:function(a){if(!(a[0]||a[1])){return;
}this.scrollSpeed=[a[0]*this.options.scrollSpeed,a[1]*this.options.scrollSpeed];
this.lastScrolled=new Date();
this.scrollInterval=setInterval(this.scroll.bind(this),10);
},scroll:function(){var current=new Date();
var delta=current-this.lastScrolled;
this.lastScrolled=current;
if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){if(this.scrollSpeed[0]||this.scrollSpeed[1]){var d=delta/1000;
this.options.scroll.scrollTo(left+d*this.scrollSpeed[0],top+d*this.scrollSpeed[1]);
}}}else{this.options.scroll.scrollLeft+=this.scrollSpeed[0]*delta/1000;
this.options.scroll.scrollTop+=this.scrollSpeed[1]*delta/1000;
}Position.prepare();
Droppables.show(Draggables._lastPointer,this.element);
Draggables.notify("onDrag",this);
if(this._isScrollChild){Draggables._lastScrollPointer=Draggables._lastScrollPointer||$A(Draggables._lastPointer);
Draggables._lastScrollPointer[0]+=this.scrollSpeed[0]*delta/1000;
Draggables._lastScrollPointer[1]+=this.scrollSpeed[1]*delta/1000;
if(Draggables._lastScrollPointer[0]<0){Draggables._lastScrollPointer[0]=0;
}if(Draggables._lastScrollPointer[1]<0){Draggables._lastScrollPointer[1]=0;
}this.draw(Draggables._lastScrollPointer);
}if(this.options.change){this.options.change(this);
}},_getWindowScroll:function(w){var T,L,W,H;
with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;
L=documentElement.scrollLeft;
}else{if(w.document.body){T=body.scrollTop;
L=body.scrollLeft;
}}if(w.innerWidth){W=w.innerWidth;
H=w.innerHeight;
}else{if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;
H=documentElement.clientHeight;
}else{W=body.offsetWidth;
H=body.offsetHeight;
}}}return{top:T,left:L,width:W,height:H};
}});
Draggable._dragging={};
var SortableObserver=Class.create({initialize:function(b,a){this.element=$(b);
this.observer=a;
this.lastValue=Sortable.serialize(this.element);
},onStart:function(){this.lastValue=Sortable.serialize(this.element);
},onEnd:function(){Sortable.unmark();
if(this.lastValue!=Sortable.serialize(this.element)){this.observer(this.element);
}}});
var Sortable={SERIALIZE_RULE:/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,sortables:{},_findRootElement:function(a){while(a.tagName.toUpperCase()!="BODY"){if(a.id&&Sortable.sortables[a.id]){return a;
}a=a.parentNode;
}},options:function(a){a=Sortable._findRootElement($(a));
if(!a){return;
}return Sortable.sortables[a.id];
},destroy:function(a){var b=Sortable.options(a);
if(b){Draggables.removeObserver(b.element);
b.droppables.each(function(c){Droppables.remove(c);
});
b.draggables.invoke("destroy");
delete Sortable.sortables[b.element.id];
}},create:function(c){c=$(c);
var b=Object.extend({element:c,tag:"li",dropOnEmpty:false,tree:false,treeTag:"ul",overlap:"vertical",constraint:"vertical",containment:c,handle:false,only:false,delay:0,hoverclass:null,ghosting:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:this.SERIALIZE_RULE,elements:false,handles:false,markDropZone:true,dropZoneCss:"emptyPlaceMarker",onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},arguments[1]||{});
this.destroy(c);
var a={revert:true,quiet:b.quiet,scroll:b.scroll,scrollSpeed:b.scrollSpeed,scrollSensitivity:b.scrollSensitivity,delay:b.delay,ghosting:b.ghosting,constraint:b.constraint,handle:b.handle};
if(b.starteffect){a.starteffect=b.starteffect;
}if(b.reverteffect){a.reverteffect=b.reverteffect;
}else{if(b.ghosting){a.reverteffect=function(g){g.style.top=0;
g.style.left=0;
};
}}if(b.endeffect){a.endeffect=b.endeffect;
}if(b.zindex){a.zindex=b.zindex;
}var d={overlap:b.overlap,containment:b.containment,tree:b.tree,hoverclass:b.hoverclass,onHover:Sortable.onHover};
var f={onHover:Sortable.onEmptyHover,overlap:b.overlap,containment:b.containment,hoverclass:b.hoverclass};
Element.cleanWhitespace(c);
b.draggables=[];
b.droppables=[];
if(b.dropOnEmpty||b.tree){Droppables.add(c,f);
b.droppables.push(c);
}(b.elements||this.findElements(c,b)||[]).each(function(j,g){var h=b.handles?$(b.handles[g]):(b.handle?$(j).select("."+b.handle)[0]:j);
b.draggables.push(new Draggable(j,Object.extend(a,{handle:h})));
Droppables.add(j,d);
if(b.tree){j.treeNode=c;
}b.droppables.push(j);
});
if(b.tree){(Sortable.findTreeElements(c,b)||[]).each(function(g){Droppables.add(g,f);
g.treeNode=c;
b.droppables.push(g);
});
}this.sortables[c.id]=b;
Draggables.addObserver(new SortableObserver(c,b.onUpdate));
},findElements:function(b,a){return Element.findChildren(b,a.only,a.tree?true:false,a.tag);
},findTreeElements:function(b,a){return Element.findChildren(b,a.only,a.tree?true:false,a.treeTag);
},onHover:function(g,f,a){if(Element.isParent(f,g)){return;
}var h=Sortable.options(f);
var d=h&&h.ghosting;
if(a>0.33&&a<0.66&&Sortable.options(f).tree){return;
}else{if(a>0.5){Sortable.mark(f,"before");
if(f.previousSibling!=g){var b=g.parentNode;
g.style.visibility="hidden";
Sortable.createGuide(g);
f.parentNode.insertBefore(g,f);
f.parentNode.insertBefore(Sortable._guide,g);
Sortable.markEmptyPlace(g,d);
if(f.parentNode!=b){Sortable.options(b).onChange(g);
}Sortable.options(f.parentNode).onChange(g);
}}else{Sortable.mark(f,"after");
var c=f.nextSibling||null;
if(c!=g){var b=g.parentNode;
g.style.visibility="hidden";
Sortable.createGuide(g);
f.parentNode.insertBefore(g,c);
f.parentNode.insertBefore(Sortable._guide,g);
Sortable.markEmptyPlace(g,d);
if(f.parentNode!=b){Sortable.options(b).onChange(g);
}Sortable.options(f.parentNode).onChange(g);
}}}},onEmptyHover:function(g,k,l){var m=g.parentNode;
var a=Sortable.options(k);
if(!Element.isParent(k,g)){var h;
var f=Sortable.options(k);
var j=f&&f.ghosting;
var c=Sortable.findElements(k,{tag:a.tag,only:a.only});
var b=null;
if(c){var d=Element.offsetSize(k,a.overlap)*(1-l);
for(h=0;
h<c.length;
h+=1){if(d-Element.offsetSize(c[h],a.overlap)>=0){d-=Element.offsetSize(c[h],a.overlap);
}else{if(d-(Element.offsetSize(c[h],a.overlap)/2)>=0){b=h+1<c.length?c[h+1]:null;
break;
}else{b=c[h];
break;
}}}}Sortable.createGuide(g);
k.insertBefore(g,b);
k.insertBefore(Sortable._guide,g);
Sortable.markEmptyPlace(g,j);
Sortable.options(m).onChange(g);
a.onChange(g);
}},createGuide:function(a){if(!Sortable._guide){Sortable._guide=$("_guide")||document.createElement("DIV");
Sortable._guide.style.position="relative";
Sortable._guide.style.width="1px";
Sortable._guide.style.height="0px";
Sortable._guide.style.cssFloat="left";
Sortable._guide.id="guide";
Element.getOffsetParent(a).appendChild(Sortable._guide);
}},markEmptyPlace:function(b,a){if(!Sortable._emptyPlaceMarker){Sortable._emptyPlaceMarker=$(Sortable.options(b).dropZoneCss)||document.createElement("DIV");
Element.hide(Sortable._emptyPlaceMarker);
Element.addClassName(Sortable._emptyPlaceMarker,Sortable.options(b).dropZoneCss);
Sortable._emptyPlaceMarker.style.position="absolute";
Element.getOffsetParent(b).appendChild(Sortable._emptyPlaceMarker);
}else{Sortable._emptyPlaceMarker.style.margin="";
}if(a&&Sortable._guide.previousSibling!=null){var g=Position.positionedOffset(Sortable._guide.previousSibling);
}else{var g=Position.positionedOffset(Sortable._guide);
var c=Element.getStyle(b,"margin");
if(c!=null){Sortable._emptyPlaceMarker.style.margin=c;
}}Sortable._emptyPlaceMarker.style.left=(g[0])+"px";
Sortable._emptyPlaceMarker.style.top=(g[1])+"px";
var f={};
f.width=(Element.getDimensions(b).width)+"px";
f.height=(Element.getDimensions(b).height)+"px";
Sortable._emptyPlaceMarker.setStyle(f);
if(Sortable.options(b).markDropZone){Element.show(Sortable._emptyPlaceMarker);
}},unmark:function(){if(Sortable._marker){Sortable._marker.hide();
}if(Sortable._guide&&Sortable._guide.parentNode){Sortable._guide.parentNode.removeChild(Sortable._guide);
}if(Sortable._emptyPlaceMarker){Sortable._emptyPlaceMarker.hide();
}},mark:function(b,a){var d=Sortable.options(b.parentNode);
if(d&&!d.ghosting){return;
}if(!Sortable._marker){Sortable._marker=($("dropmarker")||Element.extend(document.createElement("DIV"))).hide().addClassName("dropmarker").setStyle({position:"absolute"});
document.getElementsByTagName("body").item(0).appendChild(Sortable._marker);
}var c=Position.cumulativeOffset(b);
Sortable._marker.setStyle({left:c[0]+"px",top:c[1]+"px"});
if(a=="after"){if(d.overlap=="horizontal"){Sortable._marker.setStyle({left:(c[0]+b.clientWidth)+"px"});
}else{Sortable._marker.setStyle({top:(c[1]+b.clientHeight)+"px"});
}}Sortable._marker.show();
},_tree:function(f,b,g){var d=Sortable.findElements(f,b)||[];
for(var c=0;
c<d.length;
++c){var a=d[c].id.match(b.format);
if(!a){continue;
}var h={id:encodeURIComponent(a?a[1]:null),element:f,parent:g,children:[],position:g.children.length,container:$(d[c]).down(b.treeTag)};
if(h.container){this._tree(h.container,b,h);
}g.children.push(h);
}return g;
},tree:function(d){d=$(d);
var c=this.options(d);
var b=Object.extend({tag:c.tag,treeTag:c.treeTag,only:c.only,name:d.id,format:c.format},arguments[1]||{});
var a={id:null,parent:null,children:[],container:d,position:0};
return Sortable._tree(d,b,a);
},_constructIndex:function(b){var a="";
do{if(b.id){a="["+b.position+"]"+a;
}}while((b=b.parent)!=null);
return a;
},sequence:function(b){b=$(b);
var a=Object.extend(this.options(b),arguments[1]||{});
return $(this.findElements(b,a)||[]).map(function(c){return c.id.match(a.format)?c.id.match(a.format)[1]:"";
});
},setSequence:function(b,c){b=$(b);
var a=Object.extend(this.options(b),arguments[2]||{});
var d={};
this.findElements(b,a).each(function(f){if(f.id.match(a.format)){d[f.id.match(a.format)[1]]=[f,f.parentNode];
}f.parentNode.removeChild(f);
});
c.each(function(f){var g=d[f];
if(g){g[1].appendChild(g[0]);
delete d[f];
}});
},serialize:function(c){c=$(c);
var b=Object.extend(Sortable.options(c),arguments[1]||{});
var a=encodeURIComponent((arguments[1]&&arguments[1].name)?arguments[1].name:c.id);
if(b.tree){return Sortable.tree(c,arguments[1]).children.map(function(d){return[a+Sortable._constructIndex(d)+"[id]="+encodeURIComponent(d.id)].concat(d.children.map(arguments.callee));
}).flatten().join("&");
}else{return Sortable.sequence(c,arguments[1]).map(function(d){return a+"[]="+encodeURIComponent(d);
}).join("&");
}}};
Element.isParent=function(b,a){if(!b.parentNode||b==a){return false;
}if(b.parentNode==a){return true;
}return Element.isParent(b.parentNode,a);
};
Element.findChildren=function(d,b,a,c){if(!d.hasChildNodes()){return null;
}c=c.toUpperCase();
if(b){b=[b].flatten();
}var f=[];
$A(d.childNodes).each(function(h){if(h.tagName&&h.tagName.toUpperCase()==c&&(!b||(Element.classNames(h).detect(function(j){return b.include(j);
})))){f.push(h);
}if(a){var g=Element.findChildren(h,b,a,c);
if(g){f.push(g);
}}});
return(f.length>0?f.flatten():[]);
};
Element.offsetSize=function(a,b){return a["offset"+((b=="vertical"||b=="height")?"Height":"Width")];
};
if(typeof Effect=="undefined"){throw ("controls.js requires including script.aculo.us' effects.js library");
}var Autocompleter={};
Autocompleter.Base=Class.create({baseInitialize:function(b,c,a){b=$(b);
this.element=b;
this.update=$(c);
this.hasFocus=false;
this.changed=false;
this.active=false;
this.index=0;
this.entryCount=0;
this.oldElementValue=this.element.value;
if(this.setOptions){this.setOptions(a);
}else{this.options=a||{};
}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(d,f){if(!f.style.position||f.style.position=="absolute"){f.style.position="absolute";
Position.clone(d,f,{setHeight:false,offsetTop:d.offsetHeight});
}Effect.Appear(f,{duration:0.15});
};
this.options.onHide=this.options.onHide||function(d,f){new Effect.Fade(f,{duration:0.15});
};
if(typeof(this.options.tokens)=="string"){this.options.tokens=new Array(this.options.tokens);
}if(!this.options.tokens.include("\n")){this.options.tokens.push("\n");
}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,"keydown",this.onKeyPress.bindAsEventListener(this));
},show:function(){if(Element.getStyle(this.update,"display")=="none"){this.options.onShow(this.element,this.update);
}if(!this.iefix&&(Prototype.Browser.IE)&&(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(a){if(this.active){switch(a.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:this.selectEntry();
Event.stop(a);
case Event.KEY_ESC:this.hide();
this.active=false;
Event.stop(a);
return;
case Event.KEY_LEFT:case Event.KEY_RIGHT:return;
case Event.KEY_UP:this.markPrevious();
this.render();
Event.stop(a);
return;
case Event.KEY_DOWN:this.markNext();
this.render();
Event.stop(a);
return;
}}else{if(a.keyCode==Event.KEY_TAB||a.keyCode==Event.KEY_RETURN||(Prototype.Browser.WebKit>0&&a.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(b){var a=Event.findElement(b,"LI");
if(this.index!=a.autocompleteIndex){this.index=a.autocompleteIndex;
this.render();
}Event.stop(b);
},onClick:function(b){var a=Event.findElement(b,"LI");
this.index=a.autocompleteIndex;
this.selectEntry();
this.hide();
},onBlur:function(a){setTimeout(this.hide.bind(this),250);
this.hasFocus=false;
this.active=false;
},render:function(){if(this.entryCount>0){for(var a=0;
a<this.entryCount;
a++){this.index==a?Element.addClassName(this.getEntry(a),"selected"):Element.removeClassName(this.getEntry(a),"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(a){return this.update.firstChild.childNodes[a];
},getCurrentEntry:function(){return this.getEntry(this.index);
},selectEntry:function(){this.active=false;
this.updateElement(this.getCurrentEntry());
},updateElement:function(g){if(this.options.updateElement){this.options.updateElement(g);
return;
}var d="";
if(this.options.select){var a=$(g).select("."+this.options.select)||[];
if(a.length>0){d=Element.collectTextNodes(a[0],this.options.select);
}}else{d=Element.collectTextNodesIgnoreClass(g,"informal");
}var c=this.getTokenBounds();
if(c[0]!=-1){var f=this.element.value.substr(0,c[0]);
var b=this.element.value.substr(c[0]).match(/^\s+/);
if(b){f+=b[0];
}this.element.value=f+d+this.element.value.substr(c[1]);
}else{this.element.value=d;
}this.oldElementValue=this.element.value;
this.element.focus();
if(this.options.afterUpdateElement){this.options.afterUpdateElement(this.element,g);
}},updateChoices:function(c){if(!this.changed&&this.hasFocus){this.update.innerHTML=c;
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 a=0;
a<this.entryCount;
a++){var b=this.getEntry(a);
b.autocompleteIndex=a;
this.addObservers(b);
}}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(a){Event.observe(a,"mouseover",this.onHover.bindAsEventListener(this));
Event.observe(a,"click",this.onClick.bindAsEventListener(this));
},onObserverEvent:function(){this.changed=false;
this.tokenBounds=null;
if(this.getToken().length>=this.options.minChars){this.getUpdatedChoices();
}else{this.active=false;
this.hide();
}this.oldElementValue=this.element.value;
},getToken:function(){var a=this.getTokenBounds();
return this.element.value.substring(a[0],a[1]).strip();
},getTokenBounds:function(){if(null!=this.tokenBounds){return this.tokenBounds;
}var f=this.element.value;
if(f.strip().empty()){return[-1,0];
}var g=arguments.callee.getFirstDifferencePos(f,this.oldElementValue);
var j=(g==this.oldElementValue.length?1:0);
var d=-1,c=f.length;
var h;
for(var b=0,a=this.options.tokens.length;
b<a;
++b){h=f.lastIndexOf(this.options.tokens[b],g+j-1);
if(h>d){d=h;
}h=f.indexOf(this.options.tokens[b],g+j);
if(-1!=h&&h<c){c=h;
}}return(this.tokenBounds=[d+1,c]);
}});
Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos=function(c,a){var d=Math.min(c.length,a.length);
for(var b=0;
b<d;
++b){if(c[b]!=a[b]){return b;
}}return d;
};
Ajax.Autocompleter=Class.create(Autocompleter.Base,{initialize:function(c,d,b,a){this.baseInitialize(c,d,a);
this.options.asynchronous=true;
this.options.onComplete=this.onComplete.bind(this);
this.options.defaultParams=this.options.parameters||null;
this.url=b;
},getUpdatedChoices:function(){this.startIndicator();
var a=encodeURIComponent(this.options.paramName)+"="+encodeURIComponent(this.getToken());
this.options.parameters=this.options.callback?this.options.callback(this.element,a):a;
if(this.options.defaultParams){this.options.parameters+="&"+this.options.defaultParams;
}new Ajax.Request(this.url,this.options);
},onComplete:function(a){this.updateChoices(a.responseText);
}});
Autocompleter.Local=Class.create(Autocompleter.Base,{initialize:function(b,d,c,a){this.baseInitialize(b,d,a);
this.options.array=c;
},getUpdatedChoices:function(){this.updateChoices(this.options.selector(this));
},setOptions:function(a){this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(b){var d=[];
var c=[];
var j=b.getToken();
var h=0;
for(var f=0;
f<b.options.array.length&&d.length<b.options.choices;
f++){var g=b.options.array[f];
var k=b.options.ignoreCase?g.toLowerCase().indexOf(j.toLowerCase()):g.indexOf(j);
while(k!=-1){if(k==0&&g.length!=j.length){d.push("<li><strong>"+g.substr(0,j.length)+"</strong>"+g.substr(j.length)+"</li>");
break;
}else{if(j.length>=b.options.partialChars&&b.options.partialSearch&&k!=-1){if(b.options.fullSearch||/\s/.test(g.substr(k-1,1))){c.push("<li>"+g.substr(0,k)+"<strong>"+g.substr(k,j.length)+"</strong>"+g.substr(k+j.length)+"</li>");
break;
}}}k=b.options.ignoreCase?g.toLowerCase().indexOf(j.toLowerCase(),k+1):g.indexOf(j,k+1);
}}if(c.length){d=d.concat(c.slice(0,b.options.choices-d.length));
}return"<ul>"+d.join("")+"</ul>";
}},a||{});
}});
Field.scrollFreeActivate=function(a){setTimeout(function(){Field.activate(a);
},1);
};
Ajax.InPlaceEditor=Class.create({initialize:function(c,b,a){this.url=b;
this.element=c=$(c);
this.prepareOptions();
this._controls={};
arguments.callee.dealWithDeprecatedOptions(a);
Object.extend(this.options,a||{});
if(!this.options.formId&&this.element.id){this.options.formId=this.element.id+"-inplaceeditor";
if($(this.options.formId)){this.options.formId="";
}}if(this.options.externalControl){this.options.externalControl=$(this.options.externalControl);
}if(!this.options.externalControl){this.options.externalControlOnly=false;
}this._originalBackground=this.element.getStyle("background-color")||"transparent";
this.element.title=this.options.clickToEditText;
this._boundCancelHandler=this.handleFormCancellation.bind(this);
this._boundComplete=(this.options.onComplete||Prototype.emptyFunction).bind(this);
this._boundFailureHandler=this.handleAJAXFailure.bind(this);
this._boundSubmitHandler=this.handleFormSubmission.bind(this);
this._boundWrapperHandler=this.wrapUp.bind(this);
this.registerListeners();
},checkForEscapeOrReturn:function(a){if(!this._editing||a.ctrlKey||a.altKey||a.shiftKey){return;
}if(Event.KEY_ESC==a.keyCode){this.handleFormCancellation(a);
}else{if(Event.KEY_RETURN==a.keyCode){this.handleFormSubmission(a);
}}},createControl:function(h,c,b){var f=this.options[h+"Control"];
var g=this.options[h+"Text"];
if("button"==f){var a=document.createElement("input");
a.type="submit";
a.value=g;
a.className="editor_"+h+"_button";
if("cancel"==h){a.onclick=this._boundCancelHandler;
}this._form.appendChild(a);
this._controls[h]=a;
}else{if("link"==f){var d=document.createElement("a");
d.href="#";
d.appendChild(document.createTextNode(g));
d.onclick="cancel"==h?this._boundCancelHandler:this._boundSubmitHandler;
d.className="editor_"+h+"_link";
if(b){d.className+=" "+b;
}this._form.appendChild(d);
this._controls[h]=d;
}}},createEditField:function(){var c=(this.options.loadTextURL?this.options.loadingText:this.getText());
var b;
if(1>=this.options.rows&&!/\r|\n/.test(this.getText())){b=document.createElement("input");
b.type="text";
var a=this.options.size||this.options.cols||0;
if(0<a){b.size=a;
}}else{b=document.createElement("textarea");
b.rows=(1>=this.options.rows?this.options.autoRows:this.options.rows);
b.cols=this.options.cols||40;
}b.name=this.options.paramName;
b.value=c;
b.className="editor_field";
if(this.options.submitOnBlur){b.onblur=this._boundSubmitHandler;
}this._controls.editor=b;
if(this.options.loadTextURL){this.loadExternalText();
}this._form.appendChild(this._controls.editor);
},createForm:function(){var b=this;
function a(d,f){var c=b.options["text"+d+"Controls"];
if(!c||f===false){return;
}b._form.appendChild(document.createTextNode(c));
}this._form=$(document.createElement("form"));
this._form.id=this.options.formId;
this._form.addClassName(this.options.formClassName);
this._form.onsubmit=this._boundSubmitHandler;
this.createEditField();
if("textarea"==this._controls.editor.tagName.toLowerCase()){this._form.appendChild(document.createElement("br"));
}if(this.options.onFormCustomization){this.options.onFormCustomization(this,this._form);
}a("Before",this.options.okControl||this.options.cancelControl);
this.createControl("ok",this._boundSubmitHandler);
a("Between",this.options.okControl&&this.options.cancelControl);
this.createControl("cancel",this._boundCancelHandler,"editor_cancel");
a("After",this.options.okControl||this.options.cancelControl);
},destroy:function(){if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML;
}this.leaveEditMode();
this.unregisterListeners();
},enterEditMode:function(a){if(this._saving||this._editing){return;
}this._editing=true;
this.triggerCallback("onEnterEditMode");
if(this.options.externalControl){this.options.externalControl.hide();
}this.element.hide();
this.createForm();
this.element.parentNode.insertBefore(this._form,this.element);
if(!this.options.loadTextURL){this.postProcessEditField();
}if(a){Event.stop(a);
}},enterHover:function(a){if(this.options.hoverClassName){this.element.addClassName(this.options.hoverClassName);
}if(this._saving){return;
}this.triggerCallback("onEnterHover");
},getText:function(){return this.element.innerHTML;
},handleAJAXFailure:function(a){this.triggerCallback("onFailure",a);
if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML;
this._oldInnerHTML=null;
}},handleFormCancellation:function(a){this.wrapUp();
if(a){Event.stop(a);
}},handleFormSubmission:function(d){var b=this._form;
var c=$F(this._controls.editor);
this.prepareSubmission();
var f=this.options.callback(b,c)||"";
if(Object.isString(f)){f=f.toQueryParams();
}f.editorId=this.element.id;
if(this.options.htmlResponse){var a=Object.extend({evalScripts:true},this.options.ajaxOptions);
Object.extend(a,{parameters:f,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});
new Ajax.Updater({success:this.element},this.url,a);
}else{var a=Object.extend({method:"get"},this.options.ajaxOptions);
Object.extend(a,{parameters:f,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});
new Ajax.Request(this.url,a);
}if(d){Event.stop(d);
}},leaveEditMode:function(){this.element.removeClassName(this.options.savingClassName);
this.removeForm();
this.leaveHover();
this.element.style.backgroundColor=this._originalBackground;
this.element.show();
if(this.options.externalControl){this.options.externalControl.show();
}this._saving=false;
this._editing=false;
this._oldInnerHTML=null;
this.triggerCallback("onLeaveEditMode");
},leaveHover:function(a){if(this.options.hoverClassName){this.element.removeClassName(this.options.hoverClassName);
}if(this._saving){return;
}this.triggerCallback("onLeaveHover");
},loadExternalText:function(){this._form.addClassName(this.options.loadingClassName);
this._controls.editor.disabled=true;
var a=Object.extend({method:"get"},this.options.ajaxOptions);
Object.extend(a,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(c){this._form.removeClassName(this.options.loadingClassName);
var b=c.responseText;
if(this.options.stripLoadedTextTags){b=b.stripTags();
}this._controls.editor.value=b;
this._controls.editor.disabled=false;
this.postProcessEditField();
}.bind(this),onFailure:this._boundFailureHandler});
new Ajax.Request(this.options.loadTextURL,a);
},postProcessEditField:function(){var a=this.options.fieldPostCreation;
if(a){$(this._controls.editor)["focus"==a?"focus":"activate"]();
}},prepareOptions:function(){this.options=Object.clone(Ajax.InPlaceEditor.DefaultOptions);
Object.extend(this.options,Ajax.InPlaceEditor.DefaultCallbacks);
[this._extraDefaultOptions].flatten().compact().each(function(a){Object.extend(this.options,a);
}.bind(this));
},prepareSubmission:function(){this._saving=true;
this.removeForm();
this.leaveHover();
this.showSaving();
},registerListeners:function(){this._listeners={};
var a;
$H(Ajax.InPlaceEditor.Listeners).each(function(b){a=this[b.value].bind(this);
this._listeners[b.key]=a;
if(!this.options.externalControlOnly){this.element.observe(b.key,a);
}if(this.options.externalControl){this.options.externalControl.observe(b.key,a);
}}.bind(this));
},removeForm:function(){if(!this._form){return;
}this._form.remove();
this._form=null;
this._controls={};
},showSaving:function(){this._oldInnerHTML=this.element.innerHTML;
this.element.innerHTML=this.options.savingText;
this.element.addClassName(this.options.savingClassName);
this.element.style.backgroundColor=this._originalBackground;
this.element.show();
},triggerCallback:function(b,a){if("function"==typeof this.options[b]){this.options[b](this,a);
}},unregisterListeners:function(){$H(this._listeners).each(function(a){if(!this.options.externalControlOnly){this.element.stopObserving(a.key,a.value);
}if(this.options.externalControl){this.options.externalControl.stopObserving(a.key,a.value);
}}.bind(this));
},wrapUp:function(a){this.leaveEditMode();
this._boundComplete(a,this.element);
}});
Object.extend(Ajax.InPlaceEditor.prototype,{dispose:Ajax.InPlaceEditor.prototype.destroy});
Ajax.InPlaceCollectionEditor=Class.create(Ajax.InPlaceEditor,{initialize:function($super,c,b,a){this._extraDefaultOptions=Ajax.InPlaceCollectionEditor.DefaultOptions;
$super(c,b,a);
},createEditField:function(){var a=document.createElement("select");
a.name=this.options.paramName;
a.size=1;
this._controls.editor=a;
this._collection=this.options.collection||[];
if(this.options.loadCollectionURL){this.loadCollection();
}else{this.checkForExternalText();
}this._form.appendChild(this._controls.editor);
},loadCollection:function(){this._form.addClassName(this.options.loadingClassName);
this.showLoadingText(this.options.loadingCollectionText);
var options=Object.extend({method:"get"},this.options.ajaxOptions);
Object.extend(options,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(transport){var js=transport.responseText.strip();
if(!/^\[.*\]$/.test(js)){throw"Server returned an invalid collection representation.";
}this._collection=eval(js);
this.checkForExternalText();
}.bind(this),onFailure:this.onFailure});
new Ajax.Request(this.options.loadCollectionURL,options);
},showLoadingText:function(b){this._controls.editor.disabled=true;
var a=this._controls.editor.firstChild;
if(!a){a=document.createElement("option");
a.value="";
this._controls.editor.appendChild(a);
a.selected=true;
}a.update((b||"").stripScripts().stripTags());
},checkForExternalText:function(){this._text=this.getText();
if(this.options.loadTextURL){this.loadExternalText();
}else{this.buildOptionList();
}},loadExternalText:function(){this.showLoadingText(this.options.loadingText);
var a=Object.extend({method:"get"},this.options.ajaxOptions);
Object.extend(a,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(b){this._text=b.responseText.strip();
this.buildOptionList();
}.bind(this),onFailure:this.onFailure});
new Ajax.Request(this.options.loadTextURL,a);
},buildOptionList:function(){this._form.removeClassName(this.options.loadingClassName);
this._collection=this._collection.map(function(d){return 2===d.length?d:[d,d].flatten();
});
var b=("value" in this.options)?this.options.value:this._text;
var a=this._collection.any(function(d){return d[0]==b;
}.bind(this));
this._controls.editor.update("");
var c;
this._collection.each(function(f,d){c=document.createElement("option");
c.value=f[0];
c.selected=a?f[0]==b:0==d;
c.appendChild(document.createTextNode(f[1]));
this._controls.editor.appendChild(c);
}.bind(this));
this._controls.editor.disabled=false;
Field.scrollFreeActivate(this._controls.editor);
}});
Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions=function(a){if(!a){return;
}function b(c,d){if(c in a||d===undefined){return;
}a[c]=d;
}b("cancelControl",(a.cancelLink?"link":(a.cancelButton?"button":a.cancelLink==a.cancelButton==false?false:undefined)));
b("okControl",(a.okLink?"link":(a.okButton?"button":a.okLink==a.okButton==false?false:undefined)));
b("highlightColor",a.highlightcolor);
b("highlightEndColor",a.highlightendcolor);
};
Object.extend(Ajax.InPlaceEditor,{DefaultOptions:{ajaxOptions:{},autoRows:3,cancelControl:"link",cancelText:"cancel",clickToEditText:"Click to edit",externalControl:null,externalControlOnly:false,fieldPostCreation:"activate",formClassName:"inplaceeditor-form",formId:null,highlightColor:"#ffff99",highlightEndColor:"#ffffff",hoverClassName:"",htmlResponse:true,loadingClassName:"inplaceeditor-loading",loadingText:"Loading...",okControl:"button",okText:"ok",paramName:"value",rows:1,savingClassName:"inplaceeditor-saving",savingText:"Saving...",size:0,stripLoadedTextTags:false,submitOnBlur:false,textAfterControls:"",textBeforeControls:"",textBetweenControls:""},DefaultCallbacks:{callback:function(a){return Form.serialize(a);
},onComplete:function(b,a){new Effect.Highlight(a,{startcolor:this.options.highlightColor,keepBackgroundImage:true});
},onEnterEditMode:null,onEnterHover:function(a){a.element.style.backgroundColor=a.options.highlightColor;
if(a._effect){a._effect.cancel();
}},onFailure:function(b,a){alert("Error communication with the server: "+b.responseText.stripTags());
},onFormCustomization:null,onLeaveEditMode:null,onLeaveHover:function(a){a._effect=new Effect.Highlight(a.element,{startcolor:a.options.highlightColor,endcolor:a.options.highlightEndColor,restorecolor:a._originalBackground,keepBackgroundImage:true});
}},Listeners:{click:"enterEditMode",keydown:"checkForEscapeOrReturn",mouseover:"enterHover",mouseout:"leaveHover"}});
Ajax.InPlaceCollectionEditor.DefaultOptions={loadingCollectionText:"Loading options..."};
Form.Element.DelayedObserver=Class.create({initialize:function(b,a,c){this.delay=a||0.5;
this.element=$(b);
this.callback=c;
this.timer=null;
this.lastValue=$F(this.element);
Event.observe(this.element,"keyup",this.delayedListener.bindAsEventListener(this));
},delayedListener:function(a){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));
}});
if(window.jQuery){window.jQuery.noConflict();
}var CX={url_root:function(b){var a=b||document.location.pathname;
if(a.substring(0,6)=="/stage"){return"/stage";
}if(a.substring(0,5)=="/demo"){return"/demo";
}return"";
},imagePath:function(a){return"http://www.groupsite.com"+CX.url_root()+"/images/"+a;
},iconPath:function(a){return"http://www.groupsite.com"+CX.url_root()+"/images/icons/"+a;
},transIconPath:function(a){return CX.iconPath(a+(Prototype.Browser.IE6_DOWN?".gif":".png"));
},addLoadEvent:function(a){Event.observe(window,"load",a);
},popup:function(c,d,a,f,g){var b=window.open(c,"popup","width="+(d||500)+",height="+(a||350)+",scrollbars=yes,resizable=yes,toolbar=no,directories=no,menubar=no,status=no,left=100,top=100");
if(f){b.document.open();
b.document.write(f);
b.document.close();
}if(!g){b.focus();
}return false;
},toggleImage:function(d,a,c){var b=$(d);
if(b.src.split("?")[0]==a.split("?")[0]){b.src=c;
}else{b.src=a;
}},toggleSection:function(a,b){$(b).toggle();
$(a).toggleClassName("expand-flat").toggleClassName("collapse-flat");
},clearSelection:function(d){d=d||window;
var c=d.document,a;
if(c.selection&&c.selection.clear){c.selection.clear();
}else{if(!d.getSelection||!(a=d.getSelection())){return;
}}if(a.collapse){try{a.collapse(false);
}catch(b){}}if(a.removeAllRanges){a.removeAllRanges();
}},shadeRgb:function(c,b,g,h){if(b===undefined){b=true;
}if(h===undefined){h=2105376;
}g=g||(b?16777215:0);
var d=0,c=parseInt(c,16),j=255;
for(i=0;
i<3;
i++){var k=(h&j),f=(g&j),a=(c&j);
if(b?(a>f):(a<f)){f=a;
}k=a+(b?k:-k);
if(b?(k>f):(k<f)){k=f;
}d|=k;
j<<=8;
}return d.toPaddedString(6,16);
},darkenRgb:function(c,b,a){if(b===undefined){b=2105376;
}if(a===undefined){a=2105376;
}return this.shadeRgb(c,false,a,b);
},lightenRgb:function(c,b,a){if(b===undefined){b=2105376;
}if(a===undefined){a=16777215;
}return this.shadeRgb(c,true,a,b);
},addBookmark:function(a,b){if(!window.external){alert("Sorry, but your browser does not appear to support this feature.  Try using your browser's menu to bookmark this link instead.");
return;
}window.external.AddFavorite(a,b||a);
},rateLink:function(c,g,d,b){var f=$(c).up(".cactions"),h,a;
if(f){f=f.up("li");
h={pulse:f};
a=f.highlight.bind(f);
}$(c).update("...");
new Ajax.Updater(c,CX.url_root()+"/link/rate/"+g,{spinner:h,onSuccess:a,parameters:{rating:d,verbose:b?"true":"false"}});
},navigateTo:function(b){var a;
if(typeof(b)=="string"){a=b;
b=arguments[1];
options=arguments[2]||{};
}else{a=document.location.pathname;
options=arguments[1]||{};
}b=$H(document.location.search.substring(1).toQueryParams()).merge(b);
if(Object.isArray(options.ensure_hash_params)){$A(options.ensure_hash_params).each(b.unset.bind(b));
}if(Object.isArray(options.clear_params)){$A(options.clear_params).each(b.unset.bind(b));
}document.location.href=a+"?"+b.toQueryString();
},toggleObscuredTags:function(c,g,h,d,f){if(!c){return c;
}if(Prototype.Browser.IE6_DOWN){this.toggleObscuredTagsByName("select",c,g,h,d,f);
}this.toggleObscuredTagsByName("object",c,g,h,d,f);
this.toggleObscuredTagsByName("embed",c,g,h,d,f);
if(Prototype.Browser.IE7_DOWN){for(var b=0;
b<10;
b++){var a=$("obscurer"+b);
if(!a){continue;
}this.toggleObscuredTag(a,c,g,h,d,f);
this.toggleObscuredTag(a,c,"unobscured",h,d,f);
}}},toggleObscuredTagsByName:function(c,d,h,j,f,g){var a=document.getElementsByTagName(c);
j=j||d.cumulativeBox();
for(var b=0;
b<a.length;
b++){this.toggleObscuredTag(a[b],d,h,j,f,g||("_"+b));
}for(var b=0;
b<a.length;
b++){this.toggleObscuredTag(a[b],d,"unobscured",j,f,g||("_"+b));
}},toggleObscuredTag:function(y,a,h,q,s,b){var y=$(y);
var d=(y.getStyle("visibility")!="hidden");
var u=y.cumulativeBox();
var x=a.obscuredTags;
var n=false;
if(!x){x=a.obscuredTags={};
}var g=y.obscuringTags;
if(!g){g=y.obscuringTags={};
}a=$(a);
q=q||a.cumulativeBox();
var w=(u.right<q.left||u.left>q.right||u.bottom<q.top||u.top>q.bottom);
if(w^(h=="unobscured")){return;
}var f=parseInt(a.getStyle("zIndex")||"1");
for(var j=y.parentNode;
(j&&j.nodeName!="BODY");
j=j.parentNode){j=$(j);
if(j==a){return;
}if(!j||!j.visible()||j.style.visibility=="hidden"){continue;
}var c=parseInt(j.getStyle("zIndex")||"1");
if(c>f){n=true;
break;
}}var l=y.autoId(s,b);
if(!l){return;
}if(h){delete x[l];
delete g[a.id];
if(n){return;
}var r=Object.keys(g);
for(var v=0;
v<r.length;
v++){var m=document.getElementById(r[v]);
if(m&&m.visible()&&m.style.visibility!="hidden"){return;
}}y.style.visibility="visible";
}else{x[l]=true;
g[a.id]=true;
if(n){return;
}y.style.visibility="hidden";
}},mktempHiddenFrame:function(b,f,c){var g;
if(typeof(c)!="string"){var a=b+"OnLoadTemp";
window[a]=c;
c=a;
}if((g=$(b))&&g.className.indexOf("temp-hidden-frame-holder")>=0){g.remove();
}g=new Element("div",{id:b,className:"temp-hidden-frame-holder"});
b=b+"_SFRI_"+(new Date()).getTime();
g.innerHTML='<iframe style="width: 0px; height: 0px;" frameBorder="no" scrolling="no" src="javascript:\'\'" id="'+b+'" name="'+b+'" onload="CX.tempHiddenFrameOnLoad (this,\''+$(f).identify()+"',"+c+');"></iframe>';
document.body.appendChild(g);
},targetTempHiddenFrame:function(b,a){b.setAttribute("target",$(a).firstChild.id);
return true;
},getFrameDocument:function(a){return a.contentDocument||(a.contentWindow?a.contentWindow.document:window.frames[a.id].document);
},tempHiddenFrameOnLoad:function(frame,destId,onLoadFunc){if(frame.throwaway){return;
}var d=this.getFrameDocument(frame),js;
if(d.location.href.substring(0,4)!="http"){return;
}var html=Try.these(function(){return d.head.innerHTML+" "+d.body.innerHTML;
},function(){return d.body.innerHTML;
},function(){return d.documentElement.innerHTML;
});
html=html.replace(/<([\/]?)noscript/gi,"<$1script");
$(destId).update(html.stripScripts());
js=html.extractScripts();
frame.throwaway=true;
if(onLoadFunc){onLoadFunc();
}js.map.bind(js,function(t){return eval(t);
}).defer();
},destroyTempHiddenFrame:function(a){if((a=$(a))&&a.parentNode){a.parentNode.removeChild(a);
}},copyToClipboard:function(d){var b=document.getElementById("copyToClipboardHidden");
if(!b){document.body.appendChild(b=new Element("div",{id:"copyToClipboardHidden",style:"display: none;"}));
}if(Prototype.Browser.Windows){d=d.strip().gsub(/([^\r])\n/,"#{1}\r\n");
}if(window.clipboardData&&!Prototype.Browser.IE7_UP){window.clipboardData.setData("Text",d);
}else{var a=document.getElementById("copyToClipboardWrapper");
if(!a){document.body.appendChild(a=new Element("div",{id:"copyToClipboardWrapper"}));
}a.innerHTML="";
var c='<embed id="copyToClipboardFlash" src="'+document.location.protocol+"//www.groupsite.com"+CX.url_root()+'/flash/_clipboard.swf" FlashVars="clipboard='+encodeURIComponent(d)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
a.innerHTML=c;
}},falseFunction:function(){return false;
}};
(function(a){if(!a){return;
}var c;
if(a.IE){c="MSIE[\\s]";
}else{if(a.WebKit){c="AppleWebKit\\/.*Version\\/";
}else{if(a.Opera){c="Opera[\\s\\/]";
}}}if(c){c=new RegExp("^.*"+c+"((\\d{1,})\\.(\\d{1,})(\\.\\d{1,})?(\\.\\d{1,})?)","i");
}else{if(a.Gecko){c=new RegExp("^.*; rv:((\\d{1,})\\.(\\d{1,})(\\.\\d{1,})?(\\.\\d{1,})?)","i");
}}if(c&&(c=navigator.userAgent.match(c))){try{c=c.slice(c.length-5);
a.Version=c[0];
a.MajorVersion=c[1]?parseInt(c[1]):0;
a.MinorVersion=c[2]?parseInt(c[2]):0;
a.VersionNumber=(c[1]&&c[2])?parseFloat(""+c[1]+"."+c[2]):0;
a.PatchVersion=c[3]?parseInt(c[3].substring(1)):0;
a.BuildVersion=c[4]?parseInt(c[4].substring(1)):0;
}catch(d){}}a.Mac=!!navigator.platform.match(/Mac/i);
a.Linux=!!navigator.platform.match(/Linux/i);
a.Windows=!a.Mac&&!a.Linux&&!!navigator.platform.match(/Win/i);
a.IE7=(a.IE&&a.MajorVersion==7);
a.IE7_UP=(a.IE&&a.MajorVersion>=7);
a.IE7_DOWN=(a.IE&&a.MajorVersion<=7);
a.IE6=(a.IE&&a.MajorVersion==6);
a.IE6_UP=(a.IE&&a.MajorVersion>=6);
a.IE6_DOWN=(a.IE&&a.MajorVersion<=6);
a.FF2=(a.Gecko&&a.MajorVersion==1&&a.MinorVersion==8);
a.FF2_DOWN=(a.Gecko&&(a.MajorVersion<1||(a.MajorVersion==1&&a.MinorVersion<=8)));
a.FF3=(a.Gecko&&a.MajorVersion==1&&a.MinorVersion==9);
a.FF3_UP=(a.Gecko&&(a.FF3||a.MajorVersion>1));
a.FF2_MAC=(a.FF2_DOWN&&a.Mac);
a.WEBKIT3_UP=(a.WebKit&&a.MajorVersion>=3);
a.WEBKIT2=(a.WebKit&&a.MajorVersion==2);
a.WEBKIT2_DOWN=(a.WebKit&&a.MajorVersion<=2);
a.OPERA9_5_UP=(a.Opera&&a.MajorVersion>=9&&a.MinorVersion>=5);
a.OPERA9_0_DOWN=(a.Opera&&(a.MajorVersion<9||(a.MajorVersion==9&&a.MinorVersion==0)));
})(Prototype.Browser);
String.prototype.trim=String.prototype.strip;
Function.prototype.lambdify=function(){if(this._lambdified){return this._lambidified;
}var a=this;
return this._lambdified=function(){return arguments.length>1?a.apply(arguments[0],$A(arguments).slice(1,arguments.length-1)):a.call(arguments[0]);
};
};
CX.ElementMethods={readObjectParam:function(f,c,b){var a=Element.readAttribute(f,c);
if(Object.isUndefined(a)){var g=f.getElementsByTagName("param");
for(var d=0;
d<g.length;
d++){if((Element.readAttribute(g[d],"name")||"").toLowerCase()==c.toLowerCase()){a=g;
break;
}}if(!a){return;
}if(b&&b.push){b.push(a);
}a=Element.readAttribute(a,"value");
}return a;
},writeObjectParam:function(f,b,g,a){Element.writeAttribute(f,b,g);
if(!a){var h=f.getElementsByTagName("param");
for(var d=0;
d<h.length;
d++){if((Element.readAttribute(h[d],"name")||"").toLowerCase()==b.toLowerCase()){a=h;
break;
}}}if(a){Element.writeAttribute(a,"value",g);
}var c=f.getElementsByTagName("embed");
if(c&&c[0]){Element.writeAttribute(c[0],b,g);
}return f;
},disableSelection:function(a){a.onselectstart=CX.falseFunction;
a.unselectable="on";
a.style.userSelect="none";
a.style.MozUserSelect="none";
a.style.webkitUserSelect="none";
a.style.cursor="default";
return a;
},toggleVisibility:function(a){a=$(a);
a.style.visibility=(a.style.visibility!="hidden"?"hidden":"");
return a;
},showVisibility:function(a){$(a).style.visibility="";
return a;
},hideVisibility:function(a){$(a).style.visibility="hidden";
return a;
},visibility:function(a){return($(a).style.visibility!="hidden");
},showInvisible:function(a){$(a).style.visibility="hidden";
a.style.display="";
return a;
},hideNotInvisible:function(a){$(a).style.display="none";
a.style.visibility="";
return a;
},showBoth:function(a){$(a).style.visibility="";
a.style.display="";
return a;
},hideBoth:function(a){$(a).style.visibility="hidden";
a.style.display="none";
return a;
},getPlainText:function(a){return a.innerText||a.textContent;
},insertAfter:function(a,b,c){return c.nextSibling?a.insertBefore(b,c.nextSibling):a.appendChild(b);
},lastDescendant:function(a){a=$(a).lastChild;
while(a&&a.nodeType!=1){a=a.prevSibling;
}return $(a);
},ancestorOrSelf:function(b,a){if(!a||b.match(a)){return b;
}return b.up(a);
},isAttributeTrue:function(c,b){var a=Element.readAttribute(c,b);
if(!a){return null;
}a=a.toLowerCase();
return(a!="no"&&a!="0"&&a!="false")?a:false;
},findByTagNameAndClassNames:function(g,k,f){var a=[];
for(var d=0,b=k.split(",");
d<b.length;
d++){var l=b[d].split(".",2),m=g.getElementsByTagName(l[0]),h=" "+l[1]+" ";
for(var c=0;
c<m.length;
c++){if((" "+m[c].className+" ").indexOf(h)<0){continue;
}else{if(!f){a.push(m[c]);
}else{if(f(m[c])){return;
}}}}}return a;
},ancestorOffset:function(c,b){var a=0,f=0;
var d=Element.getStyle(b,"position");
if(d!=="absolute"&&d!=="relative"){return;
}do{a+=c.offsetTop||0;
f+=c.offsetLeft||0;
if(b==(c=c.offsetParent)){return Element._returnOffset(f,a);
}}while(c&&c.tagName!="BODY");
},absoluteOffset:function(c,s){if(!(c=$(c))){return;
}var v=c.ownerDocument;
if(!v){return;
}var n=v.body,o=v.documentElement;
if(c==n||c==o){return[0,0];
}if(c.getBoundingClientRect){var b=c.getBoundingClientRect(),r=0,p=0;
if(!s){r+=window.pageXOffset||o.scrollLeft||n.scrollLeft;
p+=window.pageYOffset||o.scrollTop||n.scrollTop;
}if(Prototype.Browser.FF3_UP){return Element._returnCorners(Math.round(b.left+r),Math.round(b.top+p),Math.round(b.right+r),Math.round(b.bottom+p));
}if(Prototype.Browser.IE){r-=o.clientLeft;
p-=o.clientTop;
}return Element._returnCorners(b.left+r,b.top+p,b.right+r,b.bottom+p);
}if(Prototype.Browser.Gecko&&document.getBoxObjectFor){try{var m=document.getBoxObjectFor(c),k=m.x,j=m.y;
if(s){m.x-=o.scrollLeft;
m.y-o.scrollTop;
}return Element._returnCorners(m.x,m.y,m.x+m.width,m.y+m.height);
}catch(u){}}var f=c.offsetLeft,q=c.offsetTop,d=c.getStyle("position")=="fixed",g=c,h=c.parentNode,a=c.offsetParent;
while(a){tn=a.tagName.toUpperCase();
f+=a.offsetLeft;
q+=a.offsetTop;
if(Prototype.Browser.WEBKIT3_UP||(Prototype.Browser.Gecko&&tn!="TABLE"&&tn!="TD"&&tn!="TH")){f+=parseInt($(a).getStyle("borderLeftWidth"))||0;
q+=parseInt($(a).getStyle("borderTopWidth"))||0;
}if(!d){d=($(a).getStyle("position")=="fixed");
}g=(tn=="BODY")?g:a;
a=a.offsetParent;
}if(!s){while(h&&(tn=h.tagName)&&tn!="BODY"&&tn!="HTML"){if(!Prototype.Browser.Opera||!/^inline|table.*$/i.test($(h).getStyle("display"))){f-=h.scrollLeft;
q-=h.scrollTop;
}if(Prototype.Browser.Gecko&&$(h).getStyle("overflow")!="visible"){f+=parseInt($(h).getStyle("borderLeftWidth"))||0;
q+=parseInt($(h).getStyle("borderTopWidth"))||0;
}h=h.parentNode;
}}if((Prototype.Browser.WEBKIT2_DOWN&&(d||$(g).getStyle("position")=="absolute"))||(Prototype.Browser.FF2_DOWN&&$(g).getStyle("position")!="absolute")){f-=n.offsetLeft;
q-=n.offsetTop;
}if(d){f+=Math.max(window.pageXOffset||0,o.scrollLeft,n.scrollLeft);
q+=Math.max(window.pageYOffset||0,o.scrollTop,n.scrollTop);
}else{if(s){f-=Math.max(window.pageXOffset||0,o.scrollLeft,n.scrollLeft);
q-=Math.max(window.pageYOffset||0,o.scrollTop,n.scrollTop);
}}return Element._returnOffset(f,q);
},cloneOffset:function(c,g,b){if(!(g=$(g))||!(c=$(c))){return;
}var f=g.absoluteOffset();
b=b||{};
f[0]+=b.offsetLeft||0;
f[1]+=b.offsetTop||0;
var h=[0,0];
var d=null;
if(c.getStyle("position")=="absolute"){d=c.getOffsetParent();
h=d.absoluteOffset();
}var a=$D(c).body;
if(d==a){h[0]-=a.offsetLeft;
h[1]-=a.offsetTop;
}f[0]-=parseInt(c.getStyle("marginLeft"))||0;
f[1]-=parseInt(c.getStyle("marginTop"))||0;
if(b.setLeft||Object.isUndefined(b.setLeft)){c.style.left=(f[0]-h[0])+"px";
}if(b.setTop||Object.isUndefined(b.setTop)){c.style.top=(f[1]-h[1])+"px";
}if(!b.getOffsets){return c;
}offsets=[f[0],f[1],h[0],h[1]];
offsets.left=f[0];
offsets.top=f[1];
offsets.deltaLeft=h[0];
offsets.deltaTop=h[1];
return offsets;
},cloneBox:function(c,d,b){var a=Element.cloneOffset(c,d,b),f;
b=b||{};
if(b.setWidth||(b.setWidth===undefined)){f=d.offsetWidth;
if(b.innerBox!==undefined&&!b.innerBox){f-=((parseInt(d.getStyle("paddingLeft"))||0)+(parseInt(d.getStyle("paddingRight"))||0));
}else{if(b.outerBox){f+=((parseInt(d.getStyle("marginLeft"))||0)+(parseInt(d.getStyle("marginRight"))||0));
}}c.style.width=f+"px";
if(b.getOffsets){a.width=f;
}}if(b.setHeight||(b.setHeight===undefined)){f=d.offsetHeight;
if(b.innerBox!==undefined&&!b.innerBox){f-=((parseInt(d.getStyle("paddingTop"))||0)+(parseInt(d.getStyle("paddingRight"))||0));
}else{if(b.outerBox){f+=((parseInt(d.getStyle("marginTop"))||0)+(parseInt(d.getStyle("marginBottom"))||0));
}}c.style.height=f+"px";
if(b.getOffsets){a.height=f;
}}return a;
},cumulativeBox:function(a){var c=Position.cumulativeOffset(a);
if(Object.isUndefined(c.height)&&Object.isUndefined(c.bottom)){var b=a.getDimensions();
c.width=b.width;
c.height=b.height;
}return Element._returnBox(c);
},positionedBox:function(f){var h,c,g;
if(f.getStyle("display")||"none"=="none"){h=f.style.display;
c=f.style.visibility;
g=f.style.position;
f.style.visibility="hidden";
if(f.getStyle("position")!="absolute"){f.style.position="relative";
}f.style.display="block";
}var a={width:f.offsetWidth,height:f.offsetHeight,left:f.offsetLeft,top:f.offsetTop};
if(!h||h=="none"){f.style.display=h;
f.style.position=g;
f.style.visibility=c;
}return Element._returnBox(a);
},setBox:function(a,c,b){b=b||0;
a.style.left=(c.left+b)+"px";
a.style.top=(c.top+b)+"px";
a.style.width=(c.width-b*2)+"px";
a.style.height=(c.height-b*2)+"px";
return a;
},cumulativeDecoratorWidth:function(c,b,d){if(!d){d=["Left","Right"];
}else{if(typeof(d)=="string"){d=[d];
}}if(!b){b=["padding","border","margin"];
}if(typeof(b)!="string"&&(b.length||b.length===0)){var g=arguments.callee;
return $A(b).inject(0,function(h,f){return h+g(c,f,d);
});
}var a=$A(d).collect(function(h){if(b=="border"){h+="Width";
}var f=c.getStyle(b+h);
if(!f){return 0;
}switch(typeof(f)){case"number":return f;
case"string":f=parseInt(f);
return isNaN(f)?0:f;
default:return 0;
}});
return(a[0]||a[1]||0)+(a[2]||a[1]||0);
},scrollToBy:function(a,b,d){a=$(a);
var c=Element.cumulativeOffset(a);
window.scrollTo(c[0]+(b||0),c[1]+(d||0));
return a;
},scrollToIfObscured:function(f,g,a){var h=document.viewport.getDimensions();
var c=document.viewport.getScrollOffsets();
var b=Element.cumulativeOffset(f),k=c[0],j=c[1];
var l;
if(typeof(g)=="object"){l=g;
g=l.xoffset||0;
a=l.xoffset||0;
}else{l={};
g=g||0;
a=a||0;
}if(c[0]>b[0]){k=b[0]+g;
}else{if(f.offsetWidth<h.width){k=(b[0]+f.offsetWidth)-(c[0]+h.width);
k=(k<0)?c[0]:(k+c[0]+g);
}}if(l.vcenter){a+=(h.height-f.offsetHeight)/2;
}if(c[1]>b[1]){j=b[1]+a;
}else{if(f.offsetHeight<h.height){j=(b[1]+f.offsetHeight)-(c[1]+h.height);
j=(j<0)?c[1]:(j+c[1]+a);
}}if(k!=c[0]||j!=c[1]){window.scrollTo(Math.max(k,0),Math.max(j,0));
}return f;
}};
CX.ElementMethods.autoId=Element.Methods.identify;
if(Prototype.Browser.IE){CX.ElementMethods._descendantOf=Element.Methods.descendantOf;
CX.ElementMethods.descendantOf=function(b,a){b=$(b),a=$(a);
return b.contains?(b==a||a.contains(b)):b._descendantOf(a);
};
}Element._returnCorners=function(d,f,g,c){var a=[d,f,g,c];
a.left=d;
a.top=f;
a.right=g;
a.bottom=c;
return a;
};
Element._returnBox=function(a){if(Object.isUndefined(a.height)){a.height=a.bottom-a.top;
a.width=a.right-a.left;
}else{if(Object.isUndefined(a.bottom)){a.bottom=a.top+a.height;
a.right=a.left+a.width;
}}return a;
};
Element.addMethods(CX.ElementMethods);
Position._origCumulativeOffset=Position.cumulativeOffset;
Position._origPage=Position.page;
Position._origClone=Position.clone;
Element.addMethods({_cumulativeOffset:Element.Methods.cumulativeOffset,_viewportOffset:Element.Methods.viewportOffset,_clonePosition:Element.Methods.clonePosition,cumulativeOffset:Element.Methods.absoluteOffset,viewportOffset:function(a){return a.absoluteOffset(true);
},clonePosition:function(b,c,a){if(a){a.getOffsets=false;
}return b.cloneBox(c,a);
}});
Position.cumulativeOffset=Element.Methods.cumulativeOffset;
Position.page=Element.Methods.viewportOffset;
Position.clone=function(b,c,a){return Element.clonePosition(c,b,a||{});
};
Object.extend(Event,{relativeMouse:function(b,a){a=a||Event.element(b);
var d=Event.pointer(b);
var c=Element.cumulativeOffset(a);
d.x-=c.left;
d.y-=c.top;
return d;
},hitTest:function(b,a){a=a||Event.element(b);
var c=Event.pointer(b);
return Position.within(a,c.x,c.y);
},followMouse:function(b,a,c){var d=Event.pointer(b);
if(c){d.x-=c.left;
d.y-=c.top;
}a.style.left=d.x+"px";
a.style.top=d.y+"px";
},isTargetDescendantOf:function(d,c,b){d=d||window.event;
var a=d.toElement||d.relatedTarget;
c=c||d.srcElement||d.target;
return(a==c)?!b:((a=$(a))&&a.descendantOf(c));
},isSourceDescendantOf:function(d,c,b){d=d||window.event;
var a=d.srcElement||d.target;
c=c||d.toElement||d.relatedTarget;
return(a==c)?!b:((a=$(a))&&a.descendantOf(c));
},onReady:function(a){document.observe("dom:loaded",a.curry(document));
}});
CX.Event=(function(){var h={};
function a(l){return l._cxEventChainID||(l._cxEventChainID=arguments.callee.id++);
}a.id=2;
function g(l){return h[l]||(h[l]={});
}function j(m,l){m=h[m]||(h[m]={});
try{return m[l]||(m[l]=[]);
}finally{m=null;
}}function b(m,l){return j(a(m),l);
}function k(n){for(var l=0,m;
l<n.length;
l++){if((m=chain[l])&&m.clear){m.clear();
}}}function d(l){var n;
for(var m in l){if((n=l[m])){k(n);
}l[m]=null;
}}function c(){var m;
for(var l in h){if((m=h[l])&&m.length){d(m);
}m[l];
}h=null;
}if(Prototype.Browser.IE6_DOWN&&window.attachEvent){window.attachEvent("onunload",c);
}var f=Class.create();
f.Methods={addSubscriber:function(m,l,n){if(!Object.isFunction(l)){throw {message:"Subscriber must be a function"};
}b(this,m).push([l,n]);
},hasSubscriber:function(n){var m=b(this,n);
try{return Object.isArray(m)&&m.length;
}finally{m=null;
}},removeSubscriber:function(o,l,p){if(!this.hasSubscriber(o)){return false;
}for(var n=0,m=b(this,o);
n<this.chain.length;
n++){if(m[n][0]===l&&m[n][1]===p){m.splice(n,1);
return;
}}},publish:function(m,l){if(!this.hasSubscriber(m)){return false;
}b(this,m).any(function(n){return((n[1]?n[0].call(n[1],l):n[0](l))===false);
});
}};
f.addMethods(f.Methods);
return f;
})();
Object.extend(CX.Event,(function(){var a,b;
if(Prototype.Browser.Mac&&!Prototype.Browser.WebKit){a=40;
b=1;
}else{a=120;
b=3;
}function f(h){if(h.wheelDelta){return h.wheelDelta/a;
}if(h.detail){return -h.detail/b;
}}function c(h,j){var k=f(j);
if(!k){j.stop();
}else{if(h.scrollTop<=0){if(k>0){j.stop();
}}else{if(h.scrollTop>=h.scrollHeight-h.offsetHeight){if(k<0){j.stop();
}}}}return !j.stopped;
}function d(j,h){j.observe("mousewheel",h);
j.observe("DOMMouseScroll",h);
}function g(j,h){j.stopObserving("mousewheel",h);
j.stopObserving("DOMMouseScroll",h);
}return{cancelation:function(h){h.stop();
return false;
},obstruction:function(h){h.stopPropagation();
},wheelDelta:f,wheelInside:c,observeWheel:d,stopObservingWheel:g,keepWheelInside:function(h){if(h=$(h)){d(h,c.curry(h));
}}};
})());
CX.IFrameCache={create:function(c,f){var g=!!(Prototype.Browser.IE6_DOWN&&window.attachEvent);
if(c||g){try{var k;
var b={};
function l(m){this.element=m;
}l.prototype=new l();
l.prototype.destroy=function(){if(this.element&&this.element.parentNode){this.element.parentNode.removeNode(this.element);
}this.element=null;
};
var h={put:function(n,m){if(!m){return remove(n);
}if(m.nodeName&&m.nodeName=="IFRAME"){m=true;
}b[n]=m;
},get:function(n){var m=b[n];
if(m===true){return document.getElementById(n);
}try{return m;
}finally{m=null;
}},remove:function(m){if(typeof(m)!="string"&&m.id){m=m.id;
}if(b[m]){delete b[m];
}},destroy:function(n){if(!n){return;
}var p;
try{if(n.nodeName&&n.nodeName=="IFRAME"){p=n.id;
if(g&&n.outerHTML){n.outerHTML="";
}else{if(n.parentNode){n.parentNode.removeNode(k);
}}}else{if(typeof(n)=="string"){n=b[p=n];
if(!n){return;
}if(n===true){n=document.getElementById(p);
}}else{if(n.destroy){p=n.element?n.element.id:n.id;
n.destroy();
}}}}finally{try{if(p&&b[p]){delete b[p];
}}catch(m){}if(b){for(var p in b){this.destroy(b[p]);
}}n=null;
}},create:function(n,p){var m=this.template();
if(m&&m.cloneNode){m=m.cloneNode(false);
}return m;
},destroyAll:function(){if(k){this.destroy(k);
k=null;
}if(b){for(var m in b){this.destroy();
}}b=null;
},createTemplate:function(m){return $((m||document).createElement("iframe"));
},template:function(){return k||(k=this.createTemplate());
}};
if(!f&&g){var a=h.destroyAll.bind(h);
function j(){document.detachEvent("onstop",j);
a();
}function d(){if(document.readyState==="interactive"){document.attachEvent("onstop",j);
(function(){document.detachEvent("onstop",j);
}).defer();
}}window.attachEvent("onunload",a);
window.attachEvent("onbeforeunload",d);
}return h;
}finally{h=null;
}}return{put:Prototype.emptyFunction,remove:Prototype.emptyFunction,destroyAll:Prototype.emptyFunction,create:Prototype.emptyFunction,template:Prototype.emptyFunction};
}};
CX.IFrameShim=Class.create({initialize:function(c,b){this.options=b||{};
var d,a=(b.cache_once||b.cache);
this.target=$(c);
this.element=null;
this.caching=a?"permanent":!b.temporary;
this.temporary=!this.caching;
this.margin=b.margin||0;
this.pad=b.pad||0;
this.zIndex=b.zIndex||-1;
if(b.zIndex===true){this.zIndex=null;
}if(this.caching&&c){d=c.previousSibling;
if(d&&d.nodeName&&d.nodeName.toUpperCase()=="IFRAME"&&d.className.indexOf("zshim")>=0){this.element=$(d);
if(d.clientWidth||d.clientHeight){this.cached=this.caching;
}}}this._createShim(c,b);
try{return;
}finally{d=null;
}},_createShim:function(b,a){if(!this.element){var c=this._template().cloneNode(false);
if(!a.transparent){if(Prototype.Browser.IE){c.style.filter="";
}else{c.style.background="";
c.allowTransparency=false;
}}if(a.background){c.style.background=a.background;
}else{if(a.backgroundColor){c.style.backgroundColor=a.backgroundColor;
}}this.element=c;
c=null;
}this.setTarget(b,true);
this._cachePut();
},setTarget:function(a,b){if(!this.element){return this;
}if(!b){this.element.hide();
}if(!this.cached){this.element.style.zIndex=""+(this.zIndex||((a.getStyle("zIndex")||0)-1));
}if(!this.cached||a!=this.previousSibling){a.parentNode.insertBefore(this.element,a);
}this.target=$(a);
return this;
},hide:function(){if(this.element){this.element.hideBoth();
}return this;
},hideVisibility:function(){if(this.element){this.element.hideVisibility();
}return this;
},show:function(){if(this.element){this.element.showBoth();
}return this;
},showVisibility:function(){if(this.element){this.element.showVisibility();
}return this;
},destroy:function(){try{this._cacheDestroy();
return this;
}finally{this.element=this.target=null;
}},toggleTo:function(a,b){return(a?this.enable(b):this.disable());
},fullscreen:function(){if(!this.element){return this;
}this.element.style.height="100%";
this.element.style.width="100%";
this.element.showBoth();
this.cached=this.caching;
if(Prototype.Browser.FF2_DOWN&&!this.options.caretless){this._workaroundFirefox();
}return this;
},enableForOverlay:function(a){if(CX.Overlays.enabled()&&this.element){this.enable(a);
}return this;
},disableForOverlay:function(){if(CX.Overlays.enabled()&&this.element){this.disable();
}return this;
},resize:function(){var c=this.pad*2-this.margin*2,a=this.target.offsetWidth+c,b=this.target.offsetHeight+c;
this.element.style.width=a+"px";
this.element.style.height=b+"px";
return this;
},rebox:function(a){a=(!a||!a.top)?this.target.positionedBox():Element._returnBox(a);
a.width+=this.pad*2;
a.height+=this.pad*2;
this.element.setBox(a,this.margin);
return this;
},disable:function(){if(this.caching){this.element.hideBoth();
}else{this.element.remove();
}return this;
},enable:function(a){if(!this.element){return this;
}if(this.cached=="permanent"){return this.show();
}this.rebox();
this.show();
this.cached=this.caching;
if(Prototype.Browser.FF2_DOWN&&!this.options.caretless){this._workaroundFirefox();
}return this;
},_workaroundFirefox:function(){if(!this.element){return;
}this.target.parentNode.insertBefore(this.element.remove(),this.target);
Element.insertAfter(this.target.parentNode,this.target.remove(),this.element);
}});
Object.extend(CX.IFrameShim,{staticMarkup:(Prototype.Browser.IE?("<iframe "+(location.protocol=="https:"?(Prototype.Browser.IE7?' src="https://about:blank"':' src="/images/blank.gif"'):"")+' scrolling="no" frameBorder="0" class="zshim" style="position: absolute; display: none; margin: 0; padding: 0; border: none; left: 0; top: 0; width: 0; height: 0; filter: progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);"></iframe>'):('<iframe scrolling="no" frameBorder="0" class="zshim" style="position: absolute; display: none; margin: 0; padding: 0; border: none; left: 0; top: 0; width: 0; height: 0; background: transparent;" allowtransparency="true"></iframe>')),needed:(Prototype.Browser.IE7_DOWN||Prototype.Browser.FF2_DOWN||!navigator.platform.match(/Mac|Win/)),is_needed:function(a){switch(a){case"navmain":return(this.needed||Prototype.Browser.Opera);
case"dimElement":return Prototype.Browser.FF2_MAC;
default:return this.needed;
}},staticMarkupIfNeeded:function(a){if(this.is_needed(a)){return this.staticMarkup;
}}});
Object.extend(CX.IFrameShim.prototype,(function(){var cache=CX.IFrameCache.create();
cache.createTemplate=function(){var temp=$(document.createElement("iframe"));
if(Prototype.Browser.IE&&location.protocol=="https:"){temp.src="javascript:''";
}temp.scrolling="no";
if(Prototype.Browser.IE){temp.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);";
temp.frameBorder=0;
}else{temp.setAttribute("allowtransparency","true");
temp.style.backgroundColor="transparent";
}with(temp.style){border="none";
margin="0";
padding="0";
position="absolute";
display="none";
left="0";
top="0";
width="0";
height="0";
}temp.className="zshim";
return temp;
};
if(Prototype.Browser.IE6_DOWN&&window.attachEvent){var pending=[];
function createPendingShims(){if(!pending){return;
}CX.IFrameShim.prototype._createShim=CX.IFrameShim.prototype._onload_createShim;
CX.IFrameShim.prototype._onload_createShim=null;
while(pending.length>0){var p=pending.shift();
p[0]._createShim(p[1],p[2]);
}pending=null;
}window.attachEvent("onload",createPendingShims);
return{_createShim:function(target,options){pending.push([this,target,options]);
},_onload_createShim:CX.IFrameShim.prototype._createShim,_cachePut:function(){return cache.put(this.element.identify(),this);
},_cacheRemove:function(){if(this.element){return cache.remove(this.element);
}},_cacheDestroy:function(){if(this.element){return cache.destroy(this.element);
}},_template:function(){return cache.createTemplate();
}};
}return{_cachePut:Prototype.emptyFunction,_cacheRemove:Prototype.emptyFunction,_cacheDestroy:function(){if(this.element){return cache.destroy(this.element);
}},_template:cache.createTemplate.bind(cache)};
})());
CX.AJAX=(function(){var a={};
return{contentSavepoint:function(b){b=$(b);
a[b.identify()]=b.innerHTML;
},rollbackContent:function(b,d){b=$(b);
d=d||b.identify();
var c=a[d];
b.update(c||"");
if(!Object.isUndefined(c)){delete a[d];
}b.fire("ajax:rollback");
},commitContent:function(b){if(typeof(b)!="string"){b=Element.identify(b);
}if(!Object.isUndefined(a[b])){delete a[b];
}}};
})();
CX.AJAX.ReadyEvents=(function(){var b={},a=1;
return{register:function(c){if(Object.isFunction(c)&&!c.__cx_ajax_readyEvent_id){b[c.__cx_ajax_readyEvent_id=a++]=c;
}},unregister:function(c){if(!Object.isFunction(c)||c.__cx_ajax_readyEvent_id){return;
}delete b[c.__cx_ajax_readyEvent_id];
delete c.__cx_ajax_readyEvent_id;
},onComplete:function(d,k,c){var j=d.getHeader("Content-type"),h;
if(!j||!j.strip().match(/^text\/html(;.*)?$/)){return;
}if(d.container){h=d.container[d.success()?"success":"failure"];
if(h){h=$(h);
}if(!h){return;
}}for(var f in b){try{b[f](h,d,c);
}catch(g){}}}};
})();
Ajax.Responders.register(CX.AJAX.ReadyEvents);
Object.extend(Event,{onEachReady:function(a){CX.AJAX.ReadyEvents.register(a);
Event.onReady(a);
}});
CX.AJAX.Spinner=Class.create();
Object.extend(CX.AJAX.Spinner.prototype,{initialize:function(c){this.uniq=Math.random()+new Date().getTime();
this.valid=false;
if(!c){return;
}var g=c.spinner,d=c.pulse,a=c.hilite;
if((!g||!g.target)&&!d&&!a){return;
}this.options={spinner:g,pulser:d,hilite:a};
if(this.target=g.target){if(typeof(this.target)=="function"){this.target=this.target(ajax);
}this.target=$(this.target);
this.spinner=this._createSpinner();
if(this.spinner.style&&g.style){this.spinner.setStyle(g.style);
}this.spinner.hide();
this._positionSpinner(g.position||"at",this.spinner,this.target,g.offset);
this.spinner.show();
}if(d){if(typeof(d)=="function"){d=d(ajax);
}d=$(d);
var b=[g.pulseFrom||{backgroundColor:"#c0e0ff"},g.pulseTo||{backgroundColor:"#f0c0d0"},1];
this.pulsing={style:{},target:f,fromTo:b,options:{duration:0.2}};
$H(b[0]).each(function(h){this.pulsing.style[h.key]=h.value;
});
$H(b[1]).each(function(h){this.pulsing.style[h.key]=h.value;
});
var f=this.pulsing;
(function(){f.options.afterFinish=function(){if(!this.options){return;
}this.options.style=this.fromTo[this.fromTo[2]=(this.fromTo[2]+1)%2];
this.effect=new Effect.Morph(this.target,this.options);
}.bind(f);
})();
f.options.afterFinish();
f.options.duration=1.15;
}this.valid=true;
},uniqId:function(){return this.uniq;
},isValid:function(){return this.valid;
},destroy:function(){if(this.spinner){this.spinner.remove();
this.spinner=null;
}if(this.pulsing){var a=this.pulsing;
a.options=null;
a.effect.cancel();
a.target.setStyle(a.style);
this.pulsing=null;
}if(this.hilite){this.target.highlight(this.hilite);
this.hilite=null;
}this.valid=false;
},_createSpinner:function(){return new Element("img",{src:CX.url_root()+"/images/loading.gif",style:"borderWidth: 0; zIndex: 20000;",align:"absmiddle",hspace:"2",border:"0"});
},_positionSpinner:function(a,d,b,c){b=$(b);
switch(a){case"right":c=b.getWidth()+(c||4);
break;
case"left":c=c||-14;
break;
case"bottom":c=(b.getWidth()/2)-14;
top=b.getHeight()+4;
break;
}d.setStyle({position:"absolute"});
document.body.appendChild(d);
top=top||(b.getHeight()-10)/2;
left=left||0;
d.cloneOffset(b,{offsetTop:top,offsetLeft:left});
}});
CX.AJAX.Spinners=(function(){var a={};
return{onCreate:function(d,g,c){if(!d.options||!d.options.spinner){return true;
}var f=new CX.AJAX.Spinner(d.options.spinner);
if(f.valid()){var b=f.identify();
if(a[b]){a[b].destroy();
}a[b]=f;
d.options.spinner.uniqKey=b;
}return true;
},onComplete:function(c){if(!c.options||!c.options.spinner||!c.options.spinner.uniqKey){return true;
}var b=c.options.spinner.uniqKey,d;
if(b&&a[b]){a[b].destroy();
delete this.active[b];
}return true;
},onException:function(c,b){return this.onComplete(c);
}};
})();
CX.Controls={};
CX.Controls.PopupFactory=function(w){var n,d,u,g,p,v,k,f,q,m,h,b;
var k=(Prototype.Browser.IE)?Prototype.Browser.MajorVersion:0;
function y(){var z={shim:CX.IFrameShim.is_needed()};
n=new b(z);
d=z.focusStyle||"hover";
u=n.element.className;
n.element.style.zIndex="9000";
if(d=="click"){n.element.observe("mousedown",function(A){A.stopPropagation();
});
n.items.observe("mouseup",x);
}else{n.element.observe("mouseleave",r);
n.element.observe("mouseenter",l);
n.element.observe("mouseup",x);
}}function a(){if(q&&q.state!="finished"){try{q.cancel();
}catch(z){}}}function o(){h=null;
a();
n.closeFX(g);
if(d=="click"){Event.stopObserving(document.body,"mousedown",s);
}else{if(p){p.stopObserving("mouseenter",l);
if(v){p.stopObserving("mouseleave",v);
}}}if(n.onclose){n.onclose();
}n.onselect=n.onclose=null;
v=q=null;
}function c(z,A){if(!h||(A&&A.relatedTarget&&(z===A.relatedTarget||Element.descendantOf(A.relatedTarget,z)))){return;
}m=setTimeout(j,50);
}function x(A){if(d=="click"){var z=A.element();
while(z&&z.nodeName!="A"){if(z===A.items){return;
}else{z=z.parentNode;
}}if(z&&n.onselect&&n.onselect(z,A)===false){return;
}}o();
}function s(A){if(!h){return;
}if(A){var z=A.element();
if(n.element===z||(!n.standalone&&p===z)||z.descendantOf(n.element)||(!n.standalone&&z.descendantOf(p))){return;
}}o();
}function l(){if(m){try{cancelTimeout(m);
}catch(z){}}}function j(){h=m=null;
a();
n.hideFX(g,{minimal:!!k});
if(n.onclose){n.onclose();
n.onclose=null;
}}function r(z){c(p,z);
}b=function(){this.initialize.apply(this,arguments);
};
b.prototype.close=o;
b.prototype.closeFX=function(){this.element.hide();
};
b.prototype.hideFX=o;
b.prototype.showFX=function(){this.element.showBoth();
};
b.prototype.setContent=function(A,z){if(typeof(A)!="string"&&A.innerHTML){A=A.innerHTML;
}this.element.className=u+" "+(z["class"]||"");
this.items.innerHTML=A;
};
b.prototype.setPosition=function(z,A){var D=z.getDimensions(),B=D.height,C=0;
if(Prototype.Browser.IE7_DOWN&&z.currentStyle&&!z.currentStyle.hasLayout){B=(B||1)-1;
}if(A.align=="right"){C=D.width-this.element.offsetWidth;
}this.element.cloneOffset(z,{offsetTop:B,offsetLeft:C});
};
Object.extend(b.prototype,w);
return{show:function(A,z){if(h||!n){return;
}if(n.shim){n.shim.toggleTo(!z||(z.shim!==false));
}h=true;
q=n.showFX(A,{minimal:!!k,config:z});
if(k>6){k=false;
}},hide:j,close:o,active:function(){return h;
},open:function(B,A,z){B=$(B);
if(h){if(B===g){return;
}o();
}g=B;
if(!n){y();
}if(!z){z={};
}n.setContent(A,z);
p=z.trigger?B.up(z.trigger):B;
if(d=="click"){Event.observe(document.body,"mousedown",s);
}else{p.observe("mouseenter",l);
p.observe("mouseleave",v=c.curry(n.element));
}n.element.showInvisible();
n.setPosition(z.aligner?B.up(z.aligner):B,z);
n.onclose=z.onclose;
n.onselect=z.onselect;
n.standalone=!!z.standalone;
this.show(B,z);
},toggle:function(){return h?this.hide():this.open.apply(this,arguments);
}};
};
CX.PopupMenu=new CX.Controls.PopupFactory({initialize:function(a){this.element=new Element("div",{style:"display : none;"});
this.element.addClassName("popup-menu");
this.element.innerHTML=(a.shim?CX.IFrameShim.staticMarkup:"")+'<div class="menu-pane"><ul class="menu-items"></ul></div>';
document.body.appendChild(this.element);
this.pane=this.element.lastDescendant();
this.items=this.pane.lastDescendant();
if(a.shim){this.shim=new CX.IFrameShim(this.items,{transparent:!!a.transparent,caretless:true});
}},closeFX:function(a){this.element.hide();
this.element.style.height="";
this.element.style.width="";
},hideFX:function(b,a){if(b){b.removeClassName("popup-triggered");
}if(a.minimal){this.close();
}else{return new Effect.Move(this.pane,{duration:0.15,y:-this.pane.offsetHeight,afterFinish:this.close});
}},showFX:function(b,a){if(b){b.addClassName("popup-triggered");
}this.element.style.height=this.pane.offsetHeight+"px";
this.element.style.width=this.pane.offsetWidth+"px";
if(!a.minimal){this.pane.style.top=(-this.pane.offsetHeight)+"px";
}this.element.showBoth();
if(!a.minimal){return new Effect.Move(this.pane,{duration:0.15,y:this.pane.offsetHeight});
}}});
CX.DropdownPicker=new CX.Controls.PopupFactory({initialize:function(a){this.element=new Element("div",{style:"display : none;"});
this.element.addClassName("popup-menu dropdown-picker");
this.element.innerHTML=(a.shim?CX.IFrameShim.staticMarkup:"")+'<div class="menu-container"><div class="menu-pane"><ul class="menu-items text-menu-items"></ul></div></div>';
document.body.appendChild(this.element);
this.pane=$(this.element.lastChild.lastChild);
this.items=this.pane.lastDescendant();
if(a.shim){this.shim=new CX.IFrameShim(this.pane,{transparent:!!a.transparent,caretless:true});
}CX.Event.keepWheelInside(this.pane);
a.focusStyle="click";
},closeFX:function(a){a.removeClassName("dropdown-triggered");
this.element.hide();
this.element.style.height="";
this.element.style.width="";
this.items.style.width="";
if(this.cancelMouseWheel){CX.Event.stopObservingWheel(document,CX.Event.cancelation);
this.cancelMouseWheel=null;
}},showFX:function(f,c){var b=c.config;
if(!b||!(b.preserveTriggerStyle||b.standalone)){f.addClassName("dropdown-triggered");
}var a=Math.max(this.items.clientWidth,f.getWidth());
var d=Math.min(this.items.clientHeight,Math.round(document.viewport.getDimensions().height/2.7));
this.items.style.width=a+"px";
this.pane.style.height=d+"px";
this.pane.style.width=a+"px";
this.element.style.height=this.pane.offsetHeight+"px";
this.element.style.width=this.pane.offsetWidth+"px";
if(CX.isModalDialogActive()){this.cancelMouseWheel=true;
CX.Event.observeWheel(document,CX.Event.cancelation);
}this.element.showBoth();
}});
CX.MetalPopupMenu=new CX.Controls.PopupFactory({initialize:function(a){this.element=new Element("div",{style:"display : none;"});
this.element.addClassName("metal-popup-menu");
this.element.innerHTML=(a.shim?CX.IFrameShim.staticMarkup:"")+'<span class="menu-joiner"></span><div class="menu-container"><div class="menu-pane"><div class="x"><div class="x"><div class="x"><ul class="metal-menu-items"></ul></div></div></div></div></div>';
document.body.appendChild(this.element);
this.pane=$(this.element.lastChild.lastChild);
this.joiner=$(this.element.lastChild.previousSibling);
this.items=$(this.pane.firstChild.firstChild.firstChild.firstChild);
if(a.shim){this.shim=new CX.IFrameShim(this.pane,{transparent:true,caretless:true});
}a.focusStyle="click";
},setPosition:function(a,b){var d=a.getDimensions(),c=d.height;
this.joiner.style.width=(d.width-1)+"px";
this.element.cloneOffset(a,{offsetTop:c,offsetLeft:0});
},closeFX:function(a){a.up().removeClassName("active");
this.element.hide();
this.element.style.height="";
this.element.style.width="";
this.pane.style.top="";
},hideFX:function(b,a){this.close();
},showFX:function(b,a){b.up().addClassName("active");
this.element.style.height=(this.pane.offsetHeight)+"px";
this.element.style.width=(this.pane.offsetWidth)+"px";
if(!a.minimal){this.pane.style.top=(this.pane.offsetTop-this.pane.offsetHeight)+"px";
}this.element.showBoth();
if(!a.minimal){return new Effect.Move(this.pane,{duration:0.15,y:this.pane.offsetHeight});
}}});
CX.Overlays=(function(){var d=Prototype.Browser;
var h,g,f;
var c=true;
function b(){try{h=$("navmain");
}finally{Event.observe(window,"onunload",a);
}}function a(){h=null;
}document.observe("dom:loaded",b);
return{disabled:function(){return c;
},enabled:function(){return !c;
},disable:function(j){c=true;
if(h){h.addClassName("disabled");
}if(j){if(g){g.close();
}if(f){f.close();
}}},enable:function(){if(h){h.removeClassName("disabled");
}c=false;
},openFixedDialog:function(l,k,j){if(c){return;
}var m=this.isModalDialogActive()?f:g;
if(!m){m=new this.FixedDialog(j);
}this._open(m,l,k,j);
if(this.isModalDialogActive()){f=m;
}else{g=m;
}},onFixedDialogClose:function(j){if(j===f){f=null;
}else{if(j===g&&j.temporary){g=null;
}}},closeFixedDialog:function(j){if(f){f.close();
}else{if(g){g.close();
}else{if(j){throw {message:"No fixed dialogs are open"};
}}}},hideFixedDialog:function(j){if(f){f.hide();
}else{if(g){g.hide();
}else{if(j){throw {message:"No fixed dialogs are open"};
}}}},openModalDialog:function(l,k,j){if(c){return;
}this._open(this.ModalDialog,l,k,j);
},getModalOverlayParent:function(k){if(!k){return null;
}var j=this.ModalDialog.getOverlayParent();
do{k=k.parentNode;
}while(k&&k!=j);
return(k==j)?j:null;
},isModalDialogActive:function(){return this.ModalDialog.active;
},closeDialog:function(k,j){$(k).fire("dialog:close",j||{});
},_open:function(p,l,o,s){if(c||!o){return;
}if(typeof(o)=="string"||o.innerHTML){p.open(l,o,s);
}else{if(o.frame){var q=window,j=o.url,k=o.options||{height:550,width:475};
var n=(k.id||"")+"_SFRI_"+(new Date()).getTime();
o=new Element("div");
if(k.titlebar){o.update('<h2 class="titlebar">'+k.titlebar+"</h2>");
}o.appendChild(new Element("iframe",{src:j,id:n,name:n,height:k.height,width:k.width,frameBorder:"none",style:"border-width: 0;"}));
p.open(l,o.innerHTML,s);
}else{if(o.url){o.options=o.options||{};
var r=o.options.onComplete;
var m=function(v,u){p.open(l,v.responseText.stripScripts(),s);
v.responseText.evalScripts();
if(r){r(v,u);
}};
o.options.onComplete=m;
new Ajax.Request(o.url,o.options);
}}}}};
})();
CX.Overlays.Base=Class.create(CX.Event,{initialize:function(){},open:function(){},close:function(){},_setInitialContent:function(d,a){this.changeContent=!!a.changeContent;
this.caretless=!!a.caretless;
if(Prototype.Browser.FF2_DOWN){this._contentStamp=(new Date()).getTime();
this._removeSentry=this._removeSentry||this._contentStamp;
}if(typeof(d)!="string"&&d.innerHTML){if(!a.cloneContent&&d.parentNode&&d.ownerDocument==this.content.ownerDocument){this.contentPlaceholder=this.content.ownerDocument.createElement("div");
this.contentPlaceholder.style.display="none";
d.parentNode.replaceChild(this.contentPlaceholder,d);
this.content.innerHTML="";
this.content.appendChild(d);
if(this.changeContent){this.contentOriginalVisible=d.visible();
this.contentOriginal=d;
}else{if(Prototype.Browser.IE7_DOWN){this.contentOriginal=d.cloneNode(true);
}else{this.contentOriginal=this.content.innerHTML;
}}d.show();
}else{this.content.innerHTML=d.innerHTML;
}}else{this.content.innerHTML=d;
}if(a.close!==false){var b=new Element("a",{className:"close",href:"#",title:"Close"}).update("Close");
var f=this.contentWrap||this.content;
f.insertBefore(b,f.firstChild);
b.onclick=new Function("e","Event.fire (this, 'dialog:close'); return false;").bindAsEventListener(b);
this.dialogCloser=b;
var g=a.close;
if(typeof(g)=="string"){this._onCloseFunction=new Function("e","ref",g).bind(this);
}else{if(typeof(g)=="function"){this._onCloseFunction=g.bind(this);
}}}},_removeContent:function(){if(Prototype.Browser.FF2_DOWN){var a=(this._removeSentry==this._contentStamp);
this._removeSentry=null;
if(!a){return;
}}if(this.dialogCloser){this.dialogCloser=null;
}if(this._onCloseFunction){this._onCloseFunction=null;
}if(this.contentPlaceholder&&this.contentOriginal){if(!Prototype.Browser.IE7_DOWN&&!this.changeContent){Element.replace(this.contentPlaceholder,this.contentOriginal);
}else{if(this.changeContent){this.contentOriginal[this.contentOriginalVisible?"show":"hide"]();
}this.contentPlaceholder.parentNode.replaceChild(this.contentOriginal,this.contentPlaceholder);
}this.contentOriginal=null;
this.contentPlaceholder=null;
}this.content.innerHTML="";
}});
CX.Overlays.FixedDialog=Class.create(CX.Overlays.Base,{initialize:function(a){a=a||{};
this.active=false;
this.cssName=a.cssName||"eswd";
this.extraClassNames=(a.extraClassNames||"").strip();
var f=this.dialog=$(document.createElement("div"));
this.setInitialStyles();
var c=$(a.parent)||(CX.Overlays.isModalDialogActive()?CX.Overlays.ModalDialog.getOverlayParent():$("nonmodal"));
if(c){c.appendChild(f);
}f.update('<div class="eswd"><em class="eswd-pt"><em></em><u></u><b></b><i></i><i></i></em><div class="eswd-hold"><div class="eswd-wrap"><div class="eswd-shrink"><em class="eswd-corner eswd-tl"></em><em class="eswd-corner eswd-tr"></em><div class="eswd-vside"><div class="eswd-tshade"></div></div><div class="eswd-lshade"><div class="eswd-rshade"><div class="eswd-inner"><div class="eswd-content"></div></div></div></div><div class="eswd-vside"><div class="eswd-bshade"></div></div><em class="eswd-corner eswd-bl"></em><em class="eswd-corner eswd-br"></em></div></div></div></div>');
f.observe("dialog:close",this.close.bindAsEventListener(this));
var b=this.holder=f.down();
b=this.handle=b.down();
this.content=$(b.nextSibling.firstChild.firstChild.childNodes[3].firstChild.firstChild.firstChild);
this.hotspot=b.firstDescendant();
c=f=null;
},setInitialStyles:function(showInvisible){this.dialog.className=(this.cssName+"-pos "+this.cssName+"-floating "+this.extraClassNames);
if(this.handle){this.handle.className=(this.cssName+"-pt");
}with(this.dialog.style){visibility=(showInvisible?"hidden":"");
display=(showInvisible?"":"none");
top="0px";
left="0px";
}this.aside=null;
this.origin=null;
},setClassNames:function(b,a){this.aside=b;
this.origin=a;
if(Prototype.Browser.Opera){return;
}b=b?(this.cssName+"-"+b+"-of"):"";
a=a?(this.cssName+"-handle-"+a):"";
this.dialog.className=(this.cssName+"-pos "+b+" "+this.extraClassNames);
this.handle.className=(this.cssName+"-pt "+a);
},_prepareShim:function(a){if(this.shim||!CX.IFrameShim.is_needed()){return;
}a=a||{};
a.margin=a.margin||0;
if(Prototype.Browser.IE6_DOWN){a.margin+=(this.extraClassNames?6:8);
}this.shim=new CX.IFrameShim(this.holder,{cache:a.cache,zIndex:-1,margin:a.margin,transparent:true,caretless:a.caretless});
},open:function(c,b,a){a=a||{};
if(CX.Overlays.disabled()||!this.dialog.parentNode||this.active===c.id){return;
}if(this.active){this.close();
if(Prototype.Browser.FF2_DOWN){setTimeout(this.open.bind(this,c,b,a),1);
return;
}}this._setInitialContent(b,a);
if(Prototype.Browser.IE){this.content.appendChild(new Element("div",{className:"eswd-minwidth"}));
}if(Prototype.Browser.FF2_DOWN){this.dialog.style.overflow="";
this.holder.style.overflow="";
this.content.style.overflow="";
}this._prepareShim(a);
this.positionBy(c,a,true);
if(a.withCaption){this.dialog.className+=" eswd-with-caption";
}if(this.shim){this.shim.rebox().show();
}if(!a.caretless&&Prototype.Browser.FF2_DOWN){this.dialog.style.overflow="auto";
this.holder.style.overflow="auto";
this.content.style.overflow="auto";
}this.dialog.showBoth();
this.active=c.identify();
},positionBy:function(g,f,c){var u=f.direction,y=f.align,D=0,G=0,n=false,v="",E,F;
var a=document.viewport.getDimensions(),B=document.viewport.getScrollOffsets();
if(f.inside){E=$(f.inside);
}g=$(g);
if(!c){n=this.dialog.visible();
v=this.dialog.style.visibility;
}this.setInitialStyles(true);
var r=this.dialog.parentNode;
var A=this.dialog.offsetHeight,j=this.dialog.offsetWidth;
var z=this.dialog.cloneOffset(g,{getOffsets:true});
z.left-=B.left;
z.top-=B.top;
var x=this.dialog.offsetLeft,m=this.dialog.offsetTop;
if(u=="horizontal"){if(x+j>r.offsetWidth&&x>j){u="left";
}else{u="right";
}}else{if(!u||u=="vertical"){var d=A+15;
if(f.minimumY!==false){F=f.minimumY||($("content")||r).absoluteOffset().top;
}if(z.top+d>a.height&&z.top>d&&!(F&&F>m-d)){u="top";
}else{u="bottom";
}}}switch(u){case"bottom":G=f.bottomOffset||f.yOffset||0;
this.setClassNames("bottom","vert-west");
A=this.dialog.offsetHeight;
this.dialog.style.top=(m+g.offsetHeight+G)+"px";
break;
case"top":G=f.topOffset||f.yOffset||0;
this.setClassNames("top","vert-west");
A=this.dialog.offsetHeight;
this.dialog.style.top=(m-A-G)+"px";
break;
case"right":D=f.rightOffset||f.xOffset||0;
this.setClassNames("right","horiz-north");
this.dialog.style.left=(x+g.offsetWidth+D)+"px";
break;
default:D=f.leftOffset||f.xOffset||0;
this.setClassNames("left","horiz-south");
this.dialog.style.left=(x-j-D)+"px";
break;
}if(this.aside=="bottom"||this.aside=="top"){this.handle.style.left="";
var b=Prototype.Browser.Opera?30:(this.handle.offsetLeft+this.hotspot.offsetLeft);
var q=this.dialog.parentNode.offsetWidth;
var s=x+j-q,k;
switch(y){case"left":k=b-this.hotspot.offsetLeft;
break;
case"right":k=g.offsetWidth;
break;
case"center":default:k=Math.ceil(g.offsetWidth/2)-2;
q=0;
}if(q&&E&&s<=0){var C=E.absoluteOffset().left-this.dialog.parentNode.absoluteOffset().left;
x+=C-parseInt(E.cumulativeDecoratorWidth("margin"));
s+=q-E.offsetWidth-C;
}if(s>0){s+=2;
this.dialog.style.left=(x-s)+"px";
this.handle.style.left=(s-this.hotspot.offsetLeft+k)+"px";
if(this.aside=="top"){this.dialog.style.top=(this.dialog.offsetTop+(A-this.dialog.offsetHeight))+"px";
}}else{this.dialog.style.left=(x-b+k)+"px";
}this.handle.style.top="";
}else{this.handle.style.top="";
var s=z.top+A-a.height,k=Math.ceil(g.offsetHeight/2);
var b=Prototype.Browser.Opera?30:(this.handle.offsetTop+this.hotspot.offsetTop);
if(s>0){s+=2;
this.dialog.style.top=(m-s)+"px";
this.handle.style.top=(s-this.hotspot.offsetTop+k)+"px";
}else{this.dialog.style.top=(m-b+k)+"px";
}this.handle.style.left="";
}if(this.scrollToIfObscured!==false){this.dialog.scrollToIfObscured(0,0);
}if(!n&&!c){this.dialog.hide().style.visibility=v;
}return this;
},hide:function(){if(!this.active||this.hidden){return;
}this.hidden=true;
if(this.shim){this.shim.hide();
}this.dialog.hideVisibility();
},show:function(){if(!this.active||!this.hidden){return;
}this.dialog.showVisibility();
if(this.shim){this.shim.show();
}this.hidden=false;
},close:function(a){if(!this.active||(this._onCloseFunction&&this._onCloseFunction(this)===false)){if(a){a.stop();
}return false;
}if(a){a.stopPropagation();
}if(Prototype.Browser.FF2_DOWN){if(!this.caretless){this.dialog.style.overflow="";
this.holder.style.overflow="";
this.content.style.overflow="";
}}this.dialog.hide();
if(Prototype.Browser.FF2_DOWN){setTimeout(this._cleanup.bind(this),0);
return;
}this._cleanup();
},_cleanup:function(){if(!this.active){return;
}this._removeContent();
this.active=false;
this._afterClosed();
},_afterClosed:function(){CX.Overlays.onFixedDialogClose(this);
}});
CX.Overlays.BaseTooltip={scrollToIfObscured:false,open:function(c,b,a){if(this._ref==c||this.sticky){return;
}if(!a){a={};
}a.onclose=CX.Event.cancelation;
defaultOptions={close:false,align:"center",direction:"vertical",caretless:true,xOffset:7,yOffset:4,minimumY:false};
a=a?Object.extend(defaultOptions,a):defaultOptions;
this._ref=c;
this._base.open(c,b,a);
this.sticky=a.sticky||a.close;
this.hoverable=this.sticky||a.hoverable;
if(!this.sticky){this._refmouseout=this.onRefMouseOut.bindAsEventListener(this);
this._ref.observe("mouseout",this._refmouseout);
this.dialog.observe("mouseout",this._refmouseout);
}},onRefMouseOut:function(b){var a=(b.srcElement||b.target),c=(b.toElement||b.relatedTarget);
if(Event.isTargetDescendantOf(b,this._ref)){return;
}if(!this.hoverable||!Event.isTargetDescendantOf(b,this.dialog)){this.close();
}},_afterClosed:function(){if(!this.sticky&&this._refmouseout){if(this._ref){this._ref.stopObserving("mouseout",this._refmouseout);
}this.dialog.stopObserving("mouseout",this._refmouseout);
this._refmouseout=null;
}this.sticky=false;
this._ref=null;
}};
CX.Overlays.openTooltip=function(c,b,a){if(this.disabled()){return;
}if(CX.isModalDialogActive()){CX.Overlays.ModalOverlayTooltip.open(c,b,a);
}else{CX.Overlays.MainTooltip.open(c,b,a);
}};
CX.Overlays.closeTooltip=function(c,b,a){if(CX.isModalDialogActive()){CX.Overlays.ModalOverlayTooltip.close();
}else{CX.Overlays.MainTooltip.close();
}};
CX.Overlays.toggleTooltip=function(a,d,c,b){if(this.disabled()){return;
}CX.Overlays.closeTooltip();
if(!a){return;
}if(!b){b={};
}b.sticky=true;
CX.Overlays.openTooltip(d,c,b);
};
CX.Overlays._initMainTooltip=function(){CX.Overlays.MainTooltip=new CX.Overlays.FixedDialog({extraClassNames:"etip",parent:"inner"});
Object.extend(CX.Overlays.MainTooltip,CX.Overlays.BaseTooltip);
CX.Overlays.MainTooltip._base={open:CX.Overlays.FixedDialog.prototype.open.bind(CX.Overlays.MainTooltip)};
CX.Overlays.MainTooltip._prepareShim({cache:true});
};
CX.Overlays._initModalOverlayTooltip=function(){CX.Overlays.ModalOverlayTooltip=new CX.Overlays.FixedDialog({extraClassNames:"etip etip-mdlg",parent:CX.Overlays.ModalDialog.getOverlayParent()});
Object.extend(CX.Overlays.ModalOverlayTooltip,CX.Overlays.BaseTooltip);
CX.Overlays.ModalOverlayTooltip._base={open:CX.Overlays.FixedDialog.prototype.open.bind(CX.Overlays.ModalOverlayTooltip)};
CX.Overlays.ModalOverlayTooltip._prepareShim({cache:true});
};
CX.Overlays.ModalDialog=new CX.Overlays.Base();
Object.extend(CX.Overlays.ModalDialog,{initialize:function(){this.lockBodyScroll=!!Prototype.Browser.IE6_DOWN;
this.parent=$("modal");
this.origFocus=null;
this.overlayWrap=$("movr_wrap");
this.overlayToShim=Prototype.Browser.IE?this.overlayWrap:$("movr_decorator");
this.widthOverlay=Prototype.Browser.IE?$("mdlg_scroll"):$("movr_scroll");
if(Prototype.Browser.Opera){this.overlayWrap.update(this.widthOverlay.innerHTML);
this.widthOverlay=$("movr").addClassName("movr_width");
}this.dialogWrap=$("mdlg_wrap");
this.dialog=$("mdlg");
this.contentWrap=$("mdlg_content");
this.body=$("xbody");
this.html=$(document.documentElement);
this.active=(this.html.className==="modal");
this.html.tabIndex=-1;
this.dialog.tabIndex=0;
this.body.tabIndex=-1;
this._onfocus=this.onSomeFocus.bindAsEventListener(this);
this._onmodalfocus=this.onDialogFocus.bindAsEventListener(this);
if(!Prototype.Browser.WebKit){this.dialogFocuser=this.dialog;
}else{this.dialog.insertBefore(this.dialogFocuser=new Element("a",{href:"#",className:"mdlg_focuser"}),this.dialog.firstChild);
}this.parent.observe("dialog:close",this.close.bindAsEventListener(this));
this.dialog.observe("dialog:dim",this.dim.bindAsEventListener(this));
this.dialog.observe("dialog:undim",this.undim.bindAsEventListener(this));
this.active=this.showing=false;
},dim:function(){this.dialog.dim({cssNames:"waiting-dark"});
},undim:function(){this.dialog.undim();
},getOverlayParent:function(){return this.overlayWrap;
},onDialogFocus:function(a){a.stopPropagation();
},onSomeFocus:function(a){if(!this.active){return;
}var b=a.target||a.srcElement;
if(b.style.zIndex.length>6&&b.style.zIndex>"100000"&&(!Event.isSourceDescendantOf(a,this.dialog,true))){Event.stop(a);
this.focus();
return false;
}},focus:function(a){try{if(this.content&&!this.caretless){var b=this.content.down("form");
if(b){try{b.focusFirstElement();
return;
}catch(c){}}}this.dialogFocuser.focus();
if(Prototype.Browser.Opera){CX.clearSelection();
}}finally{if(a&&this.lockBodyScroll){this.body.scrollTop=this.origScroll.top;
this.body.scrollLeft=this.origScroll.left;
}}},_prepareShim:function(){if(this.shim||!CX.IFrameShim.is_needed()){return;
}this.shim=new CX.IFrameShim(this.overlayToShim,{cache_once:true,transparent:true,zIndex:5000,caretless:true});
},_firefox2_invisibleCaretFix:function(){if(!Prototype.Browser.FF2_DOWN){return;
}this.parent.showInvisible();
this.overlayToShim.style.overflow="auto";
this.dialog.style.overflow="auto";
},_firefox2_delayedShow:function(){if(!Prototype.Browser.FF2_DOWN){return;
}this.dialog.hide();
this.parent.showBoth();
window.setTimeout(function(){this.dialog.show();
this.focus(true);
}.bind(this),20);
},_captureFocus:function(){this.parent.observe("focus",this._onmodalfocus);
this.html.observe("focus",this._onfocus);
if(Prototype.Browser.IE){this.html.observe("focusin",this._onfocus);
}if(Prototype.Browser.WebKit){this.html.addEventListener("DOMFocusIn",this._onfocus);
}},gainFocus:function(){this._captureFocus();
this.focus(true);
},_releaseFocus:function(){this.parent.stopObserving("focus",this._onmodalfocus);
this.html.stopObserving("focus",this._onfocus);
if(Prototype.Browser.IE){this.html.stopObserving("focusin",this._onfocus);
}if(Prototype.Browser.WebKit){this.html.removeEventListener("DOMFocusIn",this._onfocus);
}},restoreFocus:function(){this._releaseFocus();
var c=this.origFocus||this.body;
this.origFocus=null;
if(Prototype.Browser.IE6_DOWN){return;
}try{if(c!=this.body||!Prototype.Browser.Opera){c.focus();
}}catch(a){if(window.activeElement){try{window.activeElement.blur();
}catch(b){}}}},show:function(){if(this.viewing){return;
}if(!this.active){this.dialog.style.overflow="";
this.widthOverlay.style.width="";
this.dialogWrap.style.width="";
this.parent.hideVisibility().style.display="block";
var a=this.content.offsetWidth+24;
if(a>150){if(Prototype.Browser.IE7_DOWN){this.widthOverlay.style.width=(a+21)+"px";
this.dialogWrap.style.width=a+"px";
}else{this.widthOverlay.style.width=a+"px";
}}if(Prototype.Browser.IE7_DOWN){this.body.addClassName("obscuring");
}else{this._prepareShim();
if(this.shim){this.shim.fullscreen();
}}}this.parent.showBoth();
this.html.className="modal";
},open:function(c,b,a){if(this.active&&!(a&&a.force)){return;
}try{this.contentWrap.update('<div id="modal_dialog_message"></div><div style="clear: both; overflow: hidden; height: 0;"></div>');
this.content=this.contentWrap.down();
if(!this.active){this.origFocus=window.activeElement;
this.origScroll=document.viewport.getScrollOffsets();
}a=a||{};
this._setInitialContent(b,a);
this.active=false;
this.show();
if(Prototype.Browser.IE6_DOWN){document.documentElement.scrollTop=0;
}this.gainFocus();
this.active=true;
}catch(d){alert(d);
}},close:function(a){if(!this.active||(this._onCloseFunction&&this._onCloseFunction(this)===false)){if(a){a.stop();
}return false;
}if(a){a.stopPropagation();
}this.html.className="";
this.restoreFocus();
if(this.lockBodyScroll){window.scrollTo(this.origScroll.left,this.origScroll.top);
}this.undim();
if(Prototype.Browser.IE7_DOWN){this.body.removeClassName("obscuring");
this.body.scrollTop=this.body.scrollLeft=0;
}else{if(this.shim){this.shim.disable();
}}if(Prototype.Browser.FF2_DOWN){setTimeout(this._cleanup.bind(this),0);
return;
}this._cleanup();
},_cleanup:function(){this._removeContent();
this.dialog.style.overflow="";
this.widthOverlay.style.width="";
this.dialogWrap.style.width="";
this.active=false;
}});
(function(){var a=false;
try{a=(window.parent&&window.parent.CX&&window.parent.CX.modalDialog);
}catch(b){}if(a){Object.extend(CX,{modalDialog:window.parent.CX.modalDialog,tooltip:window.parent.CX.openTooltip,closeTooltip:window.parent.CX.closeTooltip,toggleTooltip:window.parent.CX.toggleTooltip,isModalDialogActive:window.parent.CX.isModalDialogActive,closeDialog:window.parent.CX.closeDialog.bind(window.parent.CX.closeDialog,window.frameElement),closeModalDialog:window.parent.CX.closeModalDialog.bind(window.parent.CX.closeModalDialog,window.frameElement)});
}else{document.observe("dom:loaded",function(){CX.Overlays._initMainTooltip();
try{CX.Overlays.ModalDialog.initialize();
CX.Overlays._initModalOverlayTooltip();
}catch(c){}CX.Overlays.enable();
});
Object.extend(CX,{modalDialog:CX.Overlays.openModalDialog.bind(CX.Overlays),closeModalDialog:CX.Overlays.ModalDialog.close.bind(CX.Overlays.ModalDialog),getModalOverlayParent:CX.Overlays.getModalOverlayParent.bind(CX.Overlays),tooltip:CX.Overlays.openTooltip.bind(CX.Overlays),closeTooltip:CX.Overlays.closeTooltip.bind(CX.Overlays),toggleTooltip:CX.Overlays.toggleTooltip.bind(CX.Overlays),isModalDialogActive:CX.Overlays.isModalDialogActive.bind(CX.Overlays),closeDialog:CX.Overlays.closeDialog.bind(CX.Overlays)});
}CX.fixedDialog=CX.Overlays.openFixedDialog.bind(CX.Overlays);
CX.Overlays.closeModalDialog=CX.Overlays.ModalDialog.close.bind(CX.Overlays.ModalDialog);
})();
Object.extend(CX.Overlays,(function(){var m=Prototype.Browser;
var b,r,k,q,f,o,g;
var j=null,q;
var n=(m.FF2_MAC||m.FF3||m.WebKit)?"dim":"dim scroll-lock";
var c={};
function p(){alert($A([$("main"),b,document.body,document.documentElement]).collect(function(u){return[u.inspect(),u.offsetTop,u.scrollTop,u.offsetHeight,u.scrollHeight].toString();
}).toString());
}function d(){try{b=$("xbody");
r=document.documentElement;
k=document.body;
q=$("dimscreen")||new Element("div",{id:"dimscreen"});
r.onfocus=r.onfocusin=s;
r.onblur=r.onfocusout=a;
if(m.WebKit||m.OPERA_9_5_UP){r.addEventListener("DOMFocusIn",s);
r.addEventListener("DOMFocusOut",a);
}r.onkeypress=l;
r.tabIndex=-1;
k.tabIndex=-1;
k.appendChild(q);
if(m.WebKit||m.OPERA_9_5_UP){q.appendChild(f=new Element("a",{href:"#",style:"display: block; width: 1px; height: 1px; position: absolute; background: none; opacity: 0;"}));
}else{f=q;
}}finally{Event.observe(window,"onunload",h);
}}function h(){c=b=r=k=q=f=o=null;
r.onfocus=r.onfocusin=null;
r.onblur=r.onfocusout=null;
r.onkeypress=null;
}function s(v){v=v||window.event||event;
var u=v.target||v.srcElement;
if(!j){o=u;
}else{if(u!==j&&!Element.descendantOf(u,j)){f.focus();
return false;
}}}function a(){if(!j){o=k;
}}function l(v){v=v||window.event;
var u=v.which||v.keyCode;
if(!j){return;
}if(u!=Event.KEY_ESC){return true;
}v.preventDefault&&v.preventDefault();
v.returnValue=false;
if(j===q){CX.Overlays.undimScreen();
}return false;
}document.observe("dom:loaded",d);
return{dimElement:function(v,u){var x,y;
u=u||{};
if(v){v=$(v);
x=new Element("div",{className:"dimmer "+(u.cssNames||""),style:"display: none;"});
v.makePositioned().appendChild(x);
var w=v.getDimensions();
x.setStyle({width:w.width+"px",height:w.height+"px"});
v._dimmer=x.identify();
v.addClassName("obscuring");
}else{x=q;
x.className=u.cssNames||"big-waiting-dark";
}if(u.shim!==false&&CX.IFrameShim.is_needed(v?"dimElement":"dimScreen")){y=new CX.IFrameShim(x,{transparent:true,caretless:true});
c[x.id]=y;
y[v?"enable":"fullscreen"]();
}alpha=u.duration?(u.startAlpha||0.01):(u.alpha||0.8);
if(u.style){x.setStyle(u.style);
}x.setOpacity(alpha);
x.showBoth();
if(u.duration){x._effect=new Effect.Appear(x,{from:alpha,to:u.alpha||0.8,duration:u.duration});
}},dimScreen:function(u){if(j===q){return;
}u=u||{};
g=document.viewport.getScrollOffsets();
j=m.FF3_DOWN?q.hide():q.showInvisible();
r.className=(u.lockScrollBars===false?"dim":n);
b.scrollTop=g.top;
if(m.FF2_MAC||m.FF3||u.lockScrollBars===false){g=null;
}this.dimElement(null,u.duration===0?{}:{duration:0.8});
},undimElement:function(v,u){var x,w;
u=u||{};
v=$(v);
if(v){x=$(v._dimmer);
w=this.undimElementNow.bind(this,v);
}else{x=q;
w=this.undimScreenNow.bind(this);
}if(x){if(x._effect){x._effect.cancel();
}x.style.backgroundImage="none";
if(u.duration){x.fade({to:u.startAlpha||0.01,duration:u.duration,afterFinish:w});
return;
}}w();
},undimElementNow:function(v,u){var x,y;
if(v){v=$(v);
if(v._dimmer&&(x=$(v._dimmer))){x.remove();
}v._dimmer=null;
v.removeClassName("obscuring");
v.undoPositioned();
}else{(x=q).style.backgroundImage="";
}if(x&&(y=c[x.id])){y.destroy();
try{delete c[x.id];
}catch(w){c[x.id]=null;
}}},undimScreen:function(u){u=u||{};
if(u.duration===0){this.undimScreenNow();
}else{this.undimElement(null,{duration:0.6});
}},undimScreenNow:function(u){u=u||{};
r.className="";
this.undimElementNow();
j=null;
if(o){try{o.focus();
}catch(v){}}if(g){if(!m.WebKit){document.documentElement.scrollTop=g.top;
}document.body.scrollTop=g.top;
}}};
})());
Element.addMethods({dim:CX.Overlays.dimElement.bind(CX.Overlays),undim:CX.Overlays.undimElement.bind(CX.Overlays),undimNow:CX.Overlays.undimElementNow.bind(CX.Overlays)});
Object.extend(CX,{dimScreen:CX.Overlays.dimScreen.bind(CX.Overlays),undimScreen:CX.Overlays.undimScreen.bind(CX.Overlays),undimScreenNow:CX.Overlays.undimScreenNow.bind(CX.Overlays)});
CX.Forms=(function(){var a={};
return{autoScaleElements:function(n,c,v){var r;
try{r=HTMLtoDOM(n);
}catch(m){}if(!r){return;
}var o=1*c,u=Math.ceil(o*0.84667),l=[];
for(var g=0;
g<v.length;
g++){var b=r.getElementsByTagName(v[g]);
for(var f=0;
f<b.length;
f++){var d=b[f],q,k,p=[],s=[];
if(d.parentNode.nodeName.toUpperCase()!="OBJECT"){l.push(d);
}q=parseInt(Element.readObjectParam(d,"width",p)||0);
if(q&&q<=c){continue;
}q=q||c;
k=parseInt(Element.readObjectParam(d,"height",s)||0)||u;
k=Math.round(o/q*k)+"";
Element.writeAttribute(d,"width",c);
Element.writeAttribute(d,"height",k);
if(p.length){Element.writeAttribute(p[0],"value",c);
}if(s.length){Element.writeAttribute(s[0],"value",k);
}}}return l;
},focusOnField:function(b){b=$(b);
if(!b){return;
}try{if(b.type=="hidden"){b.up().scrollToIfObscured({vcenter:true});
}else{b.scrollToIfObscured({vcenter:true});
b.focus();
}}catch(c){}},markCheckBoxSelected:function(b){b=$(b);
if(!b){return;
}if(b.match("li")){b=b.down("input[type='checkbox']");
b.checked=!b.checked;
}else{if(!b.match("input[type='checkbox']")){return;
}}b.up("li")[b.checked?"addClassName":"removeClassName"]("selected-checkbox");
},eachSelectOption:function(b,d){for(var c=0;
c<b.options.length;
c++){if(d(b.options[c],c)){break;
}}},limitTextField:function(f,d,c,g){g=g||f.value;
c=c||parseInt(f.getAttribute("maxlength"))||255;
var b=g.length;
if(b>=c){d.addClassName("txt-limit-reached").update("0 characters left.");
if(b>c){f.value=g.substr(0,c);
return false;
}}else{d.removeClassName("txt-limit-reached").update((c-b)+" characters left.");
}return true;
},enforceTextFieldLimits:function(d,b,c){d=$(d);
if(c){c=$(c);
}else{c=d.next(".txt-limit");
}(function(k,h,j){var g=function(){CX.Forms.limitTextField(k,j,h,$F(k));
};
k.observe("change",g);
k.observe("keyup",g);
})(d,b,c);
d=c=b=null;
},splitFieldName:function(c){var b=c.indexOf("[");
if(b<=0){return null;
}var d=c.indexOf("]",b);
if(d<=0){return null;
}return[c.substring(0,b),c.substring(b+1,d)];
},openEditGroup:function(c){var b=a[c];
if(b){alert("Please finish what you are currently editing before trying to edit this item.");
return;
}a[c]=true;
},isEditGroupOpen:function(b){return(a[b]==true);
},closeEditGroup:function(c){var b=a[c];
if(b){delete a[c];
}},disableElement:function(b){b=$(b);
b.lf_touched=true;
if(b.hasClassName("btn")){b.className+=" btn_disabled";
}else{if(b.hasClassName("go")){b.className+=" go_disabled";
}}b.lfold_disabled=b.disabled;
b.disabled=(b.nodeName!="BUTTON");
b.lfold_onclick=b.onclick;
b.onclick=CX.falseFunction;
b.lfold_onmousedown=b.onmousedown;
b.onmousedown=CX.falseFunction;
if(b.nodeName=="INPUT"&&b.type=="image"){b.lfold_alt=b.alt;
b.alt="";
}b.lfold_title=b.title;
b.title="";
},enableElement:function(b){b=$(b);
b.removeClassName("btn_disabled");
b.removeClassName("go_disabled");
b.disabled=b.lfold_disabled||false;
if(b.lf_touched){b.onclick=b.lfold_onclick||null;
b.onmousedown=b.lfold_onmousedown||null;
b.lfold_onclick=b.lfold_onmousedown=null;
b.alt=b.lfold_alt;
b.title=b.lfold_title;
}b.lf_touched=false;
},lock:function(h){if(arguments.length>1){for(var g=0;
g<arguments.length;
g++){this.lock(arguments[g]);
}return;
}if(!(h=$(h))){return false;
}var b=[h.getElementsByTagName("A")];
if(h.elements){b.push(h.elements);
}else{b.push(h.getElementsByTagName("INPUT"));
b.push(h.getElementsByTagName("BUTTON"));
b.push(h.getElementsByTagName("SELECT"));
b.push(h.getElementsByTagName("TEXTAREA"));
}for(var d=0;
d<b.length;
d++){for(var g=0,k;
g<b[d].length;
g++){this.disableElement(b[d][g]);
}}h.addClassName("locked-form");
h.lfold_onsubmit=h.onsubmit;
h.onsubmit=CX.falseFunction;
try{return false;
}finally{b=null;
}},unlock:function(h){if(arguments.length>1){for(var g=0;
g<arguments.length;
g++){this.unlock(arguments[g]);
}return;
}if(!(h=$(h))){return false;
}var b=[h.getElementsByTagName("A")];
if(h.elements){b.push(h.elements);
}else{b.push(h.getElementsByTagName("INPUT"));
b.push(h.getElementsByTagName("BUTTON"));
}for(var d=0;
d<b.length;
d++){for(var g=0,k;
g<b[d].length;
g++){this.enableElement(b[d][g]);
}}h.removeClassName("locked-form");
h.onsubmit=h.lfold_onsubmit;
h.lfold_onsubmit=null;
try{return false;
}finally{b=null;
}}};
})();
CX.MultipleForms=Class.create({initialize:function(c,d,a){this.element=$(c);
this.template=d;
this.count=a.count||0;
this.limit=a.limit;
this.nameDeleteIds=a.nameDeleteIds||this.element.id.replace(/_form[s]?$/,"_delete_ids[]");
this.formIdPrefix=a.formIdPrefix||this.element.id.replace(/_form[s]?$/,"_");
var f=a.controlsAdd;
if(f){if(typeof(f)=="string"||f.innerHTML){f=[f];
}for(var b=0;
b<f.length;
b++){f[b]=$(f[b]);
}this.controlsAdd=$A(f);
}},addForm:function(){if(this.limit&&this.count>this.limit){return;
}var a="new"+this.count,b;
this.element.insert(this.template.evaluate({key:a}));
$(this.formIdPrefix+a).scrollToIfObscured();
this.count++;
if(this.limit&&this.count>=this.limit){this.controlsAdd.each(Element.hide);
}},deleteForm:function(a){if(this.count>0){this.count--;
}var b=$F(a+"_id");
if(b&&b.length>0){this.element.appendChild(new Element("input",{type:"hidden",name:this.nameDeleteIds,value:b}));
}$(a).remove();
this.controlsAdd.each(Element.show);
}});
CX.Forms.TimeZoneDetector=(function(){var a,d=CX.Forms;
function f(){a=a||{};
var h=new Date(),p=h.getFullYear();
var g=new Date(p,0,1,0,0,0,0);
var k=new Date(p,6,1,0,0,0,0);
var q=g.toGMTString(),l=k.toGMTString();
q=new Date(q.substring(0,q.lastIndexOf(" ")-1));
l=new Date(l.substring(0,l.lastIndexOf(" ")-1));
var m=(g-q)/1000,j=(k-l)/1000;
var o=(m!=j),n=(m>j);
a={dst:o,hemisphere:n?"southern":"northern",utcOffset:n?j:m};
a.hourMinute=c(a.utcOffset);
}function c(k){var j=k/60,h=j/60;
j%=60;
var g=(h==0?(h<0?"-":"+"):"");
return g+h.abs().toPaddedString(2)+":"+j.toPaddedString(2);
}function b(k){var n=CX.TimeZones.byOffset[a.utcOffset.toString()];
if(!n||!n.length){return;
}var l,m,g,h={};
n.each(function(o){t=CX.TimeZones.all[o];
h[t.humanized]=t;
});
function j(q,p){if(h[q.text]&&!h[q.text]._uiOrder){h[q.text]._uiOrder=p;
}}if(k){if(k.type=="hidden"){if(g=k.readAttribute("priority_zones")){g.each(j);
}}else{d.eachSelectOption(k,j);
}}if(n.length==1){return CX.TimeZones.all[n[0]];
}n.each(function(p){var o=CX.TimeZones.all[p];
if(a.hemisphere===o.hemisphere){if(!l||l._uiOrder>o._uiOrder){l=o;
}}else{if(a.dst===o.dst){if(!m||m._uiOrder>o._uiOrder){m=o;
}}}});
return l||m;
}return{extend:function(g){g=$(g);
if(!a){f();
}var h=b(g);
if(!h){return;
}if(g.type=="hidden"){g.value=h.name;
}else{g.options.selectedIndex=h._uiOrder;
}}};
})();
CX.Forms.ColorPickerInput=(function(){function a(b){var c=(this.value=this.value.trim());
if(!c.match(/^[A-Fa-f0-9]{1,6}$/)){return;
}$(this.previewId).style.backgroundColor="#"+this.value;
if(this.onpicked){this.onpicked();
}}return{extend:function(b,d,g,c){b=$(b);
c=c||{};
if(!b._colorPickerInputExtended){Object.extend(b,this.Methods)._colorPickerInputExtended=Prototype.emptyFunction;
}b.pickerId=(typeof(d)=="string"?d:d.identify());
b.previewId=(typeof(g)=="string"?g:g.identify());
var f=c.defaultHex||b.readAttribute("defaultHex");
if(f){CX.Forms.VirtualDefaults.extend(b,{defaultValue:f.toString()});
}b.onpicked=c.onpicked||null;
b.observe("blur",a);
},Methods:{onPickerClose:function(){window[this.pickerId].hide();
if(this.virtualDefaults){this.enableVirtualDefaults();
}this.focus();
if(this.onpicked){this.onpicked();
}},onPickerOpen:function(){if(this.virtualDefaults){this.disableVirtualDefaults();
}var b=window[this.pickerId];
b.syncColor(this,$(this.previewId));
b.show();
}}};
})();
CX.Forms.VirtualDefaults=(function(){function c(h){for(var d=0;
d<this.virtualDefaults.length;
d++){var g=$(this.virtualDefaults[d]);
if(g.value==g.virtualDefaultValue){g.value="";
}}return true;
}function b(d){this.removeClassName("virtual-default");
this.title=this.nonVirtualDefaultTitle;
if(!this.value||this.value==this.virtualDefaultValue){this.select();
}}function a(d){this.detectDefaultValue();
}return{Methods:{disableVirtualDefaults:function(){this.virtualDefaultOn=false;
this.removeClassName("virtual-default");
this.title=this.nonVirtualDefaultTitle||"";
return this;
},enableVirtualDefaults:function(){this.virtualDefaultOn=true;
this.detectDefaultValue();
return this;
},detectDefaultValue:function(){if(!this.virtualDefaultOn){return true;
}if(this.value&&this.value!=this.virtualDefaultValue){return false;
}this.value=this.virtualDefaultValue;
this.addClassName("virtual-default");
this.title=this.virtualDefaultTitle;
return true;
},setAutoDetect:function(d){if(d){this.observe("focus",b);
this.observe("blur",a);
}else{this.stopObserving("focus",b);
this.stopObserving("blur",a);
}}},extend:function(d,f){d=$(d);
f=f||{};
if(!d.id){throw"INPUT must have an ID attribute";
}d.virtualDefaultValue=(f.defaultValue||d.defaultValue||"").toString();
d.virtualDefaultTitle=(d.title||"").toString();
d.nonVirtualDefaultTitle=(f.nonDefaultTitle||"").toString();
d.virtualDefaultOn=true;
if(!d._virtualDefaultsExtended){Object.extend(d,this.Methods)._virtualDefaultsExtended=Prototype.emptyFunction;
}if(!f.noAutoDetect){d.setAutoDetect(true);
}if(!d.form.virtualDefaults){d.form.virtualDefaults=[];
Event.observe(d.form,"submit",c);
}d.form.virtualDefaults.push(d.id);
d.virtualDefaults=true;
}};
})();
CX.Effect={};
CX.Effect.SlideRight=function(b){b=$(b);
var a=b.getDimensions(),c=b.style.width;
return new Effect.Scale(b,100,Object.extend({scaleContent:false,scaleY:false,scaleMode:{originalHeight:a.height,originalWidth:a.width},scaleFrom:0,restoreAfterFinish:false,afterSetupInternal:function(d){d.element.makeClipping().setStyle({width:"0px"}).show();
},afterFinishInternal:function(d){d.element.undoClipping().setStyle({width:c});
}},arguments[1]||{}));
};
CX.Effect.WipeLeft=function(b){b=$(b);
var a=b.getDimensions();
return new Effect.Scale(b,0,Object.extend({scaleContent:false,scaleY:false,scaleMode:{originalHeight:a.height,originalWidth:a.width},restoreAfterFinish:true,afterSetupInternal:function(c){c.element.makeClipping().show();
},afterFinishInternal:function(c){c.element.undoClipping().hide();
}},arguments[1]||{}));
};
Element.addMethods({slideRight:function(b,a){b=$(b);
CX.Effect.SlideRight(b,a);
return b;
},wipeLeft:function(b,a){b=$(b);
CX.Effect.WipeLeft(b,a);
return b;
}});
CX.DragDrop={starteffect:function(a){a.addClassName("dragging");
if(window.opera){a.style.border=a.getStyle("outline");
a.style.outline="none";
}Draggable._dragging[a]=true;
CX.Overlays.disable();
},endeffect:function(a){Draggable._dragging[a]=false;
a.removeClassName("dragging");
if(window.opera){a.style.outline="";
a.style.border="";
}CX.Overlays.enable();
}};
Event.onEachReady(function(){var j=document.getElementsByTagName("span"),k,f,d,l,g,h=0;
while(h<j.length){k=j[h];
if(k.className.indexOf("emailCloak")<0){h++;
continue;
}f=document.createElement("a");
d=k.firstChild;
l=k.getAttribute("for");
g=(l||d.nodeValue).split("(at)").join("@");
f.href="mailto:"+g;
f.className=k.className.replace("emailCloak","");
k.parentNode.replaceChild(f,k);
f.appendChild(document.createTextNode(l?d.nodeValue:g));
}try{return;
}finally{j=f=d=l=g=null;
}});
if(CX.IFrameShim.is_needed("navmain")){(function(){function a(c){if(CX.Overlays.disabled()){return;
}this.className+=" hover";
if(c){c.enable();
}}function b(c){if(CX.Overlays.disabled()){return;
}this.className=this.className.replace(" hover","");
if(c){c.disable();
}}Event.onReady(function(){var f=$("navmain");
if(!f){return;
}var d,c;
for(d=f.firstChild;
d;
d=d.nextSibling){if(!d.nodeName||d.nodeName.toUpperCase()!="UL"){continue;
}for(c=d.firstChild;
c;
c=c.nextSibling){if(!c.nodeName||c.nodeName.toUpperCase()!="LI"){continue;
}var h=c.getElementsByTagName("div").item(0),g=null;
if(h){g=new CX.IFrameShim(h,{cache:true,caretless:true,transparent:true});
}else{if(!Prototype.Browser.IE6_DOWN||c.className.indexOf("active")>=0){continue;
}}if(Prototype.Browser.IE6_DOWN){Element.observe(c,"mouseenter",a.bind(c,g));
Element.observe(c,"mouseleave",b.bind(c,g));
}else{if(CX.IFrameShim.is_needed("navmain")){Element.observe(c,"mouseenter",g.enableForOverlay.bind(g));
Element.observe(c,"mouseleave",g.disableForOverlay.bind(g));
}}h=g=null;
}}d=c=null;
});
})();
}if(Prototype.Browser.IE7_DOWN){(function(){function a(d){if(!this.disabled&&this.className.indexOf("disabled")<0){this.className=this.className+" "+d;
}}function c(d){this.className=(" "+this.className+" ").replace(" "+d+" "," ").strip();
}function b(){if(!this.form){return;
}if(this.disabled||this.className.indexOf("disabled")>=0){return false;
}var f=this.ownerDocument.getElementById("ieButtonClicked");
if(f){f.parentNode.removeChild(f);
}else{f=this.ownerDocument.createElement("input");
f.setAttribute("type","hidden");
f.setAttribute("id","ieButtonClicked");
}f.setAttribute("name",this.origName);
var d=this.outerHTML.match(/value\s*=\s*['"]([^'"]*)['"]/);
f.setAttribute("value",d?d[1]:this.innerText);
this.form.appendChild(f);
f=null;
}if(Prototype.Browser.IE6_DOWN){CX._on_ie6hover=function(g,f,h){var d=f?f+"_hover":"hover";
h=h||g;
Element.observe(g,"mouseenter",a.bind(h,d));
Element.observe(g,"mouseleave",c.bind(h,d));
g=h=null;
};
}else{CX._on_ie6hover=Prototype.emptyFunction;
}CX._on_ieactive=function(g,f){var d=f+"_active",h=c.bind(g,d);
Element.observe(g,"mousedown",a.bind(g,d));
Element.observe(g,"mouseup",h);
Element.observe(g,"mouseleave",h);
g=h=null;
};
CX._on_button=function(d){d.origName=d.name;
Element.writeAttribute(d,"name",null);
Element.observe(d,"click",b.bind(d));
d=null;
};
})();
Event.onEachReady(function(g){var a=(g||document.body).getElementsByTagName("button");
if(!a||!a.length){return;
}for(var d=0;
d<a.length;
d++){var f=a[d];
if(f.ie_workarounds){continue;
}var c=f.className,b;
if((b=c.indexOf(" "))>=0){c=c.substring(0,b);
}if(c=="go"||c=="btn"){CX._on_ieactive(f,c);
if(Prototype.Browser.IE6_DOWN){CX._on_ie6hover(f,c);
}}if(f.type=="submit"){CX._on_button(f);
}f.ie_workarounds=true;
}a=f=null;
});
}else{CX._on_ie6hover=CX._on_ieactive=CX._on_button=Prototype.emptyFunction;
}CX.toggleFeedbackForm=function(){if(document.getElementById("feedback_form")&&div.isModalDialogActive()){CX.closeModalDialog();
}else{CX.modalDialog($("feedback_toggle"),{frame:true,options:{titlebar:"Feedback Form",width:550,height:575},url:CX.url_root()+"/main/feedback?"+$H({"feedback[url]":document.location.pathname}).toQueryString()});
}};
CX.showTopSignup=function(){var a=$("top_signup");
window.scrollTo(0,0);
if(!a.visible()){a.blindDown({duration:0.4});
}$("tsgroup_source").value="header";
};
CX.hideTopSignup=function(){var a=$("top_signup");
if(a.parentNode.id!="topnav"){$("topnav").appendChild(a);
}if(a.visible()){a.blindUp({duration:0.5});
}};
CX.loadTopSignup=function(){var a=$("top_signup");
if(a){CX.showTopSignup();
}else{new Ajax.Updater("topnav","/signup/new",{evalScripts:true,insertion:Insertion.Bottom,onComplete:CX.showTopSignup});
}};
CX.toggleTopSignup=function(){var a=$("top_signup");
if(a){if(a.visible()){CX.hideTopSignup();
}else{CX.showTopSignup();
}}else{CX.loadTopSignup();
}};
CX.displaySignupAvailability=function(a){result=a.responseText;
if(result=="true"){Element.show("tsgroup_subdomain_available");
Element.hide("tsgroup_subdomain_notavailable");
}else{Element.hide("tsgroup_subdomain_available");
Element.show("tsgroup_subdomain_notavailable");
}};
CX.registerAjaxAds=function(a){Ajax.Responders.register({onCreate:function(b,d){try{if(b.container&&!b.url.include("ajaxads=")){b.url+=(b.url.include("?")?"&":"?")+"ajaxads="+a;
}}catch(c){}},onComplete:function(f,b){try{var d=b.getHeader("X-AjaxAds");
if(d){var c=$("x"+a+"Advert");
d=d.evalJSON();
c.update(d.stripScripts());
d.evalScripts();
}if(window._gatCX){window._gatCX();
}}catch(g){}}});
};
var Spinner={right:function(c,a,b){a=$(a);
Spinner.at(c,a,$(a).getWidth()+(b||4));
},left:function(c,a,b){Spinner.at(c,a,b||-14);
},bottom:function(c,a,b){a=$(a);
Spinner.at(c,a,(a.getWidth()/2)-14,a.getHeight()+4);
},at:function(d,c,b,a){d.setStyle({position:"absolute"});
document.body.appendChild(d);
a=a||($(c).getHeight()-10)/2;
b=b||0;
d.cloneOffset(c,{offsetTop:a,offsetLeft:b});
}};
function createLoading(){var a=$(document.createElement("img"));
a.src="/images/loading.gif";
a.setStyle({borderWidth:"0px;",zIndex:"20000"});
a.align="absmiddle";
a.hspace="2";
a.border="0";
return a;
}Ajax.Responders.register({onException:function(a){return this.onComplete(a);
},onCreate:function(c){var f;
if(!c.options||!(f=c.options.spinner)){return false;
}var d=f.target;
var a=f.pulse;
if(!d&&!a){return false;
}if(d){if(typeof(d)=="function"){d=d(c);
}d=$(d);
var g=createLoading();
if(g.style&&f.style){g.setStyle(f.style);
}g.hide();
Spinner[f.position||"at"](g,d,f.offset);
g.show();
d=g;
}if(a){if(typeof(a)=="function"){a=a(c);
}a=$(a);
fromTo=[f.pulseFrom||{backgroundColor:"#c0e0ff"},f.pulseTo||{backgroundColor:"#f0c0d0"},1];
pulsing={style:{},target:a,fromTo:fromTo,options:{duration:0.2}};
for(var b in fromTo[0]){pulsing.style[b]=a.style[b];
}for(var b in fromTo[1]){pulsing.style[b]=a.style[b];
}a=pulsing;
pulsing.options.afterFinish=function(){if(!pulsing.options){return;
}pulsing.options.style=fromTo[fromTo[2]=(fromTo[2]+1)%2];
pulsing.effect=new Effect.Morph(pulsing.target,pulsing.options);
};
pulsing.options.afterFinish();
pulsing.options.duration=1.15;
}c.spinner={loading:d,pulsing:a};
},onComplete:function(b){var a=b.spinner;
if(!a){return false;
}if(a.loading){a.loading.remove();
}var c=a.pulsing;
if(!c){return false;
}c.options=null;
c.effect.cancel();
c.target.setStyle(c.style);
}});
function generateMovieTags(c,b,a){return'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+b+'" height="'+a+'" id="viddler">\n\t<param name="movie" value="http://www.viddler.com/player/'+c+'/"/>\n\t<param name="allowScriptAccess" value="never" />\n\t<param name="autoPlay" value="true" />\n\t<param name="allowFullScreen" value="true" />\n\t<embed src="http://www.viddler.com/player/'+c+'/" width="'+b+'" height="'+a+'" type="application/x-shockwave-flash" allowScriptAccess="never" allowFullScreen="true" autoPlay="true" name="viddler" ></embed>\n</object>\n';
}function _showtip(a){CX.toggleObscuredTags(a,false);
a.style.display="block";
if(!a.hasClassName("smalltip")){t=a.down("div.tipcontent");
if(t.getHeight()>205){t.style.height=200+"px";
}}a.style.visibility="visible";
}function _hidetip(a){window.lasttip=null;
CX.toggleObscuredTags(a,true);
a.style.display="none";
}function _preptip(f,j,d,c){var b=$(j);
if(!b){return null;
}f.onmouseout=function(k){if(Event.isTargetDescendantOf(k,this)){return;
}if(this.timeout&&b.style.display=="none"){window.clearTimeout(this.timeout);
this.timeout=null;
_hidetip(b);
}else{if(c.hideDelay){b.timeout=window.setTimeout(function(){_hidetip(b);
},c.hideDelay);
}else{_hidetip(b);
}}};
if(b.parentNode!=document.body){document.body.appendChild(Element.remove(b));
}if(c.followMouse){followMouse(d,b,{left:4,top:4});
document.onmousemove=function(k){followMouse(k,b,{left:4,top:4});
};
}else{var a=$(f);
var h=Position.cumulativeOffset(a);
var g={pageX:h[0]+5,pageY:h[1]+a.getHeight(a)-11};
followMouse(g,b);
}return b;
}function _activatetip(c,b,a){b=$(b);
if(window.lasttip&&window.lasttip.id!=b.id){_hidetip(window.lasttip);
}window.lasttip=b;
if(a){c.timeout=window.setTimeout(function(){_showtip(b);
},a);
}else{_showtip(b);
}}function lingertip(d,f,c,b){if(CX.Overlays.disabled){return;
}b=b||{};
b.followMouse=null;
b.hideDelay=b.hideDelay||225;
var a=_preptip(d,f,c,b);
if(!a){return;
}a.onmouseover=function(g){if(this.timeout){window.clearTimeout(this.timeout);
this.timeout=null;
}if(this.style.display=="none"){this.style.display="block";
if(this.offsetHeight>250){this.style.height="240px";
}}window.lasttip=this;
};
a.onmouseout=function(g){a.timeout=window.setTimeout(function(){a.style.display="none";
},150);
};
_activatetip(d,a,150);
}var Cookie={get:function(c){var f=document.cookie.split(";");
for(var d=0;
d<f.length;
d++){var b=f[d].split("=");
if(b.length==2){b[0]=b[0].trim();
b[1]=b[1].trim();
if(b[0]==c){return unescape(b[1]);
}}}return false;
},set:function(b,g,d,j,f,h){var c=(b+"="+escape(g));
if(d){var a=new Date(new Date().getTime()+d*1000);
c+=("; expires="+a.toGMTString());
}c+=(j?"; path="+j:"");
c+=(f?"; domain="+f:"");
c+=(h?"; secure":"");
document.cookie=c;
},del:function(){for(var a=0;
a<arguments.length;
a++){document.cookie=arguments[a]+"=; expires=Thu,01-Jan-70 00:00:01 GMT";
}}};
function submitOnlyOnce(h,c){if(h.disabledSubmits){return false;
}h.disabledSubmits=true;
for(i=0;
i<h.elements.length;
i++){var f=h.elements[i];
var d=f.type.toLowerCase();
if(f.nodeName=="BUTTON"||d=="submit"||d=="reset"||d=="image"||d=="button"){CX.Forms.disableElement(f);
}}var a=h.getElementsByTagName("A");
for(i=0;
i<a.length;
i++){CX.Forms.disableElement(a[i]);
}h.onsubmit=function(){alert("Please wait.  This form cannot be submitted more than once.");
return false;
};
if(!c){return true;
}var g=$("waitProgress");
if(c!==true){$("pleaseWaitWhile").innerHTML=c;
}var j=null,b=h;
if(g&&document.images){j=function(){$("waitProgress").src=$("waitProgress").src;
};
}CX.modalDialog(null,$("pleaseWait"),{close:false});
window.setTimeout(function(){b.submit();
if(j){window.setTimeout(j,10);
}},100);
return false;
}function checkEnterKey(a){var b;
if(!a){a=event;
}b=a.which?a.which:a.keyCode;
return(b==13);
}function hide_show_elements(c,a){if(c){for(var b=0;
b<c.length;
b++){Element.hide(c[b]);
}}if(a){for(var b=0;
b<a.length;
b++){Element.show(a[b]);
}}}function showRate(f,d){for(var b=1;
b<=5;
b++){var c=document.getElementById("ratestar_"+f+"_"+b);
var a=c.src.lastIndexOf("/")+1;
c.src=c.src.substring(0,a)+(b>d?"star_gray.gif":"star.gif");
}}function createHiddenFrame(a,c,b){var f=$(a);
if(f){Element.remove(f);
}f=document.createElement("div");
f.innerHTML='<iframe style="width:0px;height:0px;border:none;" src="about:blank" id="'+a+'" name="'+a+'" onload="hiddenFrameLoaded (this,\''+c+"',"+b+');"></iframe>';
document.body.appendChild(f);
}function targetHiddenFrame(b,a){b.setAttribute("target",a);
return true;
}function getFrameDocument(a){if(a.contentDocument){return a.contentDocument;
}else{if(a.contentWindow){return a.contentWindow.document;
}else{return window.frames[a.id].document;
}}}function hiddenFrameLoaded(g,c,b){var f=getFrameDocument(g);
if(f.location.href=="about:blank"){return;
}var a=f.body.innerHTML.replace(/noscript>/gi,"script>");
Element.update($(c),a);
g.parentNode.parentNode.removeChild(g.parentNode);
if(b){b();
}}function show_change_photo_form(){var a=(navigator.appName.substring(0,9)=="Microsoft")?"null":"show_change_photo_form";
createHiddenFrame("change_photo_frame","change_photo",a);
fixPopup("popup_wrap");
Element.show("popup_wrap");
$("popup_wrap").style.visibility="visible";
}function show_private_msg_form(){fixPopup("popup_wrap");
Element.show("popup_wrap");
$("popup_wrap").style.visibility="visible";
}function bigLoading(a){a=$(a);
var b=a.getDimensions();
$(a).update('<img style="margin: 50px '+(b.width/2-50)+'px;" src="/images/loading_big.gif" alt=""/>');
}function linkLoading(a,b){if(!a){return null;
}a=$(a);
var c=createLoading();
c.hide();
Spinner.right(c,a,0);
c.show();
return b?null:function(){c.remove();
};
}var StyleFixes={width100Percent:function(k){k=$(k);
var j=k.getStyle("width");
if(j!="100%"){return;
}var h=Prototype.Browser.IE?["margin"]:null;
var l=k.up();
var g=k.cumulativeDecoratorWidth(h);
var d=k.cumulativeDecoratorWidth();
var f=l.getWidth();
var c=(f-g-d);
if(c<10){return;
}k.setAttribute("originalWidth",f);
k.setAttribute("originalWidthStyle",j);
k.setStyle({width:c+"px"});
}};
window.changeReason=function(a){var b=$("endorsement_description");
if(!b.messages){b.messages=[];
b.reason=0;
}b.messages[b.reason]=b.value;
b.reason=parseInt(a.options[a.selectedIndex].value);
b.value=b.messages[b.reason]||(b.reason==9?"":a.options[a.selectedIndex].text);
};
Event.onEachReady(function(c){c=c||document.body;
var a=c.getElementsByTagName("textarea");
for(var b=0;
b<a.length;
b++){var d=a[b].parentNode.className;
if(d.indexOf("wrapper")>=0||d.indexOf("wrapper2")>=0||d.indexOf("wrapper3")>=0||d.indexOf("editorBody")>=0){StyleFixes.width100Percent(a[b]);
}}});
(function(){var m=/^<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,c=/^<\/(\w+)[^>]*>/,h=/(\w+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;
var g=b("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed");
var a=b("address,applet,blockquote,button,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul");
var k=b("a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var");
var d=b("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");
var l=b("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected");
var j=b("script,style");
var f=this.HTMLParser=function(o,x){var r,s,p,u=[],v=o;
u.last=function(){return this[this.length-1];
};
while(o){s=true;
if(!u.last()||!j[u.last()]){if(o.indexOf("<!--")==0){r=o.indexOf("-->");
if(r>=0){if(x.comment){x.comment(o.substring(4,r));
}o=o.substring(r+3);
s=false;
}}else{if(o.indexOf("</")==0){p=o.match(c);
if(p){o=o.substring(p[0].length);
p[0].replace(c,q);
s=false;
}}else{if(o.indexOf("<")==0){p=o.match(m);
if(p){o=o.substring(p[0].length);
p[0].replace(m,n);
s=false;
}}}}if(s){r=o.indexOf("<");
var w=r<0?o:o.substring(0,r);
o=r<0?"":o.substring(r);
if(x.chars){x.chars(w);
}}}else{o=o.replace(new RegExp("(.*)</"+u.last()+"[^>]*>"),function(y,z){z=z.replace(/<!--(.*?)-->/g,"$1").replace(/<!\[CDATA\[(.*?)]]>/g,"$1");
if(x.chars){x.chars(z);
}return"";
});
q("",u.last());
}if(o==v){throw"Parse Error: "+o;
}v=o;
}q();
function n(y,B,C,z){if(a[B]){while(u.last()&&k[u.last()]){q("",u.last());
}}if(d[B]&&u.last()==B){q("",B);
}z=g[B]||!!z;
if(!z){u.push(B);
}if(x.start){var A=[];
C.replace(h,function(E,D){var F=arguments[2]?arguments[2]:arguments[3]?arguments[3]:arguments[4]?arguments[4]:l[D]?D:"";
A.push({name:D,value:F,escaped:F.replace(/(^|[^\\])"/g,'$1\\"')});
});
if(x.start){x.start(B,A,z);
}}}function q(y,A){if(!A){var B=0;
}else{for(var B=u.length-1;
B>=0;
B--){if(u[B]==A){break;
}}}if(B>=0){for(var z=u.length-1;
z>=B;
z--){if(x.end){x.end(u[z]);
}}u.length=B;
}}};
this.HTMLtoXML=function(o){var n="";
f(o,{start:function(p,r,q){n+="<"+p;
for(var s=0;
s<r.length;
s++){n+=" "+r[s].name+'="'+r[s].escaped+'"';
}n+=(q?"/":"")+">";
},end:function(p){n+="</"+p+">";
},chars:function(p){n+=p;
},comment:function(p){n+="<!--"+p+"-->";
}});
return n;
};
this.HTMLtoDOM=function(r,v){var q=b("html,head,body,title");
var n={link:"head",base:"head"};
if(!v){if(typeof DOMDocument!="undefined"){v=new DOMDocument();
}else{if(typeof document!="undefined"&&document.implementation&&document.implementation.createDocument){v=document.implementation.createDocument("","",null);
}else{if(Prototype.Browser.IE){v=new ActiveXObject("MSXML2.DOMDocument.3.0");
}}}}else{v=v.ownerDocument||v.getOwnerDocument&&v.getOwnerDocument()||v;
}var o=[],u=v.documentElement||(v.getDocumentElement&&v.getDocumentElement());
if(!u&&(Prototype.Browser.IE||v.createElement)){(function(){var x=v.createElement("html");
var w=v.createElement("head");
w.appendChild(v.createElement("title"));
x.appendChild(w);
x.appendChild(v.createElement("body"));
v.appendChild(x);
})();
}if(Prototype.Browser.IE||v.getElementsByTagName){for(var p in q){q[p]=v.getElementsByTagName(p)[0];
}}var s=q.body;
f(r,{start:function(z,x,w){if(q[z]){s=q[z];
return;
}var A=v.createElement(z);
for(var y=0;
y<x.length;
y++){A.setAttribute(x[y].name,x[y].value);
}if(n[z]&&typeof q[n[z]]!="boolean"){q[n[z]].appendChild(A);
}else{if(s&&(Prototype.Browser.IE||s.appendChild)){s.appendChild(A);
}}if(!w){o.push(A);
s=A;
}},end:function(w){o.length-=1;
s=o[o.length-1];
},chars:function(w){s.appendChild(v.createTextNode(w));
},comment:function(w){}});
return v;
};
function b(q){var p={},n=q.split(",");
for(var o=0;
o<n.length;
o++){p[n[o]]=true;
}return p;
}})();
ASSET_MANIFEST=["/javascripts/prototype.js","/javascripts/scriptaculous.js","/javascripts/effects.js","/javascripts/dragdrop.js","/javascripts/controls.js","/javascripts/cx/core.js","/javascripts/cx/prototype.js","/javascripts/cx/event.js","/javascripts/cx/iframe_cache.js","/javascripts/cx/iframe_shim.js","/javascripts/cx/ajax.js","/javascripts/cx/controls.js","/javascripts/cx/menus.js","/javascripts/cx/overlays.js","/javascripts/cx/overlays/dimmer.js","/javascripts/cx/forms.js","/javascripts/cx/effects.js","/javascripts/cx/dragdrop.js","/javascripts/cx/site.js","/javascripts/core.js","/javascripts/application.js","/javascripts/htmlparser.js"];
try{GLOBAL_ASSET_MANIFEST=GLOBAL_ASSET_MANIFEST.concat(ASSET_MANIFEST);
}catch(e){GLOBAL_ASSET_MANIFEST=ASSET_MANIFEST;
}
