var Cookie={set:function(A,D,C){var B="";if(C!=undefined){var E=new Date();E.setTime(E.getTime()+(86400000*parseFloat(C)));B="; expires="+E.toGMTString()}return(document.cookie=escape(A)+"="+escape(D||"")+B)},get:function(B){var A=document.cookie.match(new RegExp("(^|;)\\s*"+escape(B)+"=([^;\\s]*)"));return(A?unescape(A[2]):null)},erase:function(B){var A=Cookie.get(B)||true;Cookie.set(B,"",-1);return A},accept:function(){if(typeof navigator.cookieEnabled=="boolean"){return navigator.cookieEnabled}Cookie.set("_test","1");return(Cookie.erase("_test")==="1")}};var Prototype={Version:"1.5.0_rc2",BrowserFeatures:{XPath:!!document.evaluate},ScriptFragment:"(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)",emptyFunction:function(){},K:function(A){return A}};var Class={create:function(){return function(){this.initialize.apply(this,arguments)}}};var Abstract=new Object();Object.extend=function(C,B){for(var A in B){C[A]=B[A]}return C};Object.extend(Object,{inspect:function(A){try{if(A===undefined){return"undefined"}if(A===null){return"null"}return A.inspect?A.inspect():A.toString()}catch(B){if(B instanceof RangeError){return"..."}throw B}},keys:function(B){var C=[];for(var A in B){C.push(A)}return C},values:function(B){var C=[];for(var A in B){C.push(B[A])}return C},clone:function(A){return Object.extend({},A)}});Function.prototype.bind=function(){var C=this,A=$A(arguments),B=A.shift();return function(){return C.apply(B,A.concat($A(arguments)))}};Function.prototype.bindAsEventListener=function(B){var C=this,A=$A(arguments),B=A.shift();return function(D){return C.apply(B,[(D||window.event)].concat(A).concat($A(arguments)))}};Object.extend(Number.prototype,{toColorPart:function(){var A=this.toString(16);if(this<16){return"0"+A}return A},succ:function(){return this+1},times:function(A){$R(0,this,true).each(A);return this}});var Try={these:function(){var B;for(var C=0,A=arguments.length;C<A;C++){var D=arguments[C];try{B=D();break}catch(E){}}return B}};var PeriodicalExecuter=Class.create();PeriodicalExecuter.prototype={initialize:function(A,B){this.callback=A;this.frequency=B;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},stop:function(){if(!this.timer){return }clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.callback(this)}finally{this.currentlyExecuting=false}}}};String.interpret=function(A){return A==null?"":String(A)};Object.extend(String.prototype,{gsub:function(B,D){var E="",A=this,C;D=arguments.callee.prepareReplacement(D);while(A.length>0){if(C=A.match(B)){E+=A.slice(0,C.index);E+=String.interpret(D(C));A=A.slice(C.index+C[0].length)}else{E+=A,A=""}}return E},sub:function(A,B,C){B=this.gsub.prepareReplacement(B);C=C===undefined?1:C;return this.gsub(A,function(D){if(--C<0){return D[0]}return B(D)})},scan:function(A,B){this.gsub(A,B);return this},truncate:function(A,B){A=A||30;B=B===undefined?"...":B;return this.length>A?this.slice(0,A-B.length)+B: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 B=new RegExp(Prototype.ScriptFragment,"img");var A=new RegExp(Prototype.ScriptFragment,"im");return(this.match(B)||[]).map(function(C){return(C.match(A)||["",""])[1]})},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script)})},escapeHTML:function(){var B=document.createElement("div");var A=document.createTextNode(this);B.appendChild(A);return B.innerHTML},unescapeHTML:function(){var A=document.createElement("div");A.innerHTML=this.stripTags();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(E,F){if((F=F.split("="))[0]){var C=decodeURIComponent(F[0]);var D=F[1]?decodeURIComponent(F[1]):undefined;if(E[C]!==undefined){if(E[C].constructor!=Array){E[C]=[E[C]]}if(D){E[C].push(D)}}else{E[C]=D}}return E})},toArray:function(){return this.split("")},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)},camelize:function(){var D=this.split("-"),A=D.length;if(A==1){return D[0]}var B=this.charAt(0)=="-"?D[0].charAt(0).toUpperCase()+D[0].substring(1):D[0];for(var C=1;C<A;C++){B+=D[C].charAt(0).toUpperCase()+D[C].substring(1)}return B},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.replace(/\\/g,"\\\\");if(B){return'"'+A.replace(/"/g,'\\"')+'"'}else{return"'"+A.replace(/'/g,"\\'")+"'"}}});String.prototype.gsub.prepareReplacement=function(B){if(typeof B=="function"){return B}var A=new Template(B);return function(C){return A.evaluate(C)}};String.prototype.parseQuery=String.prototype.toQueryParams;var Template=Class.create();Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;Template.prototype={initialize:function(B,A){this.template=B.toString();this.pattern=A||Template.Pattern},evaluate:function(A){return this.template.gsub(this.pattern,function(C){var B=C[1];if(B=="\\"){return C[2]}return B+String.interpret(A[C[3]])})}};var $break=new Object();var $continue=new Object();var Enumerable={each:function(B){var A=0;try{this._each(function(D){try{B(D,A++)}catch(E){if(E!=$continue){throw E}}})}catch(C){if(C!=$break){throw C}}return this},eachSlice:function(A,C){var B=-A,D=[],E=this.toArray();while((B+=A)<E.length){D.push(E.slice(B,B+A))}return D.map(C)},all:function(A){var B=true;this.each(function(D,C){B=B&&!!(A||Prototype.K)(D,C);if(!B){throw $break}});return B},any:function(A){var B=false;this.each(function(D,C){if(B=!!(A||Prototype.K)(D,C)){throw $break}});return B},collect:function(B){var A=[];this.each(function(D,C){A.push((B||Prototype.K)(D,C))});return A},detect:function(A){var B;this.each(function(D,C){if(A(D,C)){B=D;throw $break}});return B},findAll:function(B){var A=[];this.each(function(D,C){if(B(D,C)){A.push(D)}});return A},grep:function(A,C){var B=[];this.each(function(F,D){var E=F.toString();if(E.match(A)){B.push((C||Prototype.K)(F,D))}});return B},include:function(A){var B=false;this.each(function(C){if(C==A){B=true;throw $break}});return B},inGroupsOf:function(A,B){B=B===undefined?null:B;return this.eachSlice(A,function(C){while(C.length<A){C.push(B)}return C})},inject:function(A,B){this.each(function(D,C){A=B(A,D,C)});return A},invoke:function(B){var A=$A(arguments).slice(1);return this.map(function(C){return C[B].apply(C,A)})},max:function(A){var B;this.each(function(D,C){D=(A||Prototype.K)(D,C);if(B==undefined||D>=B){B=D}});return B},min:function(A){var B;this.each(function(D,C){D=(A||Prototype.K)(D,C);if(B==undefined||D<B){B=D}});return B},partition:function(C){var B=[],A=[];this.each(function(E,D){((C||Prototype.K)(E,D)?B:A).push(E)});return[B,A]},pluck:function(A){var B=[];this.each(function(D,C){B.push(D[A])});return B},reject:function(B){var A=[];this.each(function(D,C){if(!B(D,C)){A.push(D)}});return A},sortBy:function(A){return this.map(function(C,B){return{value:C,criteria:A(C,B)}}).sort(function(E,D){var C=E.criteria,B=D.criteria;return C<B?-1:C>B?1:0}).pluck("value")},toArray:function(){return this.map()},zip:function(){var B=Prototype.K,A=$A(arguments);if(typeof A.last()=="function"){B=A.pop()}var C=[this].concat(A).map($A);return this.map(function(E,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,member:Enumerable.include,entries:Enumerable.toArray});var $A=Array.from=function(D){if(!D){return[]}if(D.toArray){return D.toArray()}else{var C=[];for(var B=0,A=D.length;B<A;B++){C.push(D[B])}return C}};Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse}Object.extend(Array.prototype,{_each:function(C){for(var B=0,A=this.length;B<A;B++){C(this[B])}},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(A&&A.constructor==Array?A.flatten():[A])})},without:function(){var A=$A(arguments);return this.select(function(B){return !A.include(B)})},indexOf:function(C){for(var B=0,A=this.length;B<A;B++){if(this[B]==C){return B}}return -1},reverse:function(A){return(A!==false?this:this.toArray())._reverse()},reduce:function(){return this.length>1?this:this[0]},uniq:function(){return this.inject([],function(B,A){return B.include(A)?B:B.concat([A])})},clone:function(){return[].concat(this)},size:function(){return this.length},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]"}});Array.prototype.toArray=Array.prototype.clone;function $w(A){A=A.strip();return A?A.split(/\s+/):[]}if(window.opera){Array.prototype.concat=function(){var E=[];for(var C=0,A=this.length;C<A;C++){E.push(this[C])}for(var C=0,A=arguments.length;C<A;C++){if(arguments[C].constructor==Array){for(var B=0,D=arguments[C].length;B<D;B++){E.push(arguments[C][B])}}else{E.push(arguments[C])}}return E}}var Hash={_each:function(B){for(var A in this){var C=this[A];if(typeof C=="function"){continue}var D=[A,C];D.key=A;D.value=C;B(D)}},keys:function(){return this.pluck("key")},values:function(){return this.pluck("value")},merge:function(A){return $H(A).inject(this,function(B,C){B[C.key]=C.value;return B})},toQueryString:function(){return this.map(function(B){if(!B.key){return null}if(B.value&&B.value.constructor==Array){B.value=B.value.compact();if(B.value.length<2){B.value=B.value.reduce()}else{var A=encodeURIComponent(B.key);return B.value.map(function(C){return A+"="+encodeURIComponent(C)}).join("&")}}if(B.value==undefined){B[1]=""}return B.map(encodeURIComponent).join("=")}).join("&")},inspect:function(){return"#<Hash:{"+this.map(function(A){return A.map(Object.inspect).join(": ")}).join(", ")+"}>"}};function $H(A){var B=Object.extend({},A||{});Object.extend(B,Enumerable);Object.extend(B,Hash);return B}ObjectRange=Class.create();Object.extend(ObjectRange.prototype,Enumerable);Object.extend(ObjectRange.prototype,{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(C,B,D,A){this.each(function(E){if(typeof E[C]=="function"){try{E[C].apply(E,[B,D,A])}catch(F){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=function(){};Ajax.Base.prototype={setOptions:function(A){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:""};Object.extend(this.options,A||{});this.options.method=this.options.method.toLowerCase();this.options.parameters=$H(typeof this.options.parameters=="string"?this.options.parameters.toQueryParams():this.options.parameters)}};Ajax.Request=Class.create();Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Request.prototype=Object.extend(new Ajax.Base(),{_complete:false,initialize:function(A,B){this.transport=Ajax.getTransport();this.setOptions(B);this.request(A)},request:function(B){var D=this.options.parameters;if(D.any()){D["_"]=""}if(!["get","post"].include(this.options.method)){D["_method"]=this.options.method;this.options.method="post"}this.url=B;if(this.options.method=="get"&&D.any()){this.url+=(this.url.indexOf("?")>=0?"&":"?")+D.toQueryString()}try{Ajax.Responders.dispatch("onCreate",this,this.transport);this.transport.open(this.options.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){setTimeout(function(){this.respondToReadyState(1)}.bind(this),10)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();var A=this.options.method=="post"?(this.options.postBody||D.toQueryString()):null;this.transport.send(A);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 E={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,"Accept":"text/javascript, text/html, application/xml, text/xml, */*"};if(this.options.method=="post"){E["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){E["Connection"]="close"}}if(typeof this.options.requestHeaders=="object"){var B=this.options.requestHeaders;if(typeof B.push=="function"){for(var D=0,A=B.length;D<A;D+=2){E[B[D]]=B[D+1]}}else{$H(B).each(function(F){E[F.key]=F.value})}}for(var C in E){this.transport.setRequestHeader(C,E[C])}},success:function(){return !this.transport.status||(this.transport.status>=200&&this.transport.status<300)},respondToReadyState:function(A){var C=Ajax.Request.Events[A];var E=this.transport,B=this.evalJSON();if(C=="Complete"){try{this._complete=true;(this.options["on"+this.transport.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(E,B)}catch(D){this.dispatchException(D)}}try{(this.options["on"+C]||Prototype.emptyFunction)(E,B);Ajax.Responders.dispatch("on"+C,this,E,B)}catch(D){this.dispatchException(D)}if(C=="Complete"){if((this.getHeader("Content-type")||"").strip().match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i)){this.evalResponse()}this.transport.onreadystatechange=Prototype.emptyFunction}},getHeader:function(A){try{return this.transport.getResponseHeader(A)}catch(B){return null}},evalJSON:function(){try{var json=this.getHeader("X-JSON");return json?eval("("+json+")"):null}catch(e){return null}},evalResponse:function(){try{return eval(this.transport.responseText)}catch(e){this.dispatchException(e)}},dispatchException:function(A){(this.options.onException||Prototype.emptyFunction)(this,A);Ajax.Responders.dispatch("onException",this,A)}});Ajax.Updater=Class.create();Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(C,A,B){this.container={success:(C.success||C),failure:(C.failure||(C.success?null:C))};this.transport=Ajax.getTransport();this.setOptions(B);var D=this.options.onComplete||Prototype.emptyFunction;this.options.onComplete=(function(F,E){this.updateContent();D(F,E)}).bind(this);this.request(A)},updateContent:function(){var A=this.container[this.success()?"success":"failure"];var B=this.transport.responseText;if(!this.options.evalScripts){B=B.stripScripts()}if(A=$(A)){if(this.options.insertion){new this.options.insertion(A,B)}else{A.update(B)}}if(this.success()){if(this.onComplete){setTimeout(this.onComplete.bind(this),10)}}}});Ajax.PeriodicalUpdater=Class.create();Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(C,A,B){this.setOptions(B);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=C;this.url=A;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(A){if(this.options.decay){this.decay=(A.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=A.responseText}this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(C){if(arguments.length>1){for(var D=0,A=[],B=arguments.length;D<B;D++){A.push($(arguments[D]))}return A}if(typeof C=="string"){C=document.getElementById(C)}return Element.extend(C)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(F,D){var C=[];var E=document.evaluate(F,$(D)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var B=0,A=E.snapshotLength;B<A;B++){C.push(E.snapshotItem(B))}return C}}document.getElementsByClassName=function(C,F){if(Prototype.BrowserFeatures.XPath){var G=".//*[contains(concat(' ', @class, ' '), ' "+C+" ')]";return document._getElementsByXPath(G,F)}else{var E=($(F)||document.body).getElementsByTagName("*");var A=[],H;for(var D=0,B=E.length;D<B;D++){H=E[D];if(Element.hasClassName(H,C)){A.push(Element.extend(H))}}return A}};if(!window.Element){var Element=new Object()}Element.extend=function(D){if(!D||_nativeExtensions||D.nodeType==3){return D}if(!D._extended&&D.tagName&&D!=window){var C=Object.clone(Element.Methods),B=Element.extend.cache;if(D.tagName=="FORM"){Object.extend(C,Form.Methods)}if(["INPUT","TEXTAREA","SELECT"].include(D.tagName)){Object.extend(C,Form.Element.Methods)}Object.extend(C,Element.Methods.Simulated);for(var A in C){var E=C[A];if(typeof E=="function"&&!(A in D)){D[A]=B.findOrStore(E)}}}D._extended=true;return D};Element.extend.cache={findOrStore:function(A){return this[A]=this[A]||function(){return A.apply(null,[this].concat($A(arguments)))}}};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){B=typeof B=="undefined"?"":B.toString();$(A).innerHTML=B.stripScripts();setTimeout(function(){B.evalScripts()},10);return A},replace:function(B,C){B=$(B);if(B.outerHTML){B.outerHTML=C.stripScripts()}else{var A=B.ownerDocument.createRange();A.selectNodeContents(B);B.parentNode.replaceChild(A.createContextualFragment(C.stripScripts()),B)}setTimeout(function(){C.evalScripts()},10);return B},inspect:function(A){A=$(A);var B="<"+A.tagName.toLowerCase();$H({"id":"id","className":"class"}).each(function(F){var C=F.first(),D=F.last();var E=(A[C]||"").toString();if(E){B+=" "+D+"="+E.inspect(true)}});return B+">"},recursivelyCollect:function(C,B){C=$(C);var A=[];while(C=C[B]){if(C.nodeType==1){A.push(Element.extend(C))}}return A},ancestors:function(A){return $(A).recursivelyCollect("parentNode")},descendants:function(A){return $A($(A).getElementsByTagName("*"))},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(typeof A=="string"){A=new Selector(A)}return A.match($(B))},up:function(B,C,A){return Selector.findElement($(B).ancestors(),C,A)},down:function(B,C,A){return Selector.findElement($(B).descendants(),C,A)},previous:function(B,C,A){return Selector.findElement($(B).previousSiblings(),C,A)},next:function(B,C,A){return Selector.findElement($(B).nextSiblings(),C,A)},getElementsBySelector:function(){var B=$A(arguments),A=$(B.shift());return Selector.findChildElements(A,B)},getElementsByClassName:function(B,A){return document.getElementsByClassName(A,B)},readAttribute:function(B,A){return $(B).getAttribute(A)},getHeight:function(A){return $(A).offsetHeight},classNames:function(A){return new Element.ClassNames(A)},hasClassName:function(B,A){if(!(B=$(B))){return }var C=B.className;if(C.length==0){return false}if(C==A||C.match(new RegExp("(^|\\s)"+A+"(\\s|$)"))){return true}return false},addClassName:function(B,A){if(!(B=$(B))){return }Element.classNames(B).add(A);return B},removeClassName:function(B,A){if(!(B=$(B))){return }Element.classNames(B).remove(A);return B},toggleClassName:function(B,A){if(!(B=$(B))){return }Element.classNames(B)[B.hasClassName(A)?"remove":"add"](A);return B},observe:function(){Event.observe.apply(Event,arguments);return $A(arguments).first()},stopObserving:function(){Event.stopObserving.apply(Event,arguments);return $A(arguments).first()},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.match(/^\s*$/)},childOf:function(B,A){B=$(B),A=$(A);while(B=B.parentNode){if(B==A){return true}}return false},scrollTo:function(A){A=$(A);var B=Position.cumulativeOffset(A);window.scrollTo(B[0],B[1]);return A},getStyle:function(A,C){A=$(A);var E=(C=="float"?(typeof A.style.styleFloat!="undefined"?"styleFloat":"cssFloat"):C).camelize();var D=A.style[E];if(!D){if(document.defaultView&&document.defaultView.getComputedStyle){var B=document.defaultView.getComputedStyle(A,null);D=B?B[E]:null}else{if(A.currentStyle){D=A.currentStyle[E]}}}if((D=="auto")&&["width","height"].include(C)&&(A.getStyle("display")!="none")){D=A["offset"+C.capitalize()]+"px"}if(window.opera&&["left","top","right","bottom"].include(C)){if(Element.getStyle(A,"position")=="static"){D="auto"}}if(C=="opacity"){if(D){return parseFloat(D)}if(D=(A.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(D[1]){return parseFloat(D[1])/100}}return 1}return D=="auto"?null:D},setStyle:function(B,C){B=$(B);for(var A in C){var D=C[A];if(A=="opacity"){if(D==1){D=(/Gecko/.test(navigator.userAgent)&&!/Konqueror|Safari|KHTML/.test(navigator.userAgent))?0.999999:1;if(/MSIE/.test(navigator.userAgent)&&!window.opera){B.style.filter=B.getStyle("filter").replace(/alpha\([^\)]*\)/gi,"")}}else{if(D<0.00001){D=0}if(/MSIE/.test(navigator.userAgent)&&!window.opera){B.style.filter=B.getStyle("filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+D*100+")"}}}else{if(A=="float"){A=(typeof B.style.styleFloat!="undefined")?"styleFloat":"cssFloat"}}B.style[A.camelize()]=D}return B},getDimensions:function(C){C=$(C);if(Element.getStyle(C,"display")!="none"){return{width:C.offsetWidth,height:C.offsetHeight}}var D=C.style;var A=D.visibility;var B=D.position;D.visibility="hidden";D.position="absolute";D.display="";var F=C.clientWidth;var E=C.clientHeight;D.display="none";D.position=B;D.visibility=A;return{width:F,height:E}},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=A.style.overflow||"auto";if((Element.getStyle(A,"overflow")||"visible")!="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}};Element.Methods.Simulated={hasAttribute:function(A,B){return $(A).getAttributeNode(B).specified}};if(document.all){Element.Methods.update=function(B,C){B=$(B);C=typeof C=="undefined"?"":C.toString();var A=B.tagName.toUpperCase();if(["THEAD","TBODY","TR","TD"].include(A)){var D=document.createElement("div");switch(A){case"THEAD":case"TBODY":D.innerHTML="<table><tbody>"+C.stripScripts()+"</tbody></table>";depth=2;break;case"TR":D.innerHTML="<table><tbody><tr>"+C.stripScripts()+"</tr></tbody></table>";depth=3;break;case"TD":D.innerHTML="<table><tbody><tr><td>"+C.stripScripts()+"</td></tr></tbody></table>";depth=4}$A(B.childNodes).each(function(E){B.removeChild(E)});depth.times(function(){D=D.firstChild});$A(D.childNodes).each(function(E){B.appendChild(E)})}else{B.innerHTML=C.stripScripts()}setTimeout(function(){C.evalScripts()},10);return B}}Object.extend(Element,Element.Methods);var _nativeExtensions=false;if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){["","Form","Input","TextArea","Select"].each(function(B){var C="HTML"+B+"Element";if(window[C]){return }var A=window[C]={};A.prototype=document.createElement(B?B.toLowerCase():"div").__proto__})}Element.addMethods=function(A){Object.extend(Element.Methods,A||{});function B(E,H,G){G=G||false;var D=Element.extend.cache;for(var C in E){var F=E[C];if(!G||!(C in H)){H[C]=D.findOrStore(F)}}}if(typeof HTMLElement!="undefined"){B(Element.Methods,HTMLElement.prototype);B(Element.Methods.Simulated,HTMLElement.prototype,true);B(Form.Methods,HTMLFormElement.prototype);[HTMLInputElement,HTMLTextAreaElement,HTMLSelectElement].each(function(C){B(Form.Element.Methods,C.prototype)});_nativeExtensions=true}};var Toggle=new Object();Toggle.display=Element.toggle;Abstract.Insertion=function(A){this.adjacency=A};Abstract.Insertion.prototype={initialize:function(B,C){this.element=$(B);this.content=C.stripScripts();if(this.adjacency&&this.element.insertAdjacentHTML){try{this.element.insertAdjacentHTML(this.adjacency,this.content)}catch(D){var A=this.element.tagName.toUpperCase();if(["TBODY","TR"].include(A)){this.insertContent(this.contentFromAnonymousTable())}else{throw D}}}else{this.range=this.element.ownerDocument.createRange();if(this.initializeRange){this.initializeRange()}this.insertContent([this.range.createContextualFragment(this.content)])}setTimeout(function(){C.evalScripts()},10)},contentFromAnonymousTable:function(){var A=document.createElement("div");A.innerHTML="<table><tbody>"+this.content+"</tbody></table>";return $A(A.childNodes[0].childNodes[0].childNodes)}};var Insertion=new Object();Insertion.Before=Class.create();Insertion.Before.prototype=Object.extend(new Abstract.Insertion("beforeBegin"),{initializeRange:function(){this.range.setStartBefore(this.element)},insertContent:function(A){A.each((function(B){this.element.parentNode.insertBefore(B,this.element)}).bind(this))}});Insertion.Top=Class.create();Insertion.Top.prototype=Object.extend(new Abstract.Insertion("afterBegin"),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(true)},insertContent:function(A){A.reverse(false).each((function(B){this.element.insertBefore(B,this.element.firstChild)}).bind(this))}});Insertion.Bottom=Class.create();Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion("beforeEnd"),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(this.element)},insertContent:function(A){A.each((function(B){this.element.appendChild(B)}).bind(this))}});Insertion.After=Class.create();Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){this.range.setStartAfter(this.element)},insertContent:function(A){A.each((function(B){this.element.parentNode.insertBefore(B,this.element.nextSibling)}).bind(this))}});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);var Selector=Class.create();Selector.prototype={initialize:function(A){this.params={classNames:[]};this.expression=A.toString().strip();this.parseExpression();this.compileMatcher()},parseExpression:function(){function G(H){throw"Parse error in selector: "+H}if(this.expression==""){G("empty expression")}var E=this.params,D=this.expression,A,C,F,B;while(A=D.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){E.attributes=E.attributes||[];E.attributes.push({name:A[2],operator:A[3],value:A[4]||A[5]||""});D=A[1]}if(D=="*"){return this.params.wildcard=true}while(A=D.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)){C=A[1],F=A[2],B=A[3];switch(C){case"#":E.id=F;break;case".":E.classNames.push(F);break;case"":case undefined:E.tagName=F.toUpperCase();break;default:G(D.inspect())}D=B}if(D.length>0){G(D.inspect())}},buildMatchExpression:function(){var C=this.params,E=[],D;if(C.wildcard){E.push("true")}if(D=C.id){E.push("element.id == "+D.inspect())}if(D=C.tagName){E.push("element.tagName.toUpperCase() == "+D.inspect())}if((D=C.classNames).length>0){for(var B=0,A=D.length;B<A;B++){E.push("Element.hasClassName(element, "+D[B].inspect()+")")}}if(D=C.attributes){D.each(function(F){var H="element.getAttribute("+F.name.inspect()+")";var G=function(I){return H+" && "+H+".split("+I.inspect()+")"};switch(F.operator){case"=":E.push(H+" == "+F.value.inspect());break;case"~=":E.push(G(" ")+".include("+F.value.inspect()+")");break;case"|=":E.push(G("-")+".first().toUpperCase() == "+F.value.toUpperCase().inspect());break;case"!=":E.push(H+" != "+F.value.inspect());break;case"":case undefined:E.push(H+" != null");break;default:throw"Unknown operator "+F.operator+" in selector"}})}return E.join(" && ")},compileMatcher:function(){this.match=new Function("element","if (!element.tagName) return false;       return "+this.buildMatchExpression())},findElements:function(E){var B;if(B=$(this.params.id)){if(this.match(B)){if(!E||Element.childOf(B,E)){return[B]}}}E=(E||document).getElementsByTagName(this.params.tagName||"*");var D=[];for(var C=0,A=E.length;C<A;C++){if(this.match(B=E[C])){D.push(Element.extend(B))}}return D},toString:function(){return this.expression}};Object.extend(Selector,{matchElements:function(B,C){var A=new Selector(C);return B.select(A.match.bind(A)).map(Element.extend)},findElement:function(A,C,B){if(typeof C=="number"){B=C,C=false}return Selector.matchElements(A,C||"*")[B||0]},findChildElements:function(A,B){return B.map(function(C){return C.strip().split(/\s+/).inject([null],function(E,F){var D=new Selector(F);return E.inject([],function(G,H){return G.concat(D.findElements(H||A))})})}).flatten()}});function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(A){$(A).reset();return A},serializeElements:function(A){return A.inject([],function(D,B){var C=Form.Element.serialize(B);if(C){D.push(C)}return D}).join("&")}};Form.Methods={serialize:function(A){return Form.serializeElements($(A).getElements())},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(G,E,C){G=$(G);var F=G.getElementsByTagName("input"),H=[];if(!E&&!C){return $A(F).map(Element.extend)}for(var D=0,A=F.length;D<A;D++){var B=F[D];if((E&&B.type!=E)||(C&&B.name!=C)){continue}H.push(Element.extend(B))}return H},disable:function(A){A=$(A);A.getElements().each(function(B){B.blur();B.disabled="true"});return A},enable:function(A){A=$(A);A.getElements().each(function(B){B.disabled=""});return A},findFirstElement:function(A){return $(A).getElements().find(function(B){return B.type!="hidden"&&!B.disabled&&["input","select","textarea"].include(B.tagName.toLowerCase())})},focusFirstElement:function(A){A=$(A);A.findFirstElement().activate();return A}};Object.extend(Form,Form.Methods);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){return""}var C=A.tagName.toLowerCase();var D=Form.Element.Serializers[C](A);if(D){var B=encodeURIComponent(D[0]);if(B.length==0){return }if(D[1].constructor!=Array){D[1]=[D[1]]}return D[1].map(function(E){return B+"="+encodeURIComponent(E)}).join("&")}},getValue:function(A){A=$(A);var B=A.tagName.toLowerCase();var C=Form.Element.Serializers[B](A);if(C){return C[1]}},clear:function(A){$(A).value="";return A},present:function(A){return $(A).value!=""},activate:function(A){A=$(A);A.focus();if(A.select&&(A.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(A.type))){A.select()}return A},disable:function(A){A=$(A);A.disabled=true;return A},enable:function(A){A=$(A);A.blur();A.disabled=false;return A}};Object.extend(Form.Element,Form.Element.Methods);var Field=Form.Element;Form.Element.Serializers={input:function(A){switch(A.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(A);default:return Form.Element.Serializers.textarea(A)}return false},inputSelector:function(A){if(A.checked){return[A.name,A.value]}},textarea:function(A){return[A.name,A.value]},select:function(A){return Form.Element.Serializers[A.type=="select-one"?"selectOne":"selectMany"](A)},selectOne:function(B){var D="",C,A=B.selectedIndex;if(A>=0){C=Element.extend(B.options[A]);D=C.hasAttribute("value")?C.value:C.text}return[B.name,D]},selectMany:function(B){var E=[];for(var D=0,A=B.length;D<A;D++){var C=Element.extend(B.options[D]);if(C.selected){E.push(C.hasAttribute("value")?C.value:C.text)}}return[B.name,E]}};var $F=Form.Element.getValue;Abstract.TimedObserver=function(){};Abstract.TimedObserver.prototype={initialize:function(A,C,B){this.frequency=C;this.element=$(A);this.callback=B;this.lastValue=this.getValue();this.registerCallback()},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},onTimerEvent:function(){var A=this.getValue();var B=("string"==typeof this.lastValue&&"string"==typeof A?this.lastValue!=A:String(this.lastValue)!=String(A));if(B){this.callback(this.element,A);this.lastValue=A}}};Form.Element.Observer=Class.create();Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create();Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=function(){};Abstract.EventObserver.prototype={initialize:function(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.bind(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();Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create();Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.serialize(this.element)}});if(!window.Event){var Event=new Object()}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,element:function(A){return A.target||A.srcElement},isLeftClick:function(A){return(((A.which)&&(A.which==1))||((A.button)&&(A.button==1)))},pointerX:function(A){return A.pageX||(A.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))},pointerY:function(A){return A.pageY||(A.clientY+(document.documentElement.scrollTop||document.body.scrollTop))},stop:function(A){if(A.preventDefault){A.preventDefault();A.stopPropagation()}else{A.returnValue=false;A.cancelBubble=true}},findElement:function(C,B){var A=Event.element(C);while(A.parentNode&&(!A.tagName||(A.tagName.toUpperCase()!=B.toUpperCase()))){A=A.parentNode}return A},observers:false,_observeAndCache:function(C,B,A,D){if(!this.observers){this.observers=[]}if(C.addEventListener){this.observers.push([C,B,A,D]);C.addEventListener(B,A,D)}else{if(C.attachEvent){this.observers.push([C,B,A,D]);C.attachEvent("on"+B,A)}}},unloadCache:function(){if(!Event.observers){return }for(var B=0,A=Event.observers.length;B<A;B++){Event.stopObserving.apply(this,Event.observers[B]);Event.observers[B][0]=null}Event.observers=false},observe:function(C,B,A,D){C=$(C);D=D||false;if(B=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||C.attachEvent)){B="keydown"}Event._observeAndCache(C,B,A,D)},stopObserving:function(C,B,A,D){C=$(C);D=D||false;if(B=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||C.detachEvent)){B="keydown"}if(C.removeEventListener){C.removeEventListener(B,A,D)}else{if(C.detachEvent){try{C.detachEvent("on"+B,A)}catch(E){}}}}});if(navigator.appVersion.match(/\bMSIE\b/)){Event.observe(window,"unload",Event.unloadCache,false)}var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},realOffset:function(A){var B=0,C=0;do{B+=A.scrollTop||0;C+=A.scrollLeft||0;A=A.parentNode}while(A);return[C,B]},cumulativeOffset:function(A){var B=0,C=0;do{B+=A.offsetTop||0;C+=A.offsetLeft||0;A=A.offsetParent}while(A);return[C,B]},positionedOffset:function(A){var B=0,D=0;do{B+=A.offsetTop||0;D+=A.offsetLeft||0;A=A.offsetParent;if(A){if(A.tagName=="BODY"){break}var C=Element.getStyle(A,"position");if(C=="relative"||C=="absolute"){break}}}while(A);return[D,B]},offsetParent:function(A){if(A.offsetParent){return A.offsetParent}if(A==document.body){return A}while((A=A.parentNode)&&A!=document.body){if(Element.getStyle(A,"position")!="static"){return A}}return document.body},within:function(B,A,C){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(B,A,C)}this.xcomp=A;this.ycomp=C;this.offset=this.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=this.realOffset(B);this.xcomp=A+C[0]-this.deltaX;this.ycomp=D+C[1]-this.deltaY;this.offset=this.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}},page:function(C){var B=0,D=0;var A=C;do{B+=A.offsetTop||0;D+=A.offsetLeft||0;if(A.offsetParent==document.body){if(Element.getStyle(A,"position")=="absolute"){break}}}while(A=A.offsetParent);A=C;do{if(!window.opera||A.tagName=="BODY"){B-=A.scrollTop||0;D-=A.scrollLeft||0}}while(A=A.parentNode);return[D,B]},clone:function(A,F){var C=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});A=$(A);var D=Position.page(A);F=$(F);var E=[0,0];var B=null;if(Element.getStyle(F,"position")=="absolute"){B=Position.offsetParent(F);E=Position.page(B)}if(B==document.body){E[0]-=document.body.offsetLeft;E[1]-=document.body.offsetTop}if(C.setLeft){F.style.left=(D[0]-E[0]+C.offsetLeft)+"px"}if(C.setTop){F.style.top=(D[1]-E[1]+C.offsetTop)+"px"}if(C.setWidth){F.style.width=A.offsetWidth+"px"}if(C.setHeight){F.style.height=A.offsetHeight+"px"}},absolutize:function(B){B=$(B);if(B.style.position=="absolute"){return }Position.prepare();var A=Position.positionedOffset(B);var F=A[1];var E=A[0];var C=B.clientWidth;var D=B.clientHeight;B._originalLeft=E-parseFloat(B.style.left||0);B._originalTop=F-parseFloat(B.style.top||0);B._originalWidth=B.style.width;B._originalHeight=B.style.height;B.style.position="absolute";B.style.top=F+"px";B.style.left=E+"px";B.style.width=C+"px";B.style.height=D+"px"},relativize:function(A){A=$(A);if(A.style.position=="relative"){return }Position.prepare();A.style.position="relative";var C=parseFloat(A.style.top||0)-(A._originalTop||0);var B=parseFloat(A.style.left||0)-(A._originalLeft||0);A.style.top=C+"px";A.style.left=B+"px";A.style.height=A._originalHeight;A.style.width=A._originalWidth}};if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){Position.cumulativeOffset=function(A){var B=0,C=0;do{B+=A.offsetTop||0;C+=A.offsetLeft||0;if(A.offsetParent==document.body){if(Element.getStyle(A,"position")=="absolute"){break}}A=A.offsetParent}while(A);return[C,B]}}Element.addMethods();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(B,A){return $A($(B).childNodes).collect(function(C){return(C.nodeType==3?C.nodeValue:((C.hasChildNodes()&&!Element.hasClassName(C,A))?Element.collectTextNodesIgnoreClass(C,A):""))}).flatten().join("")};Element.setContentZoom=function(B,A){B=$(B);B.setStyle({fontSize:(A/100)+"em"});if(navigator.appVersion.indexOf("AppleWebKit")>0){window.scrollBy(0,0)}return B};Element.getOpacity=function(A){return $(A).getStyle("opacity")};Element.setOpacity=function(A,B){return $(A).setStyle({opacity:B})};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){}};Array.prototype.call=function(){var A=arguments;this.each(function(B){B.apply(this,A)})};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},tagifyText:function(A){if(typeof Builder=="undefined"){throw ("Effect.tagifyText requires including script.aculo.us' builder.js library")}var B="position:relative";if(/MSIE/.test(navigator.userAgent)&&!window.opera){B+=";zoom:1"}A=$(A);$A(A.childNodes).each(function(C){if(C.nodeType==3){C.nodeValue.toArray().each(function(D){A.insertBefore(Builder.node("span",{style:B},D==" "?String.fromCharCode(160):D),C)});Element.remove(C)}})},multiple:function(C,B){var A;if(((typeof C=="object")||(typeof C=="function"))&&(C.length)){A=C}else{A=$(C).childNodes}var D=Object.extend({speed:0.1,delay:0},arguments[2]||{});var E=D.delay;$A(A).each(function(G,F){new B(G,Object.extend(D,{delay:F*D.speed+E}))})},PAIRS:{"slide":["SlideDown","SlideUp"],"blind":["BlindDown","BlindUp"],"appear":["Appear","Fade"]},toggle:function(B,A){B=$(B);A=(A||"appear").toLowerCase();var C=Object.extend({queue:{position:"end",scope:(B.id||"global"),limit:1}},arguments[2]||{});Effect[B.visible()?Effect.PAIRS[A][1]:Effect.PAIRS[A][0]](B,C)}};var Effect2=Effect;Effect.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){return((-Math.cos(A*Math.PI)/4)+0.75)+Math.random()/4},wobble:function(A){return(-Math.cos(A*Math.PI*(9*A))/2)+0.5},pulse:function(B,A){A=A||5;return(Math.round((B%(1/A))*A)==0?((B*A*2)-Math.floor(B*A*2)):1-((B*A*2)-Math.floor(B*A*2)))},none:function(A){return 0},full:function(A){return 1}};Effect.ScopedQueue=Class.create();Object.extend(Object.extend(Effect.ScopedQueue.prototype,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=(typeof B.options.queue=="string")?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 A=new Date().getTime();this.effects.invoke("loop",A)}});Effect.Queues={instances:$H(),get:function(A){if(typeof A!="string"){return A}if(!this.instances[A]){this.instances[A]=new Effect.ScopedQueue()}return this.instances[A]}};Effect.Queue=Effect.Queues.get("global");Effect.DefaultOptions={transition:Effect.Transitions.sinoidal,duration:1,fps:60,sync:false,from:0,to:1,delay:0,queue:"parallel"};Effect.Base=function(){};Effect.Base.prototype={position:null,start:function(A){this.options=Object.extend(Object.extend({},Effect.DefaultOptions),A||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.event("beforeStart");if(!this.options.sync){Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).add(this)}},loop:function(A){if(A>=this.startOn){if(A>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return }var C=(A-this.startOn)/(this.finishOn-this.startOn);var B=Math.round(C*this.options.fps*this.options.duration);if(B>this.currentFrame){this.render(C);this.currentFrame=B}}},render:function(A){if(this.state=="idle"){this.state="running";this.event("beforeSetup");if(this.setup){this.setup()}this.event("afterSetup")}if(this.state=="running"){if(this.options.transition){A=this.options.transition(A)}A*=(this.options.to-this.options.from);A+=this.options.from;this.position=A;this.event("beforeUpdate");if(this.update){this.update(A)}this.event("afterUpdate")}},cancel:function(){if(!this.options.sync){Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(A){if(this.options[A+"Internal"]){this.options[A+"Internal"](this)}if(this.options[A]){this.options[A](this)}},inspect:function(){return"#<Effect:"+$H(this).inspect()+",options:"+$H(this.options).inspect()+">"}};Effect.Parallel=Class.create();Object.extend(Object.extend(Effect.Parallel.prototype,Effect.Base.prototype),{initialize:function(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.Event=Class.create();Object.extend(Object.extend(Effect.Event.prototype,Effect.Base.prototype),{initialize:function(){var A=Object.extend({duration:0},arguments[0]||{});this.start(A)},update:Prototype.emptyFunction});Effect.Opacity=Class.create();Object.extend(Object.extend(Effect.Opacity.prototype,Effect.Base.prototype),{initialize:function(A){this.element=$(A);if(!this.element){throw (Effect._elementDoesNotExistError)}if(/MSIE/.test(navigator.userAgent)&&!window.opera&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var B=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(B)},update:function(A){this.element.setOpacity(A)}});Effect.Move=Class.create();Object.extend(Object.extend(Effect.Move.prototype,Effect.Base.prototype),{initialize:function(A){this.element=$(A);if(!this.element){throw (Effect._elementDoesNotExistError)}var B=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(B)},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:Math.round(this.options.x*A+this.originalLeft)+"px",top:Math.round(this.options.y*A+this.originalTop)+"px"})}});Effect.MoveBy=function(B,C,A){return new Effect.Move(B,Object.extend({x:A,y:C},arguments[3]||{}))};Effect.Scale=Class.create();Object.extend(Object.extend(Effect.Scale.prototype,Effect.Base.prototype),{initialize:function(B,A){this.element=$(B);if(!this.element){throw (Effect._elementDoesNotExistError)}var C=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:A},arguments[2]||{});this.start(C)},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(D,C){var E={};if(this.options.scaleX){E.width=Math.round(C)+"px"}if(this.options.scaleY){E.height=Math.round(D)+"px"}if(this.options.scaleFromCenter){var B=(D-this.dims[0])/2;var A=(C-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){E.top=this.originalTop-B+"px"}if(this.options.scaleX){E.left=this.originalLeft-A+"px"}}else{if(this.options.scaleY){E.top=-B+"px"}if(this.options.scaleX){E.left=-A+"px"}}}this.element.setStyle(E)}});Effect.Highlight=Class.create();Object.extend(Object.extend(Effect.Highlight.prototype,Effect.Base.prototype),{initialize:function(A){this.element=$(A);if(!this.element){throw (Effect._elementDoesNotExistError)}var B=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(B)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return }this.oldStyle={backgroundImage:this.element.getStyle("background-image")};this.element.setStyle({backgroundImage:"none"});if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(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+(Math.round(this._base[D]+(this._delta[D]*A)).toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=Class.create();Object.extend(Object.extend(Effect.ScrollTo.prototype,Effect.Base.prototype),{initialize:function(A){this.element=$(A);this.start(arguments[1]||{})},setup:function(){Position.prepare();var B=Position.cumulativeOffset(this.element);if(this.options.offset){B[1]+=this.options.offset}var A=window.innerHeight?window.height-window.innerHeight:document.body.scrollHeight-(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight);this.scrollStart=Position.deltaY;this.delta=(B[1]>A?A:B[1])-this.scrollStart},update:function(A){Position.prepare();window.scrollTo(Position.deltaX,this.scrollStart+(A*this.delta))}});Effect.Fade=function(B){B=$(B);var A=B.getInlineOpacity();var C=Object.extend({from:B.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(B,C)};Effect.Appear=function(A){A=$(A);var B=Object.extend({from:(A.getStyle("display")=="none"?0:A.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(A,B)};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,afterSetup: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(B){B=$(B);var A={top:B.getStyle("top"),left:B.getStyle("left")};return new Effect.Move(B,{x:20,y:0,duration:0.05,afterFinishInternal:function(C){new Effect.Move(C.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(D){new Effect.Move(D.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(E){new Effect.Move(E.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(F){new Effect.Move(F.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(G){new Effect.Move(G.element,{x:-20,y:0,duration:0.05,afterFinishInternal:function(H){H.element.undoPositioned().setStyle(A)}})}})}})}})}})}})};Effect.SlideDown=function(B){B=$(B).cleanWhitespace();var C=B.down().getStyle("bottom");var A=B.getDimensions();return new Effect.Scale(B,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:A.height,originalWidth:A.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:C})}},arguments[1]||{}))};Effect.SlideUp=function(A){A=$(A).cleanWhitespace();var B=A.down().getStyle("bottom");return new Effect.Scale(A,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(C){C.element.makePositioned();C.element.down().makePositioned();if(window.opera){C.element.setStyle({top:""})}C.element.makeClipping().show()},afterUpdateInternal:function(C){C.element.down().setStyle({bottom:(C.dims[0]-C.element.clientHeight)+"px"})},afterFinishInternal:function(C){C.element.hide().undoClipping().undoPositioned().setStyle({bottom:B});C.element.down().undoPositioned()}},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(B){B=$(B);var C=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var A={top:B.style.top,left:B.style.left,height:B.style.height,width:B.style.width,opacity:B.getInlineOpacity()};var H=B.getDimensions();var F,G;var E,D;switch(C.direction){case"top-left":F=G=E=D=0;break;case"top-right":F=H.width;G=D=0;E=-H.width;break;case"bottom-left":F=E=0;G=H.height;D=-H.height;break;case"bottom-right":F=H.width;G=H.height;E=-H.width;D=-H.height;break;case"center":F=H.width/2;G=H.height/2;E=-H.width/2;D=-H.height/2;break}return new Effect.Move(B,{x:F,y:G,duration:0.01,beforeSetup:function(I){I.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(I){new Effect.Parallel([new Effect.Opacity(I.element,{sync:true,to:1,from:0,transition:C.opacityTransition}),new Effect.Move(I.element,{x:E,y:D,sync:true,transition:C.moveTransition}),new Effect.Scale(I.element,100,{scaleMode:{originalHeight:H.height,originalWidth:H.width},sync:true,scaleFrom:window.opera?1:0,transition:C.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(J){J.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(J){J.effects[0].element.undoClipping().undoPositioned().setStyle(A)}},C))}})};Effect.Shrink=function(B){B=$(B);var C=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var A={top:B.style.top,left:B.style.left,height:B.style.height,width:B.style.width,opacity:B.getInlineOpacity()};var F=B.getDimensions();var E,D;switch(C.direction){case"top-left":E=D=0;break;case"top-right":E=F.width;D=0;break;case"bottom-left":E=0;D=F.height;break;case"bottom-right":E=F.width;D=F.height;break;case"center":E=F.width/2;D=F.height/2;break}return new Effect.Parallel([new Effect.Opacity(B,{sync:true,to:0,from:1,transition:C.opacityTransition}),new Effect.Scale(B,window.opera?1:0,{sync:true,transition:C.scaleTransition,restoreAfterFinish:true}),new Effect.Move(B,{x:E,y:D,sync:true,transition:C.moveTransition})],Object.extend({beforeStartInternal:function(G){G.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(G){G.effects[0].element.hide().undoClipping().undoPositioned().setStyle(A)}},C))};Effect.Pulsate=function(C){C=$(C);var D=arguments[1]||{};var B=C.getInlineOpacity();var E=D.transition||Effect.Transitions.sinoidal;var A=function(F){return E(1-Effect.Transitions.pulse(F,D.pulses))};A.bind(E);return new Effect.Opacity(C,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(F){F.element.setStyle({opacity:B})}},D),{transition:A}))};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();Object.extend(Object.extend(Effect.Morph.prototype,Effect.Base.prototype),{initialize:function(B){this.element=$(B);if(!this.element){throw (Effect._elementDoesNotExistError)}var C=Object.extend({style:{}},arguments[1]||{});if(typeof C.style=="string"){if(C.style.indexOf(":")==-1){var D="",A="."+C.style;$A(document.styleSheets).reverse().each(function(E){if(E.cssRules){cssRules=E.cssRules}else{if(E.rules){cssRules=E.rules}}$A(cssRules).reverse().each(function(F){if(A==F.selectorText){D=F.style.cssText;throw $break}});if(D){throw $break}});this.style=D.parseStyle();C.afterFinishInternal=function(E){E.element.addClassName(E.options.style);E.transforms.each(function(F){if(F.style!="opacity"){E.element.style[F.style.camelize()]=""}})}}else{this.style=C.style.parseStyle()}}else{this.style=$H(C.style)}this.start(C)},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(G){var B=G[0].underscore().dasherize(),F=G[1],E=null;if(F.parseColor("#zzzzzz")!="#zzzzzz"){F=F.parseColor();E="color"}else{if(B=="opacity"){F=parseFloat(F);if(/MSIE/.test(navigator.userAgent)&&!window.opera&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(F)){var D=F.match(/^([\+\-]?[0-9\.]+)(.*)$/),F=parseFloat(D[1]),E=(D.length==3)?D[2]:null}}}var C=this.element.getStyle(B);return $H({style:B,originalValue:E=="color"?A(C):parseFloat(C||0),targetValue:E=="color"?A(F):F,unit:E})}.bind(this)).reject(function(B){return((B.originalValue==B.targetValue)||(B.unit!="color"&&(isNaN(B.originalValue)||isNaN(B.targetValue))))})},update:function(A){var B=$H(),C=null;this.transforms.each(function(D){C=D.unit=="color"?$R(0,2).inject("#",function(E,F,G){return E+(Math.round(D.originalValue[G]+(D.targetValue[G]-D.originalValue[G])*A)).toColorPart()}):D.originalValue+Math.round(((D.targetValue-D.originalValue)*A)*1000)/1000+D.unit;B[D.style]=C});this.element.setStyle(B)}});Effect.Transform=Class.create();Object.extend(Effect.Transform.prototype,{initialize:function(A){this.tracks=[];this.options=arguments[1]||{};this.addTracks(A)},addTracks:function(A){A.each(function(B){var C=$H(B).values().first();this.tracks.push($H({ids:$H(B).keys().first(),effect:Effect.Morph,options:{style:C}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(B){var A=[$(B.ids)||$$(B.ids)].flatten();return A.map(function(C){return new B.effect(C,Object.extend({sync:true},B.options))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=["azimuth","backgroundAttachment","backgroundColor","backgroundImage","backgroundPosition","backgroundRepeat","borderBottomColor","borderBottomStyle","borderBottomWidth","borderCollapse","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRightColor","borderRightStyle","borderRightWidth","borderSpacing","borderTopColor","borderTopStyle","borderTopWidth","bottom","captionSide","clear","clip","color","content","counterIncrement","counterReset","cssFloat","cueAfter","cueBefore","cursor","direction","display","elevation","emptyCells","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","height","left","letterSpacing","lineHeight","listStyleImage","listStylePosition","listStyleType","marginBottom","marginLeft","marginRight","marginTop","markerOffset","marks","maxHeight","maxWidth","minHeight","minWidth","opacity","orphans","outlineColor","outlineOffset","outlineStyle","outlineWidth","overflowX","overflowY","paddingBottom","paddingLeft","paddingRight","paddingTop","page","pageBreakAfter","pageBreakBefore","pageBreakInside","pauseAfter","pauseBefore","pitch","pitchRange","position","quotes","richness","right","size","speakHeader","speakNumeral","speakPunctuation","speechRate","stress","tableLayout","textAlign","textDecoration","textIndent","textShadow","textTransform","top","unicodeBidi","verticalAlign","visibility","voiceFamily","volume","whiteSpace","widows","width","wordSpacing","zIndex"];Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.prototype.parseStyle=function(){var A=Element.extend(document.createElement("div"));A.innerHTML='<div style="'+this+'"></div>';var C=A.down().style,B=$H();Element.CSS_PROPERTIES.each(function(D){if(C[D]){B[D]=C[D]}});if(/MSIE/.test(navigator.userAgent)&&!window.opera&&this.indexOf("opacity")>-1){B.opacity=this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]}return B};Element.morph=function(A,B){new Effect.Morph(A,Object.extend({style:B},arguments[2]||{}));return A};["setOpacity","getOpacity","getInlineOpacity","forceRerendering","setContentZoom","collectTextNodes","collectTextNodesIgnoreClass","morph"].each(function(A){Element.Methods[A]=Element[A]});Element.Methods.visualEffect=function(B,A,C){s=A.gsub(/_/,"-").camelize();effect_class=s.charAt(0).toUpperCase()+s.substring(1);new Effect[effect_class](B,C);return $(B)};Element.addMethods();var SkitchLoader={Version:1,SrcPath:"/js/src/",isLoaded:false,Modules:["plasq.base","plasq.ajax","plasq.iphone","objects","object.div","object.text","object.image","object.container","object.selectcopy","object.rightpane","object.section","object.comments"],require:function(A){document.write('<script type="text/javascript" src="'+A+"?"+SkitchLoader.Version+'"><\/script>')},loadModule:function(A){path=SkitchLoader.SrcPath;SkitchLoader.require(path+A+".js");return true},load:function(){if(SkitchLoader.isLoaded){return false}SkitchLoader.isLoaded=true;if((typeof Prototype=="undefined")||(typeof Element=="undefined")||(typeof Element.Methods=="undefined")||parseFloat(Prototype.Version.split(".")[0]+"."+Prototype.Version.split(".")[1])<1.5){throw ("Skitch Web requires the Prototype JavaScript framework >= 1.5.0")}$A(document.getElementsByTagName("script")).findAll(function(A){return(A.src&&A.src.match(/\/js\/src\/skitchloader\.js(\?.*)?$/))}).each(function(A){SkitchLoader.Version=A.src.split("?")[1]});SkitchLoader.Modules.each(function(A){SkitchLoader.loadModule(A)})}};if(!plasq){var plasq={}}if(!plasq.mySkitch){plasq.mySkitch={}}plasq.mySkitch.load=function(B,C,A){new Ajax.Action(B,["param="+C,"back="+A])};plasq.mySkitch.clear=function(A){$(A).innerHTML=""};plasq.switchControl=function(A){if($(A).disabled){return false}$(A).checked=$(A).checked?false:true;return false};plasq.switchControlOn=function(A){if($(A).disabled){return false}$(A).checked=true;return false};plasq.switchControlOff=function(A){if($(A).disabled){return false}$(A).checked=false;return false};plasq.setCookie=function(D,E,C){var A=new Date();var B=new Date();if(C==null||C==0){C=1}B.setTime(A.getTime()+3600000*24*C);document.cookie=D+"="+escape(E)+";expires="+B.toGMTString()};Ajax.URL="/ajaxStream/";Ajax.Action=Class.create();Ajax.Action.prototype=Object.extend(Ajax.Request.prototype,{initialize:function(event,param,callback,url){if(!url){url=Ajax.URL}var params="event="+event;if(param){param.each(function(item){params=params+"&"+item})}this.transport=Ajax.getTransport();var options={method:"get",parameters:params,onComplete:Prototype.emptyFunction};if(callback){options.onComplete=callback}else{options.onComplete=(function(res){if(res.status==200){try{eval(res.responseText)}catch(err){alert(res.responseText+"\n\nerror: "+err.description)}}}).bind(this)}this.setOptions(options);this.request(url)}});plasq.iphone={sendEmail:function(C,B){var A=encodeURIComponent($("emailto").value);var C=encodeURIComponent(C);var B=encodeURIComponent(B);window.location.href="mailto:"+A+"?subject=Skitch'd: "+C+"&body=Here is an image I wanted to show you:%0A"+B+"%0A%0ASent using http://plasq.com/skitch"}};if(typeof plasq=="undefined"||typeof plasq.mySkitch=="undefined"){throw ("objects.js requires including the plasq.base.js library")}if(!plasq.mySkitch.classes){plasq.mySkitch.classes={objectID:0}}plasq.mySkitch.classes.div=Class.create();plasq.mySkitch.classes.div.prototype={initialize:function(C,B,D,A){this.parent=$(C);this.id=D?D:"customdiv_"+(++plasq.mySkitch.classes.objectID);this.element=document.createElement("div");this.element.id=this.id;this.element.className=A;this.element.parentObject=this;if(B){this.element.innerHTML=B}this.parent.appendChild(this.element)}};plasq.mySkitch.classes.text=Class.create();plasq.mySkitch.classes.text.prototype={initialize:function(B,C,A){this.parent=$(B);this.text=C;this.id="text_"+(++plasq.mySkitch.classes.objectID);if(A){this.owner=A}this.element=document.createElement("div");this.element.id=this.id+"_div";this.element.className="myskitch-text";this.element.parentObject=this;this.element.innerHTML=this.text;this.parent.appendChild(this.element)}};plasq.mySkitch.classes.image=Class.create();plasq.mySkitch.classes.image.setupWidths=function(){document.getElementsByClassName("myskitch-image").each(function(A){A.parentObject.setupWidth()})};plasq.mySkitch.classes.image.prototype={initialize:function(I,A,G,F,E,D,C,H,B){this.parent=$(I);this.src=A;this.dst=G;this.alt=E;this.guid=F;this.width=C;this.height=H;this.outerimage=D;this.id="image_"+(++plasq.mySkitch.classes.objectID);if(B){this.owner=B}this.element=document.createElement("div");this.element.id=this.id+"_div";this.element.className="myskitch-image";this.element.parentObject=this;if(this.outerimage){this.outerelement=document.createElement("div");this.outerelement.id=this.id+"_outerdiv";this.outerelement.className="myskitch-outer-image";this.outerelement.parentObject=this;this.parent.appendChild(this.outerelement);this.outerelement.appendChild(this.element);this.container=this.outerelement}else{this.container=this.element;this.parent.appendChild(this.element)}this.img=document.createElement("img");this.img.id=this.id+"_img";this.img.src=this.src;this.img.alt=this.alt;if(this.img.alt){this.img.onmouseover=(this.showImageTooltip).bind(this);this.img.onmousemove=(this.moveImageTooltip).bind(this);this.img.onmouseout=(this.hideImageTooltip).bind(this)}else{this.img.onmouseover=(this.checkShowActions).bind(this);this.img.onmouseout=(this.checkHideActions).bind(this)}this.img.style.border="0px";this.img.className="myskitch-image-img";this.img.parentObject=this;if(this.dst){this.alink=document.createElement("a");this.alink.href=this.dst;this.alink.appendChild(this.img);this.element.appendChild(this.alink);this.info=document.createElement("div");this.info.id=this.id+"_info";this.info.className="myskitch-image-info";this.info.parentObject=this;this.info.innerHTML="info";this.element.appendChild(this.info);this.actions=document.createElement("div");this.actions.id=this.id+"_actions";this.actions.className="myskitch-image-actions";this.actions.parentObject=this;this.actions.style.display=this.outerimage?"none":"block";this.actions.enabled=false;this.actions.container=document.createElement("div");this.actions.container.id=this.id+"_actions_container";this.actions.container.className="myskitch-image-actions-container";this.actions.container.parentObject=this;this.actions.onmouseover=(this.showActions).bind(this);this.actions.onmouseout=(this.checkHideActions).bind(this);this.actions.onclick=(function(){return false});this.actions.onmouseup=(this.followLink).bind(this);this.actions.container.appendChild(this.actions);this.element.appendChild(this.actions.container)}else{this.info=document.createElement("div");this.info.id=this.id+"_info";this.info.className="myskitch-image-info";this.info.parentObject=this;this.info.innerHTML="info";this.element.appendChild(this.info);this.actions=document.createElement("div");this.actions.id=this.id+"_actions";this.actions.className="myskitch-image-actions";this.actions.parentObject=this;this.actions.style.display=this.outerimage?"none":"block";this.actions.enabled=false;this.actions.container=document.createElement("div");this.actions.container.id=this.id+"_actions_container";this.actions.container.className="myskitch-image-actions-container";this.actions.container.parentObject=this;this.actions.onmouseover=(this.showActions).bind(this);this.actions.onmouseout=(this.checkHideActions).bind(this);this.actions.onclick=(function(){return false});this.actions.container.appendChild(this.actions);this.element.appendChild(this.actions.container);this.element.appendChild(this.img)}this.setupWidth()},followLink:function(){if(!plasq.mySkitch.dragging){window.location.href=this.dst}},enableInfo:function(){this.actions.infoText=document.createElement("div");this.actions.infoText.id=this.id+"_info";this.actions.infoText.className="myskitch-image-infotext";this.actions.infoText.parentObject=this;this.actions.appendChild(this.actions.infoText);this.actions.enabled=true;this.setupWidth();return this},enablePermissions:function(){this.actions.permBtn=document.createElement("div");this.actions.permBtn.id=this.id+"_actions_permissions";this.actions.permBtn.className="myskitch-image-action";this.actions.permBtn.parentObject=this;this.actions.permBtn.a=document.createElement("div");this.actions.permBtn.a.id=this.id+"_actions_permissions_a";this.actions.permBtn.a.className="myskitch-comment-edit";this.actions.permBtn.a.parentObject=this;this.actions.permBtn.a.onclick=(this.editPermClick).bind(this);this.actions.permBtn.a.title="Edit this permissions for this image";this.actions.permBtn.appendChild(this.actions.permBtn.a);this.actions.appendChild(this.actions.permBtn);this.actions.enabled=true;this.setupWidth();return this},enableSlurp:function(A){this.actions.slurpBtn=document.createElement("div");this.actions.slurpBtn.id=this.id+"_actions_slurp";this.actions.slurpBtn.className="myskitch-image-action";this.actions.slurpBtn.parentObject=this;this.actions.appendChild(this.actions.slurpBtn);this.actions.slurpBtn.skitchit=new plasq.mySkitch.classes.skitchit(this.actions.slurpBtn,A,false,"open");this.actions.enabled=true;this.setupWidth();return this},enableRotate:function(){this.actions.rotateBtn=document.createElement("div");this.actions.rotateBtn.id=this.id+"_actions_delete";this.actions.rotateBtn.className="myskitch-image-action";this.actions.rotateBtn.parentObject=this;this.actions.rotateBtn.left=document.createElement("a");this.actions.rotateBtn.left.id=this.id+"_actions_rotate_left";this.actions.rotateBtn.left.className="myskitch-image-action-rotate";this.actions.rotateBtn.left.parentObject=this;this.actions.rotateBtn.left.onmousedown=(this.rotateLeftWrapper).bind(this);this.actions.rotateBtn.left.onmouseup=(this.rotateStop).bind(this);this.actions.rotateBtn.left.innerHTML="Left ";this.actions.rotateBtn.left.style.cursor="pointer";this.actions.rotateBtn.right=document.createElement("a");this.actions.rotateBtn.right.id=this.id+"_actions_rotate_right";this.actions.rotateBtn.right.className="myskitch-image-action-rotate";this.actions.rotateBtn.right.parentObject=this;this.actions.rotateBtn.right.onmousedown=(this.rotateRightWrapper).bind(this);this.actions.rotateBtn.right.onmouseup=(this.rotateStop).bind(this);this.actions.rotateBtn.right.innerHTML="Right";this.actions.rotateBtn.right.style.cursor="pointer";this.actions.rotateBtn.appendChild(this.actions.rotateBtn.left);this.actions.rotateBtn.appendChild(this.actions.rotateBtn.right);this.actions.appendChild(this.actions.rotateBtn);this.actions.enabled=true;this.setupWidth();return this},enableDelete:function(){this.actions.deleteBtn=document.createElement("div");this.actions.deleteBtn.id=this.id+"_actions_delete";this.actions.deleteBtn.className="myskitch-image-action";this.actions.deleteBtn.parentObject=this;this.actions.deleteBtn.a=document.createElement("a");this.actions.deleteBtn.a.id=this.id+"_actions_delete_a";this.actions.deleteBtn.a.className="myskitch-image-action-delete";this.actions.deleteBtn.a.parentObject=this;this.actions.deleteBtn.a.onclick=(this.deleteBtnClick).bind(this);this.actions.deleteBtn.a.onmousedown=(function(){plasq.mySkitch.dragging=true});this.actions.deleteBtn.a.innerHTML="Delete";this.actions.deleteBtn.appendChild(this.actions.deleteBtn.a);this.actions.appendChild(this.actions.deleteBtn);this.actions.enabled=true;this.setupWidth();return this},enableDescription:function(A,B){this.description=A;this.actions.editDescBtn=document.createElement("div");this.actions.editDescBtn.id=this.id+"_actions_description";this.actions.editDescBtn.parentObject=this;if(B){this.actions.editDescBtn.onclick=(this.editDescClick).bind(this);this.actions.editDescBtn.onmousedown=(function(){plasq.mySkitch.dragging=true});if(A&&A!="&nbsp;"){this.actions.editDescBtn.innerHTML=this.description;this.actions.editDescBtn.className="myskitch-edit-desc-display"}else{this.actions.editDescBtn.innerHTML="Click here to add a description";this.actions.editDescBtn.className="myskitch-edit-desc-action"}this.actions.editDescDiv=document.createElement("div");this.actions.editDescDiv.className="myskitch-edit-desc-div";this.actions.editDescDiv.editor=document.createElement("textarea");this.actions.editDescDiv.editor.className="myskitch-edit-desc-editor";this.actions.editDescDiv.save=document.createElement("input");this.actions.editDescDiv.save.onclick=(this.saveDescClick).bind(this);this.actions.editDescDiv.save.className="myskitch-edit-desc-editor-save";this.actions.editDescDiv.save.type="button";this.actions.editDescDiv.save.value="Save";this.actions.editDescDiv.cancel=document.createElement("input");this.actions.editDescDiv.cancel.onclick=(this.cancelDescClick).bind(this);this.actions.editDescDiv.cancel.className="myskitch-edit-desc-editor-cancel";this.actions.editDescDiv.cancel.type="button";this.actions.editDescDiv.cancel.value="Cancel";this.actions.editDescDiv.appendChild(this.actions.editDescDiv.editor);this.actions.editDescDiv.appendChild(document.createElement("br"));this.actions.editDescDiv.appendChild(this.actions.editDescDiv.save);this.actions.editDescDiv.appendChild(this.actions.editDescDiv.cancel);this.parent.appendChild(this.actions.editDescBtn);this.parent.appendChild(this.actions.editDescDiv)}else{if(A&&A!="&nbsp;"){this.actions.editDescBtn.className="myskitch-edit-desc-show";this.actions.editDescBtn.innerHTML=this.description;this.parent.appendChild(this.actions.editDescBtn)}}return this},editPermClick:function(){alert("You're not allowed to edit permissions for this image.")},editDescClick:function(){this.actions.editDescDiv.editor.value="Loading...";this.actions.editDescDiv.editor.disabled=true;this.actions.editDescDiv.save.disabled=true;this.actions.editDescDiv.style.display="block";this.actions.editDescBtn.style.display="none";new Ajax.Action("rawobjectdesc",["guid="+this.guid],(function(A){var B=A.responseText;if(B&&B!="-1"){if(B==" "){B=""}this.actions.editDescDiv.editor.value=B;this.actions.editDescDiv.editor.disabled=false;this.actions.editDescDiv.save.disabled=false;this.actions.editDescDiv.editor.focus()}else{this.cancelDescClick()}}).bind(this))},saveDescClick:function(){var A=encodeURIComponent(this.actions.editDescDiv.editor.value);var B=encodeURIComponent(this.guid);var C="event=setobjectdesc&desc="+A+"&guid="+B;if(!A){this.actions.editDescBtn.innerHTML="Click here to add a description";this.actions.editDescBtn.className="myskitch-edit-desc-action"}else{this.actions.editDescBtn.className="myskitch-edit-desc-display";this.actions.editDescBtn.innerHTML="Loading..."}this.cancelDescClick();new Ajax.Updater(this.actions.editDescBtn,Ajax.URL,{parameters:C,onComplete:(function(E,D){if(!A){this.actions.editDescBtn.innerHTML="Click here to add a description"}else{new Effect.Highlight(this.actions.editDescBtn,{duration:2})}}).bind(this),asynchronous:true,evalScripts:false})},cancelDescClick:function(){this.actions.editDescDiv.style.display="none";this.actions.editDescBtn.style.display="block"},deleteBtnClick:function(){if(confirm("Are you sure you want to delete this image?")){new Ajax.Action("delete",["param="+this.guid]);if(this.outerimage){this.parent.removeChild(this.outerelement)}else{this.parent.removeChild(this.element);plasq.mySkitch.clear("content");plasq.mySkitch.container=new plasq.mySkitch.classes.container("content");plasq.mySkitch.container.addText("&nbsp;");plasq.mySkitch.container.addSection("Image successfully deleted");plasq.mySkitch.container.addText("Redirecting...");if(plasq.mySkitch.backLink){window.location=plasq.mySkitch.backLink}}}plasq.mySkitch.dragging=false},showActions:function(){if(!this.outerimage){return false}var A=this.actions;if(A.effect){A.effect.cancel()}Element.setOpacity(A,1);A.style.display="block"},checkShowActions:function(){if(!this.outerimage){return false}if(this.actions.enabled){var A=this.actions;if(A.effect){A.effect.cancel()}if(A.style.display=="block"){return this.showActions()}Element.setOpacity(A,0);A.style.display="block";A.animating=true;A.effect=new Effect.Opacity(A,{duration:0.5,from:0,to:0.9,afterFinish:function(){A.animating=false}})}},checkHideActions:function(){if(!this.outerimage){return false}if(this.actions.enabled){var A=this.actions;if(A.effect){A.effect.cancel()}A.animating=true;A.effect=new Effect.Opacity(A,{duration:0.5,from:0.9,to:0,afterFinish:function(){A.style.display="none";A.animating=false}})}},setupWidth:function(){if(this.width>0){var B=(parseInt(window.innerWidth)-85);var C=0;if(plasq.mySkitch.selectCopyContainer){C=parseInt(plasq.mySkitch.selectCopyContainer.element.getDimensions().width)}B=B-C;windowWidth=B;if(this.width<=B){B=parseInt(this.width)}if(this.img){this.img.style.width=parseInt(B)+"px"}if(this.actions.enabled){actionWidth=(B-2);if(!this.dst){if(actionWidth<225){actionWidth=225}}this.actions.style.width=actionWidth+"px"}if(this.actions.infoText){var D=Math.round(100*B/this.width);this.actions.infoText.innerHTML=parseInt(this.width)+"x"+parseInt(this.height)+"px @ "+D+"%"}var A=document.getElementsByClassName("comment-image-external");$A(A).each(function(E){if(windowWidth<E.originalX){E.style.width=windowWidth+"px"}else{E.style.width=E.originalX+"px"}})}},showImageTooltip:function(C){this.checkShowActions();var A=$("tooltip_body");var B=$("tooltip");if(A){A.innerHTML=this.alt}if(B){if(B.effect){B.effect.cancel()}B.animating=true;B.style.left=(Event.pointerX(C)-160)+"px";B.style.top=(Event.pointerY(C)-35)+"px";if(parseInt(B.style.left)<-20){B.style.left="-20px"}if(parseInt(B.style.top)<-20){B.style.top="-20px"}Element.setOpacity(B,0);B.style.display="block";B.effect=new Effect.Opacity(B,{duration:0.5,from:0,to:0.9,queue:{scope:"_tooltip",position:"front"},afterFinish:function(){B.animating=false;B.activeObject=this}})}},moveImageTooltip:function(B){var A=$("tooltip");if(A){if(!A.animating&&A.activeObject==this){A.style.display="block";Element.setOpacity(A,0.9)}A.style.left=(Event.pointerX(B)-160)+"px";A.style.top=(Event.pointerY(B)-35)+"px";if(parseInt(A.style.left)<-20){A.style.left="-20px"}if(parseInt(A.style.top)<-20){A.style.top="-20px"}}},hideImageTooltip:function(B){this.checkHideActions();var A=$("tooltip");if(A){if(A.effect){A.effect.cancel()}A.animating=true;A.effect=new Effect.Opacity(A,{duration:0.5,from:0.9,to:0,queue:{scope:"_tooltip",position:"front"},afterFinish:function(){A.style.display="none";A.animating=false}})}},rotate:function(H,D){var G=this.img;if(!D){G.angle=((G.angle==undefined?0:G.angle)+H)%360}else{G.angle=H}if(G.angle>=0){var A=Math.PI*G.angle/180}else{var A=Math.PI*(360+G.angle)/180}var E=Math.cos(A);var F=Math.sin(A);if(document.all&&!window.opera){var C=document.createElement("img");C.src=G.src;C.height=G.height;C.width=G.width;C.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+E+",M12="+(-F)+",M21="+F+",M22="+E+",SizingMethod='auto expand')"}else{var C=document.createElement("canvas");if(!G.oImage){C.oImage=new Image();C.oImage.src=G.src}else{C.oImage=G.oImage}C.style.width=C.width=Math.abs(E*C.oImage.width)+Math.abs(F*C.oImage.height);C.style.height=C.height=Math.abs(E*C.oImage.height)+Math.abs(F*C.oImage.width);var B=C.getContext("2d");B.save();if(A<=Math.PI/2){B.translate(F*C.oImage.height,0)}else{if(A<=Math.PI){B.translate(C.width,-E*C.oImage.height)}else{if(A<=1.5*Math.PI){B.translate(-E*C.oImage.width,C.height)}else{B.translate(0,-F*C.oImage.width)}}}B.rotate(A);B.drawImage(C.oImage,0,0,C.oImage.width,C.oImage.height);B.restore()}C.id=G.id;C.angle=G.angle;G.parentNode.replaceChild(C,G);this.img=C},rotateRightWrapper:function(){this.rotateStop();this.rotateRight(this.rotateCounter)},rotateLeftWrapper:function(){this.rotateStop();this.rotateLeft(this.rotateCounter)},rotateRight:function(A){if(A!=this.rotateCounter){return false}else{this.rotate(1);setTimeout("$('"+this.id+"_div').parentObject.rotateRight("+this.rotateCounter+");",0)}},rotateLeft:function(A){if(A!=this.rotateCounter){return false}else{this.rotate(-1);setTimeout("$('"+this.id+"_div').parentObject.rotateLeft("+this.rotateCounter+");",0)}},rotateStop:function(){if(!this.rotateCounter){this.rotateCounter=1}else{this.rotateCounter++}}};plasq.mySkitch.classes.container=Class.create();plasq.mySkitch.classes.container.prototype={initialize:function(A){this.parent=$(A);this.id="image_strip_"+(++plasq.mySkitch.classes.objectID);this.element=document.createElement("div");this.element.id=this.id;this.element.className="myskitch-image-strip";this.element.parentObject=this;this.parent.appendChild(this.element)},addText:function(A){return new plasq.mySkitch.classes.text(this.element,A,this)},addImage:function(F,G,A,E,C,B,D){return new plasq.mySkitch.classes.image(this.element,F,G,A,E,(C?true:false),B,D,this)},addDiv:function(B,C,A){return new plasq.mySkitch.classes.div(this.element,B,C,A)},addSection:function(D,B,A,C){return new plasq.mySkitch.classes.section(this.element,D,B,A,C,this)},addSelectCopy:function(C,B,A){return new plasq.mySkitch.classes.selectCopy(this.element,C,B,A,this)},addSelectCopyContainer:function(){return new plasq.mySkitch.classes.selectCopyContainer(this.element,this)},addComments:function(A,D,B,C,E){return new plasq.mySkitch.classes.comments(this.element,A,D,B,C,this,E)},addPermissions:function(A,B){return new plasq.mySkitch.classes.permissions(this.element,A,B,this)},addTwitter:function(B,A){return new plasq.mySkitch.classes.twitter(this.element,B,A,this)}};plasq.mySkitch.classes.selectCopy=Class.create();plasq.mySkitch.classes.selectCopy.prototype={initialize:function(B,D,E,C,A){this.parent=$(B);this.section=D;this.intro=C;this.text=E.replace("[br]","\n");this.id="selectcopy_"+(++plasq.mySkitch.classes.objectID);if(A){this.owner=A}this.element=document.createElement("div");this.element.id=this.id+"_div";this.element.className="myskitch-selectcopy";this.element.parentObject=this;this.sectionTitle=document.createElement("div");this.sectionTitle.id=this.id+"_title";this.sectionTitle.className="myskitch-selectcopy-title";this.sectionTitle.innerHTML=this.section;this.sectionTitle.parentObject=this;this.element.appendChild(this.sectionTitle);this.textCopiedParent=document.createElement("div");this.textCopiedParent.id=this.id+"_textcopiedparent";this.textCopiedParent.className="myskitch-selectcopy-relative-parent";this.textCopiedParent.parentObject=this;this.textCopiedLabel=document.createElement("div");this.textCopiedLabel.id=this.id+"_textcopiedlabel";this.textCopiedLabel.className="myskitch-selectcopy-textcopied";this.textCopiedLabel.style.display="none";this.textCopiedLabel.parentObject=this;this.textCopiedParent.appendChild(this.textCopiedLabel);this.element.appendChild(this.textCopiedParent);this.textHelpParent=document.createElement("div");this.textHelpParent.id=this.id+"_texthelpparent";this.textHelpParent.className="myskitch-selectcopy-relative-parent";this.textHelpParent.parentObject=this;this.textHelpLabel=document.createElement("div");this.textHelpLabel.id=this.id+"_texthelplabel";this.textHelpLabel.className="myskitch-selectcopy-texthelp myskitch-selectcopy-texthelp-pos";this.textHelpLabel.style.display="none";this.textHelpLabel.parentObject=this;this.textHelpBody=document.createElement("div");this.textHelpBody.id=this.id+"_texthelpbody";this.textHelpBody.className="myskitch-selectcopy-texthelp-body";this.textHelpBody.innerHTML=this.intro;this.textHelpBody.parentObject=this;this.textHelpLabel.appendChild(this.textHelpBody);this.textHelpParent.appendChild(this.textHelpLabel);this.element.appendChild(this.textHelpParent);this.sectionText=document.createElement("input");this.sectionText.id=this.id+"_title";this.sectionText.className="myskitch-selectcopy-text";this.sectionText.value=E.replace("[br]","");this.sectionText.parentObject=this;this.sectionText.onclick=(function(){this.select()});this.element.appendChild(this.sectionText);this.copyBtn=document.createElement("div");this.copyBtn.id=this.id+"_copybtn";this.copyBtn.className="myskitch-selectcopy-copybtn";this.copyBtn.innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="copybtn" width="33" height="16" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="FlashVars" value="tooltipid='+escape(this.textCopiedLabel.id)+"&cliptext="+escape(this.text)+'" /><param name="movie" value="/res/copybtn.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="/res/copybtn.swf" FlashVars="tooltipid='+escape(this.textCopiedLabel.id)+"&cliptext="+escape(this.text)+'" quality="high" bgcolor="#ffffff" width="33" height="16" swLiveConnect=true id="copybtn" name="copybtn" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';this.element.appendChild(this.copyBtn);this.helpBtn=document.createElement("div");this.helpBtn.id=this.id+"_helpbtn";this.helpBtn.className="myskitch-selectcopy-helpbtn";this.helpBtn.parentObject=this;this.helpBtn.onmouseover=(function(){this.helpBtn.className="myskitch-selectcopy-helpbtn-over";this.textHelpLabel.setOpacity(1).show();setTimeout("Effect.Fade( '"+this.textHelpLabel.id+"', { fps: 60, duration: 1.0 } );",15000)}).bind(this);this.helpBtn.onmouseout=(function(){this.helpBtn.className="myskitch-selectcopy-helpbtn";this.textHelpLabel.style.display="none"}).bind(this);this.element.appendChild(this.helpBtn);this.textCopy=document.createElement("div");this.textCopy.id=this.id+"_textcopy";this.textCopy.className="myskitch-selectcopy-textcopy";this.textCopy.parentObject=this;this.element.appendChild(this.textCopy);this.parent.appendChild(this.element)},copyContent:function(){if(window.clipboardData){window.clipboardData.setData("Text",this.text);Element.setOpacity(this.textCopiedLabel,1);Element.show(this.textCopiedLabel)}else{this.textCopy.innerHTML='<embed src="/res/clipcopy.swf" FlashVars="cliptext='+escape(this.text)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';this.textCopiedLabel.setOpacity(1).show()}setTimeout("Effect.Fade( '"+this.textCopiedLabel.id+"', { fps: 60, duration: 1.0 } );",1500);this.sectionText.select();plasq.mySkitch.browser.trackStats("COPYLINK",this.section)}};plasq.mySkitch.classes.selectCopyContainer=Class.create();plasq.mySkitch.classes.selectCopyContainer.prototype={initialize:function(B,A){this.parent=$(B);this.id="selectcopycontainer_"+(++plasq.mySkitch.classes.objectID);if(A){this.owner=A}this.element=document.createElement("div");this.element.id=this.id+"_div";this.element.className="myskitch-selectcopy-container";this.element.parentObject=this;this.parent.appendChild(this.element)},addSelectCopy:function(C,B,A){return new plasq.mySkitch.classes.selectCopy(this.element,C,B,A,this)}};function copybtn_DoFSCommand(B,A){if(B=="tooltipid"){Element.setOpacity($(A),1);Element.show($(A));setTimeout("Effect.Fade( '"+A+"', { fps: 60, duration: 1.0 } );",1500);$(A).parentObject.sectionText.select();plasq.mySkitch.browser.trackStats("COPYLINK",$(A).parentObject.section)}}plasq.mySkitch.classes.permissions=Class.create();plasq.mySkitch.classes.permissions.prototype={initialize:function(D,B,C,A){this.parent=$(D);this.guid=B;this.settings=C;this.id="permissions_"+(++plasq.mySkitch.classes.objectID);if(A){this.owner=A}this.keychangecounter=0;this.lastpasswordsent="";this.element=document.createElement("div");this.element.id=this.id;this.element.className="myskitch-permissions";this.spinner=document.createElement("img");this.spinner.alt="Saving...";this.spinner.src="/images/spinner.gif";this.spinner.align="right";this.spinner.style.display="none";this.spinner.className="myskitch-permissions-icon";this.typing=document.createElement("img");this.typing.alt="Typing...";this.typing.src="/images/typing.png";this.typing.align="right";this.typing.style.display="none";this.typing.className="myskitch-permissions-icon";this.check=document.createElement("img");this.check.alt="Saved!";this.check.src="/images/check.png";this.check.align="right";this.check.style.display="none";this.check.className="myskitch-permissions-icon";this.title=document.createElement("div");this.title.innerHTML="This content is...";this.title.className="myskitch-permissions-title";this.radioPublished=document.createElement("input");this.radioPublished.type="radio";this.radioPublished.name="permission";this.radioPublished.id=this.id+"_radioPublished";this.radioPublished.checked=this.settings.permission=="published"?true:false;this.radioPublished.onchange=(this.selectPublished).bind(this);this.labelPublished=document.createElement("label");this.labelPublished.htmlFor=this.radioPublished.id;this.labelPublished.innerHTML="Public";this.descPublished=document.createElement("div");this.descPublished.className="myskitch-permissions-smalldesc";this.descPublished.innerHTML="Viewable by anyone";this.radioPublic=document.createElement("input");this.radioPublic.type="radio";this.radioPublic.name="permission";this.radioPublic.id=this.id+"_radioPublic";this.radioPublic.checked=this.settings.permission=="public"?true:false;this.radioPublic.onchange=(this.selectPublic).bind(this);this.labelPublic=document.createElement("label");this.labelPublic.htmlFor=this.radioPublic.id;this.labelPublic.innerHTML="A Secret URL";this.descPublic=document.createElement("div");this.descPublic.className="myskitch-permissions-smalldesc";this.descPublic.innerHTML="People who know the URL";this.radioPrivate=document.createElement("input");this.radioPrivate.type="radio";this.radioPrivate.name="permission";this.radioPrivate.id=this.id+"_radioPrivate";this.radioPrivate.checked=this.settings.permission=="private"?true:false;this.radioPrivate.onchange=(this.selectPrivate).bind(this);this.labelPrivate=document.createElement("label");this.labelPrivate.htmlFor=this.radioPrivate.id;this.labelPrivate.innerHTML="Private";this.descPrivate=document.createElement("div");this.descPrivate.className="myskitch-permissions-smalldesc";this.descPrivate.innerHTML="Protected access";this.privateContainer=document.createElement("div");this.privateContainer.className="myskitch-permissions-private-container";this.privateContainer.style.display="none";this.passwordContainer=document.createElement("div");this.passwordContainer.className="myskitch-permissions-private-container";this.passwordContainer.style.display="none";this.privateContainer.radioJustMe=document.createElement("input");this.privateContainer.radioJustMe.onclick=(this.selectPrivate).bind(this);this.privateContainer.radioJustMe.type="radio";this.privateContainer.radioJustMe.name="privatepermission";this.privateContainer.radioJustMe.id=this.id+"_radioJustMe";this.privateContainer.radioJustMe.checked=this.settings.permission=="private"?true:false;this.privateContainer.labelJustMe=document.createElement("label");this.privateContainer.labelJustMe.htmlFor=this.privateContainer.radioJustMe.id;this.privateContainer.labelJustMe.innerHTML="Just me, please";this.privateContainer.descJustMe=document.createElement("div");this.privateContainer.descJustMe.className="myskitch-permissions-smalldesc";this.privateContainer.descJustMe.innerHTML="Only I can see this, when logged in";this.privateContainer.radioPassWd=document.createElement("input");this.privateContainer.radioPassWd.onclick=(this.selectPassword).bind(this);this.privateContainer.radioPassWd.type="radio";this.privateContainer.radioPassWd.name="privatepermission";this.privateContainer.radioPassWd.id=this.id+"_radioPassWd";this.privateContainer.radioPassWd.checked=this.settings.permission=="password"?true:false;this.privateContainer.labelPassWd=document.createElement("label");this.privateContainer.labelPassWd.htmlFor=this.privateContainer.radioPassWd.id;this.privateContainer.labelPassWd.innerHTML="Someone with this password";this.privateContainer.descPassWd=document.createElement("div");this.privateContainer.descPassWd.className="myskitch-permissions-smalldesc";this.privateContainer.descPassWd.innerHTML="People who know the URL and password";this.passwordContainer.inputPadlock=document.createElement("div");this.passwordContainer.inputPadlock.className="myskitch-permissions-padlock-closed";this.passwordContainer.inputPadlock.style.display=this.settings.permission=="password"?"block":"none";this.passwordContainer.inputPadlock.innerHTML="&nbsp;";this.passwordContainer.inputPassWd=document.createElement("input");this.passwordContainer.inputPassWd.type="text";this.passwordContainer.inputPassWd.value=this.settings.permission=="password"?"*****":"";this.passwordContainer.inputPassWd.className="myskitch-permissions-password";this.passwordContainer.inputPassWd.onkeyup=(this.checkPassword).bind(this);this.passwordContainer.inputPassWd.onchange=(this.checkPassword).bind(this);this.passwordContainer.inputPassWd.onfocus=(this.focusPassword).bind(this);this.passwordContainer.inputPassWd.onblur=(this.blurPassword).bind(this);this.parent.appendChild(this.element);this.element.appendChild(this.spinner);this.element.appendChild(this.typing);this.element.appendChild(this.check);this.element.appendChild(this.title);this.element.appendChild(this.radioPublished);this.element.appendChild(this.labelPublished);this.element.appendChild(this.descPublished);this.element.appendChild(this.radioPublic);this.element.appendChild(this.labelPublic);this.element.appendChild(this.descPublic);this.element.appendChild(this.radioPrivate);this.element.appendChild(this.labelPrivate);this.element.appendChild(this.descPrivate);this.element.appendChild(this.privateContainer);this.privateContainer.appendChild(this.privateContainer.radioJustMe);this.privateContainer.appendChild(this.privateContainer.labelJustMe);this.privateContainer.appendChild(this.privateContainer.descJustMe);this.privateContainer.appendChild(this.privateContainer.radioPassWd);this.privateContainer.appendChild(this.privateContainer.labelPassWd);this.privateContainer.appendChild(this.privateContainer.descPassWd);this.privateContainer.appendChild(this.passwordContainer);this.passwordContainer.appendChild(this.passwordContainer.inputPadlock);this.passwordContainer.appendChild(this.passwordContainer.inputPassWd);if(this.radioPrivate.checked){this.showPrivateContainer()}if(this.privateContainer.radioPassWd.checked){this.showPrivateContainer();this.showPasswordContainer()}},copySharedClick:function(){if(window.clipboardData){window.clipboardData.setData("Text",this.settings.sharedurl);Element.setOpacity(this.privateContainer.textCopiedLabel,1);Element.show(this.privateContainer.textCopiedLabel)}else{this.privateContainer.textCopy.innerHTML='<embed src="/res/clipcopy.swf" FlashVars="cliptext='+escape(this.settings.sharedurl)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';this.privateContainer.textCopiedLabel.setOpacity(1).show()}setTimeout("Effect.Fade( '"+this.privateContainer.textCopiedLabel.id+"', { fps: 60, duration: 1.0 } );",1500)},hidePrivateContainer:function(){this.hidePasswordContainer();this.privateContainer.style.display="none"},showPrivateContainer:function(){this.privateContainer.style.display="block"},hidePasswordContainer:function(){this.passwordContainer.style.display="none"},showPasswordContainer:function(){this.passwordContainer.style.display="block"},selectPassword:function(){this.displayPublicWarning(false);this.showPrivateContainer();this.showPasswordContainer();this.passwordContainer.inputPassWd.focus();this.passwordContainer.inputPassWd.select();this.saveSetting("permission","password")},selectPublished:function(){this.displayPublicWarning(false);this.hidePrivateContainer();this.saveSetting("permission","published")},selectPublic:function(){if(this.radioPublic.checked){this.displayPublicWarning(true);this.hidePrivateContainer();this.saveSetting("permission","public")}},selectPrivate:function(){if(this.radioPrivate.checked){this.privateContainer.radioJustMe.checked=true;this.displayPublicWarning(false);this.showPrivateContainer();this.hidePasswordContainer();this.saveSetting("permission","private")}},selectShared:function(){this.displayPublicWarning(false);this.hidePrivateContainer();this.saveSetting("permission","shared")},showSpinner:function(){this.check.style.display="none";this.typing.style.display="none";this.spinner.style.display="block"},hideSpinner:function(){this.spinner.style.display="none";this.typing.style.display="none";this.check.style.display="block"},saveSetting:function(A,B){B=encodeURIComponent(B);this.showSpinner();new Ajax.Action("setpermissions",["guid="+this.guid,"setting="+A,"value="+B],(function(C){this.hideSpinner()}).bind(this))},displayPublicWarning:function(A){$A(document.getElementsByClassName("myskitch-header-notes")).each(function(B){B.style.display=A?"block":"none"})},focusPassword:function(){if(this.passwordContainer.inputPassWd.value=="*****"){this.passwordContainer.inputPassWd.value=""}this.passwordContainer.inputPadlock.style.display="block";this.passwordContainer.inputPadlock.className="myskitch-permissions-padlock-open"},blurPassword:function(){if(this.passwordContainer.inputPassWd.value==""){this.radioPrivate.checked=true;this.selectPrivate()}},checkPassword:function(){this.keychangecounter++;var A=this.keychangecounter;value=this.passwordContainer.inputPassWd.value;if(value&&this.lastpasswordsent!=value){this.passwordContainer.inputPadlock.style.display="block";this.passwordContainer.inputPadlock.className="myskitch-permissions-padlock-open";this.check.style.display="none";this.typing.style.display="block";setTimeout((function(){this.savePassword(A)}).bind(this),1000)}},savePassword:function(A){if(A==this.keychangecounter){this.passwordContainer.inputPadlock.style.display="block";this.passwordContainer.inputPadlock.className="myskitch-permissions-padlock-closed";this.lastpasswordsent=value;this.saveSetting("password",value)}}};plasq.mySkitch.classes.rightPane=Class.create();plasq.mySkitch.classes.rightPane.prototype={initialize:function(B,C,A){this.parent=$(B);this.section=C;this.id="rightpane_"+(++plasq.mySkitch.classes.objectID);if(A){this.owner=A}this.element=document.createElement("div");this.element.id=this.id+"_div";this.element.className="myskitch-right-pane";this.element.parentObject=this;this.parent.appendChild(this.element)},addTrashcan:function(){this.trashCan=new plasq.mySkitch.classes.trashcan(this.element,this);return this.trashCan},addTags:function(){this.tags=new plasq.mySkitch.classes.tags(this.element,this);return this.tags}};plasq.mySkitch.classes.section=Class.create();plasq.mySkitch.classes.section.prototype={initialize:function(E,F,C,B,D,A){this.parent=$(E);this.section=F;this.editable=C;this.extratitle=D;this.guid=B;this.id="section_"+(++plasq.mySkitch.classes.objectID);if(A){this.owner=A}this.element=document.createElement("h1");this.element.id=this.id+"_div";this.element.innerHTML=this.section;this.element.parentObject=this;this.editor=document.createElement("input");this.editor.id=this.id+"_editor";this.editor.value=this.section;this.editor.onblur=(this.saveSection).bind(this);this.editor.onchange=(this.changeSection).bind(this);this.editor.onkeyup=(this.checkSection).bind(this);this.editor.className="myskitch-section-editor";this.editor.parentObject=this;this.editor.style.display="none";if(this.editable){this.element.className="myskitch-section-editable";this.element.onclick=(this.editSection).bind(this);this.element.onmouseover=(function(){this.style.backgroundColor="#FFF5FB"});this.element.onmouseout=(function(){this.style.backgroundColor="#FFFFFF"})}else{this.element.className="myskitch-section"}this.parent.appendChild(this.element);this.parent.appendChild(this.editor);if(this.extratitle){this.element.extratitle=document.createElement("div");this.element.extratitle.className="myskitch-section-extratitle";this.element.extratitle.innerHTML=this.extratitle;this.parent.appendChild(this.element.extratitle)}this.saved=true},editSection:function(){this.element.style.display="none";this.editor.style.display="block";this.editor.focus();this.editor.select()},checkSection:function(B){var A;if(B&&B.which){A=B.which}else{B=event;A=B.keyCode}if(A==13){this.saveSection();return false}else{if(A==27){this.cancelSection();return false}}this.saved=false},changeSection:function(){this.saved=false},cancelSection:function(){this.element.style.display="block";this.editor.style.display="none";this.editor.value=this.element.innerHTML;this.saved=true},saveSection:function(){if(this.saved){this.element.style.display="block";this.editor.style.display="none";return false}value=this.editor.value;title=encodeURIComponent(value);this.element.innerHTML="Saving...";this.element.style.display="block";this.editor.style.display="none";new Ajax.Action("setobjecttitle",["guid="+this.guid,"title="+title],(function(A){this.element.innerHTML=value;new Effect.Highlight(this.element.id,{duration:2})}).bind(this));this.saved=true}};plasq.mySkitch.classes.comments=Class.create();plasq.mySkitch.classes.comments.prototype={initialize:function(D,B,F,C,E,A,G){this.parent=$(D);this.id="comments_"+(++plasq.mySkitch.classes.objectID);this.guid=B;this.text=F?F:"Loading comments...";this.guest=E?true:false;this.lastchecksum=C;if(A){this.owner=A}this.element=document.createElement("div");this.element.id=this.id+"_div";this.element.className="myskitch-comments";this.element.parentObject=this;this.parent.appendChild(this.element);this.container=document.createElement("div");this.container.id=this.id+"_container";this.container.className="myskitch-comments-container";this.container.parentObject=this;this.container.innerHTML=this.text;this.element.appendChild(this.container);this.header=document.createElement("div");this.header.className="myskitch-section";this.header.innerHTML="<h1>Say Something:</h1>";this.element.appendChild(this.header);this.addcomments=document.createElement("div");this.addcomments.id=this.id+"_addcomments";this.addcomments.className="myskitch-addcomments";this.addcomments.parentObject=this;this.element.appendChild(this.addcomments);this.addcomments.form=document.createElement("div");this.addcomments.form.id=this.id+"_addcomments_link";this.addcomments.form.href="javascript:;";this.addcomments.form.className="myskitch-addcomments-form";this.addcomments.form.parentObject=this;this.addcomments.appendChild(this.addcomments.form);this.addcomments.form.textarea=document.createElement("textarea");this.addcomments.form.textarea.id=this.addcomments.form.id+"_textarea";this.addcomments.form.textarea.className="myskitch-addcomments-form-textarea";this.addcomments.form.appendChild(this.addcomments.form.textarea);this.addcomments.form.appendChild(document.createElement("br"));if(this.guest){new plasq.mySkitch.classes.div(this.addcomments.form,"Guest commenter details:");this.addcomments.form.name=document.createElement("input");this.addcomments.form.name.type="text";this.addcomments.form.name.field="name";this.addcomments.form.name.value="name";this.addcomments.form.name.onclick=this.checkClearInput;this.addcomments.form.name.onblur=this.checkClearInput;this.addcomments.form.name.className="myskitch-addcomments-form-extrafield";this.addcomments.form.appendChild(this.addcomments.form.name);this.addcomments.form.email=document.createElement("input");this.addcomments.form.email.type="text";this.addcomments.form.email.field="email";this.addcomments.form.email.value="email";this.addcomments.form.email.onclick=this.checkClearInput;this.addcomments.form.email.onblur=this.checkClearInput;this.addcomments.form.email.className="myskitch-addcomments-form-extrafield";this.addcomments.form.appendChild(this.addcomments.form.email);this.addcomments.form.appendChild(document.createElement("br"))}this.addcomments.form.subscribe=document.createElement("input");this.addcomments.form.subscribe.type="checkbox";this.addcomments.form.subscribe.id="subscribe";this.addcomments.form.subscribe.value="1";this.addcomments.form.subscribe.checked=parseInt(G)?true:false;this.addcomments.form.subscribe.onclick=(this.toggleSubscribed).bind(this);this.addcomments.form.appendChild(this.addcomments.form.subscribe);this.addcomments.form.subscribelbl=document.createElement("label");this.addcomments.form.subscribelbl.setAttribute("for","subscribe");this.addcomments.form.subscribelbl.innerHTML="Email me when someone comments";this.addcomments.form.appendChild(this.addcomments.form.subscribelbl);this.addcomments.form.appendChild(document.createElement("br"));this.addcomments.form.submit=document.createElement("input");this.addcomments.form.submit.type="button";this.addcomments.form.submit.value="Post Comment";this.addcomments.form.submit.onclick=(this.submitComment).bind(this);this.addcomments.form.submit.className="myskitch-addcomments-form-submit";this.addcomments.form.appendChild(this.addcomments.form.submit);this.updating=false;setInterval((this.updateComments).bind(this),60000)},toggleSubscribed:function(){var C="";var B=this.addcomments.form.subscribe.checked?false:true;var A=this.addcomments.form.subscribe.checked?1:0;if(this.guest){C=this.addcomments.form.email.value;if(C=="email"||C==""){alert("You need to fill in your email before you can subscribe!");this.addcomments.form.submit.disabled=false;this.addcomments.form.email.select();this.addcomments.form.email.focus();this.addcomments.form.subscribe.checked=B;return false}}this.addcomments.form.subscribe.checked=B;new Ajax.Action("setsubscription",["guid="+this.guid,"subscribe="+A,"email="+encodeURIComponent(C)],(function(D){this.addcomments.form.subscribe.checked=B?false:true}).bind(this))},slurpAddButton:function(A){this.addcomments.form.slurp=document.createElement("span");this.addcomments.form.slurp.className="myskitch-addcomments-form-skitch";this.addcomments.form.slurp.innerHTML="&nbsp;";this.addcomments.form.appendChild(this.addcomments.form.slurp);this.skitchit=new plasq.mySkitch.classes.skitchit(this.addcomments.form.slurp,A,"myskitch-skitchit-comment","addcomment");return this},updateComments:function(){if(this.editControl){return false}if(this.updating){return false}this.updating=true;new Ajax.Action("listcomments",["guid="+this.guid,"checksum="+this.lastchecksum],(function(res){if(res.responseText){try{var response=eval("("+res.responseText+")");if(response.checksum!=this.lastchecksum){this.container.innerHTML=response.comments;this.lastchecksum=response.checksum;setTimeout("plasq.mySkitch.classes.image.setupWidths();",0)}}catch(e){}}this.updating=false}).bind(this))},checkClearInput:function(){if(this.value=="name"||this.value=="email"){this.value="";this.focus()}else{if(this.value==""){this.value=this.field}}},deleteComment:function(commentid,fadeoutElement){this.commentid=commentid;if(confirm("Are you sure you want to delete this comment?")){this.editControl=false;if(fadeoutElement){Effect.Fade($(fadeoutElement),{duration:2,from:1,to:0,afterFinish:(function(){this.updating=true;new Ajax.Action("delcomment",["commentid="+commentid,"guid="+this.guid],(function(res){if(res.responseText){try{var response=eval("("+res.responseText+")");if(response.checksum!=this.lastchecksum){this.container.innerHTML=response.comments;this.lastchecksum=response.checksum;setTimeout("plasq.mySkitch.classes.image.setupWidths();",0)}}catch(e){}}this.updating=false}).bind(this))}).bind(this)})}else{this.updating=true;new Ajax.Action("delcomment",["commentid="+commentid,"guid="+this.guid],(function(res){if(res.responseText){try{var response=eval("("+res.responseText+")");if(response.checksum!=this.lastchecksum){this.container.innerHTML=response.comments;this.lastchecksum=response.checksum;setTimeout("plasq.mySkitch.classes.image.setupWidths();",0)}}catch(e){}}this.updating=true}).bind(this))}}},editComment:function(B,A){if(this.editControl){if(this.editControl.isEdited){if(!confirm("You are already editing another comment! By switching editing to this comment, you will lose all changes to your previous comment!")){this.editControl.textArea.focus();return false}}if(B==this.commentid){this.editControl.textArea.focus();return false}this.hideEditControl()}this.commentid=B;this.lastComment=A;this.postComment=document.getElementsByClassName("myskitch-comment-post",this.lastComment);Element.hide(this.postComment[0]);this.editControl=document.createElement("div");this.editControl.className="myskitch-comment-editor";this.editControl.isEdited=false;this.editControl.textArea=document.createElement("textarea");this.editControl.textArea.disabled=true;this.editControl.textArea.value="Loading...";this.editControl.textArea.onchange=(this.changeComment).bind(this);this.editControl.saveBtn=document.createElement("input");this.editControl.saveBtn.type="button";this.editControl.saveBtn.value="Save";this.editControl.saveBtn.disabled=true;this.editControl.saveBtn.onclick=(this.saveComment).bind(this);this.editControl.saveBtn.className="myskitch-comment-editor-save";this.editControl.cancelBtn=document.createElement("input");this.editControl.cancelBtn.type="button";this.editControl.cancelBtn.value="Cancel";this.editControl.cancelBtn.onclick=(this.hideEditControl).bind(this);this.editControl.cancelBtn.className="myskitch-comment-editor-cancel";this.editControl.appendChild(this.editControl.textArea);this.editControl.appendChild(document.createElement("br"));this.editControl.appendChild(this.editControl.saveBtn);this.editControl.appendChild(this.editControl.cancelBtn);this.lastComment.appendChild(this.editControl);new Ajax.Action("rawcomment",["commentid="+this.commentid],(function(C){if(C.responseText&&C.responseText!="-1"){if(C.responseText==" "){C.responseText=""}this.editControl.textArea.value=C.responseText;this.editControl.textArea.disabled=false;this.editControl.saveBtn.disabled=false;this.editControl.textArea.focus()}else{this.hideEditControl()}}).bind(this))},changeComment:function(){if(this.editControl){this.editControl.isEdited=true}},hideEditControl:function(){Element.show(this.postComment[0]);var B=this.editControl;var A=this.lastComment;this.editControl=false;Effect.Fade(B,{duration:1,from:1,to:0,afterFinish:(function(){A.removeChild(B)}).bind(this)})},saveComment:function(){var comment=encodeURIComponent(this.editControl.textArea.value);var guid=encodeURIComponent(this.guid);var commentid=this.commentid;if(!comment){this.editControl.textArea.focus();return false}this.editControl=false;this.updating=true;new Ajax.Action("savecomment",["guid="+guid,"comment="+comment,"commentid="+commentid,"checksum="+this.lastchecksum],(function(res){if(res.responseText){try{var response=eval("("+res.responseText+")");if(response.checksum!=this.lastchecksum){this.container.innerHTML=response.comments;this.lastchecksum=response.checksum;new Effect.Highlight($("myskitch-new-comment"),{duration:2});setTimeout("plasq.mySkitch.classes.image.setupWidths();",0)}}catch(e){}}this.updating=false}).bind(this))},submitComment:function(){var comment=encodeURIComponent(this.addcomments.form.textarea.value);var guid=encodeURIComponent(this.guid);if(!comment){this.addcomments.form.textarea.focus();return false}this.editControl=false;this.addcomments.form.submit.disabled=true;var subscribe=$("subscribe").checked?"1":"0";if(this.guest){var email=encodeURIComponent(this.addcomments.form.email.value);var name=encodeURIComponent(this.addcomments.form.name.value);if(name=="name"||name==""){alert("You need to fill in your name before you can post!");this.addcomments.form.submit.disabled=false;this.addcomments.form.name.select();this.addcomments.form.name.focus();return false}if(email=="email"||email==""){alert("You need to fill in your email before you can post! Don't worry, we won't post it on the page, it will only be used to notify you about new comments on this page! :)");this.addcomments.form.submit.disabled=false;this.addcomments.form.email.select();this.addcomments.form.email.focus();return false}var params=["guid="+guid,"comment="+comment,"checksum="+this.lastchecksum,"name="+name,"email="+email,"subscribe="+subscribe]}else{var params=["guid="+guid,"comment="+comment,"checksum="+this.lastchecksum,"subscribe="+subscribe]}this.updating=true;new Ajax.Action("addcomment",params,(function(res){if(res.responseText){try{var response=eval("("+res.responseText+")");if(response.checksum!=this.lastchecksum){this.container.innerHTML=response.comments;this.lastchecksum=response.checksum;new Effect.Highlight($("myskitch-new-comment"),{duration:2});setTimeout("plasq.mySkitch.classes.image.setupWidths();",0)}}catch(e){}}this.updating=false;this.addcomments.form.submit.disabled=false}).bind(this));this.addcomments.form.textarea.value=""}};plasq.mySkitch.commentUtils={imageOver:function(A){plasq.mySkitch.commentUtils.showEditButton(A,true)},imageOut:function(A){plasq.mySkitch.commentUtils.showEditButton(A,false)},showEditButton:function(B,A){elements=document.getElementsByClassName("comment-image-edit-button",B);elements.each(function(C){C.style.display=A?"block":"none"})},externalImageLoaded:function(A){A.originalX=A.getDimensions().width;A.originalY=A.getDimensions().height;A.className="comment-image-external"},checkPassword:function(elementid,guid,parentguid){var password=encodeURIComponent($(elementid).value);var parentguid=encodeURIComponent(parentguid);var guid=encodeURIComponent(guid);plasq.mySkitch.container.comments.container.parentObject.updating=true;new Ajax.Action("checkpassword",["password="+password,"guid="+guid,"parentguid="+parentguid],(function(res){if(res.responseText){try{var response=eval("("+res.responseText+")");if(response.checksum!=this.lastchecksum){plasq.mySkitch.container.comments.container.innerHTML=response.comments;plasq.mySkitch.container.comments.container.parentObject.lastchecksum=response.checksum;setTimeout("plasq.mySkitch.classes.image.setupWidths();",0)}}catch(e){}}plasq.mySkitch.container.comments.container.parentObject.updating=false}).bind(this))}};plasq.mySkitch.classes.skitchit=Class.create();plasq.mySkitch.classes.skitchit.prototype={initialize:function(B,A,D,C){this.parent=$(B);this.url=A;this.id="skitchit_"+(++plasq.mySkitch.classes.objectID);this.section=C?C:"open";this.element=document.createElement("div");this.element.id=this.id;this.element.className="myskitch-skitchit";this.element.parentObject=this;this.button=document.createElement("div");this.button.id=this.id+"_button";this.button.className=D?D:"myskitch-skitchit-button";this.button.onclick=(this.click).bind(this);this.button.parentObject=this;this.element.appendChild(this.button);this.parent.appendChild(this.element)},click:function(){plasq.mySkitch.browser.openSkitchLink(this.url);plasq.mySkitch.browser.trackStats("SKITCHIT",this.section)}};plasq.mySkitch.classes.imagestrip=Class.create();plasq.mySkitch.classes.imagestrip.prototype={initialize:function(C,D,B){this.parent=$(C);this.scale=D?D:1;this.width=B?B:400;this.id="imagestrip_"+(++plasq.mySkitch.classes.objectID);this.element=document.createElement("div");this.element.id=this.id;this.element.className="myskitch-imagestrip";this.container=document.createElement("div");this.container.id=this.id+"_container";this.container.className="myskitch-imagestrip-container";this.container.style.marginLeft=(50*this.scale)+"px";this.container.style.marginRight=(50*this.scale)+"px";this.scrollleft=document.createElement("div");this.scrollleft.id=this.id+"_scrollleft";this.scrollleft.className="myskitch-imagestrip-scroll-left";this.scrollleft.style.width=(50*this.scale)+"px";this.scrollleft.style.height=(100*this.scale)+"px";this.scrollleft.onmouseover=(this.scrollLeft).bind(this);this.scrollleft.onmouseout=(this.scrollStop).bind(this);this.scrollleft.onclick=(this.scrollLeftClick).bind(this);this.scrollright=document.createElement("div");this.scrollright.id=this.id+"_scrollright";this.scrollright.className="myskitch-imagestrip-scroll-right";this.scrollright.style.width=(50*this.scale)+"px";this.scrollright.style.height=(100*this.scale)+"px";this.scrollright.onmouseover=(this.scrollRight).bind(this);this.scrollright.onmouseout=(this.scrollStop).bind(this);this.scrollright.onclick=(this.scrollRightClick).bind(this);this.textzone=document.createElement("div");this.textzone.className="myskitch-imagestrip-textzone";Element.setOpacity(this.scrollleft,0.25);Element.setOpacity(this.scrollright,0.25);this.element.style.width=this.width+"px";this.element.style.height=(100*this.scale)+"px";this.element.appendChild(this.container);this.element.appendChild(this.scrollleft);this.element.appendChild(this.scrollright);this.parent.appendChild(this.element);this.parent.appendChild(this.textzone);this.images=new Array();this.speed=1;this.totalWidth=0;this.avatar=false;var A=Cookie.get(this.id);if(A){this.currentx=parseInt(A);this.container.style.left=this.currentx+"px";this.update()}else{this.currentx=0}},scrollLeftClick:function(){var A=0;this.scrollStop();this.currentx=A;this.container.style.left=this.currentx+"px";this.update()},scrollRightClick:function(){var A=(this.totalWidth-this.width)*-1;this.scrollStop();this.currentx=A;this.container.style.left=this.currentx+"px";this.update()},scrollStop:function(){this.scrolling=false;this.speed=1},scrollLeft:function(A){this.scrolling=true;this.scroll(1)},scrollRight:function(){this.scrolling=true;this.scroll(-1)},scroll:function(C){if(!this.scrolling){return false}this.speed++;if(this.speed>200){this.speed=200}var A=(this.totalWidth-this.width)*-1;var B=this.currentx+(C*Math.ceil(this.speed/10));if(B<A){B=A;this.scrollStop()}if(B>0){B=0;this.scrollStop()}if(this.currentx!=B){this.currentx=B;this.container.style.left=B+"px";this.update()}setTimeout((function(){this.scroll(C)}).bind(this),0);return true},addImage:function(F,B,H,C,I,D){var A=document.createElement("div");var E=document.createElement("img");ratio=C/I;h=(100*this.scale)-10;w=h*ratio;E.div=A;E.border=0;E.loaded=false;E.height=Math.round(h);E.width=Math.round(w);E.guid=F;E.shortid=B;E.url="http://img.skitch.com/"+B+".preview.png";E.parentObject=this;E.onmouseover=this.imageOver;E.onmouseout=this.imageOut;E.className="myskitch-imagestrip-image";A.className="myskitch-imagestrip-imagebox";A.img=E;A.caption=H;if(D){var G=document.createElement("a");G.href=D;A.appendChild(G);G.appendChild(E)}else{E.onclick=this.imageClick;A.appendChild(E)}this.container.appendChild(A);this.images.push(A)},imageOver:function(){this.parentObject.textzone.innerHTML=this.div.caption},imageOut:function(){this.parentObject.textzone.innerHTML=""},imageClick:function(){if(this.parentObject.avatar){if(this.parentObject.avatar.selectImage){this.parentObject.avatar.selectImage(this.guid,"library")}}},setup:function(){this.totalWidth=this.update();this.container.style.width=this.totalWidth+"px"},update:function(){var A=(50*this.scale)*2;this.images.each((function(B){if((A+this.currentx)<(this.width+(50*this.scale))){if(!B.img.loaded){B.img.loaded=true;B.img.src=B.img.url}}A+=(B.img.width+10)}).bind(this));Cookie.set(this.id,this.currentx,600);return A}};plasq.mySkitch.classes.imageupload=Class.create();plasq.mySkitch.classes.imageupload.prototype={initialize:function(C,B,D,A){this.parent=$(C);this.id=D?D:"imageupload_"+(++plasq.mySkitch.classes.objectID);this.element=document.createElement("div");this.element.id=this.id;this.element.className=A;this.element.parentObject=this;if(B){this.element.innerHTML=B}this.parent.appendChild(this.element)}};plasq.mySkitch.classes.avatar=Class.create();plasq.mySkitch.classes.avatar.prototype={initialize:function(B,A){this.parent=$(B);this.url=A;this.id="skitchit_"+(++plasq.mySkitch.classes.objectID);this.element=document.createElement("img");this.element.id=this.id;this.element.className="myskitch-avatar";this.element.parentObject=this;this.clear();this.parent.appendChild(this.element);this.update()},selectImage:function(A,B){this.clear();new Ajax.Action("createavatar",["guid="+A,"type="+B],(function(C){this.update()}).bind(this))},clear:function(){this.element.src="/images/transpix.gif"},update:function(){this.element.src=this.url+"?"+Math.round(Math.random()*99999999999)}};plasq.mySkitch.classes.twitter=Class.create();plasq.mySkitch.classes.twitter.prototype={initialize:function(C,D,B,A){this.parent=$(C);this.title=D;this.url=B;this.focused=false;this.posted=false;this.id="text_"+(++plasq.mySkitch.classes.objectID);if(A){this.owner=A}this.element=document.createElement("div");this.element.id=this.id+"_div";this.element.className="myskitch-twitter";this.element.parentObject=this;this.img=document.createElement("img");this.img.id=this.id+"_img";this.img.className="myskitch-twitter-image";this.img.parentObject=this;this.img.src="/images/twitter.png";this.frame=document.createElement("div");this.frame.className="myskitch-twitter-frame";this.frame.innerHTML="Send to ";this.frame.appendChild(this.img);this.frame.onclick=(this.showInput).bind(this);this.input=document.createElement("div");this.input.className="myskitch-twitter-input";this.input.id=this.id+"_input";this.input.label=document.createElement("div");this.input.label.className="myskitch-twitter-input-label";this.input.label.innerHTML="Message:";this.input.letters=document.createElement("div");this.input.letters.className="myskitch-twitter-input-letters";this.input.letters.innerHTML="140";this.input.area=document.createElement("textarea");this.input.area.className="myskitch-twitter-input-area";this.input.area.id=this.id+"_input_area";this.input.area.onblur=(this.hideInput).bind(this);this.input.area.onkeydown=(this.checkKeyInput).bind(this);this.input.area.onchange=(this.updateCounter).bind(this);this.input.area.onpress=(this.updateCounter).bind(this);this.input.area.onkeyup=(this.updateCounter).bind(this);this.input.button=document.createElement("input");this.input.button.onclick=(this.buttonSendClick).bind(this);this.input.button.onmousedown=(this.buttonPrepare).bind(this);this.input.button.style.display="block";this.input.button.value="Send to Twitter";this.input.button.type="button";this.input.close=document.createElement("input");this.input.close.style.display="none";this.input.close.value="Close";this.input.close.type="button";this.input.appendChild(this.input.label);this.input.appendChild(this.input.letters);this.input.appendChild(this.input.area);this.input.appendChild(this.input.button);this.input.appendChild(this.input.close);this.element.appendChild(this.frame);this.element.appendChild(this.input);this.parent.appendChild(this.element)},showInput:function(){this.input.style.display="block";this.frame.style.display="none";this.input.close.style.display="none";this.input.button.style.display="block";if(this.tinyurl&&!this.posted){this.input.area.readOnly=false;this.moveCaretToEnd(this.input.area);this.updateCounter()}else{this.input.area.value="Creating tiny url...";this.input.area.readOnly=true;new Ajax.Action("tinyurl",["url="+this.url],(function(A){this.tinyurl="  "+A.responseText;this.input.area.readOnly=false;this.input.area.value=this.title;this.moveCaretToEnd(this.input.area);this.updateCounter();this.posted=false}).bind(this))}},updateCounter:function(){var B=140-this.tinyurl.length;var A=B-this.input.area.value.length;if(A<0){A=0;this.input.area.value=this.input.area.value.substr(0,B)}this.input.letters.innerHTML=A},moveCaretToEnd:function(C){C.focus();var D=C.value.length;var A=D;if(C.setSelectionRange){C.setSelectionRange(D,A)}else{if(C.createTextRange){var B=C.createTextRange();B.moveStart("character",D);B.moveEnd("character",A);B.select()}}},hideInput:function(){setTimeout((function(){this.actualHideInput()}).bind(this),100)},actualHideInput:function(){if(this.focused){return false}this.input.style.display="none";this.frame.style.display="block";return true},buttonPrepare:function(){this.focused=true},buttonSendClick:function(){this.twitterUpdate()},twitterUpdate:function(){var A=this.input.area.value;if(!A){return false}var B=encodeURIComponent(A+this.tinyurl);this.input.area.readOnly=true;this.input.area.value="Posting to twitter...";this.input.button.disabled=true;this.input.area.focus();new Ajax.Action("twitterupdate",["text="+B],(function(C){this.input.area.readOnly=true;this.input.area.value=C.responseText;this.focused=false;this.posted=true;this.input.close.style.display="block";this.input.button.style.display="none";this.input.button.disabled=false}).bind(this))},faceBookUpdate:function(){window.location="http://www.facebook.com/share.php?u="+encodeURIComponent(this.url)},checkKeyInput:function(B){var A;if(B&&B.which){A=B.which}else{if(event){B=event;A=B.keyCode}}if(A==13){this.twitterUpdate();return false}else{if(A==27){this.hideInput();return false}}this.updateCounter()}};plasq.mySkitch.browser={resize:function(){plasq.mySkitch.classes.image.setupWidths()},loader:function(){var A=document.getElementsByClassName("myskitch-selectcopy-container");$A(A).each(function(B){B.style.display="block"});plasq.mySkitch.classes.image.setupWidths()},openSkitchLink:function(A){try{window.location=A}catch(B){alert("You don't seem to have Skitch installed! :/\nIf you do, please upgrade to the latest version to use the 'edit' functionality.")}},trackStats:function(B,A,E,C,D){if(!B){return false}if(!A){A=""}if(!E){E=""}if(!C){C="1"}if(!D){D=0}B=encodeURIComponent(B);D=encodeURIComponent(D);A=encodeURIComponent(A);E=encodeURIComponent(E);C=encodeURIComponent(C);new Ajax.Action("trackstats",["identifier="+B,"data1="+A,"data2="+E,"value+"+C,"annotations="+D]);return true}}