var Prototype={Version:"1.6.1",Browser:(function(){var B=navigator.userAgent;var A=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!A,Opera:A,WebKit:B.indexOf("AppleWebKit/")>-1,Gecko:B.indexOf("Gecko")>-1&&B.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(B)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var A=window.Element||window.HTMLElement;return !!(A&&A.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var C=document.createElement("div");var B=document.createElement("form");var A=false;if(C.__proto__&&(C.__proto__!==B.__proto__)){A=true}C=B=null;return A})()},Tuning:{extendOnCssSelect:true},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(A){return A}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var C;for(var B=0,D=arguments.length;B<D;B++){var A=arguments[B];try{C=A();break}catch(E){}}return C}};var Class=(function(){function A(){}function B(){var G=null,F=$A(arguments);if(Object.isFunction(F[0])){G=F.shift()}function D(){this.initialize.apply(this,arguments)}Object.extend(D,Class.Methods);D.superclass=G;D.subclasses=[];if(G){A.prototype=G.prototype;D.prototype=new A;G.subclasses.push(D)}for(var E=0;E<F.length;E++){D.addMethods(F[E])}if(!D.prototype.initialize){D.prototype.initialize=Prototype.emptyFunction}D.prototype.constructor=D;return D}function C(J){var F=this.superclass&&this.superclass.prototype;var E=Object.keys(J);if(!Object.keys({toString:true}).length){if(J.toString!=Object.prototype.toString){E.push("toString")}if(J.valueOf!=Object.prototype.valueOf){E.push("valueOf")}}for(var D=0,G=E.length;D<G;D++){var I=E[D],H=J[I];if(F&&Object.isFunction(H)&&H.argumentNames().first()=="$super"){var K=H;H=(function(L){return function(){return F[L].apply(this,arguments)}})(I).wrap(K);H.valueOf=K.valueOf.bind(K);H.toString=K.toString.bind(K)}this.prototype[I]=H}return this}return{create:B,Methods:{addMethods:C}}})();(function(){var D=Object.prototype.toString;function I(Q,S){for(var R in S){Q[R]=S[R]}return Q}function L(Q){try{if(E(Q)){return"undefined"}if(Q===null){return"null"}return Q.inspect?Q.inspect():String(Q)}catch(R){if(R instanceof RangeError){return"..."}throw R}}function K(Q){var S=typeof Q;switch(S){case"undefined":case"function":case"unknown":return ;case"boolean":return Q.toString()}if(Q===null){return"null"}if(Q.toJSON){return Q.toJSON()}if(H(Q)){return }var R=[];for(var U in Q){var T=K(Q[U]);if(!E(T)){R.push(U.toJSON()+": "+T)}}return"{"+R.join(", ")+"}"}function C(Q){return $H(Q).toQueryString()}function F(Q){return Q&&Q.toHTML?Q.toHTML():String.interpret(Q)}function O(Q){var R=[];for(var S in Q){R.push(S)}return R}function M(Q){var R=[];for(var S in Q){R.push(Q[S])}return R}function J(Q){return I({},Q)}function H(Q){return !!(Q&&Q.nodeType==1)}function G(Q){return D.call(Q)=="[object Array]"}function P(Q){return Q instanceof Hash}function B(Q){return typeof Q==="function"}function A(Q){return D.call(Q)=="[object String]"}function N(Q){return D.call(Q)=="[object Number]"}function E(Q){return typeof Q==="undefined"}I(Object,{extend:I,inspect:L,toJSON:K,toQueryString:C,toHTML:F,keys:O,values:M,clone:J,isElement:H,isArray:G,isHash:P,isFunction:B,isString:A,isNumber:N,isUndefined:E})})();Object.extend(Function.prototype,(function(){var K=Array.prototype.slice;function D(O,L){var N=O.length,M=L.length;while(M--){O[N+M]=L[M]}return O}function I(M,L){M=K.call(M,0);return D(M,L)}function G(){var L=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return L.length==1&&!L[0]?[]:L}function H(N){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var L=this,M=K.call(arguments,1);return function(){var O=I(M,arguments);return L.apply(N,O)}}function F(N){var L=this,M=K.call(arguments,1);return function(P){var O=D([P||window.event],M);return L.apply(N,O)}}function J(){if(!arguments.length){return this}var L=this,M=K.call(arguments,0);return function(){var N=I(M,arguments);return L.apply(this,N)}}function E(N){var L=this,M=K.call(arguments,1);N=N*1000;return window.setTimeout(function(){return L.apply(L,M)},N)}function A(){var L=D([0.01],arguments);return this.delay.apply(this,L)}function C(M){var L=this;return function(){var N=D([L.bind(this)],arguments);return M.apply(this,N)}}function B(){if(this._methodized){return this._methodized}var L=this;return this._methodized=function(){var M=D([this],arguments);return L.apply(null,M)}}return{argumentNames:G,bind:H,bindAsEventListener:F,curry:J,delay:E,defer:A,wrap:C,methodize:B}})());Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+'Z"'};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(A){return String(A).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};var PeriodicalExecuter=Class.create({initialize:function(B,A){this.callback=B;this.frequency=A;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},execute:function(){this.callback(this)},stop:function(){if(!this.timer){return }clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute();this.currentlyExecuting=false}catch(A){this.currentlyExecuting=false;throw A}}}});Object.extend(String,{interpret:function(A){return A==null?"":String(A)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,(function(){function prepareReplacement(replacement){if(Object.isFunction(replacement)){return replacement}var template=new Template(replacement);return function(match){return template.evaluate(match)}}function gsub(pattern,replacement){var result="",source=this,match;replacement=prepareReplacement(replacement);if(Object.isString(pattern)){pattern=RegExp.escape(pattern)}if(!(pattern.length||pattern.source)){replacement=replacement("");return replacement+source.split("").join(replacement)+replacement}while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length)}else{result+=source,source=""}}return result}function sub(pattern,replacement,count){replacement=prepareReplacement(replacement);count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0){return match[0]}return replacement(match)})}function scan(pattern,iterator){this.gsub(pattern,iterator);return String(this)}function truncate(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?"...":truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this)}function strip(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function stripTags(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")}function stripScripts(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")}function extractScripts(){var matchAll=new RegExp(Prototype.ScriptFragment,"img");var matchOne=new RegExp(Prototype.ScriptFragment,"im");return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||["",""])[1]})}function evalScripts(){return this.extractScripts().map(function(script){return eval(script)})}function escapeHTML(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function unescapeHTML(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function toQueryParams(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match){return{}}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift());var value=pair.length>1?pair.join("="):pair[0];if(value!=undefined){value=decodeURIComponent(value)}if(key in hash){if(!Object.isArray(hash[key])){hash[key]=[hash[key]]}hash[key].push(value)}else{hash[key]=value}}return hash})}function toArray(){return this.split("")}function succ(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)}function times(count){return count<1?"":new Array(count+1).join(this)}function camelize(){var parts=this.split("-"),len=parts.length;if(len==1){return parts[0]}var camelized=this.charAt(0)=="-"?parts[0].charAt(0).toUpperCase()+parts[0].substring(1):parts[0];for(var i=1;i<len;i++){camelized+=parts[i].charAt(0).toUpperCase()+parts[i].substring(1)}return camelized}function capitalize(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()}function underscore(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()}function dasherize(){return this.replace(/_/g,"-")}function inspect(useDoubleQuotes){var escapedString=this.replace(/[\x00-\x1f\\]/g,function(character){if(character in String.specialChar){return String.specialChar[character]}return"\\u00"+character.charCodeAt().toPaddedString(2,16)});if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'}return"'"+escapedString.replace(/'/g,"\\'")+"'"}function toJSON(){return this.inspect(true)}function unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")}function isJSON(){var str=this;if(str.blank()){return false}str=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str)}function evalJSON(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())}function include(pattern){return this.indexOf(pattern)>-1}function startsWith(pattern){return this.indexOf(pattern)===0}function endsWith(pattern){var d=this.length-pattern.length;return d>=0&&this.lastIndexOf(pattern)===d}function empty(){return this==""}function blank(){return/^\s*$/.test(this)}function interpolate(object,pattern){return new Template(this,pattern).evaluate(object)}return{gsub:gsub,sub:sub,scan:scan,truncate:truncate,strip:String.prototype.trim?String.prototype.trim:strip,stripTags:stripTags,stripScripts:stripScripts,extractScripts:extractScripts,evalScripts:evalScripts,escapeHTML:escapeHTML,unescapeHTML:unescapeHTML,toQueryParams:toQueryParams,parseQuery:toQueryParams,toArray:toArray,succ:succ,times:times,camelize:camelize,capitalize:capitalize,underscore:underscore,dasherize:dasherize,inspect:inspect,toJSON:toJSON,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:evalJSON,include:include,startsWith:startsWith,endsWith:endsWith,empty:empty,blank:blank,interpolate:interpolate}})());var Template=Class.create({initialize:function(A,B){this.template=A.toString();this.pattern=B||Template.Pattern},evaluate:function(A){if(A&&Object.isFunction(A.toTemplateReplacements)){A=A.toTemplateReplacements()}return this.template.gsub(this.pattern,function(D){if(A==null){return(D[1]+"")}var F=D[1]||"";if(F=="\\"){return D[2]}var B=A,G=D[3];var E=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;D=E.exec(G);if(D==null){return F}while(D!=null){var C=D[1].startsWith("[")?D[2].replace(/\\\\]/g,"]"):D[1];B=B[C];if(null==B||""==D[3]){break}G=G.substring("["==D[3]?D[1].length:D[0].length);D=E.exec(G)}return F+String.interpret(B)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function C(Y,X){var W=0;try{this._each(function(a){Y.call(X,a,W++)})}catch(Z){if(Z!=$break){throw Z}}return this}function R(Z,Y,X){var W=-Z,a=[],b=this.toArray();if(Z<1){return b}while((W+=Z)<b.length){a.push(b.slice(W,W+Z))}return a.collect(Y,X)}function B(Y,X){Y=Y||Prototype.K;var W=true;this.each(function(a,Z){W=W&&!!Y.call(X,a,Z);if(!W){throw $break}});return W}function I(Y,X){Y=Y||Prototype.K;var W=false;this.each(function(a,Z){if(W=!!Y.call(X,a,Z)){throw $break}});return W}function J(Y,X){Y=Y||Prototype.K;var W=[];this.each(function(a,Z){W.push(Y.call(X,a,Z))});return W}function T(Y,X){var W;this.each(function(a,Z){if(Y.call(X,a,Z)){W=a;throw $break}});return W}function H(Y,X){var W=[];this.each(function(a,Z){if(Y.call(X,a,Z)){W.push(a)}});return W}function G(Z,Y,X){Y=Y||Prototype.K;var W=[];if(Object.isString(Z)){Z=new RegExp(RegExp.escape(Z))}this.each(function(b,a){if(Z.match(b)){W.push(Y.call(X,b,a))}});return W}function A(W){if(Object.isFunction(this.indexOf)){if(this.indexOf(W)!=-1){return true}}var X=false;this.each(function(Y){if(Y==W){X=true;throw $break}});return X}function Q(X,W){W=Object.isUndefined(W)?null:W;return this.eachSlice(X,function(Y){while(Y.length<X){Y.push(W)}return Y})}function L(W,Y,X){this.each(function(a,Z){W=Y.call(X,W,a,Z)});return W}function V(X){var W=$A(arguments).slice(1);return this.map(function(Y){return Y[X].apply(Y,W)})}function P(Y,X){Y=Y||Prototype.K;var W;this.each(function(a,Z){a=Y.call(X,a,Z);if(W==null||a>=W){W=a}});return W}function N(Y,X){Y=Y||Prototype.K;var W;this.each(function(a,Z){a=Y.call(X,a,Z);if(W==null||a<W){W=a}});return W}function E(Z,X){Z=Z||Prototype.K;var Y=[],W=[];this.each(function(b,a){(Z.call(X,b,a)?Y:W).push(b)});return[Y,W]}function F(X){var W=[];this.each(function(Y){W.push(Y[X])});return W}function D(Y,X){var W=[];this.each(function(a,Z){if(!Y.call(X,a,Z)){W.push(a)}});return W}function M(X,W){return this.map(function(Z,Y){return{value:Z,criteria:X.call(W,Z,Y)}}).sort(function(d,c){var Z=d.criteria,Y=c.criteria;return Z<Y?-1:Z>Y?1:0}).pluck("value")}function O(){return this.map()}function S(){var X=Prototype.K,W=$A(arguments);if(Object.isFunction(W.last())){X=W.pop()}var Y=[this].concat(W).map($A);return this.map(function(a,Z){return X(Y.pluck(Z))})}function K(){return this.toArray().length}function U(){return"#<Enumerable:"+this.toArray().inspect()+">"}return{each:C,eachSlice:R,all:B,every:B,any:I,some:I,collect:J,map:J,detect:T,findAll:H,select:H,filter:H,grep:G,include:A,member:A,inGroupsOf:Q,inject:L,invoke:V,max:P,min:N,partition:E,pluck:F,reject:D,sortBy:M,toArray:O,entries:O,zip:S,size:K,inspect:U,find:T}})();function $A(C){if(!C){return[]}if("toArray" in Object(C)){return C.toArray()}var B=C.length||0,A=new Array(B);while(B--){A[B]=C[B]}return A}function $w(A){if(!Object.isString(A)){return[]}A=A.strip();return A?A.split(/\s+/):[]}Array.from=$A;(function(){var S=Array.prototype,M=S.slice,O=S.forEach;function B(W){for(var V=0,X=this.length;V<X;V++){W(this[V])}}if(!O){O=B}function L(){this.length=0;return this}function D(){return this[0]}function G(){return this[this.length-1]}function I(){return this.select(function(V){return V!=null})}function U(){return this.inject([],function(W,V){if(Object.isArray(V)){return W.concat(V.flatten())}W.push(V);return W})}function H(){var V=M.call(arguments,0);return this.select(function(W){return !V.include(W)})}function F(V){return(V!==false?this:this.toArray())._reverse()}function K(V){return this.inject([],function(Y,X,W){if(0==W||(V?Y.last()!=X:!Y.include(X))){Y.push(X)}return Y})}function P(V){return this.uniq().findAll(function(W){return V.detect(function(X){return W===X})})}function Q(){return M.call(this,0)}function J(){return this.length}function T(){return"["+this.map(Object.inspect).join(", ")+"]"}function R(){var V=[];this.each(function(W){var X=Object.toJSON(W);if(!Object.isUndefined(X)){V.push(X)}});return"["+V.join(", ")+"]"}function A(X,V){V||(V=0);var W=this.length;if(V<0){V=W+V}for(;V<W;V++){if(this[V]===X){return V}}return -1}function N(W,V){V=isNaN(V)?this.length:(V<0?this.length+V:V)+1;var X=this.slice(0,V).reverse().indexOf(W);return(X<0)?X:V-X-1}function C(){var a=M.call(this,0),Y;for(var W=0,X=arguments.length;W<X;W++){Y=arguments[W];if(Object.isArray(Y)&&!("callee" in Y)){for(var V=0,Z=Y.length;V<Z;V++){a.push(Y[V])}}else{a.push(Y)}}return a}Object.extend(S,Enumerable);if(!S._reverse){S._reverse=S.reverse}Object.extend(S,{_each:O,clear:L,first:D,last:G,compact:I,flatten:U,without:H,reverse:F,uniq:K,intersect:P,clone:Q,toArray:Q,size:J,inspect:T,toJSON:R});var E=(function(){return[].concat(arguments)[0][0]!==1})(1,2);if(E){S.concat=C}if(!S.indexOf){S.indexOf=A}if(!S.lastIndexOf){S.lastIndexOf=N}})();function $H(A){return new Hash(A)}var Hash=Class.create(Enumerable,(function(){function E(Q){this._object=Object.isHash(Q)?Q.toObject():Object.clone(Q)}function F(R){for(var Q in this._object){var S=this._object[Q],T=[Q,S];T.key=Q;T.value=S;R(T)}}function K(Q,R){return this._object[Q]=R}function C(Q){if(this._object[Q]!==Object.prototype[Q]){return this._object[Q]}}function N(Q){var R=this._object[Q];delete this._object[Q];return R}function P(){return Object.clone(this._object)}function O(){return this.pluck("key")}function M(){return this.pluck("value")}function G(R){var Q=this.detect(function(S){return S.value===R});return Q&&Q.key}function I(Q){return this.clone().update(Q)}function D(Q){return new Hash(Q).inject(this,function(R,S){R.set(S.key,S.value);return R})}function B(Q,R){if(Object.isUndefined(R)){return Q}return Q+"="+encodeURIComponent(String.interpret(R))}function A(){return this.inject([],function(S,T){var R=encodeURIComponent(T.key),Q=T.value;if(Q&&typeof Q=="object"){if(Object.isArray(Q)){return S.concat(Q.map(B.curry(R)))}}else{S.push(B(R,Q))}return S}).join("&")}function L(){return"#<Hash:{"+this.map(function(Q){return Q.map(Object.inspect).join(": ")}).join(", ")+"}>"}function J(){return Object.toJSON(this.toObject())}function H(){return new Hash(this)}return{initialize:E,_each:F,set:K,get:C,unset:N,toObject:P,toTemplateReplacements:P,keys:O,values:M,index:G,merge:I,update:D,toQueryString:A,inspect:L,toJSON:J,clone:H}})());Hash.from=$H;Object.extend(Number.prototype,(function(){function D(){return this.toPaddedString(2,16)}function E(){return this+1}function A(K,J){$R(0,this,true).each(K,J);return this}function B(L,K){var J=this.toString(K||10);return"0".times(L-J.length)+J}function F(){return isFinite(this)?this.toString():"null"}function I(){return Math.abs(this)}function H(){return Math.round(this)}function G(){return Math.ceil(this)}function C(){return Math.floor(this)}return{toColorPart:D,succ:E,times:A,toPaddedString:B,toJSON:F,abs:I,round:H,ceil:G,floor:C}})());function $R(C,A,B){return new ObjectRange(C,A,B)}var ObjectRange=Class.create(Enumerable,(function(){function B(F,D,E){this.start=F;this.end=D;this.exclusive=E}function C(D){var E=this.start;while(this.include(E)){D(E);E=E.succ()}}function A(D){if(D<this.start){return false}if(this.exclusive){return D<this.end}return D<=this.end}return{initialize:B,_each:C,include:A}})());var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(A){this.responders._each(A)},register:function(A){if(!this.include(A)){this.responders.push(A)}},unregister:function(A){this.responders=this.responders.without(A)},dispatch:function(D,B,C,A){this.each(function(E){if(Object.isFunction(E[D])){try{E[D].apply(E,[B,C,A])}catch(F){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(A){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};Object.extend(this.options,A||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters)){this.options.parameters=this.options.parameters.toQueryParams()}else{if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()}}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,B,A){$super(A);this.transport=Ajax.getTransport();this.request(B)},request:function(B){this.url=B;this.method=this.options.method;var D=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){D._method=this.method;this.method="post"}this.parameters=D;if(D=Object.toQueryString(D)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+D}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){D+="&_="}}}try{var A=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(A)}Ajax.Responders.dispatch("onCreate",this,A);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||D):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(C){this.dispatchException(C)}},onStateChange:function(){var A=this.transport.readyState;if(A>1&&!((A==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var E={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.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 C=this.options.requestHeaders;if(Object.isFunction(C.push)){for(var B=0,D=C.length;B<D;B+=2){E[C[B]]=C[B+1]}}else{$H(C).each(function(F){E[F.key]=F.value})}}for(var A in E){this.transport.setRequestHeader(A,E[A])}},success:function(){var A=this.getStatus();return !A||(A>=200&&A<300)},getStatus:function(){try{return this.transport.status||0}catch(A){return 0}},respondToReadyState:function(A){var C=Ajax.Request.Events[A],B=new Ajax.Response(this);if(C=="Complete"){try{this._complete=true;(this.options["on"+B.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(B,B.headerJSON)}catch(D){this.dispatchException(D)}var E=B.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&E&&E.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+C]||Prototype.emptyFunction)(B,B.headerJSON);Ajax.Responders.dispatch("on"+C,this,B,B.headerJSON)}catch(D){this.dispatchException(D)}if(C=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var A=this.url.match(/^\s*https?:\/\/[^\/]*/);return !A||(A[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))},getHeader:function(A){try{return this.transport.getResponseHeader(A)||null}catch(B){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(A){(this.options.onException||Prototype.emptyFunction)(this,A);Ajax.Responders.dispatch("onException",this,A)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(C){this.request=C;var D=this.transport=C.transport,A=this.readyState=D.readyState;if((A>2&&!Prototype.Browser.IE)||A==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(D.responseText);this.headerJSON=this._getHeaderJSON()}if(A==4){var B=D.responseXML;this.responseXML=Object.isUndefined(B)?null:B;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(A){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(A){return null}},getResponseHeader:function(A){return this.transport.getResponseHeader(A)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var A=this.getHeader("X-JSON");if(!A){return null}A=decodeURIComponent(escape(A));try{return A.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(B){this.request.dispatchException(B)}},_getResponseJSON:function(){var A=this.request.options;if(!A.evalJSON||(A.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(A.sanitizeJSON||!this.request.isSameOrigin())}catch(B){this.request.dispatchException(B)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,A,C,B){this.container={success:(A.success||A),failure:(A.failure||(A.success?null:A))};B=Object.clone(B);var D=B.onComplete;B.onComplete=(function(E,F){this.updateContent(E.responseText);if(Object.isFunction(D)){D(E,F)}}).bind(this);$super(C,B)},updateContent:function(D){var C=this.container[this.success()?"success":"failure"],A=this.options;if(!A.evalScripts){D=D.stripScripts()}if(C=$(C)){if(A.insertion){if(Object.isString(A.insertion)){var B={};B[A.insertion]=D;C.insert(B)}else{A.insertion(C,D)}}else{C.update(D)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,A,C,B){$super(B);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=A;this.url=C;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(A){if(this.options.decay){this.decay=(A.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=A.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(B){if(arguments.length>1){for(var A=0,D=[],C=arguments.length;A<C;A++){D.push($(arguments[A]))}return D}if(Object.isString(B)){B=document.getElementById(B)}return Element.extend(B)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(F,A){var C=[];var E=document.evaluate(F,$(A)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var B=0,D=E.snapshotLength;B<D;B++){C.push(Element.extend(E.snapshotItem(B)))}return C}}if(!window.Node){var Node={}}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})}(function(C){var B=(function(){var F=document.createElement("form");var E=document.createElement("input");var D=document.documentElement;E.setAttribute("name","test");F.appendChild(E);D.appendChild(F);var G=F.elements?(typeof F.elements.test=="undefined"):null;D.removeChild(F);F=E=null;return G})();var A=C.Element;C.Element=function(F,E){E=E||{};F=F.toLowerCase();var D=Element.cache;if(B&&E.name){F="<"+F+' name="'+E.name+'">';delete E.name;return Element.writeAttribute(document.createElement(F),E)}if(!D[F]){D[F]=Element.extend(document.createElement(F))}return Element.writeAttribute(D[F].cloneNode(false),E)};Object.extend(C.Element,A||{});if(A){C.Element.prototype=A.prototype}})(this);Element.cache={};Element.idCounter=1;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=$(A);A.style.display="none";return A},show:function(A){A=$(A);A.style.display="";return A},remove:function(A){A=$(A);A.parentNode.removeChild(A);return A},update:(function(){var B=(function(){var E=document.createElement("select"),F=true;E.innerHTML='<option value="test">test</option>';if(E.options&&E.options[0]){F=E.options[0].nodeName.toUpperCase()!=="OPTION"}E=null;return F})();var A=(function(){try{var E=document.createElement("table");if(E&&E.tBodies){E.innerHTML="<tbody><tr><td>test</td></tr></tbody>";var G=typeof E.tBodies[0]=="undefined";E=null;return G}}catch(F){return true}})();var D=(function(){var E=document.createElement("script"),G=false;try{E.appendChild(document.createTextNode(""));G=!E.firstChild||E.firstChild&&E.firstChild.nodeType!==3}catch(F){G=true}E=null;return G})();function C(F,G){F=$(F);if(G&&G.toElement){G=G.toElement()}if(Object.isElement(G)){return F.update().insert(G)}G=Object.toHTML(G);var E=F.tagName.toUpperCase();if(E==="SCRIPT"&&D){F.text=G;return F}if(B||A){if(E in Element._insertionTranslations.tags){while(F.firstChild){F.removeChild(F.firstChild)}Element._getContentFromAnonymousElement(E,G.stripScripts()).each(function(H){F.appendChild(H)})}else{F.innerHTML=G.stripScripts()}}else{F.innerHTML=G.stripScripts()}G.evalScripts.bind(G).defer();return F}return C})(),replace:function(B,C){B=$(B);if(C&&C.toElement){C=C.toElement()}else{if(!Object.isElement(C)){C=Object.toHTML(C);var A=B.ownerDocument.createRange();A.selectNode(B);C.evalScripts.bind(C).defer();C=A.createContextualFragment(C.stripScripts())}}B.parentNode.replaceChild(C,B);return B},insert:function(C,E){C=$(C);if(Object.isString(E)||Object.isNumber(E)||Object.isElement(E)||(E&&(E.toElement||E.toHTML))){E={bottom:E}}var D,F,B,G;for(var A in E){D=E[A];A=A.toLowerCase();F=Element._insertionTranslations[A];if(D&&D.toElement){D=D.toElement()}if(Object.isElement(D)){F(C,D);continue}D=Object.toHTML(D);B=((A=="before"||A=="after")?C.parentNode:C).tagName.toUpperCase();G=Element._getContentFromAnonymousElement(B,D.stripScripts());if(A=="top"||A=="after"){G.reverse()}G.each(F.curry(C));D.evalScripts.bind(D).defer()}return C},wrap:function(B,C,A){B=$(B);if(Object.isElement(C)){$(C).writeAttribute(A||{})}else{if(Object.isString(C)){C=new Element(C,A)}else{C=new Element("div",C)}}if(B.parentNode){B.parentNode.replaceChild(C,B)}C.appendChild(B);return C},inspect:function(B){B=$(B);var A="<"+B.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(F){var E=F.first(),C=F.last();var D=(B[E]||"").toString();if(D){A+=" "+C+"="+D.inspect(true)}});return A+">"},recursivelyCollect:function(A,C){A=$(A);var B=[];while(A=A[C]){if(A.nodeType==1){B.push(Element.extend(A))}}return B},ancestors:function(A){return Element.recursivelyCollect(A,"parentNode")},descendants:function(A){return Element.select(A,"*")},firstDescendant:function(A){A=$(A).firstChild;while(A&&A.nodeType!=1){A=A.nextSibling}return $(A)},immediateDescendants:function(A){if(!(A=$(A).firstChild)){return[]}while(A&&A.nodeType!=1){A=A.nextSibling}if(A){return[A].concat($(A).nextSiblings())}return[]},previousSiblings:function(A){return Element.recursivelyCollect(A,"previousSibling")},nextSiblings:function(A){return Element.recursivelyCollect(A,"nextSibling")},siblings:function(A){A=$(A);return Element.previousSiblings(A).reverse().concat(Element.nextSiblings(A))},match:function(B,A){if(Object.isString(A)){A=new Selector(A)}return A.match($(B))},up:function(B,D,A){B=$(B);if(arguments.length==1){return $(B.parentNode)}var C=Element.ancestors(B);return Object.isNumber(D)?C[D]:Selector.findElement(C,D,A)},down:function(B,C,A){B=$(B);if(arguments.length==1){return Element.firstDescendant(B)}return Object.isNumber(C)?Element.descendants(B)[C]:Element.select(B,C)[A||0]},previous:function(B,D,A){B=$(B);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(B))}var C=Element.previousSiblings(B);return Object.isNumber(D)?C[D]:Selector.findElement(C,D,A)},next:function(C,D,B){C=$(C);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(C))}var A=Element.nextSiblings(C);return Object.isNumber(D)?A[D]:Selector.findElement(A,D,B)},select:function(B){var A=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(B,A)},adjacent:function(B){var A=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(B.parentNode,A).without(B)},identify:function(A){A=$(A);var B=Element.readAttribute(A,"id");if(B){return B}do{B="anonymous_element_"+Element.idCounter++}while($(B));Element.writeAttribute(A,"id",B);return B},readAttribute:function(C,A){C=$(C);if(Prototype.Browser.IE){var B=Element._attributeTranslations.read;if(B.values[A]){return B.values[A](C,A)}if(B.names[A]){A=B.names[A]}if(A.include(":")){return(!C.attributes||!C.attributes[A])?null:C.attributes[A].value}}return C.getAttribute(A)},writeAttribute:function(E,C,F){E=$(E);var B={},D=Element._attributeTranslations.write;if(typeof C=="object"){B=C}else{B[C]=Object.isUndefined(F)?true:F}for(var A in B){C=D.names[A]||A;F=B[A];if(D.values[A]){C=D.values[A](E,F)}if(F===false||F===null){E.removeAttribute(C)}else{if(F===true){E.setAttribute(C,C)}else{E.setAttribute(C,F)}}}return E},getHeight:function(A){return Element.getDimensions(A).height},getWidth:function(A){return Element.getDimensions(A).width},classNames:function(A){return new Element.ClassNames(A)},hasClassName:function(A,B){if(!(A=$(A))){return }var C=A.className;return(C.length>0&&(C==B||new RegExp("(^|\\s)"+B+"(\\s|$)").test(C)))},addClassName:function(A,B){if(!(A=$(A))){return }if(!Element.hasClassName(A,B)){A.className+=(A.className?" ":"")+B}return A},removeClassName:function(A,B){if(!(A=$(A))){return }A.className=A.className.replace(new RegExp("(^|\\s+)"+B+"(\\s+|$)")," ").strip();return A},toggleClassName:function(A,B){if(!(A=$(A))){return }return Element[Element.hasClassName(A,B)?"removeClassName":"addClassName"](A,B)},cleanWhitespace:function(B){B=$(B);var C=B.firstChild;while(C){var A=C.nextSibling;if(C.nodeType==3&&!/\S/.test(C.nodeValue)){B.removeChild(C)}C=A}return B},empty:function(A){return $(A).innerHTML.blank()},descendantOf:function(B,A){B=$(B),A=$(A);if(B.compareDocumentPosition){return(B.compareDocumentPosition(A)&8)===8}if(A.contains){return A.contains(B)&&A!==B}while(B=B.parentNode){if(B==A){return true}}return false},scrollTo:function(A){A=$(A);var B=Element.cumulativeOffset(A);window.scrollTo(B[0],B[1]);return A},getStyle:function(B,C){B=$(B);C=C=="float"?"cssFloat":C.camelize();var D=B.style[C];if(!D||D=="auto"){var A=document.defaultView.getComputedStyle(B,null);D=A?A[C]:null}if(C=="opacity"){return D?parseFloat(D):1}return D=="auto"?null:D},getOpacity:function(A){return $(A).getStyle("opacity")},setStyle:function(B,C){B=$(B);var E=B.style,A;if(Object.isString(C)){B.style.cssText+=";"+C;return C.include("opacity")?B.setOpacity(C.match(/opacity:\s*(\d?\.?\d*)/)[1]):B}for(var D in C){if(D=="opacity"){B.setOpacity(C[D])}else{E[(D=="float"||D=="cssFloat")?(Object.isUndefined(E.styleFloat)?"cssFloat":"styleFloat"):D]=C[D]}}return B},setOpacity:function(A,B){A=$(A);A.style.opacity=(B==1||B==="")?"":(B<0.00001)?0:B;return A},getDimensions:function(C){C=$(C);var G=Element.getStyle(C,"display");if(G!="none"&&G!=null){return{width:C.offsetWidth,height:C.offsetHeight}}var B=C.style;var F=B.visibility;var D=B.position;var A=B.display;B.visibility="hidden";if(D!="fixed"){B.position="absolute"}B.display="block";var H=C.clientWidth;var E=C.clientHeight;B.display=A;B.position=D;B.visibility=F;return{width:H,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(Prototype.Browser.Opera){A.style.top=0;A.style.left=0}}return A},undoPositioned:function(A){A=$(A);if(A._madePositioned){A._madePositioned=undefined;A.style.position=A.style.top=A.style.left=A.style.bottom=A.style.right=""}return A},makeClipping:function(A){A=$(A);if(A._overflow){return A}A._overflow=Element.getStyle(A,"overflow")||"auto";if(A._overflow!=="hidden"){A.style.overflow="hidden"}return A},undoClipping:function(A){A=$(A);if(!A._overflow){return A}A.style.overflow=A._overflow=="auto"?"":A._overflow;A._overflow=null;return A},cumulativeOffset:function(B){var A=0,C=0;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;B=B.offsetParent}while(B);return Element._returnOffset(C,A)},positionedOffset:function(B){var A=0,D=0;do{A+=B.offsetTop||0;D+=B.offsetLeft||0;B=B.offsetParent;if(B){if(B.tagName.toUpperCase()=="BODY"){break}var C=Element.getStyle(B,"position");if(C!=="static"){break}}}while(B);return Element._returnOffset(D,A)},absolutize:function(B){B=$(B);if(Element.getStyle(B,"position")=="absolute"){return B}var D=Element.positionedOffset(B);var F=D[1];var E=D[0];var C=B.clientWidth;var A=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=A+"px";return B},relativize:function(A){A=$(A);if(Element.getStyle(A,"position")=="relative"){return A}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;return A},cumulativeScrollOffset:function(B){var A=0,C=0;do{A+=B.scrollTop||0;C+=B.scrollLeft||0;B=B.parentNode}while(B);return Element._returnOffset(C,A)},getOffsetParent: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)},viewportOffset:function(D){var A=0,C=0;var B=D;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;if(B.offsetParent==document.body&&Element.getStyle(B,"position")=="absolute"){break}}while(B=B.offsetParent);B=D;do{if(!Prototype.Browser.Opera||(B.tagName&&(B.tagName.toUpperCase()=="BODY"))){A-=B.scrollTop||0;C-=B.scrollLeft||0}}while(B=B.parentNode);return Element._returnOffset(C,A)},clonePosition:function(B,D){var A=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});D=$(D);var E=Element.viewportOffset(D);B=$(B);var F=[0,0];var C=null;if(Element.getStyle(B,"position")=="absolute"){C=Element.getOffsetParent(B);F=Element.viewportOffset(C)}if(C==document.body){F[0]-=document.body.offsetLeft;F[1]-=document.body.offsetTop}if(A.setLeft){B.style.left=(E[0]-F[0]+A.offsetLeft)+"px"}if(A.setTop){B.style.top=(E[1]-F[1]+A.offsetTop)+"px"}if(A.setWidth){B.style.width=D.offsetWidth+"px"}if(A.setHeight){B.style.height=D.offsetHeight+"px"}return B}};Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(D,B,C){switch(C){case"left":case"top":case"right":case"bottom":if(D(B,"position")==="static"){return null}case"height":case"width":if(!Element.visible(B)){return null}var E=parseInt(D(B,C),10);if(E!==B["offset"+C.capitalize()]){return E+"px"}var A;if(C==="height"){A=["border-top-width","padding-top","padding-bottom","border-bottom-width"]}else{A=["border-left-width","padding-left","padding-right","border-right-width"]}return A.inject(E,function(F,G){var H=D(B,G);return H===null?F:F-parseInt(H,10)})+"px";default:return D(B,C)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(C,A,B){if(B==="title"){return A.title}return C(A,B)})}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(C,B){B=$(B);try{B.offsetParent}catch(E){return $(document.body)}var A=B.getStyle("position");if(A!=="static"){return C(B)}B.setStyle({position:"relative"});var D=C(B);B.setStyle({position:A});return D});$w("positionedOffset viewportOffset").each(function(A){Element.Methods[A]=Element.Methods[A].wrap(function(E,C){C=$(C);try{C.offsetParent}catch(G){return Element._returnOffset(0,0)}var B=C.getStyle("position");if(B!=="static"){return E(C)}var D=C.getOffsetParent();if(D&&D.getStyle("position")==="fixed"){D.setStyle({zoom:1})}C.setStyle({position:"relative"});var F=E(C);C.setStyle({position:B});return F})});Element.Methods.cumulativeOffset=Element.Methods.cumulativeOffset.wrap(function(B,A){try{A.offsetParent}catch(C){return Element._returnOffset(0,0)}return B(A)});Element.Methods.getStyle=function(A,B){A=$(A);B=(B=="float"||B=="cssFloat")?"styleFloat":B.camelize();var C=A.style[B];if(!C&&A.currentStyle){C=A.currentStyle[B]}if(B=="opacity"){if(C=(A.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(C[1]){return parseFloat(C[1])/100}}return 1}if(C=="auto"){if((B=="width"||B=="height")&&(A.getStyle("display")!="none")){return A["offset"+B.capitalize()]+"px"}return null}return C};Element.Methods.setOpacity=function(B,E){function F(G){return G.replace(/alpha\([^\)]*\)/gi,"")}B=$(B);var A=B.currentStyle;if((A&&!A.hasLayout)||(!A&&B.style.zoom=="normal")){B.style.zoom=1}var D=B.getStyle("filter"),C=B.style;if(E==1||E===""){(D=F(D))?C.filter=D:C.removeAttribute("filter");return B}else{if(E<0.00001){E=0}}C.filter=F(D)+"alpha(opacity="+(E*100)+")";return B};Element._attributeTranslations=(function(){var B="className";var A="for";var C=document.createElement("div");C.setAttribute(B,"x");if(C.className!=="x"){C.setAttribute("class","x");if(C.className==="x"){B="class"}}C=null;C=document.createElement("label");C.setAttribute(A,"x");if(C.htmlFor!=="x"){C.setAttribute("htmlFor","x");if(C.htmlFor==="x"){A="htmlFor"}}C=null;return{read:{names:{"class":B,className:B,"for":A,htmlFor:A},values:{_getAttr:function(D,E){return D.getAttribute(E)},_getAttr2:function(D,E){return D.getAttribute(E,2)},_getAttrNode:function(D,F){var E=D.getAttributeNode(F);return E?E.value:""},_getEv:(function(){var D=document.createElement("div");D.onclick=Prototype.emptyFunction;var F=D.getAttribute("onclick");var E;if(String(F).indexOf("{")>-1){E=function(G,H){H=G.getAttribute(H);if(!H){return null}H=H.toString();H=H.split("{")[1];H=H.split("}")[0];return H.strip()}}else{if(F===""){E=function(G,H){H=G.getAttribute(H);if(!H){return null}return H.strip()}}}D=null;return E})(),_flag:function(D,E){return $(D).hasAttribute(E)?E:null},style:function(D){return D.style.cssText.toLowerCase()},title:function(D){return D.title}}}}})();Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(A,B){A.checked=!!B},style:function(A,B){A.style.cssText=B?B:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(A){Element._attributeTranslations.write.names[A.toLowerCase()]=A;Element._attributeTranslations.has[A.toLowerCase()]=A});(function(A){Object.extend(A,{href:A._getAttr2,src:A._getAttr2,type:A._getAttr,action:A._getAttrNode,disabled:A._flag,checked:A._flag,readonly:A._flag,multiple:A._flag,onload:A._getEv,onunload:A._getEv,onclick:A._getEv,ondblclick:A._getEv,onmousedown:A._getEv,onmouseup:A._getEv,onmouseover:A._getEv,onmousemove:A._getEv,onmouseout:A._getEv,onfocus:A._getEv,onblur:A._getEv,onkeypress:A._getEv,onkeydown:A._getEv,onkeyup:A._getEv,onsubmit:A._getEv,onreset:A._getEv,onselect:A._getEv,onchange:A._getEv})})(Element._attributeTranslations.read.values);if(Prototype.BrowserFeatures.ElementExtensions){(function(){function A(E){var B=E.getElementsByTagName("*"),D=[];for(var C=0,F;F=B[C];C++){if(F.tagName!=="!"){D.push(F)}}return D}Element.Methods.down=function(C,D,B){C=$(C);if(arguments.length==1){return C.firstDescendant()}return Object.isNumber(D)?A(C)[D]:Element.select(C,D)[B||0]}})()}}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(A,B){A=$(A);A.style.opacity=(B==1)?0.999999:(B==="")?"":(B<0.00001)?0:B;return A}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(A,B){A=$(A);A.style.opacity=(B==1||B==="")?"":(B<0.00001)?0:B;if(B==1){if(A.tagName.toUpperCase()=="IMG"&&A.width){A.width++;A.width--}else{try{var D=document.createTextNode(" ");A.appendChild(D);A.removeChild(D)}catch(C){}}}return A};Element.Methods.cumulativeOffset=function(B){var A=0,C=0;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;if(B.offsetParent==document.body){if(Element.getStyle(B,"position")=="absolute"){break}}B=B.offsetParent}while(B);return Element._returnOffset(C,A)}}}}}if("outerHTML" in document.documentElement){Element.Methods.replace=function(C,E){C=$(C);if(E&&E.toElement){E=E.toElement()}if(Object.isElement(E)){C.parentNode.replaceChild(E,C);return C}E=Object.toHTML(E);var D=C.parentNode,B=D.tagName.toUpperCase();if(Element._insertionTranslations.tags[B]){var F=C.next();var A=Element._getContentFromAnonymousElement(B,E.stripScripts());D.removeChild(C);if(F){A.each(function(G){D.insertBefore(G,F)})}else{A.each(function(G){D.appendChild(G)})}}else{C.outerHTML=E.stripScripts()}E.evalScripts.bind(E).defer();return C}}Element._returnOffset=function(B,C){var A=[B,C];A.left=B;A.top=C;return A};Element._getContentFromAnonymousElement=function(C,B){var D=new Element("div"),A=Element._insertionTranslations.tags[C];if(A){D.innerHTML=A[0]+B+A[1];A[2].times(function(){D=D.firstChild})}else{D.innerHTML=B}return $A(D.childNodes)};Element._insertionTranslations={before:function(A,B){A.parentNode.insertBefore(B,A)},top:function(A,B){A.insertBefore(B,A.firstChild)},bottom:function(A,B){A.appendChild(B)},after:function(A,B){A.parentNode.insertBefore(B,A.nextSibling)},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};(function(){var A=Element._insertionTranslations.tags;Object.extend(A,{THEAD:A.TBODY,TFOOT:A.TBODY,TH:A.TD})})();Element.Methods.Simulated={hasAttribute:function(A,C){C=Element._attributeTranslations.has[C]||C;var B=$(A).getAttributeNode(C);return !!(B&&B.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);(function(A){if(!Prototype.BrowserFeatures.ElementExtensions&&A.__proto__){window.HTMLElement={};window.HTMLElement.prototype=A.__proto__;Prototype.BrowserFeatures.ElementExtensions=true}A=null})(document.createElement("div"));Element.extend=(function(){function C(G){if(typeof window.Element!="undefined"){var I=window.Element.prototype;if(I){var K="_"+(Math.random()+"").slice(2);var H=document.createElement(G);I[K]="x";var J=(H[K]!=="x");delete I[K];H=null;return J}}return false}function B(H,G){for(var J in G){var I=G[J];if(Object.isFunction(I)&&!(J in H)){H[J]=I.methodize()}}}var D=C("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(D){return function(H){if(H&&typeof H._extendedByPrototype=="undefined"){var G=H.tagName;if(G&&(/^(?:object|applet|embed)$/i.test(G))){B(H,Element.Methods);B(H,Element.Methods.Simulated);B(H,Element.Methods.ByTag[G.toUpperCase()])}}return H}}return Prototype.K}var A={},E=Element.Methods.ByTag;var F=Object.extend(function(I){if(!I||typeof I._extendedByPrototype!="undefined"||I.nodeType!=1||I==window){return I}var G=Object.clone(A),H=I.tagName.toUpperCase();if(E[H]){Object.extend(G,E[H])}B(I,G);I._extendedByPrototype=Prototype.emptyFunction;return I},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(A,Element.Methods);Object.extend(A,Element.Methods.Simulated)}}});F.refresh();return F})();Element.hasAttribute=function(A,B){if(A.hasAttribute){return A.hasAttribute(B)}return Element.Methods.Simulated.hasAttribute(A,B)};Element.addMethods=function(C){var J=Prototype.BrowserFeatures,D=Element.Methods.ByTag;if(!C){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var B=C;C=arguments[1]}if(!B){Object.extend(Element.Methods,C||{})}else{if(Object.isArray(B)){B.each(H)}else{H(B)}}function H(F){F=F.toUpperCase();if(!Element.Methods.ByTag[F]){Element.Methods.ByTag[F]={}}Object.extend(Element.Methods.ByTag[F],C)}function A(M,L,F){F=F||false;for(var O in M){var N=M[O];if(!Object.isFunction(N)){continue}if(!F||!(O in L)){L[O]=N.methodize()}}}function E(N){var F;var M={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};if(M[N]){F="HTML"+M[N]+"Element"}if(window[F]){return window[F]}F="HTML"+N+"Element";if(window[F]){return window[F]}F="HTML"+N.capitalize()+"Element";if(window[F]){return window[F]}var L=document.createElement(N);var O=L.__proto__||L.constructor.prototype;L=null;return O}var I=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(J.ElementExtensions){A(Element.Methods,I);A(Element.Methods.Simulated,I,true)}if(J.SpecificElementExtensions){for(var K in Element.Methods.ByTag){var G=E(K);if(Object.isUndefined(G)){continue}A(D[K],G.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){return{width:this.getWidth(),height:this.getHeight()}},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};(function(C){var H=Prototype.Browser,F=document,D,E={};function A(){if(H.WebKit&&!F.evaluate){return document}if(H.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body}return document.documentElement}function G(B){if(!D){D=A()}E[B]="client"+B;C["get"+B]=function(){return D[E[B]]};return C["get"+B]()}C.getWidth=G.curry("Width");C.getHeight=G.curry("Height")})(document.viewport);Element.Storage={UID:1};Element.addMethods({getStorage:function(B){if(!(B=$(B))){return }var A;if(B===window){A=0}else{if(typeof B._prototypeUID==="undefined"){B._prototypeUID=[Element.Storage.UID++]}A=B._prototypeUID[0]}if(!Element.Storage[A]){Element.Storage[A]=$H()}return Element.Storage[A]},store:function(B,A,C){if(!(B=$(B))){return }if(arguments.length===2){Element.getStorage(B).update(A)}else{Element.getStorage(B).set(A,C)}return B},retrieve:function(C,B,A){if(!(C=$(C))){return }var E=Element.getStorage(C),D=E.get(B);if(Object.isUndefined(D)){E.set(B,A);D=A}return D},clone:function(C,A){if(!(C=$(C))){return }var E=C.cloneNode(A);E._prototypeUID=void 0;if(A){var D=Element.select(E,"*"),B=D.length;while(B--){D[B]._prototypeUID=void 0}}return Element.extend(E)}});var Selector=Class.create({initialize:function(A){this.expression=A.strip();if(this.shouldUseSelectorsAPI()){this.mode="selectorsAPI"}else{if(this.shouldUseXPath()){this.mode="xpath";this.compileXPathMatcher()}else{this.mode="normal";this.compileMatcher()}}},shouldUseXPath:(function(){var A=(function(){var E=false;if(document.evaluate&&window.XPathResult){var D=document.createElement("div");D.innerHTML="<ul><li></li></ul><div><ul><li></li></ul></div>";var C=".//*[local-name()='ul' or local-name()='UL']//*[local-name()='li' or local-name()='LI']";var B=document.evaluate(C,D,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);E=(B.snapshotLength!==2);D=null}return E})();return function(){if(!Prototype.BrowserFeatures.XPath){return false}var B=this.expression;if(Prototype.Browser.WebKit&&(B.include("-of-type")||B.include(":empty"))){return false}if((/(\[[\w-]*?:|:checked)/).test(B)){return false}if(A){return false}return true}})(),shouldUseSelectorsAPI:function(){if(!Prototype.BrowserFeatures.SelectorsAPI){return false}if(Selector.CASE_INSENSITIVE_CLASS_NAMES){return false}if(!Selector._div){Selector._div=new Element("div")}try{Selector._div.querySelector(this.expression)}catch(A){return false}return true},compileMatcher:function(){var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m,len=ps.length,name;if(Selector._cache[e]){this.matcher=Selector._cache[e];return }this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i=0;i<len;i++){p=ps[i].re;name=ps[i].name;if(m=e.match(p)){this.matcher.push(Object.isFunction(c[name])?c[name](m):new Template(c[name]).evaluate(m));e=e.replace(m[0],"");break}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher},compileXPathMatcher:function(){var G=this.expression,H=Selector.patterns,C=Selector.xpath,F,B,A=H.length,D;if(Selector._cache[G]){this.xpath=Selector._cache[G];return }this.matcher=[".//*"];while(G&&F!=G&&(/\S/).test(G)){F=G;for(var E=0;E<A;E++){D=H[E].name;if(B=G.match(H[E].re)){this.matcher.push(Object.isFunction(C[D])?C[D](B):new Template(C[D]).evaluate(B));G=G.replace(B[0],"");break}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath},findElements:function(A){A=A||document;var C=this.expression,B;switch(this.mode){case"selectorsAPI":if(A!==document){var D=A.id,E=$(A).identify();E=E.replace(/([\.:])/g,"\\$1");C="#"+E+" "+C}B=$A(A.querySelectorAll(C)).map(Element.extend);A.id=D;return B;case"xpath":return document._getElementsByXPath(this.xpath,A);default:return this.matcher(A)}},match:function(I){this.tokens=[];var M=this.expression,A=Selector.patterns,E=Selector.assertions;var B,D,F,L=A.length,C;while(M&&B!==M&&(/\S/).test(M)){B=M;for(var H=0;H<L;H++){D=A[H].re;C=A[H].name;if(F=M.match(D)){if(E[C]){this.tokens.push([C,Object.clone(F)]);M=M.replace(F[0],"")}else{return this.findElements(document).include(I)}}}}var K=true,C,J;for(var H=0,G;G=this.tokens[H];H++){C=G[0],J=G[1];if(!Selector.assertions[C](I,J)){K=false;break}}return K},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+">"}});if(Prototype.BrowserFeatures.SelectorsAPI&&document.compatMode==="BackCompat"){Selector.CASE_INSENSITIVE_CLASS_NAMES=(function(){var C=document.createElement("div"),A=document.createElement("span");C.id="prototype_test_id";A.className="Test";C.appendChild(A);var B=(C.querySelector("#prototype_test_id .test")!==null);C=A=null;return B})()}Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(A){if(A[1]=="*"){return""}return"[local-name()='"+A[1].toLowerCase()+"' or local-name()='"+A[1].toUpperCase()+"']"},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(A){A[1]=A[1].toLowerCase();return new Template("[@#{1}]").evaluate(A)},attr:function(A){A[1]=A[1].toLowerCase();A[3]=A[5]||A[6];return new Template(Selector.xpath.operators[A[2]]).evaluate(A)},pseudo:function(A){var B=Selector.xpath.pseudos[A[1]];if(!B){return""}if(Object.isFunction(B)){return B(A)}return new Template(Selector.xpath.pseudos[A[1]]).evaluate(A)},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]",empty:"[count(*) = 0 and (count(text()) = 0)]",checked:"[@checked]",disabled:"[(@disabled) and (@type!='hidden')]",enabled:"[not(@disabled) and (@type!='hidden')]",not:function(E){var H=E[6],C=Selector.patterns,I=Selector.xpath,A,J,G=C.length,B;var D=[];while(H&&A!=H&&(/\S/).test(H)){A=H;for(var F=0;F<G;F++){B=C[F].name;if(E=H.match(C[F].re)){J=Object.isFunction(I[B])?I[B](E):new Template(I[B]).evaluate(E);D.push("("+J.substring(1,J.length-1)+")");H=H.replace(E[0],"");break}}}return"[not("+D.join(" and ")+")]"},"nth-child":function(A){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",A)},"nth-last-child":function(A){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",A)},"nth-of-type":function(A){return Selector.xpath.pseudos.nth("position() ",A)},"nth-last-of-type":function(A){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",A)},"first-of-type":function(A){A[6]="1";return Selector.xpath.pseudos["nth-of-type"](A)},"last-of-type":function(A){A[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](A)},"only-of-type":function(A){var B=Selector.xpath.pseudos;return B["first-of-type"](A)+B["last-of-type"](A)},nth:function(E,C){var F,G=C[6],B;if(G=="even"){G="2n+0"}if(G=="odd"){G="2n+1"}if(F=G.match(/^(\d+)$/)){return"["+E+"= "+F[1]+"]"}if(F=G.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(F[1]=="-"){F[1]=-1}var D=F[1]?Number(F[1]):1;var A=F[2]?Number(F[2]):0;B="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(B).evaluate({fragment:E,a:D,b:A})}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);      c = false;',className:'n = h.className(n, r, "#{1}", c);    c = false;',id:'n = h.id(n, r, "#{1}", c);           c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(A){A[3]=(A[5]||A[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(A)},pseudo:function(A){if(A[6]){A[6]=A[6].replace(/"/g,'\\"')}return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(A)},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:[{name:"laterSibling",re:/^\s*~\s*/},{name:"child",re:/^\s*>\s*/},{name:"adjacent",re:/^\s*\+\s*/},{name:"descendant",re:/^\s/},{name:"tagName",re:/^\s*(\*|[\w\-]+)(\b|$)?/},{name:"id",re:/^#([\w\-\*]+)(\b|$)/},{name:"className",re:/^\.([\w\-\*]+)(\b|$)/},{name:"pseudo",re:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/},{name:"attrPresence",re:/^\[((?:[\w-]+:)?[\w-]+)\]/},{name:"attr",re:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/}],assertions:{tagName:function(A,B){return B[1].toUpperCase()==A.tagName.toUpperCase()},className:function(A,B){return Element.hasClassName(A,B[1])},id:function(A,B){return A.id===B[1]},attrPresence:function(A,B){return Element.hasAttribute(A,B[1])},attr:function(B,C){var A=Element.readAttribute(B,C[1]);return A&&Selector.operators[C[2]](A,C[5]||C[6])}},handlers:{concat:function(B,A){for(var C=0,D;D=A[C];C++){B.push(D)}return B},mark:function(A){var D=Prototype.emptyFunction;for(var B=0,C;C=A[B];B++){C._countedByPrototype=D}return A},unmark:(function(){var A=(function(){var B=document.createElement("div"),E=false,D="_countedByPrototype",C="x";B[D]=C;E=(B.getAttribute(D)===C);B=null;return E})();return A?function(B){for(var C=0,D;D=B[C];C++){D.removeAttribute("_countedByPrototype")}return B}:function(B){for(var C=0,D;D=B[C];C++){D._countedByPrototype=void 0}return B}})(),index:function(A,D,G){A._countedByPrototype=Prototype.emptyFunction;if(D){for(var B=A.childNodes,E=B.length-1,C=1;E>=0;E--){var F=B[E];if(F.nodeType==1&&(!G||F._countedByPrototype)){F.nodeIndex=C++}}}else{for(var E=0,C=1,B=A.childNodes;F=B[E];E++){if(F.nodeType==1&&(!G||F._countedByPrototype)){F.nodeIndex=C++}}}},unique:function(B){if(B.length==0){return B}var D=[],E;for(var C=0,A=B.length;C<A;C++){if(typeof (E=B[C])._countedByPrototype=="undefined"){E._countedByPrototype=Prototype.emptyFunction;D.push(Element.extend(E))}}return Selector.handlers.unmark(D)},descendant:function(A){var D=Selector.handlers;for(var C=0,B=[],E;E=A[C];C++){D.concat(B,E.getElementsByTagName("*"))}return B},child:function(A){var E=Selector.handlers;for(var D=0,C=[],F;F=A[D];D++){for(var B=0,G;G=F.childNodes[B];B++){if(G.nodeType==1&&G.tagName!="!"){C.push(G)}}}return C},adjacent:function(A){for(var C=0,B=[],E;E=A[C];C++){var D=this.nextElementSibling(E);if(D){B.push(D)}}return B},laterSibling:function(A){var D=Selector.handlers;for(var C=0,B=[],E;E=A[C];C++){D.concat(B,Element.nextSiblings(E))}return B},nextElementSibling:function(A){while(A=A.nextSibling){if(A.nodeType==1){return A}}return null},previousElementSibling:function(A){while(A=A.previousSibling){if(A.nodeType==1){return A}}return null},tagName:function(A,H,C,B){var I=C.toUpperCase();var E=[],G=Selector.handlers;if(A){if(B){if(B=="descendant"){for(var F=0,D;D=A[F];F++){G.concat(E,D.getElementsByTagName(C))}return E}else{A=this[B](A)}if(C=="*"){return A}}for(var F=0,D;D=A[F];F++){if(D.tagName.toUpperCase()===I){E.push(D)}}return E}else{return H.getElementsByTagName(C)}},id:function(A,I,B,C){var H=$(B),G=Selector.handlers;if(I==document){if(!H){return[]}if(!A){return[H]}}else{if(!I.sourceIndex||I.sourceIndex<1){var A=I.getElementsByTagName("*");for(var E=0,D;D=A[E];E++){if(D.id===B){return[D]}}}}if(A){if(C){if(C=="child"){for(var F=0,D;D=A[F];F++){if(H.parentNode==D){return[H]}}}else{if(C=="descendant"){for(var F=0,D;D=A[F];F++){if(Element.descendantOf(H,D)){return[H]}}}else{if(C=="adjacent"){for(var F=0,D;D=A[F];F++){if(Selector.handlers.previousElementSibling(H)==D){return[H]}}}else{A=G[C](A)}}}}for(var F=0,D;D=A[F];F++){if(D==H){return[H]}}return[]}return(H&&Element.descendantOf(H,I))?[H]:[]},className:function(B,A,C,D){if(B&&D){B=this[D](B)}return Selector.handlers.byClassName(B,A,C)},byClassName:function(C,B,F){if(!C){C=Selector.handlers.descendant([B])}var H=" "+F+" ";for(var E=0,D=[],G,A;G=C[E];E++){A=G.className;if(A.length==0){continue}if(A==F||(" "+A+" ").include(H)){D.push(G)}}return D},attrPresence:function(C,B,A,G){if(!C){C=B.getElementsByTagName("*")}if(C&&G){C=this[G](C)}var E=[];for(var D=0,F;F=C[D];D++){if(Element.hasAttribute(F,A)){E.push(F)}}return E},attr:function(B,J,I,K,D,C){if(!B){B=J.getElementsByTagName("*")}if(B&&C){B=this[C](B)}var M=Selector.operators[D],G=[];for(var F=0,E;E=B[F];F++){var H;if(Prototype.Browser.IE&&!Prototype.Tuning.extendOnCssSelect){var A=I;var L=Element._attributeTranslations.read;if(L.values[A]){H=L.values[A](E,A)}else{if(L.names[A]){A=L.names[A]}if(A.include(":")){H(!E.attributes||!E.attributes[A])?null:E.attributes[A].value}else{H=E.getAttribute(A)}}}else{H=Element.readAttribute(E,I)}if(H===null){continue}if(M(H,K)){G.push(E)}}return G},pseudo:function(B,C,E,A,D){if(B&&D){B=this[D](B)}if(!B){B=A.getElementsByTagName("*")}return Selector.pseudos[C](B,E,A)}},pseudos:{"first-child":function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(Selector.handlers.previousElementSibling(E)){continue}C.push(E)}return C},"last-child":function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(Selector.handlers.nextElementSibling(E)){continue}C.push(E)}return C},"only-child":function(B,G,A){var E=Selector.handlers;for(var D=0,C=[],F;F=B[D];D++){if(!E.previousElementSibling(F)&&!E.nextElementSibling(F)){C.push(F)}}return C},"nth-child":function(B,C,A){return Selector.pseudos.nth(B,C,A)},"nth-last-child":function(B,C,A){return Selector.pseudos.nth(B,C,A,true)},"nth-of-type":function(B,C,A){return Selector.pseudos.nth(B,C,A,false,true)},"nth-last-of-type":function(B,C,A){return Selector.pseudos.nth(B,C,A,true,true)},"first-of-type":function(B,C,A){return Selector.pseudos.nth(B,"1",A,false,true)},"last-of-type":function(B,C,A){return Selector.pseudos.nth(B,"1",A,true,true)},"only-of-type":function(B,D,A){var C=Selector.pseudos;return C["last-of-type"](C["first-of-type"](B,D,A),D,A)},getIndices:function(B,A,C){if(B==0){return A>0?[A]:[]}return $R(1,C).inject([],function(D,E){if(0==(E-A)%B&&(E-A)/B>=0){D.push(E)}return D})},nth:function(A,L,N,K,C){if(A.length==0){return[]}if(L=="even"){L="2n+0"}if(L=="odd"){L="2n+1"}var J=Selector.handlers,I=[],B=[],E;J.mark(A);for(var H=0,D;D=A[H];H++){if(!D.parentNode._countedByPrototype){J.index(D.parentNode,K,C);B.push(D.parentNode)}}if(L.match(/^\d+$/)){L=Number(L);for(var H=0,D;D=A[H];H++){if(D.nodeIndex==L){I.push(D)}}}else{if(E=L.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(E[1]=="-"){E[1]=-1}var O=E[1]?Number(E[1]):1;var M=E[2]?Number(E[2]):0;var P=Selector.pseudos.getIndices(O,M,A.length);for(var H=0,D,F=P.length;D=A[H];H++){for(var G=0;G<F;G++){if(D.nodeIndex==P[G]){I.push(D)}}}}}J.unmark(A);J.unmark(B);return I},empty:function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(E.tagName=="!"||E.firstChild){continue}C.push(E)}return C},not:function(A,D,I){var G=Selector.handlers,J,C;var H=new Selector(D).findElements(I);G.mark(H);for(var F=0,E=[],B;B=A[F];F++){if(!B._countedByPrototype){E.push(B)}}G.unmark(H);return E},enabled:function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(!E.disabled&&(!E.type||E.type!=="hidden")){C.push(E)}}return C},disabled:function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(E.disabled){C.push(E)}}return C},checked:function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(E.checked){C.push(E)}}return C}},operators:{"=":function(B,A){return B==A},"!=":function(B,A){return B!=A},"^=":function(B,A){return B==A||B&&B.startsWith(A)},"$=":function(B,A){return B==A||B&&B.endsWith(A)},"*=":function(B,A){return B==A||B&&B.include(A)},"~=":function(B,A){return(" "+B+" ").include(" "+A+" ")},"|=":function(B,A){return("-"+(B||"").toUpperCase()+"-").include("-"+(A||"").toUpperCase()+"-")}},split:function(B){var A=[];B.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(C){A.push(C[1].strip())});return A},matchElements:function(F,G){var E=$$(G),D=Selector.handlers;D.mark(E);for(var C=0,B=[],A;A=F[C];C++){if(A._countedByPrototype){B.push(A)}}D.unmark(E);return B},findElement:function(B,C,A){if(Object.isNumber(C)){A=C;C=false}return Selector.matchElements(B,C||"*")[A||0]},findChildElements:function(E,G){G=Selector.split(G.join(","));var D=[],F=Selector.handlers;for(var C=0,B=G.length,A;C<B;C++){A=new Selector(G[C].strip());F.concat(D,A.findElements(E))}return(B>1)?F.unique(D):D}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(B,A){for(var C=0,D;D=A[C];C++){if(D.tagName!=="!"){B.push(D)}}return B}})}function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(A){A=$(A);A.reset();return A},serializeElements:function(G,B){if(typeof B!="object"){B={hash:!!B}}else{if(Object.isUndefined(B.hash)){B.hash=true}}var C,F,A=false,E=B.submit;var D=G.inject({},function(H,I){if(!I.disabled&&I.name){C=I.name;F=$(I).getValue();if(F!=null&&I.type!="file"&&(I.type!="submit"||(!A&&E!==false&&(!E||C==E)&&(A=true)))){if(C in H){if(!Object.isArray(H[C])){H[C]=[H[C]]}H[C].push(F)}else{H[C]=F}}}return H});return B.hash?D:Object.toQueryString(D)}};Form.Methods={serialize:function(B,A){return Form.serializeElements(Form.getElements(B),A)},getElements:function(E){var F=$(E).getElementsByTagName("*"),D,A=[],C=Form.Element.Serializers;for(var B=0;D=F[B];B++){A.push(D)}return A.inject([],function(G,H){if(C[H.tagName.toLowerCase()]){G.push(Element.extend(H))}return G})},getInputs:function(G,C,D){G=$(G);var A=G.getElementsByTagName("input");if(!C&&!D){return $A(A).map(Element.extend)}for(var E=0,H=[],F=A.length;E<F;E++){var B=A[E];if((C&&B.type!=C)||(D&&B.name!=D)){continue}H.push(Element.extend(B))}return H},disable:function(A){A=$(A);Form.getElements(A).invoke("disable");return A},enable:function(A){A=$(A);Form.getElements(A).invoke("enable");return A},findFirstElement:function(B){var C=$(B).getElements().findAll(function(D){return"hidden"!=D.type&&!D.disabled});var A=C.findAll(function(D){return D.hasAttribute("tabIndex")&&D.tabIndex>=0}).sortBy(function(D){return D.tabIndex}).first();return A?A:C.find(function(D){return/^(?:input|select|textarea)$/i.test(D.tagName)})},focusFirstElement:function(A){A=$(A);A.findFirstElement().activate();return A},request:function(B,A){B=$(B),A=Object.clone(A||{});var D=A.parameters,C=B.readAttribute("action")||"";if(C.blank()){C=window.location.href}A.parameters=B.serialize(true);if(D){if(Object.isString(D)){D=D.toQueryParams()}Object.extend(A.parameters,D)}if(B.hasAttribute("method")&&!A.method){A.method=B.method}return new Ajax.Request(C,A)}};Form.Element={focus:function(A){$(A).focus();return A},select:function(A){$(A).select();return A}};Form.Element.Methods={serialize:function(A){A=$(A);if(!A.disabled&&A.name){var B=A.getValue();if(B!=undefined){var C={};C[A.name]=B;return Object.toQueryString(C)}}return""},getValue:function(A){A=$(A);var B=A.tagName.toLowerCase();return Form.Element.Serializers[B](A)},setValue:function(A,B){A=$(A);var C=A.tagName.toLowerCase();Form.Element.Serializers[C](A,B);return A},clear:function(A){$(A).value="";return A},present:function(A){return $(A).value!=""},activate:function(A){A=$(A);try{A.focus();if(A.select&&(A.tagName.toLowerCase()!="input"||!(/^(?:button|reset|submit)$/i.test(A.type)))){A.select()}}catch(B){}return A},disable:function(A){A=$(A);A.disabled=true;return A},enable:function(A){A=$(A);A.disabled=false;return A}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(A,B){switch(A.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(A,B);default:return Form.Element.Serializers.textarea(A,B)}},inputSelector:function(A,B){if(Object.isUndefined(B)){return A.checked?A.value:null}else{A.checked=!!B}},textarea:function(A,B){if(Object.isUndefined(B)){return A.value}else{A.value=B}},select:function(C,F){if(Object.isUndefined(F)){return this[C.type=="select-one"?"selectOne":"selectMany"](C)}else{var B,D,G=!Object.isArray(F);for(var A=0,E=C.length;A<E;A++){B=C.options[A];D=this.optionValue(B);if(G){if(D==F){B.selected=true;return }}else{B.selected=F.include(D)}}}},selectOne:function(B){var A=B.selectedIndex;return A>=0?this.optionValue(B.options[A]):null},selectMany:function(D){var A,E=D.length;if(!E){return null}for(var C=0,A=[];C<E;C++){var B=D.options[C];if(B.selected){A.push(this.optionValue(B))}}return A},optionValue:function(A){return Element.extend(A).hasAttribute("value")?A.value:A.text}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,A,B,C){$super(C,B);this.element=$(A);this.lastValue=this.getValue()},execute:function(){var A=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(A)?this.lastValue!=A:String(this.lastValue)!=String(A)){this.callback(this.element,A);this.lastValue=A}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=Class.create({initialize:function(A,B){this.element=$(A);this.callback=B;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var A=this.getValue();if(this.lastValue!=A){this.callback(this.element,A);this.lastValue=A}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(A){if(A.type){switch(A.type.toLowerCase()){case"checkbox":case"radio":Event.observe(A,"click",this.onElementEvent.bind(this));break;default:Event.observe(A,"change",this.onElementEvent.bind(this));break}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});(function(){var V={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{}};var E=document.documentElement;var W="onmouseenter" in E&&"onmouseleave" in E;var O;if(Prototype.Browser.IE){var H={0:1,1:4,2:2};O=function(Y,X){return Y.button===H[X]}}else{if(Prototype.Browser.WebKit){O=function(Y,X){switch(X){case 0:return Y.which==1&&!Y.metaKey;case 1:return Y.which==2||(Y.which==1&&Y.metaKey);case 2:return Y.which==3;default:return false}}}else{O=function(Y,X){return Y.which?(Y.which===X+1):(Y.button===X)}}}function R(X){return O(X,0)}function Q(X){return O(X,1)}function K(X){return O(X,2)}function C(Z){Z=V.extend(Z);var Y=Z.target,X=Z.type,a=Z.currentTarget;if(a&&a.tagName){if(X==="load"||X==="error"||(X==="click"&&a.tagName.toLowerCase()==="input"&&a.type==="radio")){Y=a}}if(Y.nodeType==Node.TEXT_NODE){Y=Y.parentNode}return Element.extend(Y)}function M(Y,a){var X=V.element(Y);if(!a){return X}var Z=[X].concat(X.ancestors());return Selector.findElement(Z,a,0)}function P(X){return{x:B(X),y:A(X)}}function B(Z){var Y=document.documentElement,X=document.body||{scrollLeft:0};return Z.pageX||(Z.clientX+(Y.scrollLeft||X.scrollLeft)-(Y.clientLeft||0))}function A(Z){var Y=document.documentElement,X=document.body||{scrollTop:0};return Z.pageY||(Z.clientY+(Y.scrollTop||X.scrollTop)-(Y.clientTop||0))}function N(X){V.extend(X);X.preventDefault();X.stopPropagation();X.stopped=true}V.Methods={isLeftClick:R,isMiddleClick:Q,isRightClick:K,element:C,findElement:M,pointer:P,pointerX:B,pointerY:A,stop:N};var T=Object.keys(V.Methods).inject({},function(X,Y){X[Y]=V.Methods[Y].methodize();return X});if(Prototype.Browser.IE){function G(Y){var X;switch(Y.type){case"mouseover":X=Y.fromElement;break;case"mouseout":X=Y.toElement;break;default:return null}return Element.extend(X)}Object.extend(T,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});V.extend=function(Y,X){if(!Y){return false}if(Y._extendedByPrototype){return Y}Y._extendedByPrototype=Prototype.emptyFunction;var Z=V.pointer(Y);Object.extend(Y,{target:Y.srcElement||X,relatedTarget:G(Y),pageX:Z.x,pageY:Z.y});return Object.extend(Y,T)}}else{V.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(V.prototype,T);V.extend=Prototype.K}function L(b,a,c){var Z=Element.retrieve(b,"prototype_event_registry");if(Object.isUndefined(Z)){D.push(b);Z=Element.retrieve(b,"prototype_event_registry",$H())}var X=Z.get(a);if(Object.isUndefined(X)){X=[];Z.set(a,X)}if(X.pluck("handler").include(c)){return false}var Y;if(a.include(":")){Y=function(d){if(Object.isUndefined(d.eventName)){return false}if(d.eventName!==a){return false}V.extend(d,b);c.call(b,d)}}else{if(!W&&(a==="mouseenter"||a==="mouseleave")){if(a==="mouseenter"||a==="mouseleave"){Y=function(f){V.extend(f,b);var d=f.relatedTarget;while(d&&d!==b){try{d=d.parentNode}catch(g){d=b}}if(d===b){return }c.call(b,f)}}}else{Y=function(d){V.extend(d,b);c.call(b,d)}}}Y.handler=c;X.push(Y);return Y}function F(){for(var X=0,Y=D.length;X<Y;X++){V.stopObserving(D[X]);D[X]=null}}var D=[];if(Prototype.Browser.IE){window.attachEvent("onunload",F)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}var J=Prototype.K;if(!W){J=function(Y){var X={mouseenter:"mouseover",mouseleave:"mouseout"};return Y in X?X[Y]:Y}}function S(a,Z,b){a=$(a);var Y=L(a,Z,b);if(!Y){return a}if(Z.include(":")){if(a.addEventListener){a.addEventListener("dataavailable",Y,false)}else{a.attachEvent("ondataavailable",Y);a.attachEvent("onfilterchange",Y)}}else{var X=J(Z);if(a.addEventListener){a.addEventListener(X,Y,false)}else{a.attachEvent("on"+X,Y)}}return a}function I(c,a,d){c=$(c);var Z=Element.retrieve(c,"prototype_event_registry");if(Object.isUndefined(Z)){return c}if(a&&!d){var b=Z.get(a);if(Object.isUndefined(b)){return c}b.each(function(e){Element.stopObserving(c,a,e.handler)});return c}else{if(!a){Z.each(function(g){var e=g.key,f=g.value;f.each(function(h){Element.stopObserving(c,e,h.handler)})});return c}}var b=Z.get(a);if(!b){return }var Y=b.find(function(e){return e.handler===d});if(!Y){return c}var X=J(a);if(a.include(":")){if(c.removeEventListener){c.removeEventListener("dataavailable",Y,false)}else{c.detachEvent("ondataavailable",Y);c.detachEvent("onfilterchange",Y)}}else{if(c.removeEventListener){c.removeEventListener(X,Y,false)}else{c.detachEvent("on"+X,Y)}}Z.set(a,b.without(Y));return c}function U(a,Z,Y,X){a=$(a);if(Object.isUndefined(X)){X=true}if(a==document&&document.createEvent&&!a.dispatchEvent){a=document.documentElement}var b;if(document.createEvent){b=document.createEvent("HTMLEvents");b.initEvent("dataavailable",true,true)}else{b=document.createEventObject();b.eventType=X?"ondataavailable":"onfilterchange"}b.eventName=Z;b.memo=Y||{};if(document.createEvent){a.dispatchEvent(b)}else{a.fireEvent(b.eventType,b)}return V.extend(b)}Object.extend(V,V.Methods);Object.extend(V,{fire:U,observe:S,stopObserving:I});Element.addMethods({fire:U,observe:S,stopObserving:I});Object.extend(document,{fire:U.methodize(),observe:S.methodize(),stopObserving:I.methodize(),loaded:false});if(window.Event){Object.extend(window.Event,V)}else{window.Event=V}})();(function(){var D;function A(){if(document.loaded){return }if(D){window.clearTimeout(D)}document.loaded=true;document.fire("dom:loaded")}function C(){if(document.readyState==="complete"){document.stopObserving("readystatechange",C);A()}}function B(){try{document.documentElement.doScroll("left")}catch(E){D=B.defer();return }A()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",A,false)}else{document.observe("readystatechange",C);if(window==top){D=B.defer()}}Event.observe(window,"load",A)})();Element.addMethods();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(A,B){return Element.insert(A,{before:B})},Top:function(A,B){return Element.insert(A,{top:B})},Bottom:function(A,B){return Element.insert(A,{bottom:B})},After:function(A,B){return Element.insert(A,{after:B})}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},within:function(B,A,C){if(this.includeScrollOffsets||Element.hasClassName(B,"js-page-drop")){return this.withinIncludingScrolloffsets(B,A,C)}this.xcomp=A;this.ycomp=C;this.offset=Element.cumulativeOffset(B);return(C>=this.offset[1]&&C<this.offset[1]+B.offsetHeight&&A>=this.offset[0]&&A<this.offset[0]+B.offsetWidth)},withinIncludingScrolloffsets:function(B,A,D){var C=Element.cumulativeScrollOffset(B);this.xcomp=A+C[0]-this.deltaX;this.ycomp=D+C[1]-this.deltaY;this.offset=Element.cumulativeOffset(B);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+B.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+B.offsetWidth)},overlap:function(B,A){if(!B){return 0}if(B=="vertical"){return((this.offset[1]+A.offsetHeight)-this.ycomp)/A.offsetHeight}if(B=="horizontal"){return((this.offset[0]+A.offsetWidth)-this.xcomp)/A.offsetWidth}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(A){Position.prepare();return Element.absolutize(A)},relativize:function(A){Position.prepare();return Element.relativize(A)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(B,C,A){A=A||{};return Element.clonePosition(C,B,A)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(B){function A(C){return C.blank()?null:"[contains(concat(' ', @class, ' '), ' "+C+" ')]"}B.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(C,E){E=E.toString().strip();var D=/\s/.test(E)?$w(E).map(A).join(""):A(E);return D?document._getElementsByXPath(".//*"+D,C):[]}:function(E,F){F=F.toString().strip();var G=[],H=(/\s/.test(F)?$w(F):null);if(!H&&!F){return G}var C=$(E).getElementsByTagName("*");F=" "+F+" ";for(var D=0,J,I;J=C[D];D++){if(J.className&&(I=" "+J.className+" ")&&(I.include(F)||(H&&H.all(function(K){return !K.toString().blank()&&I.include(" "+K+" ")})))){G.push(Element.extend(J))}}return G};return function(D,C){return $(C||document.body).getElementsByClassName(D)}}(Element.Methods)}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);String.prototype.parseColor=function(){var A="#";if(this.slice(0,4)=="rgb("){var C=this.slice(4,this.length-1).split(",");var B=0;do{A+=parseInt(C[B]).toColorPart()}while(++B<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var B=1;B<4;B++){A+=(this.charAt(B)+this.charAt(B)).toLowerCase()}}if(this.length==7){A=this.toLowerCase()}}}return(A.length==7?A:(arguments[0]||this))};Element.collectTextNodes=function(A){return $A($(A).childNodes).collect(function(B){return(B.nodeType==3?B.nodeValue:(B.hasChildNodes()?Element.collectTextNodes(B):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(A,B){return $A($(A).childNodes).collect(function(C){return(C.nodeType==3?C.nodeValue:((C.hasChildNodes()&&!Element.hasClassName(C,B))?Element.collectTextNodesIgnoreClass(C,B):""))}).flatten().join("")};Element.setContentZoom=function(A,B){A=$(A);A.setStyle({fontSize:(B/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return A};Element.getInlineOpacity=function(A){return $(A).style.opacity||""};Element.forceRerendering=function(A){try{A=$(A);var C=document.createTextNode(" ");A.appendChild(C);A.removeChild(C)}catch(B){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(A){return(-Math.cos(A*Math.PI)/2)+0.5},reverse:function(A){return 1-A},flicker:function(A){var A=((-Math.cos(A*Math.PI)/4)+0.75)+Math.random()/4;return A>1?1:A},wobble:function(A){return(-Math.cos(A*Math.PI*(9*A))/2)+0.5},pulse:function(B,A){return(-Math.cos((B*((A||5)-0.5)*2)*Math.PI)/2)+0.5},spring:function(A){return 1-(Math.cos(A*4.5*Math.PI)*Math.exp(-A*6))},none:function(A){return 0},full:function(A){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(A){var B="position:relative";if(Prototype.Browser.IE){B+=";zoom:1"}A=$(A);$A(A.childNodes).each(function(C){if(C.nodeType==3){C.nodeValue.toArray().each(function(D){A.insertBefore(new Element("span",{style:B}).update(D==" "?String.fromCharCode(160):D),C)});Element.remove(C)}})},multiple:function(B,C){var E;if(((typeof B=="object")||Object.isFunction(B))&&(B.length)){E=B}else{E=$(B).childNodes}var A=Object.extend({speed:0.1,delay:0},arguments[2]||{});var D=A.delay;$A(E).each(function(G,F){new C(G,Object.extend(A,{delay:F*A.speed+D}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(B,C,A){B=$(B);C=(C||"appear").toLowerCase();return Effect[Effect.PAIRS[C][B.visible()?1:0]](B,Object.extend({queue:{position:"end",scope:(B.id||"global"),limit:1}},A||{}))}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(A){this.effects._each(A)},add:function(B){var C=new Date().getTime();var A=Object.isString(B.options.queue)?B.options.queue:B.options.queue.position;switch(A){case"front":this.effects.findAll(function(D){return D.state=="idle"}).each(function(D){D.startOn+=B.finishOn;D.finishOn+=B.finishOn});break;case"with-last":C=this.effects.pluck("startOn").max()||C;break;case"end":C=this.effects.pluck("finishOn").max()||C;break}B.startOn+=C;B.finishOn+=C;if(!B.options.queue.limit||(this.effects.length<B.options.queue.limit)){this.effects.push(B)}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)}},remove:function(A){this.effects=this.effects.reject(function(B){return B==A});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var C=new Date().getTime();for(var B=0,A=this.effects.length;B<A;B++){this.effects[B]&&this.effects[B].loop(C)}}});Effect.Queues={instances:$H(),get:function(A){if(!Object.isString(A)){return A}return this.instances.get(A)||this.instances.set(A,new Effect.ScopedQueue())}};Effect.Queue=Effect.Queues.get("global");Effect.Base=Class.create({position:null,start:function(A){if(A&&A.transition===false){A.transition=Effect.Transitions.linear}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.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;this.render=(function(){function B(D,C){if(D.options[C+"Internal"]){D.options[C+"Internal"](D)}if(D.options[C]){D.options[C](D)}}return function(C){if(this.state==="idle"){this.state="running";B(this,"beforeSetup");if(this.setup){this.setup()}B(this,"afterSetup")}if(this.state==="running"){C=(this.options.transition(C)*this.fromToDelta)+this.options.from;this.position=C;B(this,"beforeUpdate");if(this.update){this.update(C)}B(this,"afterUpdate")}}})();this.event("beforeStart");if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this)}},loop:function(C){if(C>=this.startOn){if(C>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return }var B=(C-this.startOn)/this.totalTime,A=(B*this.totalFrames).round();if(A>this.currentFrame){this.render(B);this.currentFrame=A}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(A){if(this.options[A+"Internal"]){this.options[A+"Internal"](this)}if(this.options[A]){this.options[A](this)}},inspect:function(){var A=$H();for(property in this){if(!Object.isFunction(this[property])){A.set(property,this[property])}}return"#<Effect:"+A.inspect()+",options:"+$H(this.options).inspect()+">"}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(A){this.effects=A||[];this.start(arguments[1])},update:function(A){this.effects.invoke("render",A)},finish:function(A){this.effects.each(function(B){B.render(1);B.cancel();B.event("beforeFinish");if(B.finish){B.finish(A)}B.event("afterFinish")})}});Effect.Tween=Class.create(Effect.Base,{initialize:function(C,F,E){C=Object.isString(C)?$(C):C;var B=$A(arguments),D=B.last(),A=B.length==5?B[3]:null;this.method=Object.isFunction(D)?D.bind(C):Object.isFunction(C[D])?C[D].bind(C):function(G){C[D]=G};this.start(Object.extend({from:F,to:E},A||{}))},update:function(A){this.method(A)}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(B){this.element=$(B);if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var A=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(A)},update:function(A){this.element.setOpacity(A)}});Effect.Move=Class.create(Effect.Base,{initialize:function(B){this.element=$(B);if(!this.element){throw (Effect._elementDoesNotExistError)}var A=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(A)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(A){this.element.setStyle({left:(this.options.x*A+this.originalLeft).round()+"px",top:(this.options.y*A+this.originalTop).round()+"px"})}});Effect.MoveBy=function(B,A,C){return new Effect.Move(B,Object.extend({x:C,y:A},arguments[3]||{}))};Effect.Scale=Class.create(Effect.Base,{initialize:function(B,C){this.element=$(B);if(!this.element){throw (Effect._elementDoesNotExistError)}var A=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:C},arguments[2]||{});this.start(A)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(B){this.originalStyle[B]=this.element.style[B]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var A=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(B){if(A.indexOf(B)>0){this.fontSize=parseFloat(A);this.fontSizeType=B}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(A){var B=(this.options.scaleFrom/100)+(this.factor*A);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*B+this.fontSizeType})}this.setDimensions(this.dims[0]*B,this.dims[1]*B)},finish:function(A){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(A,D){var E={};if(this.options.scaleX){E.width=D.round()+"px"}if(this.options.scaleY){E.height=A.round()+"px"}if(this.options.scaleFromCenter){var C=(A-this.dims[0])/2;var B=(D-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){E.top=this.originalTop-C+"px"}if(this.options.scaleX){E.left=this.originalLeft-B+"px"}}else{if(this.options.scaleY){E.top=-C+"px"}if(this.options.scaleX){E.left=-B+"px"}}}this.element.setStyle(E)}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(B){this.element=$(B);if(!this.element){throw (Effect._elementDoesNotExistError)}var A=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(A)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return }this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(A){return parseInt(this.options.startcolor.slice(A*2+1,A*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(A){return parseInt(this.options.endcolor.slice(A*2+1,A*2+3),16)-this._base[A]}.bind(this))},update:function(A){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(B,C,D){return B+((this._base[D]+(this._delta[D]*A)).round().toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(C){var B=arguments[1]||{},A=document.viewport.getScrollOffsets(),D=$(C).cumulativeOffset();if(B.offset){D[1]+=B.offset}return new Effect.Tween(null,A.top,D[1],B,function(E){scrollTo(A.left,E.round())})};Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");String.prototype.parseStyle=function(){var B,A=$H();if(Prototype.Browser.WebKit){B=new Element("div",{style:this}).style}else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';B=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(C){if(B[C]){A.set(C,B[C])}});if(Prototype.Browser.IE&&this.include("opacity")){A.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])}return A};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(B){var A=document.defaultView.getComputedStyle($(B),null);return Element.CSS_PROPERTIES.inject({},function(C,D){C[D]=A[D];return C})}}else{Element.getStyles=function(B){B=$(B);var A=B.currentStyle,C;C=Element.CSS_PROPERTIES.inject({},function(D,E){D[E]=A[E];return D});if(!C.opacity){C.opacity=B.getOpacity()}return C}}Effect.Methods={morph:function(A,B){A=$(A);new Effect.Morph(A,Object.extend({style:B},arguments[2]||{}));return A},visualEffect:function(C,E,B){C=$(C);var D=E.dasherize().camelize(),A=D.charAt(0).toUpperCase()+D.substring(1);new Effect[A](C,B);return C},highlight:function(B,A){B=$(B);new Effect.Highlight(B,A);return B}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(A){Effect.Methods[A]=function(C,B){C=$(C);Effect[A.charAt(0).toUpperCase()+A.substring(1)](C,B);return C}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(A){Effect.Methods[A]=Element[A]});Element.addMethods(Effect.Methods);if(Object.isUndefined(Effect)){throw ("dragdrop.js requires including script.aculo.us' effects.js library")}var Droppables={drops:[],remove:function(A){this.drops=this.drops.reject(function(B){return B.element==$(A)})},add:function(B){B=$(B);var A=Object.extend({triggerIn:Prototype.emptyFunction,triggerOut:Prototype.emptyFunction,greedy:true,hoverclass:null,tree:false},arguments[1]||{});if(A.containment){A._containers=[];var C=A.containment;if(Object.isArray(C)){C.each(function(D){A._containers.push($(D))})}else{A._containers.push($(C))}}if(A.accept){A.accept=[A.accept].flatten()}if(Prototype.Browser.IE&&B){Element.makePositioned(B)}A.element=B;this.drops.push(A)},findDeepestChild:function(A){deepest=A[0];for(i=1;i<A.length;++i){if(Element.isParent(A[i].element,deepest.element)){deepest=A[i]}}return deepest},isContained:function(B,A){var C;if(A.tree){C=B.treeNode}else{C=B.parentNode}return A._containers.detect(function(D){return C==D})},isAffected:function(A,C,B){return((B.element!=C)&&((!B._containers)||this.isContained(C,B))&&((!B.accept)||(Element.classNames(C).detect(function(D){return B.accept.include(D)})))&&Position.within(B.element,A[0],A[1]))},deactivate:function(B){if(this.last_active==B&&B.triggerOut){this.last_active=null;B.triggerOut(B);if(B.hoverclass){GH.Util.removeClassName(B.element,B.hoverclass)}else{if(B.element.id){var A=Boards.findIssue(B.element.id);if(A){A.deactivate()}}}}this.last_active=null},activate:function(B,C){if(this.last_active!=B&&B.triggerIn){this.last_active=B;B.triggerIn(B);if(B.hoverclass){GH.Util.addClassName(B.element,B.hoverclass)}else{if(B.element.id){var A=Boards.findIssue(B.element.id);if(A){A.activate()}}}}this.last_active=B},show:function(A,C){if(!this.drops.length){return }var B,D=[];this.drops.each(function(E){if(GH.Util.isVisible(E.element)&&Droppables.isAffected(A,C,E)){D.push(E);throw $break}});if(D.length>0){B=Droppables.findDeepestChild(D)}if(this.last_active&&this.last_active!=B){this.deactivate(this.last_active)}if(B){Position.within(B.element,A[0],A[1]);if(B.onHover){B.onHover(C,B.element,Position.overlap(B.overlap,B.element))}if(B!=this.last_active){Droppables.activate(B,B.element)}}},fire:function(B,A){if(!this.last_active){return }Position.prepare();if(this.isAffected([Event.pointerX(B),Event.pointerY(B)],A,this.last_active)){if(this.last_active.onDrop){this.last_active.onDrop(A,this.last_active.element,B);return true}}},reset:function(){if(this.last_active){this.deactivate(this.last_active)}}};var Draggables={drags:[],observers:[],register:function(A){if(this.drags.length==0){this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.updateDrag.bindAsEventListener(this);this.eventKeypress=this.keyPress.bindAsEventListener(this);Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);Event.observe(document,"keypress",this.eventKeypress)}this.drags.push(A)},unregister:function(A){this.drags=this.drags.reject(function(B){return B==A});if(this.drags.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);Event.stopObserving(document,"keypress",this.eventKeypress)}},activate:function(A){if(A.options.delay){this._timeout=setTimeout(function(){Draggables._timeout=null;window.focus();Draggables.activeDraggable=A}.bind(this),A.options.delay)}else{window.focus();this.activeDraggable=A}},deactivate:function(){this.activeDraggable=null},updateDrag:function(A){if(!this.activeDraggable){return }var B=[Event.pointerX(A),Event.pointerY(A)];if(this._lastPointer&&(this._lastPointer.inspect()==B.inspect())){return }this._lastPointer=B;this.activeDraggable.updateDrag(A,B)},endDrag:function(A){if(this._timeout){clearTimeout(this._timeout);this._timeout=null}if(!this.activeDraggable){return }this._lastPointer=null;this.activeDraggable.endDrag(A);this.activeDraggable=null},keyPress:function(A){if(this.activeDraggable){this.activeDraggable.keyPress(A)}},addObserver:function(A){this.observers.push(A);this._cacheObserverCallbacks()},removeObserver:function(A){this.observers=this.observers.reject(function(B){return B.element==A});this._cacheObserverCallbacks()},notify:function(B,A,C){if(this[B+"Count"]>0){this.observers.each(function(D){if(D[B]){D[B](B,A,C)}})}if(A.options[B]){A.options[B](A,C)}},_cacheObserverCallbacks:function(){["onStart","onEnd","onDrag"].each(function(A){Draggables[A+"Count"]=Draggables.observers.select(function(B){return B[A]}).length})}};var Draggable=Class.create({initialize:function(B){var C={handle:false,reverteffect:function(F,E,D){var G=Math.sqrt(Math.abs(E^2)+Math.abs(D^2))*0.02;new Effect.Move(F,{x:-D,y:-E,duration:G,queue:{scope:"_draggable",position:"end"}})},endeffect:function(E){var D=Object.isNumber(E._opacity)?E._opacity:1;new Effect.Opacity(E,{duration:0.2,from:0.7,to:D,queue:{scope:"_draggable",position:"end"},afterFinish:function(){Draggable._dragging[E]=false}})},zindex:3000,revert:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false,delay:0};if(!arguments[1]||Object.isUndefined(arguments[1].endeffect)){Object.extend(C,{starteffect:function(D){D._opacity=Element.getOpacity(D);Draggable._dragging[D]=true;new Effect.Opacity(D,{duration:0.2,from:D._opacity,to:0.7})}})}var A=Object.extend(C,arguments[1]||{});this.element=$(B);if(A.handle&&Object.isString(A.handle)){this.handle=this.element.down("."+A.handle,0)}if(!this.handle){this.handle=$(A.handle)}if(!this.handle){this.handle=this.element}if(A.scroll&&!(A.scroll==window)){A.scroll=$(A.scroll);this._isScrollChild=Element.childOf(this.element,A.scroll)}Element.makePositioned(this.element);this.options=A;this.dragging=false;this.ancestorZ=$H();this.eventMouseDown=this.initDrag.bindAsEventListener(this);Event.observe(this.handle,"mousedown",this.eventMouseDown);Draggables.register(this)},destroy:function(){Event.stopObserving(this.handle,"mousedown",this.eventMouseDown);Draggables.unregister(this)},currentDelta:function(){return([parseInt(Element.getStyle(this.element,"left")||"0"),parseInt(Element.getStyle(this.element,"top")||"0")])},initDrag:function(A){if(!Object.isUndefined(Draggable._dragging[this.element])&&Draggable._dragging[this.element]){return }if(Event.isLeftClick(A)){var C=Event.element(A);if((tag_name=C.tagName.toUpperCase())&&(tag_name=="INPUT"||tag_name=="SELECT"||tag_name=="OPTION"||tag_name=="BUTTON"||tag_name=="TEXTAREA")){return }var B=[Event.pointerX(A),Event.pointerY(A)];var D=this.element.cumulativeOffset();this.offset=[0,1].map(function(E){return(B[E]-D[E])});Draggables.activate(this);Event.stop(A)}},startDrag:function(B){this.dragging=true;if(!this.delta){this.delta=this.currentDelta()}if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,"z-index")||0);this.element.style.zIndex=this.options.zindex;if(navigator.userAgent.toLowerCase().indexOf("msie 7")>-1){this.element.ancestors().each(function(C){var D=C.getStyle("position");if(D=="relative"||D=="absolute"||D=="fixed"){this.ancestorZ.set(C,C.style.zIndex);C.style.zIndex=this.options.zindex}},this)}}if(this.options.ghosting){this._clone=this.element.cloneNode(true);this._originallyAbsolute=(this.element.getStyle("position")=="absolute");if(!this._originallyAbsolute){Position.absolutize(this.element)}this.element.parentNode.insertBefore(this._clone,this.element)}if(this.options.scroll){if(this.options.scroll==window){var A=this._getWindowScroll(this.options.scroll);this.originalScrollLeft=A.left;this.originalScrollTop=A.top}else{this.originalScrollLeft=this.options.scroll.scrollLeft;this.originalScrollTop=this.options.scroll.scrollTop}}Draggables.notify("onStart",this,B);if(this.options.starteffect){this.options.starteffect(this.element)}},updateDrag:function(event,pointer){if(!this.dragging){this.startDrag(event)}if(!this.options.quiet){Position.prepare();Droppables.show(pointer,this.element)}Draggables.notify("onDrag",this,event);this.draw(pointer);if(this.options.change){this.options.change(this)}if(this.options.scroll){this.stopScrolling();var p;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){p=[left,top,left+width,top+height]}}else{p=Position.page(this.options.scroll);p[0]+=this.options.scroll.scrollLeft+Position.deltaX;p[1]+=this.options.scroll.scrollTop+Position.deltaY;p.push(p[0]+this.options.scroll.offsetWidth);p.push(p[1]+this.options.scroll.offsetHeight)}var speed=[0,0];if(pointer[0]<(p[0]+this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[0]+this.options.scrollSensitivity)}if(pointer[1]<(p[1]+this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[1]+this.options.scrollSensitivity)}if(pointer[0]>(p[2]-this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[2]-this.options.scrollSensitivity)}if(pointer[1]>(p[3]-this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[3]-this.options.scrollSensitivity)}this.startScrolling(speed)}if(Prototype.Browser.WebKit){window.scrollBy(0,0)}Event.stop(event)},finishDrag:function(B,E){this.dragging=false;if(this.options.quiet){Position.prepare();var D=[Event.pointerX(B),Event.pointerY(B)];Droppables.show(D,this.element)}if(this.options.ghosting){if(!this._originallyAbsolute){Position.relativize(this.element)}delete this._originallyAbsolute;Element.remove(this._clone);this._clone=null}var F=false;if(E){F=Droppables.fire(B,this.element);if(!F){F=false}}if(F&&this.options.onDropped){this.options.onDropped(this.element)}Draggables.notify("onEnd",this,B);var A=this.options.revert;if(A&&Object.isFunction(A)){A=A(this.element)}var C=this.currentDelta();if(A&&this.options.reverteffect){if(F==0||A!="failure"){this.options.reverteffect(this.element,C[1]-this.delta[1],C[0]-this.delta[0])}}else{this.delta=C}if(this.options.zindex){if(Prototype.Browser.Gecko&&this.originalZ==0){this.originalZ="auto"}this.element.style.zIndex=this.originalZ;if(navigator.userAgent.toLowerCase().indexOf("msie 7")>-1){this.element.ancestors().each(function(G){var H=G.getStyle("position");if(H=="relative"||H=="absolute"||H=="fixed"){G.style.zIndex=this.ancestorZ.get(G)}},this)}}if(this.options.endeffect){this.options.endeffect(this.element)}Draggables.deactivate(this);Droppables.reset()},keyPress:function(A){if(A.keyCode!=Event.KEY_ESC){return }this.finishDrag(A,false);Event.stop(A)},endDrag:function(A){if(!this.dragging){return }this.stopScrolling();this.finishDrag(A,true);Event.stop(A)},draw:function(A){var F=this.element.cumulativeOffset();if(this.options.ghosting){var C=Position.realOffset(this.element);F[0]+=C[0]-Position.deltaX;F[1]+=C[1]-Position.deltaY}var E=this.currentDelta();F[0]-=E[0];F[1]-=E[1];if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){F[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;F[1]-=this.options.scroll.scrollTop-this.originalScrollTop}var D=[0,1].map(function(G){return(A[G]-F[G]-this.offset[G])}.bind(this));if(this.options.snap){if(Object.isFunction(this.options.snap)){D=this.options.snap(D[0],D[1],this)}else{if(Object.isArray(this.options.snap)){D=D.map(function(G,H){return(G/this.options.snap[H]).round()*this.options.snap[H]}.bind(this))}else{D=D.map(function(G){return(G/this.options.snap).round()*this.options.snap}.bind(this))}}}var B=this.element.style;if((!this.options.constraint)||(this.options.constraint=="horizontal")){B.left=D[0]+"px"}if((!this.options.constraint)||(this.options.constraint=="vertical")){B.top=D[1]+"px"}if(B.visibility=="hidden"){B.visibility=""}},stopScrolling:function(){if(this.scrollInterval){clearInterval(this.scrollInterval);this.scrollInterval=null;Draggables._lastScrollPointer=null}},startScrolling:function(A){if(!(A[0]||A[1])){return }this.scrollSpeed=[A[0]*this.options.scrollSpeed,A[1]*this.options.scrollSpeed];this.lastScrolled=new Date();this.scrollInterval=setInterval(this.scroll.bind(this),10)},scroll:function(){var current=new Date();var delta=current-this.lastScrolled;this.lastScrolled=current;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){if(this.scrollSpeed[0]||this.scrollSpeed[1]){var d=delta/1000;this.options.scroll.scrollTo(left+d*this.scrollSpeed[0],top+d*this.scrollSpeed[1])}}}else{this.options.scroll.scrollLeft+=this.scrollSpeed[0]*delta/1000;this.options.scroll.scrollTop+=this.scrollSpeed[1]*delta/1000}Position.prepare();Droppables.show(Draggables._lastPointer,this.element);Draggables.notify("onDrag",this);if(this._isScrollChild){Draggables._lastScrollPointer=Draggables._lastScrollPointer||$A(Draggables._lastPointer);Draggables._lastScrollPointer[0]+=this.scrollSpeed[0]*delta/1000;Draggables._lastScrollPointer[1]+=this.scrollSpeed[1]*delta/1000;if(Draggables._lastScrollPointer[0]<0){Draggables._lastScrollPointer[0]=0}if(Draggables._lastScrollPointer[1]<0){Draggables._lastScrollPointer[1]=0}this.draw(Draggables._lastScrollPointer)}if(this.options.change){this.options.change(this)}},_getWindowScroll:function(w){var T,L,W,H;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft}else{if(w.document.body){T=body.scrollTop;L=body.scrollLeft}}if(w.innerWidth){W=w.innerWidth;H=w.innerHeight}else{if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight}else{W=body.offsetWidth;H=body.offsetHeight}}}return{top:T,left:L,width:W,height:H}}});Draggable._dragging={};var SortableObserver=Class.create({initialize:function(B,A){this.element=$(B);this.observer=A;this.lastValue=Sortable.serialize(this.element)},onStart:function(){this.lastValue=Sortable.serialize(this.element)},onEnd:function(){Sortable.unmark();if(this.lastValue!=Sortable.serialize(this.element)){this.observer(this.element)}}});var Sortable={SERIALIZE_RULE:/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,sortables:{},_findRootElement:function(A){while(A.tagName.toUpperCase()!="BODY"){if(A.id&&Sortable.sortables[A.id]){return A}A=A.parentNode}},options:function(A){A=Sortable._findRootElement($(A));if(!A){return }return Sortable.sortables[A.id]},destroy:function(A){A=$(A);var B=Sortable.sortables[A.id];if(B){Draggables.removeObserver(B.element);B.droppables.each(function(C){Droppables.remove(C)});B.draggables.invoke("destroy");delete Sortable.sortables[B.element.id]}},create:function(C){C=$(C);var B=Object.extend({element:C,tag:"li",dropOnEmpty:false,tree:false,treeTag:"ul",overlap:"vertical",constraint:"vertical",containment:C,handle:false,only:false,delay:0,hoverclass:null,ghosting:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:this.SERIALIZE_RULE,elements:false,handles:false,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},arguments[1]||{});this.destroy(C);var A={revert:true,quiet:B.quiet,scroll:B.scroll,scrollSpeed:B.scrollSpeed,scrollSensitivity:B.scrollSensitivity,delay:B.delay,ghosting:B.ghosting,constraint:B.constraint,handle:B.handle};if(B.starteffect){A.starteffect=B.starteffect}if(B.reverteffect){A.reverteffect=B.reverteffect}else{if(B.ghosting){A.reverteffect=function(F){F.style.top=0;F.style.left=0}}}if(B.endeffect){A.endeffect=B.endeffect}if(B.zindex){A.zindex=B.zindex}var D={overlap:B.overlap,containment:B.containment,tree:B.tree,hoverclass:B.hoverclass,onHover:Sortable.onHover};var E={onHover:Sortable.onEmptyHover,overlap:B.overlap,containment:B.containment,hoverclass:B.hoverclass};Element.cleanWhitespace(C);B.draggables=[];B.droppables=[];if(B.dropOnEmpty||B.tree){Droppables.add(C,E);B.droppables.push(C)}(B.elements||this.findElements(C,B)||[]).each(function(H,F){var G=B.handles?$(B.handles[F]):(B.handle?$(H).select("."+B.handle)[0]:H);B.draggables.push(new Draggable(H,Object.extend(A,{handle:G})));Droppables.add(H,D);if(B.tree){H.treeNode=C}B.droppables.push(H)});if(B.tree){(Sortable.findTreeElements(C,B)||[]).each(function(F){Droppables.add(F,E);F.treeNode=C;B.droppables.push(F)})}this.sortables[C.identify()]=B;Draggables.addObserver(new SortableObserver(C,B.onUpdate))},findElements:function(B,A){return Element.findChildren(B,A.only,A.tree?true:false,A.tag)},findTreeElements:function(B,A){return Element.findChildren(B,A.only,A.tree?true:false,A.treeTag)},onHover:function(E,D,A){if(Element.isParent(D,E)){return }if(A>0.33&&A<0.66&&Sortable.options(D).tree){return }else{if(A>0.5){Sortable.mark(D,"before");if(D.previousSibling!=E){var B=E.parentNode;E.style.visibility="hidden";D.parentNode.insertBefore(E,D);if(D.parentNode!=B){Sortable.options(B).onChange(E)}Sortable.options(D.parentNode).onChange(E)}}else{Sortable.mark(D,"after");var C=D.nextSibling||null;if(C!=E){var B=E.parentNode;E.style.visibility="hidden";D.parentNode.insertBefore(E,C);if(D.parentNode!=B){Sortable.options(B).onChange(E)}Sortable.options(D.parentNode).onChange(E)}}}},onEmptyHover:function(E,G,H){var I=E.parentNode;var A=Sortable.options(G);if(!Element.isParent(G,E)){var F;var C=Sortable.findElements(G,{tag:A.tag,only:A.only});var B=null;if(C){var D=Element.offsetSize(G,A.overlap)*(1-H);for(F=0;F<C.length;F+=1){if(D-Element.offsetSize(C[F],A.overlap)>=0){D-=Element.offsetSize(C[F],A.overlap)}else{if(D-(Element.offsetSize(C[F],A.overlap)/2)>=0){B=F+1<C.length?C[F+1]:null;break}else{B=C[F];break}}}}G.insertBefore(E,B);Sortable.options(I).onChange(E);A.onChange(E)}},unmark:function(){if(Sortable._marker){Sortable._marker.hide()}},mark:function(B,A){var D=Sortable.options(B.parentNode);if(D&&!D.ghosting){return }if(!Sortable._marker){Sortable._marker=($("dropmarker")||Element.extend(document.createElement("DIV"))).hide().addClassName("dropmarker").setStyle({position:"absolute"});document.getElementsByTagName("body").item(0).appendChild(Sortable._marker)}var C=B.cumulativeOffset();Sortable._marker.setStyle({left:C[0]+"px",top:C[1]+"px"});if(A=="after"){if(D.overlap=="horizontal"){Sortable._marker.setStyle({left:(C[0]+B.clientWidth)+"px"})}else{Sortable._marker.setStyle({top:(C[1]+B.clientHeight)+"px"})}}Sortable._marker.show()},_tree:function(E,B,F){var D=Sortable.findElements(E,B)||[];for(var C=0;C<D.length;++C){var A=D[C].id.match(B.format);if(!A){continue}var G={id:encodeURIComponent(A?A[1]:null),element:E,parent:F,children:[],position:F.children.length,container:$(D[C]).down(B.treeTag)};if(G.container){this._tree(G.container,B,G)}F.children.push(G)}return F},tree:function(D){D=$(D);var C=this.options(D);var B=Object.extend({tag:C.tag,treeTag:C.treeTag,only:C.only,name:D.id,format:C.format},arguments[1]||{});var A={id:null,parent:null,children:[],container:D,position:0};return Sortable._tree(D,B,A)},_constructIndex:function(B){var A="";do{if(B.id){A="["+B.position+"]"+A}}while((B=B.parent)!=null);return A},sequence:function(B){B=$(B);var A=Object.extend(this.options(B),arguments[1]||{});return $(this.findElements(B,A)||[]).map(function(C){return C.id.match(A.format)?C.id.match(A.format)[1]:""})},setSequence:function(B,C){B=$(B);var A=Object.extend(this.options(B),arguments[2]||{});var D={};this.findElements(B,A).each(function(E){if(E.id.match(A.format)){D[E.id.match(A.format)[1]]=[E,E.parentNode]}E.parentNode.removeChild(E)});C.each(function(E){var F=D[E];if(F){F[1].appendChild(F[0]);delete D[E]}})},serialize:function(C){C=$(C);var B=Object.extend(Sortable.options(C),arguments[1]||{});var A=encodeURIComponent((arguments[1]&&arguments[1].name)?arguments[1].name:C.id);if(B.tree){return Sortable.tree(C,arguments[1]).children.map(function(D){return[A+Sortable._constructIndex(D)+"[id]="+encodeURIComponent(D.id)].concat(D.children.map(arguments.callee))}).flatten().join("&")}else{return Sortable.sequence(C,arguments[1]).map(function(D){return A+"[]="+encodeURIComponent(D)}).join("&")}}};Element.isParent=function(B,A){if(!B.parentNode||B==A){return false}if(B.parentNode==A){return true}return Element.isParent(B.parentNode,A)};Element.findChildren=function(D,B,A,C){if(!D.hasChildNodes()){return null}C=C.toUpperCase();if(B){B=[B].flatten()}var E=[];$A(D.childNodes).each(function(G){if(G.tagName&&G.tagName.toUpperCase()==C&&(!B||(Element.classNames(G).detect(function(H){return B.include(H)})))){E.push(G)}if(A){var F=Element.findChildren(G,B,A,C);if(F){E.push(F)}}});return(E.length>0?E.flatten():[])};Element.offsetSize=function(A,B){return A["offset"+((B=="vertical"||B=="height")?"Height":"Width")]};Calendar=function(D,C,F,A){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=F||null;this.onClose=A||null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT.DEF_DATE_FORMAT;this.ttDateFormat=Calendar._TT.TT_DATE_FORMAT;this.isPopup=true;this.weekNumbers=true;this.firstDayOfWeek=typeof D=="number"?D:Calendar._FD;this.showsOtherMonths=false;this.dateStr=C;this.ar_days=null;this.showsTime=false;this.time24=true;this.yearStep=2;this.hiliteToday=true;this.multiple=null;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined"){Calendar._SDN_len=3}var B=new Array();for(var E=8;E>0;){B[--E]=Calendar._DN[E].substr(0,Calendar._SDN_len)}Calendar._SDN=B;if(typeof Calendar._SMN_len=="undefined"){Calendar._SMN_len=3}B=new Array();for(var E=12;E>0;){B[--E]=Calendar._MN[E].substr(0,Calendar._SMN_len)}Calendar._SMN=B}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_ie6=(Calendar.is_ie&&/msie 6\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(E){var A=0,D=0;var C=/^div$/i.test(E.tagName);if(C&&E.scrollLeft){A=E.scrollLeft}if(C&&E.scrollTop){D=E.scrollTop}var F={x:E.offsetLeft-A,y:E.offsetTop-D};if(E.offsetParent){var B=this.getAbsolutePos(E.offsetParent);F.x+=B.x;F.y+=B.y}return F};Calendar.isRelated=function(C,A){var D=A.relatedTarget;if(!D){var B=A.type;if(B=="mouseover"){D=A.fromElement}else{if(B=="mouseout"){D=A.toElement}}}while(D){if(D==C){return true}D=D.parentNode}return false};Calendar.removeClass=function(E,D){if(!(E&&E.className)){return }var A=E.className.split(" ");var B=new Array();for(var C=A.length;C>0;){if(A[--C]!=D){B[B.length]=A[C]}}E.className=B.join(" ")};Calendar.addClass=function(B,A){Calendar.removeClass(B,A);B.className+=" "+A};Calendar.getElement=function(A){var B=Calendar.is_ie?window.event.srcElement:A.currentTarget;while(B.nodeType!=1||/^div$/i.test(B.tagName)){B=B.parentNode}return B};Calendar.getTargetElement=function(A){var B=Calendar.is_ie?window.event.srcElement:A.target;while(B.nodeType!=1){B=B.parentNode}return B};Calendar.stopEvent=function(A){A||(A=window.event);if(Calendar.is_ie){A.cancelBubble=true;A.returnValue=false}else{A.preventDefault();A.stopPropagation()}return false};Calendar.addEvent=function(A,C,B){if(A.attachEvent){A.attachEvent("on"+C,B)}else{if(A.addEventListener){A.addEventListener(C,B,true)}else{A["on"+C]=B}}};Calendar.removeEvent=function(A,C,B){if(A.detachEvent){A.detachEvent("on"+C,B)}else{if(A.removeEventListener){A.removeEventListener(C,B,true)}else{A["on"+C]=null}}};Calendar.createElement=function(C,B){var A=null;if(document.createElementNS){A=document.createElementNS("http://www.w3.org/1999/xhtml",C)}else{A=document.createElement(C)}if(typeof B!="undefined"){B.appendChild(A)}return A};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true)}}};Calendar.findMonth=function(A){if(typeof A.month!="undefined"){return A}else{if(typeof A.parentNode.month!="undefined"){return A.parentNode}}return null};Calendar.findYear=function(A){if(typeof A.year!="undefined"){return A}else{if(typeof A.parentNode.year!="undefined"){return A.parentNode}}return null};Calendar.showMonthsCombo=function(){var E=Calendar._C;if(!E){return false}var E=E;var F=E.activeDiv;var D=E.monthsCombo;if(E.hilitedMonth){Calendar.removeClass(E.hilitedMonth,"hilite")}if(E.activeMonth){Calendar.removeClass(E.activeMonth,"active")}var C=E.monthsCombo.getElementsByTagName("div")[E.date.getMonth()];Calendar.addClass(C,"active");E.activeMonth=C;var B=D.style;B.display="block";if(F.navtype<0){B.left=F.offsetLeft+"px"}else{var A=D.offsetWidth;if(typeof A=="undefined"){A=50}B.left=(F.offsetLeft+F.offsetWidth-A)+"px"}B.top=(F.offsetTop+F.offsetHeight)+"px"};Calendar.showYearsCombo=function(D){var A=Calendar._C;if(!A){return false}var A=A;var C=A.activeDiv;var F=A.yearsCombo;if(A.hilitedYear){Calendar.removeClass(A.hilitedYear,"hilite")}if(A.activeYear){Calendar.removeClass(A.activeYear,"active")}A.activeYear=null;var B=A.date.getFullYear()+(D?1:-1);var I=F.firstChild;var H=false;for(var E=12;E>0;--E){if(B>=A.minYear&&B<=A.maxYear){I.innerHTML=B;I.year=B;I.style.display="block";H=true}else{I.style.display="none"}I=I.nextSibling;B+=D?A.yearStep:-A.yearStep}if(H){var J=F.style;J.display="block";if(C.navtype<0){J.left=C.offsetLeft+"px"}else{var G=F.offsetWidth;if(typeof G=="undefined"){G=50}J.left=(C.offsetLeft+C.offsetWidth-G)+"px"}J.top=(C.offsetTop+C.offsetHeight)+"px"}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false}if(cal.timeout){clearTimeout(cal.timeout)}var el=cal.activeDiv;if(!el){return false}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev)}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler()}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler()}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev)}};Calendar.tableMouseOver=function(M){var A=Calendar._C;if(!A){return }var C=A.activeDiv;var I=Calendar.getTargetElement(M);if(I==C||I.parentNode==C){Calendar.addClass(C,"hilite active");Calendar.addClass(C.parentNode,"rowhilite")}else{if(typeof C.navtype=="undefined"||(C.navtype!=50&&(C.navtype==0||Math.abs(C.navtype)>2))){Calendar.removeClass(C,"active")}Calendar.removeClass(C,"hilite");Calendar.removeClass(C.parentNode,"rowhilite")}M||(M=window.event);if(C.navtype==50&&I!=C){var L=Calendar.getAbsolutePos(C);var O=C.offsetWidth;var N=M.clientX;var P;var K=true;if(N>L.x+O){P=N-L.x-O;K=false}else{P=L.x-N}if(P<0){P=0}var F=C._range;var H=C._current;var G=Math.floor(P/10)%F.length;for(var E=F.length;--E>=0;){if(F[E]==H){break}}while(G-->0){if(K){if(--E<0){E=F.length-1}}else{if(++E>=F.length){E=0}}}var B=F[E];C.innerHTML=B;A.onUpdateTime()}var D=Calendar.findMonth(I);if(D){if(D.month!=A.date.getMonth()){if(A.hilitedMonth){Calendar.removeClass(A.hilitedMonth,"hilite")}Calendar.addClass(D,"hilite");A.hilitedMonth=D}else{if(A.hilitedMonth){Calendar.removeClass(A.hilitedMonth,"hilite")}}}else{if(A.hilitedMonth){Calendar.removeClass(A.hilitedMonth,"hilite")}var J=Calendar.findYear(I);if(J){if(J.year!=A.date.getFullYear()){if(A.hilitedYear){Calendar.removeClass(A.hilitedYear,"hilite")}Calendar.addClass(J,"hilite");A.hilitedYear=J}else{if(A.hilitedYear){Calendar.removeClass(A.hilitedYear,"hilite")}}}else{if(A.hilitedYear){Calendar.removeClass(A.hilitedYear,"hilite")}}}return Calendar.stopEvent(M)};Calendar.tableMouseDown=function(A){if(Calendar.getTargetElement(A)==Calendar.getElement(A)){return Calendar.stopEvent(A)}};Calendar.calDragIt=function(B){var C=Calendar._C;if(!(C&&C.dragging)){return false}var E;var D;if(Calendar.is_ie){D=window.event.clientY+document.body.scrollTop;E=window.event.clientX+document.body.scrollLeft}else{E=B.pageX;D=B.pageY}C.hideShowCovered();var A=C.element.style;A.left=(E-C.xOffs)+"px";A.top=(D-C.yOffs)+"px";return Calendar.stopEvent(B)};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev)}cal.hideShowCovered()};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300){with(Calendar){if(el.navtype==50){el._current=el.innerHTML;addEvent(document,"mousemove",tableMouseOver)}else{addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver)}addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp)}}else{if(cal.isPopup){cal._dragStart(ev)}}if(el.navtype==-1||el.navtype==1){if(cal.timeout){clearTimeout(cal.timeout)}cal.timeout=setTimeout("Calendar.showMonthsCombo()",250)}else{if(el.navtype==-2||el.navtype==2){if(cal.timeout){clearTimeout(cal.timeout)}cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250)}else{cal.timeout=null}}return Calendar.stopEvent(ev)};Calendar.dayMouseDblClick=function(A){Calendar.cellClick(Calendar.getElement(A),A||window.event);if(Calendar.is_ie){document.selection.empty()}};Calendar.dayMouseOver=function(B){var A=Calendar.getElement(B);if(Calendar.isRelated(A,B)||Calendar._C||A.disabled){return false}if(A.ttip){if(A.ttip.substr(0,1)=="_"){A.ttip=A.caldate.print(A.calendar.ttDateFormat)+A.ttip.substr(1)}A.calendar.tooltips.innerHTML=A.ttip}if(A.navtype!=300){Calendar.addClass(A,"hilite");if(A.caldate){Calendar.addClass(A.parentNode,"rowhilite")}}return Calendar.stopEvent(B)};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled){return false}removeClass(el,"hilite");if(el.caldate){removeClass(el.parentNode,"rowhilite")}if(el.calendar){el.calendar.tooltips.innerHTML=_TT.SEL_DATE}return stopEvent(ev)}};Calendar.cellClick=function(E,N){var C=E.calendar;var H=false;var K=false;var F=null;if(typeof E.navtype=="undefined"){if(C.currentDateEl){Calendar.removeClass(C.currentDateEl,"selected");Calendar.addClass(E,"selected");H=(C.currentDateEl==E);if(!H){C.currentDateEl=E}}C.date.setDateOnly(E.caldate);F=C.date;var B=!(C.dateClicked=!E.otherMonth);if(!B&&!C.currentDateEl){C._toggleMultipleDate(new Date(F))}else{K=!E.disabled}if(B){C._init(C.firstDayOfWeek,F)}}else{if(E.navtype==200){Calendar.removeClass(E,"hilite");C.callCloseHandler();return }F=new Date(C.date);if(E.navtype==0){F.setDateOnly(new Date())}C.dateClicked=false;var M=F.getFullYear();var G=F.getMonth();function A(Q){var R=F.getDate();var P=F.getMonthDays(Q);if(R>P){F.setDate(P)}F.setMonth(Q)}switch(E.navtype){case 400:Calendar.removeClass(E,"hilite");var O=Calendar._TT.ABOUT;if(typeof O!="undefined"){O+=C.showsTime?Calendar._TT.ABOUT_TIME:""}else{O='Help and about box text is not translated into this language.\nIf you know this language and you feel generous please update\nthe corresponding file in "lang" subdir to match calendar-en.js\nand send it back to <mihai_bazon@yahoo.com> to get it into the distribution  ;-)\n\nThank you!\nhttp://dynarch.com/mishoo/calendar.epl\n'}alert(O);return ;case -2:if(M>C.minYear){F.setFullYear(M-1)}break;case -1:if(G>0){A(G-1)}else{if(M-->C.minYear){F.setFullYear(M);A(11)}}break;case 1:if(G<11){A(G+1)}else{if(M<C.maxYear){F.setFullYear(M+1);A(0)}}break;case 2:if(M<C.maxYear){F.setFullYear(M+1)}break;case 100:C.setFirstDayOfWeek(E.fdow);return ;case 50:var J=E._range;var L=E.innerHTML;for(var I=J.length;--I>=0;){if(J[I]==L){break}}if(N&&N.shiftKey){if(--I<0){I=J.length-1}}else{if(++I>=J.length){I=0}}var D=J[I];E.innerHTML=D;C.onUpdateTime();return ;case 0:if((typeof C.getDateStatus=="function")&&C.getDateStatus(F,F.getFullYear(),F.getMonth(),F.getDate())){return false}break}if(!F.equalsTo(C.date)){C.setDate(F);K=true}else{if(E.navtype==0){K=H=true}}}if(K){N&&C.callHandler()}if(H){Calendar.removeClass(E,"hilite");N&&C.callCloseHandler()}};Calendar.prototype.create=function(A,M){var L=null;if(!M){L=document.getElementsByTagName("body")[0];this.isPopup=true}else{L=M;this.isPopup=false}this.date=this.dateStr?new Date(this.dateStr):new Date();var P=Calendar.createElement("table");this.table=P;P.cellSpacing=0;P.cellPadding=0;P.calendar=this;Calendar.addEvent(P,"mousedown",Calendar.tableMouseDown);var C=Calendar.createElement("div");this.element=C;C.className="calendar";if(this.isPopup){C.style.position=A;C.style.display="none"}C.appendChild(P);var J=Calendar.createElement("thead",P);var N=null;var Q=null;var B=this;var F=function(T,S,R){N=Calendar.createElement("td",Q);N.colSpan=S;N.className="button";if(R!=0&&Math.abs(R)<=2){N.className+=" nav"}Calendar._add_evs(N);N.calendar=B;N.navtype=R;N.innerHTML="<div unselectable='on'>"+T+"</div>";return N};Q=Calendar.createElement("tr",J);var D=6;(this.isPopup)&&--D;(this.weekNumbers)&&++D;F("?",1,400).ttip=Calendar._TT.INFO;this.title=F("",D,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT.DRAG_TO_MOVE;this.title.style.cursor="move";F("&#x00d7;",1,200).ttip=Calendar._TT.CLOSE}Q=Calendar.createElement("tr",J);Q.className="headrow";this._nav_py=F("&#x00ab;",1,-2);this._nav_py.ttip=Calendar._TT.PREV_YEAR;this._nav_pm=F("&#x2039;",1,-1);this._nav_pm.ttip=Calendar._TT.PREV_MONTH;this._nav_now=F(Calendar._TT.TODAY,this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT.GO_TODAY;this._nav_nm=F("&#x203a;",1,1);this._nav_nm.ttip=Calendar._TT.NEXT_MONTH;this._nav_ny=F("&#x00bb;",1,2);this._nav_ny.ttip=Calendar._TT.NEXT_YEAR;Q=Calendar.createElement("tr",J);Q.className="daynames";if(this.weekNumbers){N=Calendar.createElement("td",Q);N.className="name wn";N.innerHTML=Calendar._TT.WK}for(var I=7;I>0;--I){N=Calendar.createElement("td",Q);if(!I){N.navtype=100;N.calendar=this;Calendar._add_evs(N)}}this.firstdayname=(this.weekNumbers)?Q.firstChild.nextSibling:Q.firstChild;this._displayWeekdays();var H=Calendar.createElement("tbody",P);this.tbody=H;for(I=6;I>0;--I){Q=Calendar.createElement("tr",H);if(this.weekNumbers){N=Calendar.createElement("td",Q)}for(var G=7;G>0;--G){N=Calendar.createElement("td",Q);N.calendar=this;Calendar._add_evs(N)}}if(this.showsTime){Q=Calendar.createElement("tr",H);Q.className="time";N=Calendar.createElement("td",Q);N.className="time";N.colSpan=2;N.innerHTML=Calendar._TT.TIME||"&nbsp;";N=Calendar.createElement("td",Q);N.className="time";N.colSpan=this.weekNumbers?4:3;(function(){function U(d,f,e,g){var b=Calendar.createElement("span",N);b.className=d;b.innerHTML=f;b.calendar=B;b.ttip=Calendar._TT.TIME_PART;b.navtype=50;b._range=[];if(typeof e!="number"){b._range=e}else{for(var c=e;c<=g;++c){var a;if(c<10&&g>=10){a="0"+c}else{a=""+c}b._range[b._range.length]=a}}Calendar._add_evs(b);return b}var Y=B.date.getHours();var R=B.date.getMinutes();var Z=!B.time24;var S=(Y>12);if(Z&&S){Y-=12}var W=U("hour",Y,Z?1:0,Z?12:23);var V=Calendar.createElement("span",N);V.innerHTML=":";V.className="colon";var T=U("minute",R,0,59);var X=null;N=Calendar.createElement("td",Q);N.className="time";N.colSpan=2;if(Z){X=U("ampm",S?Calendar._TT.PM:Calendar._TT.AM,[Calendar._TT.am,Calendar._TT.pm])}else{N.innerHTML="&nbsp;"}B.onSetTime=function(){var b,a=this.date.getHours(),c=this.date.getMinutes();if(Z){b=(a>=12);if(b){a-=12}if(a==0){a=12}X.innerHTML=b?Calendar._TT.pm:Calendar._TT.am}W.innerHTML=(a<10)?("0"+a):a;T.innerHTML=(c<10)?("0"+c):c};B.onUpdateTime=function(){var b=this.date;var c=parseInt(W.innerHTML,10);if(Z){if(/pm/i.test(X.innerHTML)&&c<12){c+=12}else{if(/am/i.test(X.innerHTML)&&c==12){c=0}}}var e=b.getDate();var a=b.getMonth();var f=b.getFullYear();b.setHours(c);b.setMinutes(parseInt(T.innerHTML,10));b.setFullYear(f);b.setMonth(a);b.setDate(e);this.dateClicked=false;this.callHandler()}})()}else{this.onSetTime=this.onUpdateTime=function(){}}var K=Calendar.createElement("tfoot",P);Q=Calendar.createElement("tr",K);Q.className="footrow";N=F(Calendar._TT.SEL_DATE,this.weekNumbers?8:7,300);N.className="ttip";if(this.isPopup){N.ttip=Calendar._TT.DRAG_TO_MOVE;N.style.cursor="move"}this.tooltips=N;C=Calendar.createElement("div",this.element);this.monthsCombo=C;C.className="combo";for(I=0;I<Calendar._MN.length;++I){var E=Calendar.createElement("div");E.className=Calendar.is_ie?"label-IEfix":"label";E.month=I;E.innerHTML=Calendar._SMN[I];C.appendChild(E)}C=Calendar.createElement("div",this.element);this.yearsCombo=C;C.className="combo";for(I=12;I>0;--I){var O=Calendar.createElement("div");O.className=Calendar.is_ie?"label-IEfix":"label";C.appendChild(O)}this._init(this.firstDayOfWeek,this.date);L.appendChild(this.element)};Calendar._keyEvent=function(L){var A=window._dynarch_popupCalendar;if(!A||A.multiple){return false}(Calendar.is_ie)&&(L=window.event);var I=(Calendar.is_ie||L.type=="keypress"),M=L.keyCode;if(L.ctrlKey){switch(M){case 37:I&&Calendar.cellClick(A._nav_pm);break;case 38:I&&Calendar.cellClick(A._nav_py);break;case 39:I&&Calendar.cellClick(A._nav_nm);break;case 40:I&&Calendar.cellClick(A._nav_ny);break;default:return false}}else{switch(M){case 32:Calendar.cellClick(A._nav_now);break;case 27:I&&A.callCloseHandler();break;case 37:case 38:case 39:case 40:if(I){var E,N,J,G,C,D;E=M==37||M==38;D=(M==37||M==39)?1:7;function B(){C=A.currentDateEl;var K=C.pos;N=K&15;J=K>>4;G=A.ar_days[J][N]}B();function F(){var K=new Date(A.date);K.setDate(K.getDate()-D);A.setDate(K)}function H(){var K=new Date(A.date);K.setDate(K.getDate()+D);A.setDate(K)}while(1){switch(M){case 37:if(--N>=0){G=A.ar_days[J][N]}else{N=6;M=38;continue}break;case 38:if(--J>=0){G=A.ar_days[J][N]}else{F();B()}break;case 39:if(++N<7){G=A.ar_days[J][N]}else{N=0;M=40;continue}break;case 40:if(++J<A.ar_days.length){G=A.ar_days[J][N]}else{H();B()}break}break}if(G){if(!G.disabled){Calendar.cellClick(G)}else{if(E){F()}else{H()}}}}break;case 13:if(I){Calendar.cellClick(A.currentDateEl,L)}break;default:return false}}return Calendar.stopEvent(L)};Calendar.prototype._init=function(M,W){var V=new Date(),Q=V.getFullYear(),Y=V.getMonth(),B=V.getDate();this.table.style.visibility="hidden";var I=W.getFullYear();if(I<this.minYear){I=this.minYear;W.setFullYear(I)}else{if(I>this.maxYear){I=this.maxYear;W.setFullYear(I)}}this.firstDayOfWeek=M;this.date=new Date(W);var X=W.getMonth();var a=W.getDate();var Z=W.getMonthDays();W.setDate(1);var R=(W.getDay()-this.firstDayOfWeek)%7;if(R<0){R+=7}W.setDate(-R);W.setDate(W.getDate()+1);var F=this.tbody.firstChild;var K=Calendar._SMN[X];var O=this.ar_days=new Array();var N=Calendar._TT.WEEKEND;var D=this.multiple?(this.datesCells={}):null;for(var T=0;T<6;++T,F=F.nextSibling){var A=F.firstChild;if(this.weekNumbers){A.className="day wn";var E=W;if(X==0&&T==0&&Date.useISO8601WeekNumbers==false){E=new Date(I,X,1)}A.innerHTML=E.getWeekNumber();A=A.nextSibling}F.className="daysrow";var U=false,G,C=O[T]=[];for(var S=0;S<7;++S,A=A.nextSibling,W.setDate(G+1)){G=W.getDate();var H=W.getDay();A.className="day";A.pos=T<<4|S;C[S]=A;var L=(W.getMonth()==X);if(!L){if(this.showsOtherMonths){A.className+=" othermonth";A.otherMonth=true}else{A.className="emptycell";A.innerHTML="&nbsp;";A.disabled=true;continue}}else{A.otherMonth=false;U=true}A.disabled=false;A.innerHTML=this.getDateText?this.getDateText(W,G):G;if(D){D[W.print("%Y%m%d")]=A}if(this.getDateStatus){var P=this.getDateStatus(W,I,X,G);if(this.getDateToolTip){var J=this.getDateToolTip(W,I,X,G);if(J){A.title=J}}if(P===true){A.className+=" disabled";A.disabled=true}else{if(/disabled/i.test(P)){A.disabled=true}A.className+=" "+P}}if(!A.disabled){A.caldate=new Date(W);A.ttip="_";if(!this.multiple&&L&&G==a&&this.hiliteToday){A.className+=" selected";this.currentDateEl=A}if(W.getFullYear()==Q&&W.getMonth()==Y&&G==B){A.className+=" today";A.ttip+=Calendar._TT.PART_TODAY}if(N.indexOf(H.toString())!=-1){A.className+=A.otherMonth?" oweekend":" weekend"}}}if(!(U||this.showsOtherMonths)){F.className="emptyrow"}}this.title.innerHTML=Calendar._MN[X]+", "+I;this.onSetTime();this.table.style.visibility="visible";this._initMultipleDates()};Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var B in this.multiple){var A=this.datesCells[B];var C=this.multiple[B];if(!C){continue}if(A){A.className+=" selected"}}}};Calendar.prototype._toggleMultipleDate=function(B){if(this.multiple){var C=B.print("%Y%m%d");var A=this.datesCells[C];if(A){var D=this.multiple[C];if(!D){Calendar.addClass(A,"selected");this.multiple[C]=B}else{Calendar.removeClass(A,"selected");delete this.multiple[C]}}}};Calendar.prototype.setDateToolTipHandler=function(A){this.getDateToolTip=A};Calendar.prototype.setDate=function(A){if(!A.equalsTo(this.date)){this._init(this.firstDayOfWeek,A)}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date)};Calendar.prototype.setFirstDayOfWeek=function(A){this._init(A,this.date);this._displayWeekdays()};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(A){this.getDateStatus=A};Calendar.prototype.setRange=function(A,B){this.minYear=A;this.maxYear=B};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat))}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this)}this.hideShowCovered()};Calendar.prototype.destroy=function(){var A=this.element.parentNode;A.removeChild(this.element);Calendar._C=null;window._dynarch_popupCalendar=null};Calendar.prototype.reparent=function(B){var A=this.element;A.parentNode.removeChild(A);B.appendChild(A)};Calendar._checkCalendar=function(B){var C=window._dynarch_popupCalendar;if(!C){return false}var A=Calendar.is_ie?Calendar.getElement(B):Calendar.getTargetElement(B);for(;A!=null&&A!=C.element;A=A.parentNode){}if(A==null){window._dynarch_popupCalendar.callCloseHandler();return Calendar.stopEvent(B)}};Calendar.prototype.show=function(){var E=this.table.getElementsByTagName("tr");for(var D=E.length;D>0;){var F=E[--D];Calendar.removeClass(F,"rowhilite");var C=F.getElementsByTagName("td");for(var B=C.length;B>0;){var A=C[--B];Calendar.removeClass(A,"hilite");Calendar.removeClass(A,"active")}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window._dynarch_popupCalendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar)}this.hideShowCovered()};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar)}this.element.style.display="none";this.hidden=true;this.hideShowCovered()};Calendar.prototype.showAt=function(A,C){var B=this.element.style;B.zIndex=3001;B.left=A+"px";B.top=C+"px";this.show()};Calendar.prototype.showAtElement=function(C,E,D){var A=this;var F=Calendar.getAbsolutePos(C);if(!E||typeof E!="string"){this.showAt(F.x,F.y+C.offsetHeight);return true}function B(J){if(J.x<0){J.x=0}if(J.y<0){J.y=0}var K=document.createElement("div");var I=K.style;I.position=D;I.right=I.bottom=I.width=I.height="0px";document.body.appendChild(K);var H=Calendar.getAbsolutePos(K);document.body.removeChild(K);if(Calendar.is_ie6){H.y+=document.body.scrollTop;H.x+=document.body.scrollLeft}else{H.y+=window.scrollY;H.x+=window.scrollX}var G=J.x+J.width-H.x;if(G>0){J.x-=G}G=J.y+J.height-H.y;if(G>0){J.y-=G}}this.element.style.display="block";Calendar.continuation_for_the_khtml_browser=function(){var G=A.element.offsetWidth;var I=A.element.offsetHeight;A.element.style.display="none";var H=E.substr(0,1);var J="l";if(E.length>1){J=E.substr(1,1)}switch(H){case"T":F.y-=I;break;case"B":F.y+=C.offsetHeight;break;case"C":F.y+=(C.offsetHeight-I)/2;break;case"t":F.y+=C.offsetHeight-I;break;case"b":break}switch(J){case"L":F.x-=G;break;case"R":F.x+=C.offsetWidth;break;case"C":F.x+=(C.offsetWidth-G)/2;break;case"l":F.x+=C.offsetWidth-G;break;case"r":break}F.width=G;F.height=I+40;A.monthsCombo.style.display="none";B(F);A.showAt(F.x,F.y)};if(Calendar.is_khtml){setTimeout("Calendar.continuation_for_the_khtml_browser()",10)}else{Calendar.continuation_for_the_khtml_browser()}};Calendar.prototype.setDateFormat=function(A){this.dateFormat=A};Calendar.prototype.setTtDateFormat=function(A){this.ttDateFormat=A};Calendar.prototype.parseDate=function(B,A){if(!A){A=this.dateFormat}this.setDate(Date.parseDate(B,A))};Calendar.prototype.hideShowCovered=function(){if(!Calendar.is_ie&&!Calendar.is_opera){return }function B(R){var Q=R.style.visibility;if(!Q){if(document.defaultView&&typeof (document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml){Q=document.defaultView.getComputedStyle(R,"").getPropertyValue("visibility")}else{Q=""}}else{if(R.currentStyle){Q=R.currentStyle.visibility}else{Q=""}}}return Q}var P=new Array("applet","iframe","select");var C=this.element;var A=Calendar.getAbsolutePos(C);var F=A.x;var D=C.offsetWidth+F;var O=A.y;var N=C.offsetHeight+O;for(var H=P.length;H>0;){var G=document.getElementsByTagName(P[--H]);var E=null;for(var J=G.length;J>0;){E=G[--J];A=Calendar.getAbsolutePos(E);var M=A.x;var L=E.offsetWidth+M;var K=A.y;var I=E.offsetHeight+K;if(this.hidden||(M>D)||(L<F)||(K>N)||(I<O)){if(!E.__msh_save_visibility){E.__msh_save_visibility=B(E)}E.style.visibility=E.__msh_save_visibility}else{if(!E.__msh_save_visibility){E.__msh_save_visibility=B(E)}E.style.visibility="hidden"}}}};Calendar.prototype._displayWeekdays=function(){var B=this.firstDayOfWeek;var A=this.firstdayname;var D=Calendar._TT.WEEKEND;for(var C=0;C<7;++C){A.className="day name";var E=(C+B)%7;if(C){A.ttip=Calendar._TT.DAY_FIRST.replace("%s",Calendar._DN[E]);A.navtype=100;A.calendar=this;A.fdow=E;Calendar._add_evs(A)}if(D.indexOf(E.toString())!=-1){Calendar.addClass(A,"weekend")}A.innerHTML=Calendar._SDN[(C+B)%7];A=A.nextSibling}};Calendar.prototype._hideCombos=function(){this.monthsCombo.style.display="none";this.yearsCombo.style.display="none"};Calendar.prototype._dragStart=function(ev){if(this.dragging){return }this.dragging=true;var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft}else{posY=ev.clientY+window.scrollY;posX=ev.clientX+window.scrollX}var st=this.element.style;this.xOffs=posX-parseInt(st.left);this.yOffs=posY-parseInt(st.top);with(Calendar){addEvent(document,"mousemove",calDragIt);addEvent(document,"mouseup",calDragEnd)}};Date._MD=new Array(31,28,31,30,31,30,31,31,30,31,30,31);Date.SECOND=1000;Date.MINUTE=60*Date.SECOND;Date.HOUR=60*Date.MINUTE;Date.DAY=24*Date.HOUR;Date.WEEK=7*Date.DAY;Date._multisplit=function(E,F){if(E==null){return null}if(F==null){F=""}var B=[];var A=E.length;var D="";var C=false;for(i=0;i<A;i++){var G=E.charAt(i);if(F.indexOf(G)==-1){C=true;D+=G}else{if(C){B[B.length]=D;D="";C=false}}}if(D.length>0){B[B.length]=D}if(B.length==0){B[B.length]=""}return B};Date._parseNonDateFormatChars=function(D){var F="aAbBCdeHIJklmMnpPSstUWVuwyY%";var E="";var A=D.length;var C=false;for(i=0;i<A;i++){var G=D.charAt(i);if(G=="%"){var B="";if(i+1<A){B=D.charAt(i+1)}i=i+1;if(B.length>0&&F.indexOf(B)!=-1){continue}else{if(E.indexOf(G)==-1){E+=G}if(B.length>0&&E.indexOf(B)==-1){E+=B}}}else{if(E.indexOf(G)==-1){E+=G}}}return E};Date.parseDate=function(G,A){var H=new Date();var J=0;var B=-1;var F=0;var P=Date._parseNonDateFormatChars(A);var K=Date._multisplit(G,P);var I=A.match(/%./g);var E=0,D=0;var L=0;var C=0;for(E=0;E<K.length;++E){if(!K[E]){continue}switch(I[E]){case"%d":case"%e":F=parseInt(K[E],10);break;case"%m":B=parseInt(K[E],10)-1;break;case"%Y":case"%y":J=parseInt(K[E],10);(J<100)&&(J+=(J>29)?1900:2000);break;case"%b":case"%B":var M=K[E].toLowerCase();var O=false;if(I[E]=="%b"){for(D=0;D<12;++D){if(Calendar._SMN[D].substr(0,M.length).toLowerCase()==M){B=D;O=true;break}}}if(!O){for(D=0;D<12;++D){if(Calendar._MN[D].substr(0,M.length).toLowerCase()==M){B=D;break}}}break;case"%H":case"%I":case"%k":case"%l":L=parseInt(K[E],10);break;case"%P":case"%p":if(/pm/i.test(K[E])&&L<12){L+=12}else{if(/am/i.test(K[E])&&L>=12){L-=12}}break;case"%M":C=parseInt(K[E],10);break}}if(isNaN(J)){J=H.getFullYear()}if(isNaN(B)){B=H.getMonth()}if(isNaN(F)){F=H.getDate()}if(isNaN(L)){L=H.getHours()}if(isNaN(C)){C=H.getMinutes()}if(J!=0&&B!=-1&&F!=0){return new Date(J,B,F,L,C,0)}J=0;B=-1;F=0;for(E=0;E<K.length;++E){if(K[E].search(/[a-zA-Z]+/)!=-1){var N=-1;for(D=0;D<12;++D){if(Calendar._MN[D].substr(0,K[E].length).toLowerCase()==K[E].toLowerCase()){N=D;break}}if(N!=-1){if(B!=-1){F=B+1}B=N}}else{if(parseInt(K[E],10)<=12&&B==-1){B=K[E]-1}else{if(parseInt(K[E],10)>31&&J==0){J=parseInt(K[E],10);(J<100)&&(J+=(J>29)?1900:2000)}else{if(F==0){F=K[E]}}}}}if(J==0){J=H.getFullYear()}if(B!=-1&&F!=0){return new Date(J,B,F,L,C,0)}return H};Date.prototype.getMonthDays=function(B){var A=this.getFullYear();if(typeof B=="undefined"){B=this.getMonth()}if(((0==(A%4))&&((0!=(A%100))||(0==(A%400))))&&B==1){return 29}else{return Date._MD[B]}};Date.prototype.getDayOfYear=function(){var A=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var C=new Date(this.getFullYear(),0,0,0,0,0);var B=A-C;return Math.floor(B/Date.DAY)};Date.prototype.getWeekNumber=function(){if(Date.useISO8601WeekNumbers){var C=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var B=C.getDay();C.setDate(C.getDate()-(B+6)%7+3);var A=C.valueOf();C.setMonth(0);C.setDate(4);return Math.round((A-C.valueOf())/(7*86400000))+1}else{return this._getWeekNumberStandard()}};Date.prototype._getWeekNumberStandard=function(){var B=1000*60*60*24;var F=this;var H=F.getFullYear();var G=-1;var E=new Date(H,0,1);var D=E.getDay();var C=Math.ceil((F.getTime()-E.getTime())/B);if(C<0&&C>=(-1*D)){G=1}else{G=1;var A=new Date(E.getTime());A.setHours(0,0,0,0);while(A.getTime()<F.getTime()&&A.getFullYear()==H){G+=1;A.setDate(A.getDate()+7)}}return G};Date.prototype.equalsTo=function(A){return((this.getFullYear()==A.getFullYear())&&(this.getMonth()==A.getMonth())&&(this.getDate()==A.getDate())&&(this.getHours()==A.getHours())&&(this.getMinutes()==A.getMinutes()))};Date.prototype.setDateOnly=function(A){var B=new Date(A);this.setDate(1);this.setFullYear(B.getFullYear());this.setMonth(B.getMonth());this.setDate(B.getDate())};Date.prototype.print=function(I){var A=this.getMonth();var H=this.getDate();var J=this.getFullYear();var L=this.getWeekNumber();var M=this.getDay();var Q={};var N=this.getHours();var B=(N>=12);var F=(B)?(N-12):N;var P=this.getDayOfYear();if(F==0){F=12}var C=this.getMinutes();var G=this.getSeconds();Q["%a"]=Calendar._SDN[M];Q["%A"]=Calendar._DN[M];Q["%b"]=Calendar._SMN[A];Q["%B"]=Calendar._MN[A];Q["%C"]=1+Math.floor(J/100);Q["%d"]=(H<10)?("0"+H):H;Q["%e"]=H;Q["%H"]=(N<10)?("0"+N):N;Q["%I"]=(F<10)?("0"+F):F;Q["%j"]=(P<100)?((P<10)?("00"+P):("0"+P)):P;Q["%k"]=N;Q["%l"]=F;Q["%m"]=(A<9)?("0"+(1+A)):(1+A);Q["%M"]=(C<10)?("0"+C):C;Q["%n"]="\n";Q["%p"]=B?Calendar._TT.PM:Calendar._TT.AM;Q["%P"]=B?Calendar._TT.PM:Calendar._TT.AM;Q["%s"]=Math.floor(this.getTime()/1000);Q["%S"]=(G<10)?("0"+G):G;Q["%t"]="\t";Q["%U"]=Q["%W"]=Q["%V"]=(L<10)?("0"+L):L;Q["%u"]=M+1;Q["%w"]=M;Q["%y"]=(""+J).substr(2,2);Q["%Y"]=J;Q["%%"]="%";var O=/%./g;if(!Calendar.is_ie5&&!Calendar.is_khtml){return I.replace(O,function(R){return Q[R]||R})}var K=I.match(O);for(var E=0;E<K.length;E++){var D=Q[K[E]];if(D){O=new RegExp(K[E],"g");I=I.replace(O,D)}}return I};Date.prototype.__msh_oldSetFullYear=Date.prototype.setFullYear;Date.prototype.setFullYear=function(B){var A=new Date(this);A.__msh_oldSetFullYear(B);if(A.getMonth()!=this.getMonth()){this.setDate(28)}this.__msh_oldSetFullYear(B)};window._dynarch_popupCalendar=null;Calendar.setup=function(G){function F(H,I){if(typeof G[H]=="undefined"){G[H]=I}}F("inputField",null);F("displayArea",null);F("button",null);F("eventName","click");F("ifFormat","%Y/%m/%d");F("daFormat","%Y/%m/%d");F("singleClick",true);F("disableFunc",null);F("dateStatusFunc",G.disableFunc);F("dateText",null);F("firstDay",null);F("align","Br");F("range",[1900,2999]);F("weekNumbers",true);F("flat",null);F("flatCallback",null);F("onSelect",null);F("onClose",null);F("onUpdate",null);F("date",null);F("showsTime",false);F("timeFormat","24");F("electric",true);F("step",2);F("position",null);F("cache",false);F("showOthers",false);F("multiple",null);var C=["inputField","displayArea","button"];for(var B in C){if(typeof G[C[B]]=="string"){G[C[B]]=document.getElementById(G[C[B]])}}if(!(G.flat||G.multiple||G.inputField||G.displayArea||G.button)){alert("Calendar.setup:\n  Nothing to setup (no fields found).  Please check your code");return false}function A(I){var H=I.params;var J=(I.dateClicked||H.electric);if(J&&H.inputField){H.inputField.value=I.date.print(H.ifFormat);if(typeof H.inputField.onchange=="function"){H.inputField.onchange()}}if(J&&H.displayArea){H.displayArea.innerHTML=I.date.print(H.daFormat)}if(J&&typeof H.onUpdate=="function"){H.onUpdate(I)}if(J&&H.flat){if(typeof H.flatCallback=="function"){H.flatCallback(I)}}if(J&&H.singleClick&&I.dateClicked){I.callCloseHandler()}}if(G.flat!=null){if(typeof G.flat=="string"){G.flat=document.getElementById(G.flat)}if(!G.flat){alert("Calendar.setup:\n  Flat specified but can't find parent.");return false}var E=new Calendar(G.firstDay,G.date,G.onSelect||A);E.showsOtherMonths=G.showOthers;E.showsTime=G.showsTime;E.time24=(G.timeFormat=="24");E.params=G;E.weekNumbers=G.weekNumbers;E.setRange(G.range[0],G.range[1]);E.setDateStatusHandler(G.dateStatusFunc);E.getDateText=G.dateText;if(G.ifFormat){E.setDateFormat(G.ifFormat)}if(G.inputField&&typeof G.inputField.value=="string"){E.parseDate(G.inputField.value)}E.create(G.positionStyle,G.flat);E.show();return false}var D=G.button||G.displayArea||G.inputField;D["on"+G.eventName]=function(){var H=G.inputField||G.displayArea;var J=G.inputField?G.ifFormat:G.daFormat;var N=false;var L=window.calendar;if(H){G.date=Date.parseDate(H.value||H.innerHTML,J)}if(!(L&&G.cache)){window.calendar=L=new Calendar(G.firstDay,G.date,G.onSelect||A,G.onClose||function(O){O.hide()});L.showsTime=G.showsTime;L.time24=(G.timeFormat=="24");L.weekNumbers=G.weekNumbers;N=true}else{if(G.date){L.setDate(G.date)}L.hide()}if(G.multiple){L.multiple={};for(var I=G.multiple.length;--I>=0;){var M=G.multiple[I];var K=M.print("%Y%m%d");L.multiple[K]=M}}L.showsOtherMonths=G.showOthers;L.yearStep=G.step;L.setRange(G.range[0],G.range[1]);L.params=G;L.setDateStatusHandler(G.dateStatusFunc);L.getDateText=G.dateText;L.setDateFormat(J);if(N){L.create(G.positionStyle)}L.refresh();if(!G.position){L.showAtElement(G.button||G.displayArea||G.inputField,G.align,G.positionStyle)}else{L.showAt(G.position[0],G.position[1])}return false};return E};var GH={VERSION:"4.0"};GH.Util={doSubmit:function(evt,func){var charCode=(evt.which)?evt.which:evt.keyCode;if(charCode==13){eval(func)}},show:function(A){if($(A)){Element.show($(A))}},hide:function(A){if($(A)){Element.hide($(A))}},showAll:function(A){A.each(function(B){GH.Util.show(B)})},hideAll:function(A){A.each(function(B){GH.Util.hide(B)})},switchView:function(A,B){GH.Util.hide(B);GH.Util.show(A)},isVisible:function(A){return $(A)&&Element.visible($(A))},stopObserving:function(C,A,B){if($(C)){Event.stopObserving(C,A,B)}},innerValue:function(A){return($(A)?$(A).innerHTML:"")},write:function(B,A){if($(B)){$(B).innerHTML=A}},highLight:function(B,A){if($(B)){new Effect.Highlight($(B),{duration:A,queue:"parallel"})}},setClassName:function(B,A){if($(B)){$(B).className=A}},addClassName:function(B,A){if($(B)){$(B).addClassName(A)}},removeClassName:function(B,A){if($(B)){$(B).removeClassName(A)}},removeClassNames:function(B,A){AJS.$("#"+B).removeClass(A)},hasClassName:function(B,A){return $(B)&&$(B).hasClassName(A)},innerWidth:function(A){return AJS.$("#"+A).innerWidth()},insertTop:function(B,A){if($(B)){new Insertion.Top($(B),A)}},setBackground:function(B,A){if($(B)){$(B).style.backgroundColor=A}},setValue:function(B,A){if($(B)){$(B).value=A}},resetValues:function(A){A.each(function(B){GH.Util.setValue(B,"")})},setValueWithHTML:function(B,A){if($(B)){$(B).value=GH.Util.trim(GH.Util.innerValue(A))}},destroy:function(A){if($(A)){$(A).remove()}},trim:function(A){if(!A){return""}A=A.replace(/^\s+/g,"");A=A.replace(/&lt;/g,"<");A=A.replace(/&gt;/g,">");return A},findPos:function(A){return[AJS.$("#"+A).position().left,AJS.$("#"+A).position().top]},scrollTop:function(){return AJS.$(window).scrollTop()},getPopup:function(A,C,B,D){$(A).style.top=B+"px";$(A).style.left=C+"px";$(A).style.position="absolute";$(A).style.visibility="visible";if(D){$(A).style.zIndex=D}return $(A)},toDate:function(C){var D="";for(var B=0;B<C.length;B++){if((C.charAt(B)>="0")&&(C.charAt(B)<="9")){var A=B;while((C.charAt(A)>="0")&&(C.charAt(A)<="9")&&A<C.length){D=D+C.charAt(A++)}D=D+C.charAt(A+1)+" ";B=A+2}}return D},toggle:function(A){if($(A)){if($F(A)){$(A).checked=""}else{$(A).checked="checked"}}},setValue:function(B,A){if($(B)){$(B).value=A}},selectionText:function(A){return A.options[A.selectedIndex].text},forceWidth:function(B,A){if(!!(window.attachEvent&&!window.opera)){$(B).style.width=A}},isFireFox:function(){return navigator.userAgent&&navigator.userAgent.indexOf("Firefox")!=-1},windownDim:function(){return[AJS.$(window).width(),AJS.$(window).height()]},openWindow:function(A,B){return window.open(A,B,"location=0,left="+((this.windownDim[0]-800)/2)+",top="+((this.windownDim[1]-600)/2)+",width=820px,height=600px,menubar=1,resizable=1,toolbar=0,scrollbars=1")},charCounter:function(B,D,A,C){if($F(D).length>A){$(D).value=$F(D).substring(0,A)}GH.Util.write(C,""+(A-$F(D).length))},verifyKeyCode:function(B){var A=(B.which)?B.which:B.keyCode;if(A==8||A==9){return true}if(A>31&&A<41){return true}if(A>43&&A<60){return true}if(A>64&&A<91){return true}if(A>94&&A<123){return true}return false},isSelectionModifier:function(A){var B=(navigator.appVersion.indexOf("Mac")!==-1)?true:false;return A.ctrlKey||((B&&A.metaKey)||(!B&&A.altKey))},stopPropagationFor:function(B,A){A.each(function(C){Event.observe($(C),B,GH.Util.stopPropagation)})},stopPropagation:function(A){if(!A){var A=window.event}A.cancelBubble=true;A.returnValue=false;if(A.stopPropagation){A.stopPropagation();A.preventDefault()}},switchParent:function(A){$$("div[id^=parent_]").each(function(B){GH.Util.hide(B)});GH.Util.show("parent_"+A)},verifyNumInput:function(B){var A=(B.which)?B.which:B.keyCode;if(A==8||A==46){return true}else{if(A>34&&A<41){return true}else{return GH.Util.isNumKey(B)}}},isNumKey:function(B){var A=(B.which)?B.which:B.keyCode;if(A>47&&A<58){return true}return false},toPath:function(A){return A.replace(/\\/g,"/")},disableLinks:function(A){if(!A){A=$$("a")}A.invoke("observe","click",Event.stop)},find:function(A,B){if(B===false){Prototype.Tuning.extendOnCssSelect=false}return $$(A);if(B===false){Prototype.Tuning.extendOnCssSelect=true}}};Encoder={EncodeType:"entity",isEmpty:function(A){if(A){return((A===null)||A.length==0||/^\s+$/.test(A))}else{return true}},HTML2Numerical:function(C){var B=new Array("&nbsp;","&iexcl;","&cent;","&pound;","&curren;","&yen;","&brvbar;","&sect;","&uml;","&copy;","&ordf;","&laquo;","&not;","&shy;","&reg;","&macr;","&deg;","&plusmn;","&sup2;","&sup3;","&acute;","&micro;","&para;","&middot;","&cedil;","&sup1;","&ordm;","&raquo;","&frac14;","&frac12;","&frac34;","&iquest;","&agrave;","&aacute;","&acirc;","&atilde;","&Auml;","&aring;","&aelig;","&ccedil;","&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;","&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&Ouml;","&times;","&oslash;","&ugrave;","&uacute;","&ucirc;","&Uuml;","&yacute;","&thorn;","&szlig;","&agrave;","&aacute;","&acirc;","&atilde;","&auml;","&aring;","&aelig;","&ccedil;","&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;","&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&ouml;","&divide;","&oslash;","&ugrave;","&uacute;","&ucirc;","&uuml;","&yacute;","&thorn;","&yuml;","&quot;","&amp;","&lt;","&gt;","&oelig;","&oelig;","&scaron;","&scaron;","&yuml;","&circ;","&tilde;","&ensp;","&emsp;","&thinsp;","&zwnj;","&zwj;","&lrm;","&rlm;","&ndash;","&mdash;","&lsquo;","&rsquo;","&sbquo;","&ldquo;","&rdquo;","&bdquo;","&dagger;","&dagger;","&permil;","&lsaquo;","&rsaquo;","&euro;","&fnof;","&alpha;","&beta;","&gamma;","&delta;","&epsilon;","&zeta;","&eta;","&theta;","&iota;","&kappa;","&lambda;","&mu;","&nu;","&xi;","&omicron;","&pi;","&rho;","&sigma;","&tau;","&upsilon;","&phi;","&chi;","&psi;","&omega;","&alpha;","&beta;","&gamma;","&delta;","&epsilon;","&zeta;","&eta;","&theta;","&iota;","&kappa;","&lambda;","&mu;","&nu;","&xi;","&omicron;","&pi;","&rho;","&sigmaf;","&sigma;","&tau;","&upsilon;","&phi;","&chi;","&psi;","&omega;","&thetasym;","&upsih;","&piv;","&bull;","&hellip;","&prime;","&prime;","&oline;","&frasl;","&weierp;","&image;","&real;","&trade;","&alefsym;","&larr;","&uarr;","&rarr;","&darr;","&harr;","&crarr;","&larr;","&uarr;","&rarr;","&darr;","&harr;","&forall;","&part;","&exist;","&empty;","&nabla;","&isin;","&notin;","&ni;","&prod;","&sum;","&minus;","&lowast;","&radic;","&prop;","&infin;","&ang;","&and;","&or;","&cap;","&cup;","&int;","&there4;","&sim;","&cong;","&asymp;","&ne;","&equiv;","&le;","&ge;","&sub;","&sup;","&nsub;","&sube;","&supe;","&oplus;","&otimes;","&perp;","&sdot;","&lceil;","&rceil;","&lfloor;","&rfloor;","&lang;","&rang;","&loz;","&spades;","&clubs;","&hearts;","&diams;");var A=new Array("&#160;","&#161;","&#162;","&#163;","&#164;","&#165;","&#166;","&#167;","&#168;","&#169;","&#170;","&#171;","&#172;","&#173;","&#174;","&#175;","&#176;","&#177;","&#178;","&#179;","&#180;","&#181;","&#182;","&#183;","&#184;","&#185;","&#186;","&#187;","&#188;","&#189;","&#190;","&#191;","&#192;","&#193;","&#194;","&#195;","&#196;","&#197;","&#198;","&#199;","&#200;","&#201;","&#202;","&#203;","&#204;","&#205;","&#206;","&#207;","&#208;","&#209;","&#210;","&#211;","&#212;","&#213;","&#214;","&#215;","&#216;","&#217;","&#218;","&#219;","&#220;","&#221;","&#222;","&#223;","&#224;","&#225;","&#226;","&#227;","&#228;","&#229;","&#230;","&#231;","&#232;","&#233;","&#234;","&#235;","&#236;","&#237;","&#238;","&#239;","&#240;","&#241;","&#242;","&#243;","&#244;","&#245;","&#246;","&#247;","&#248;","&#249;","&#250;","&#251;","&#252;","&#253;","&#254;","&#255;","&#34;","&#38;","&#60;","&#62;","&#338;","&#339;","&#352;","&#353;","&#376;","&#710;","&#732;","&#8194;","&#8195;","&#8201;","&#8204;","&#8205;","&#8206;","&#8207;","&#8211;","&#8212;","&#8216;","&#8217;","&#8218;","&#8220;","&#8221;","&#8222;","&#8224;","&#8225;","&#8240;","&#8249;","&#8250;","&#8364;","&#402;","&#913;","&#914;","&#915;","&#916;","&#917;","&#918;","&#919;","&#920;","&#921;","&#922;","&#923;","&#924;","&#925;","&#926;","&#927;","&#928;","&#929;","&#931;","&#932;","&#933;","&#934;","&#935;","&#936;","&#937;","&#945;","&#946;","&#947;","&#948;","&#949;","&#950;","&#951;","&#952;","&#953;","&#954;","&#955;","&#956;","&#957;","&#958;","&#959;","&#960;","&#961;","&#962;","&#963;","&#964;","&#965;","&#966;","&#967;","&#968;","&#969;","&#977;","&#978;","&#982;","&#8226;","&#8230;","&#8242;","&#8243;","&#8254;","&#8260;","&#8472;","&#8465;","&#8476;","&#8482;","&#8501;","&#8592;","&#8593;","&#8594;","&#8595;","&#8596;","&#8629;","&#8656;","&#8657;","&#8658;","&#8659;","&#8660;","&#8704;","&#8706;","&#8707;","&#8709;","&#8711;","&#8712;","&#8713;","&#8715;","&#8719;","&#8721;","&#8722;","&#8727;","&#8730;","&#8733;","&#8734;","&#8736;","&#8743;","&#8744;","&#8745;","&#8746;","&#8747;","&#8756;","&#8764;","&#8773;","&#8776;","&#8800;","&#8801;","&#8804;","&#8805;","&#8834;","&#8835;","&#8836;","&#8838;","&#8839;","&#8853;","&#8855;","&#8869;","&#8901;","&#8968;","&#8969;","&#8970;","&#8971;","&#9001;","&#9002;","&#9674;","&#9824;","&#9827;","&#9829;","&#9830;");return this.swapArrayVals(C,B,A)},NumericalToHTML:function(C){var B=new Array("&#160;","&#161;","&#162;","&#163;","&#164;","&#165;","&#166;","&#167;","&#168;","&#169;","&#170;","&#171;","&#172;","&#173;","&#174;","&#175;","&#176;","&#177;","&#178;","&#179;","&#180;","&#181;","&#182;","&#183;","&#184;","&#185;","&#186;","&#187;","&#188;","&#189;","&#190;","&#191;","&#192;","&#193;","&#194;","&#195;","&#196;","&#197;","&#198;","&#199;","&#200;","&#201;","&#202;","&#203;","&#204;","&#205;","&#206;","&#207;","&#208;","&#209;","&#210;","&#211;","&#212;","&#213;","&#214;","&#215;","&#216;","&#217;","&#218;","&#219;","&#220;","&#221;","&#222;","&#223;","&#224;","&#225;","&#226;","&#227;","&#228;","&#229;","&#230;","&#231;","&#232;","&#233;","&#234;","&#235;","&#236;","&#237;","&#238;","&#239;","&#240;","&#241;","&#242;","&#243;","&#244;","&#245;","&#246;","&#247;","&#248;","&#249;","&#250;","&#251;","&#252;","&#253;","&#254;","&#255;","&#34;","&#38;","&#60;","&#62;","&#338;","&#339;","&#352;","&#353;","&#376;","&#710;","&#732;","&#8194;","&#8195;","&#8201;","&#8204;","&#8205;","&#8206;","&#8207;","&#8211;","&#8212;","&#8216;","&#8217;","&#8218;","&#8220;","&#8221;","&#8222;","&#8224;","&#8225;","&#8240;","&#8249;","&#8250;","&#8364;","&#402;","&#913;","&#914;","&#915;","&#916;","&#917;","&#918;","&#919;","&#920;","&#921;","&#922;","&#923;","&#924;","&#925;","&#926;","&#927;","&#928;","&#929;","&#931;","&#932;","&#933;","&#934;","&#935;","&#936;","&#937;","&#945;","&#946;","&#947;","&#948;","&#949;","&#950;","&#951;","&#952;","&#953;","&#954;","&#955;","&#956;","&#957;","&#958;","&#959;","&#960;","&#961;","&#962;","&#963;","&#964;","&#965;","&#966;","&#967;","&#968;","&#969;","&#977;","&#978;","&#982;","&#8226;","&#8230;","&#8242;","&#8243;","&#8254;","&#8260;","&#8472;","&#8465;","&#8476;","&#8482;","&#8501;","&#8592;","&#8593;","&#8594;","&#8595;","&#8596;","&#8629;","&#8656;","&#8657;","&#8658;","&#8659;","&#8660;","&#8704;","&#8706;","&#8707;","&#8709;","&#8711;","&#8712;","&#8713;","&#8715;","&#8719;","&#8721;","&#8722;","&#8727;","&#8730;","&#8733;","&#8734;","&#8736;","&#8743;","&#8744;","&#8745;","&#8746;","&#8747;","&#8756;","&#8764;","&#8773;","&#8776;","&#8800;","&#8801;","&#8804;","&#8805;","&#8834;","&#8835;","&#8836;","&#8838;","&#8839;","&#8853;","&#8855;","&#8869;","&#8901;","&#8968;","&#8969;","&#8970;","&#8971;","&#9001;","&#9002;","&#9674;","&#9824;","&#9827;","&#9829;","&#9830;");var A=new Array("&nbsp;","&iexcl;","&cent;","&pound;","&curren;","&yen;","&brvbar;","&sect;","&uml;","&copy;","&ordf;","&laquo;","&not;","&shy;","&reg;","&macr;","&deg;","&plusmn;","&sup2;","&sup3;","&acute;","&micro;","&para;","&middot;","&cedil;","&sup1;","&ordm;","&raquo;","&frac14;","&frac12;","&frac34;","&iquest;","&agrave;","&aacute;","&acirc;","&atilde;","&Auml;","&aring;","&aelig;","&ccedil;","&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;","&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&Ouml;","&times;","&oslash;","&ugrave;","&uacute;","&ucirc;","&Uuml;","&yacute;","&thorn;","&szlig;","&agrave;","&aacute;","&acirc;","&atilde;","&auml;","&aring;","&aelig;","&ccedil;","&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;","&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&ouml;","&divide;","&oslash;","&ugrave;","&uacute;","&ucirc;","&uuml;","&yacute;","&thorn;","&yuml;","&quot;","&amp;","&lt;","&gt;","&oelig;","&oelig;","&scaron;","&scaron;","&yuml;","&circ;","&tilde;","&ensp;","&emsp;","&thinsp;","&zwnj;","&zwj;","&lrm;","&rlm;","&ndash;","&mdash;","&lsquo;","&rsquo;","&sbquo;","&ldquo;","&rdquo;","&bdquo;","&dagger;","&dagger;","&permil;","&lsaquo;","&rsaquo;","&euro;","&fnof;","&alpha;","&beta;","&gamma;","&delta;","&epsilon;","&zeta;","&eta;","&theta;","&iota;","&kappa;","&lambda;","&mu;","&nu;","&xi;","&omicron;","&pi;","&rho;","&sigma;","&tau;","&upsilon;","&phi;","&chi;","&psi;","&omega;","&alpha;","&beta;","&gamma;","&delta;","&epsilon;","&zeta;","&eta;","&theta;","&iota;","&kappa;","&lambda;","&mu;","&nu;","&xi;","&omicron;","&pi;","&rho;","&sigmaf;","&sigma;","&tau;","&upsilon;","&phi;","&chi;","&psi;","&omega;","&thetasym;","&upsih;","&piv;","&bull;","&hellip;","&prime;","&prime;","&oline;","&frasl;","&weierp;","&image;","&real;","&trade;","&alefsym;","&larr;","&uarr;","&rarr;","&darr;","&harr;","&crarr;","&larr;","&uarr;","&rarr;","&darr;","&harr;","&forall;","&part;","&exist;","&empty;","&nabla;","&isin;","&notin;","&ni;","&prod;","&sum;","&minus;","&lowast;","&radic;","&prop;","&infin;","&ang;","&and;","&or;","&cap;","&cup;","&int;","&there4;","&sim;","&cong;","&asymp;","&ne;","&equiv;","&le;","&ge;","&sub;","&sup;","&nsub;","&sube;","&supe;","&oplus;","&otimes;","&perp;","&sdot;","&lceil;","&rceil;","&lfloor;","&rfloor;","&lang;","&rang;","&loz;","&spades;","&clubs;","&hearts;","&diams;");return this.swapArrayVals(C,B,A)},numEncode:function(B){if(this.isEmpty(B)){return""}var C="";for(var A=0;A<B.length;A++){var D=B.charAt(A);if(D<" "||D>"~"){D="&#"+D.charCodeAt()+";"}C+=D}return C},htmlDecode:function(C){var E,B,D=C;if(this.isEmpty(D)){return""}D=this.HTML2Numerical(D);arr=D.match(/&#[0-9]{1,5};/g);if(arr!=null){for(var A=0;A<arr.length;A++){B=arr[A];E=B.substring(2,B.length-1);if(E>=-32768&&E<=65535){D=D.replace(B,String.fromCharCode(E))}else{D=D.replace(B,"")}}}return D},htmlEncode:function(A,B){if(this.isEmpty(A)){return""}B=B|false;if(B){if(this.EncodeType=="numerical"){A=A.replace(/&/g,"&#38;")}else{A=A.replace(/&/g,"&amp;")}}A=this.XSSEncode(A,false);if(this.EncodeType=="numerical"||!B){A=this.HTML2Numerical(A)}A=this.numEncode(A);if(!B){A=A.replace(/&#/g,"##AMPHASH##");if(this.EncodeType=="numerical"){A=A.replace(/&/g,"&#38;")}else{A=A.replace(/&/g,"&amp;")}A=A.replace(/##AMPHASH##/g,"&#")}A=A.replace(/&#\d*([^\d;]|$)/g,"$1");if(!B){A=this.correctEncoding(A)}if(this.EncodeType=="entity"){A=this.NumericalToHTML(A)}return A},XSSEncode:function(B,A){if(!this.isEmpty(B)){A=A||true;if(A){B=B.replace(/\'/g,"&#39;");B=B.replace(/\"/g,"&quot;");B=B.replace(/</g,"&lt;");B=B.replace(/>/g,"&gt;")}else{B=B.replace(/\'/g,"&#39;");B=B.replace(/\"/g,"&#34;");B=B.replace(/</g,"&#60;");B=B.replace(/>/g,"&#62;")}return B}else{return""}},stripUnicode:function(A){return A.replace(/[^\x20-\x7E]/g,"")},correctEncoding:function(A){return A.replace(/(&amp;)(amp;)+/,"$1")},swapArrayVals:function(F,C,B){if(this.isEmpty(F)){return""}var E;if(C&&B){if(C.length==B.length){for(var A=0,D=C.length;A<D;A++){E=new RegExp(C[A],"g");F=F.replace(E,B[A])}}}return F},inArray:function(D,B){for(var C=0,A=B.length;C<A;C++){if(B[C]===D){return C}}return -1}};var Cookie=Class.create();Cookie.prototype={initialize:function(B,C,E,A,D){this.name=B;this.expires=A;this.domain=C;this.path=E;this.secure=D;this.data=this.buildData();this.store()},getData:function(A){return this.data[A]},setData:function(A,B){this.data[A]=B;this.store()},removeData:function(A){delete this.data[A];this.store()},buildData:function(){var C=document.cookie.indexOf(this.name+"=");if(C==-1||this.name!=document.cookie.substr(C,this.name.length)){return{}}var A=C+this.name.length+1;var B=document.cookie.indexOf(";",A);if(B==-1){B=document.cookie.length}return unescape(document.cookie.substring(A,B)).evalJSON()},store:function(){var B="";if(this.expires){var A=new Date();B=this.expires*86400000;B=";expires="+new Date(A.getTime()+B)}document.cookie=this.name+"="+escape(Object.toJSON(this.data))+this.getOptions()+B},erase:function(){document.cookie=this.name+"="+this.getOptions()+";expires=Thu, 01-Jan-1970 00:00:01 GMT"},getOptions:function(){return(this.path?";path="+this.path:"")+(this.domain?";domain="+this.domain:"")}};var Pagination=Class.create();Pagination.prototype={initialize:function(){this.total=0;this.currentPage=0},set:function(F,B){F=F>1?F:0;this.currentPage=B<=F&&B>0?B:1;if(this.total>F){for(var A=this.total;A>F;A--){Event.stopObserving($("cp_"+A));$("cp_"+A).remove()}}else{if(this.total<F){for(var A=this.total;A<F;A++){var E=A+1;var D=new Element("li");D.id="cp_"+E;D.update(E);$("gh-column-pagination").appendChild(D);if(E==this.currentPage){GH.Util.addClassName(D,"gh-selected")}var C=this;Event.observe(D,"click",Boards.colPagination.setPage)}}}this.total=F},setPage:function(B,D){var C=B.element();var A=parseInt(C?C.id.split("_")[1]:1);if(A!=Boards.colPagination.currentPage){Boards.colPagination.currentPage=A;$$("#gh-column-pagination li").each(function(E){GH.Util.removeClassName(E,"gh-selected")});GH.Util.addClassName(C.id,"gh-selected");Boards.refreshColumn(Boards.colPagination.currentNumber)}},clean:function(){$$("#gh-column-pagination li").each(function(A){Event.stopObserving(A)})}};var Boards=new function(){this.ISSUE_PADDING=40;this.waiting="";this.boards=$H();this.needsRefresh=this.inSearchMode=false;this.planningBoard;this.listView;this.compactView;this.searchStart=this.callCount=this.clickCount=0;this.draggedIssue,this.winPicker,this.AJSpopup;this.colPagination=new Pagination();this.cookies=new Cookie("gh.i","","/",90,false);this.pluginKey="com.pyxis.greenhopper.jira:greenhopper-webactions";this.init=function(C,F,E,B,D,A){this.selectedProjectId=C;this.linkId=E;this.delay=D;this.ctx=A;this.autoRefresh=B;this.doRefresh(0,Boards.delay);this.mainBoard=Boards.boards.set(F,new Board(F));this.createDialog()};this.getBoard=function(A){return Boards.boards.get(A)?Boards.boards.get(A):Boards.boards.set(A,new Board(A))};this.removeBoard=function(B){try{Boards.boards.unset(B).clean()}catch(A){}};this.refreshOverview=function(){Boards.working();Boards.submit("RefreshOverview",$H({selectedProjectId:Boards.selectedProjectId,selectedBoardId:"-1"}))};this.ffocus=function(A){if($(A)){$(A).focus()}};this.showPopup=function(B,A){if($(B+"-dd")){$(B+"-dd").setStyle({left:A[0]+"px",top:A[1]+"px"});Boards.openWithShadow(B,[A[0]-8,A[1]])}GH.Util.hideAll(["opt_wait","popup_wait","search_wait"])};this.modalPopup=function(A,C){GH.Util.showAll(["overlay","dialog"]);if(Boards.inSearchMode&&A!="search"){GH.Util.switchView(A,"search")}else{GH.Util.switchView(A,"waiting_display")}var B=$(C+"-dd").parentNode.style.paddingTop;Boards.openWithShadow(C,[-8,B.substring(0,B.length-2)]);if($("popup-scroll")){$("popup-scroll").scrollTop=0}GH.Util.hideAll(["opt_wait","popup_wait","search_wait","waiting_display"])};this.popup=function(A,B,F){if($(A+"-dd")){var E=0;var C=0;var I=F&&$(F)?$(F):$(A);var G=I;while(G.offsetParent){E+=G.offsetLeft;C+=G.offsetTop;G=G.offsetParent}var D=E-B/2;if(E<B/2){D=3}else{if(GH.Util.windownDim()[0]-E<B/2){D=GH.Util.windownDim()[0]-B-(GH.Util.isFireFox()?24:9)}}var H=C+Element.getHeight(I)+(Prototype.Browser.IE?3:2);I=G=null;Boards.showPopup(A,[D,H])}GH.Util.hideAll(["opt_wait","popup_wait","search_wait"])};this.openWithShadow=function(D,B){if(!$(D+"-dd")||$(D+"-dd").innerHTML==""){return }GH.Util.setClassName(D+"-dd-s","gh-shadow");var C=$(D+"-dd").getWidth();var A=$(D+"-dd").getHeight();if(B[0]!=null){$(D+"-dd-s").setStyle({top:B[1]+"px",left:B[0]+"px",width:(C+16)+"px",height:(A+14)+"px"})}else{$(D+"-dd-s").setStyle({top:B[1]+"px",width:(C+16)+"px",height:(A+14)+"px"})}$(D+"-dd-s").innerHTML='<div class="tl"></div><div class="tr"></div><div class="l" style="height:'+(A-8)+'px;"></div><div class="r" style="height:'+(A-8)+'px;"></div><div class="bl"></div><div class="br"></div><div class="b" style="width:'+(C-12)+'px;"></div>';GH.Util.showAll([D+"-dd",D+"-dd-s"])};this.popupError=function(){GH.Util.show("popuperrors");if($("popup-scroll")){$("popup-scroll").scrollTop=0}};this.editCapacity=function(A){$(A+"_max").value=$F(A+"_maxValue");$(A+"_min").value=$F(A+"_minValue");GH.Util.switchView(A+"Edit",A+"Txt");GH.Util.switchView(A+"Edit_links",A+"Txt_links");Boards.ffocus(A+"_min")};this.cancelCapacity=function(A){GH.Util.switchView(A+"Txt",A+"Edit");GH.Util.switchView(A+"Txt_links",A+"Edit_links")};this.setCapacity=function(A){GH.Util.show("Stats_wait");Boards.updater("statistics-table","SetDefaultCapacity",$H({fieldId:A,maxCapacity:$F(A+"_max"),minCapacity:$F(A+"_min")}),true,Boards.doneWorking)};this.toggleMarker=function(A){GH.Util.show("Stats_wait");Boards.updater("statistics-table","ToggleMarker",$H({fieldId:A}),true,Boards.doneWorking)};this.addStats=function(){GH.Util.show("Stats_wait");Boards.updater("statistics-table","AddStats",$H({fieldId:$F("statsSelect"),maxCapacity:$F("capacity_max"),minCapacity:$F("capacity_min")}),true,Boards.doneWorking)};this.removeStats=function(A){GH.Util.show("Stats_wait");Boards.updater("statistics-table","RemoveStats",$H({fieldId:A}),true,Boards.doneWorking)};this.is=function(A){return $(A)?true:false};this.isPlanningBoard=function(){if(this.planningBoard==null){this.planningBoard=Boards.is("VersionBoard")||Boards.is("ComponentBoard")||Boards.is("AssigneeBoard")}return this.planningBoard};this.isListView=function(){if(this.listView==null){this.listView=GH.Util.innerValue("issueDisplay")=="list"}return this.listView};this.isCompactView=function(){if(this.compactView==null){this.compactView=($("isCompactView")?true:false)}return this.compactView};this.escapeHandler=function(A){if(A.keyCode==Event.KEY_ESC){Boards.boards.values().each(function(B){B.unfocus(true,true);B.issues.values().each(function(C){C.cancelEdit()})})}};this.screenSizeHandler=function(){if(Boards.draggedIssue){return }var F=9,K=14,M=11,C=15,E=0,D=0;GH.Util.removeClassNames("gh","gh-dyn-1 gh-dyn-2 gh-dyn-3 gh-dyn-4 gh-dyn-5 gh-dyn-6 gh-dyn-over");var P=GH.Util.innerWidth("gh-content-inner")-C;if(P>1959){GH.Util.addClassName("gh","gh-dyn-over");GH.Util.write("js-cardwidth","")}else{var L=1,B=1,I=1;var O=$$("div[class*=gh-step-header]").size();if(P<=1130){switch(O){case D:B=3;I=4;break;case 1:B=3;I=4;break;case 2:B=2;I=2;break;case 3:B=1;I=2;break;case 4:B=1;I=1;break;case 5:B=E;I=1;break;case 6:B=E;I=1;break;default:B=E;I=E;break}}else{if(P>1130&&P<=1350){L=2;switch(O){case D:B=4;I=5;break;case 1:B=3;I=4;break;case 2:B=2;I=3;break;case 3:B=1;I=2;break;case 4:B=1;I=1;break;case 5:B=E;I=1;break;case 6:B=E;I=1;break;case 7:B=E;I=1;break;default:B=E;I=E;break}}else{if(P>1350&&P<=1400){L=3;switch(O){case D:B=4;I=5;break;case 1:B=3;I=5;break;case 2:B=2;I=3;break;case 3:B=1;I=2;break;case 4:B=1;I=2;break;case 5:B=1;I=1;break;case 6:B=E;I=1;break;case 7:B=E;I=1;break;case 8:B=E;I=1;break;default:B=E;I=E;break}}else{if(P>1400&&P<=1530){L=4;switch(O){case D:B=4;I=5;break;case 1:B=4;I=5;break;case 2:B=2;I=4;break;case 3:B=1;I=2;break;case 4:B=1;I=2;break;case 5:B=E;I=1;break;case 6:B=E;I=1;break;case 7:B=E;I=1;break;case 8:B=E;I=1;break;default:B=E;I=E;break}}else{if(P>1530&&P<=1700){L=5;switch(O){case D:B=5;I=6;break;case 1:B=5;I=6;break;case 2:B=2;I=3;break;case 3:B=2;I=3;break;case 4:B=1;I=2;break;case 5:B=1;I=1;break;case 6:B=1;I=1;break;case 7:B=E;I=1;break;case 8:B=E;I=1;break;case 9:B=E;I=1;break;default:B=E;I=E;break}}else{if(P>1700&&P<=1959){L=6;switch(O){case D:B=6;I=7;break;case 1:B=5;I=7;break;case 2:B=3;I=4;break;case 3:B=2;I=3;break;case 4:B=1;I=2;break;case 5:B=1;I=2;break;case 6:B=1;I=1;break;case 7:B=E;I=1;break;case 8:B=E;I=1;break;case 9:B=E;I=1;break;case 10:B=E;I=1;break;default:B=E;I=E;break}}}}}}}GH.Util.addClassName("gh","gh-dyn-"+L);var J=GH.Util.innerValue("issueDisplay")=="summary"?I:B;J=J+(GH.Util.hasClassName("gh","gh-column-hidden")?1:0);var H=parseInt($("gh-issues").getStyle("padding-right").split("px")[0])+parseInt($("gh-issues").getStyle("padding-left").split("px")[0])+(O*M);var G=(Boards.isPlanningBoard()||Boards.is("ProjectBoard"))&&J>0?"#gh.gh-board-planning.gh-cards .gh-issue{width:"+((P-H)/J-F)+"px;}":"";var N=Boards.is("TaskBoard")&&J>0?"#gh.gh-board-task .gh-cards .gh-issue{width:"+(((P-H)/J)/O-K)+"px;}":"";if(Prototype.Browser.IE){var A=new Element("style",{type:"text/css"});A.styleSheet.cssText=G+N;$("js-cardwidth").update(A)}else{GH.Util.write("js-cardwidth","<style type='text/css'>"+G+N+"</style>")}}};this.changeBoard=function(A){Boards.working();Boards.submit(A)};this.changeView=function(A){Boards.getBoard(A).selectBoard()};this.changeTaskBoard=function(A){Boards.working();Boards.submit("SetPlainTaskBoard",$H({plain:A}))};this.changeReleased=function(){Boards.submit($F("releasedType"))};this.relocate=function(A,B){Boards.destroy();window.location=this.ctx+"/secure/"+Boards.type(true)+".jspa?selectedProjectId="+A+(B?"&selectedBoardId="+B:"")+($("configTab")?"&configTab="+$F("configTab"):"")};this.closeIFrame=function(B,A){Boards.updater("confirmation","CloseIFrame",$H({id:B,displayedTime:A}),true,Boards.success)};this.viewIssue=function(A,B){if(Prototype.Browser.WebKit&&B&&B.isMiddleClick()){return true}else{Boards.updater("confirmation","GetIssue",$H({key:A}),true,Boards.doneWorking);return false}};this.updatePBar=function(){Boards.updater("pBar","UpdatePBar",$H({}),true,Boards.doneWorking)};this.editIssue=function(A){Boards.updater("confirmation","GHEditIssue",$H({id:A}),false,Boards.success)};this.newSubTask=function(D,F,C,E){var A=C?Boards.getFieldValues("new"):[[],[]];var B=Boards.getFieldValues("forced");E=E?E:($("subType")?$F("subType"):"");Boards.updater("confirmation","GHAddIssue",$H({key:D,issueType:E,fieldsKeys:A[0].slice(0,-1),fieldsValues:A[1].slice(0,-3),forcedFieldsKeys:B[0].slice(0,-1),forcedFieldsValues:B[1].slice(0,-3),createNext:F}),true,Boards.success)};this.newIssue=function(F,C,E){var A=C?Boards.getFieldValues("new"):[[],[]];var B=Boards.getFieldValues("forced");E=E?E:($("issueType")?$F("issueType"):"");var D=C&&Ranking.relativeIssue?Ranking.relativeIssue:Boards.focussedBoard().firstSelection();Boards.updater("confirmation","GHAddIssue",$H({issueType:E,relativeIssueKey:D,fieldsKeys:A[0].slice(0,-1),fieldsValues:A[1].slice(0,-3),forcedFieldsKeys:B[0].slice(0,-1),forcedFieldsValues:B[1].slice(0,-3),createNext:F}),true,Boards.success)};this.pushValues=function(A,B,C){$$("*[id^=newField_]").each(function(G){var H=G.readAttribute("fieldId");if(A.indexOf(H)>=0){if($(G).nodeName=="SELECT"&&$(G).getAttribute("multiple")!=null){var D=$(G).options;var F=Encoder.htmlDecode(B[A.indexOf(H)]).split(",");for(var E=0;E<D.length;E++){if(F.indexOf(D[E].value)>=0){D[E].selected="selected"}}}else{$(G).value=Encoder.htmlDecode(B[A.indexOf(H)])}if(C){$(G).disabled=C;GH.Util.hide("edit_"+H)}}})};this.createIssue=function(C,D){var A=Boards.getFieldValues("new");var B=Boards.getFieldValues("forced");Boards.updater("popuperrors","GHCreateNewIssue",$H({key:C,issueType:($("issueType")?$F("issueType"):$F("subType")),fieldsKeys:A[0].slice(0,-1),fieldsValues:A[1].slice(0,-3),forcedFieldsKeys:B[0].slice(0,-1),forcedFieldsValues:B[1].slice(0,-3),createNext:D}),true,Boards.success)};this.getFieldValues=function(C){var A="";var B="";$$("*[id^="+C+"Field_]").each(function(E){var F=E.readAttribute("fieldId");if(F!=null&&typeof $F(E)!="undefined"){A+=F+",";var D=$F(E).constructor===Array?Boards.getMSValue(E):$F(E);B+=(D==""?" ":D)+"@%@"}});return[A,B]};this.synch=function(){Boards.submit("Synch")};this.doAction=function(A){Boards.updater("confirmation",A,$H({}),true,Boards.doneWorking)};this.cardUpdated=function(B,A){if(A.id.startsWith("marker_")){Boards.updater("confirmation","MarkerUpdating",$H({fieldId:A.id.split("marker_")[1],dropBoardId:B,selectedBoardId:Boards.focussedBoard().id}),false,Boards.success)}else{GH.Util.hide(A);Boards.updater("confirmation","Updating",$H({issueKeys:Boards.draggedIssue.board.selectedIssuesQueryString(),dropBoardId:B,selectedBoardId:Boards.draggedIssue.board.id}),true,Boards.doneWorking)}};this.lastDrop=function(A){Boards.focussedBoard().getIssueAt(Boards.focussedBoard().issues.size()).cardDropped(A,true)};this.addSelectedSubs=function(B){B=!B?"":B+",";var C=$$('input[class^="js-subbox"]');for(var A=0;A<C.size();A++){if(C[A].checked==true){B=B+C[A].value+(A<C.size()-1?", ":"")}}C=null;return B};this.allSubs=function(B){var C=$$('input[class^="js-subbox"]');for(var A=0;A<C.length;A++){if(Element.getHeight(C[A])>0){C[A].checked=B}}};this.updatingPStatus=function(A){Boards.updater("confirmation","UpdatingStatus",$H({key:A}),false,Boards.success)};this.updatingStatus=function(B,A){if(Boards.draggedIssue.board.id!=B){GH.Util.hide(A);Boards.draggedIssue.updatingStatus(B)}};this.refreshSearchStats=function(B,A){Boards.updater("search-column","RefreshSearchStats",$H({type:Boards.type(),inSearchMode:true,searchKey:B,searchType:A}),true,Boards.success)};this.retrieve=function(B,A,C){Boards.searchStart=0;Boards.inSearchMode=true;if(Boards.isPlanningBoard()){Boards.mainBoard.disableDrops()}else{if(Boards.is("TaskBoard")){Boards.boards.values().each(function(D){D.disableDrop()})}}GH.Util.write("confirmation","");$("searchType").value=A;Boards.updater("search","SearchBoard",$H({type:Boards.type(),searchKey:B,start:0,searchType:A,redirectType:C}),false,Boards.success)};this.search=function(B,A){if(GH.Util.trim($F(B))==""){return }Boards.retrieve($F(B),"query",A);$(B).value="";$(B).blur()};this.searchFor=function(D,B,A,C){Boards.searchStart=D;Boards.updater("search-results","SearchAgain",$H({type:Boards.type(),searchKey:B,start:D,searchType:A,redirectType:C}),true,Boards.doneWorking)};this.resetSearchInput=function(B,A){if(A||$(B+"In").value==""){GH.Util.show(B+"Label");$(B+"In").value=""}};this.cleanSearch=function(){Boards.inSearchMode=false;Boards.removeBoard(10);if(Boards.isPlanningBoard()){Boards.mainBoard.enableDrops()}else{if(Boards.is("TaskBoard")){Boards.boards.values().each(function(A){A.enableDrop()})}}Boards.searchStart=0;Boards.resetSearchInput("search",true);GH.Util.write("search","")};this.returnToSearch=function(){GH.Util.hideAll(["waiting","confirmation","opt_wait","popup_wait","search_wait"]);Boards.closeAJSPopup();GH.Util.write("confirmation","");GH.Util.showAll(["overlay","search"])};this.mimicSearch=function(B,A){if($(B).value==A){$(B).value=""}};this.showAJSPopup=function(C,B,A){Boards.doneWorking();if(Boards.inSearchMode){GH.Util.hideAll(["overlay","search"])}Boards.AJSpopup.gotoPage(C);Boards.AJSpopup.gotoPanel(B);Boards.AJSpopup.show();if(A){Boards.ffocus(A)}};this.closePopup=function(){Boards.closeAJSPopup();if(Boards.inSearchMode){Boards.cleanSearch()}if(Boards.needsRefresh){Boards.refreshAll()}else{Boards.doneWorking()}};this.newAJSPopup=function(C,A,B){Boards.closeAJSPopup();Boards.AJSpopup=new AJS.Dialog(C,A,B)};this.closeAJSPopup=function(){if(Boards.AJSpopup){Boards.AJSpopup.hide();Boards.AJSpopup.remove();Boards.AJSpopup=null}};this.getBoardForIssue=function(A,B,D){if(Boards.inSearchMode){Boards.cleanSearch()}Boards.working();Boards.colPagination.currentPage="0";var C=$H({type:B,key:A,commitedIn:(D?D:false),issueKeys:A});if(D){C=C.merge({selectedBoardId:"-1"})}Boards.submit("GetBoardForIssue",C)};this.manage=function(){Boards.submit("Manage")};this.addingVersion=function(){Boards.updater("confirmation","ManageVersion",$H({}),true,Boards.doneWorking)};this.addVersion=function(A){Boards.updater("query-results","GHCreateVersion",$H({name:$F("versionName"),masterId:$F("master"),releaseDate:$F("releaseDateIn"),endDate:$F("endDateIn"),date:$F("stratDateIn"),description:$F("versionDesc"),createNext:A?true:false}),true,Boards.success)};this.resetVersionInputs=function(){$("versionName").value=$("stratDateIn").value=$("endDateIn").value=$("releaseDateIn").value=$("versionDesc").value="";GH.Util.write("query-results","");Boards.ffocus("versionName");Boards.doneWorking()};this.reloadBoard=function(){Boards.submit(Boards.type(true))};this.enableCtxOpt=function(A,B){var C=$(A+"-sel-"+B);C.disabled=false;$$("#ctx-"+A+"-"+B+" [class*=js-options]").each(function(E){if(E.checked){C.disabled=true;C.options[0].selected=true;for(var D=1;D<C.options.length;D++){C.options[D].selected=false}throw $break}})};this.setCtx=function(A){Boards.updater("confirmation","SetCtx",$H({contextId:A}),true,Boards.success)};this.checkSortBy=function(){if(GH.Util.hasClassName("ctx-sort-"+$F("ctx-sort"),"js-rank")){$("ctx-order-true").checked=true;$("ctx-order-true").disabled=true;$("ctx-order-false").disabled=true}else{$("ctx-order-true").disabled=false;$("ctx-order-false").disabled=false}};this.deleteCtx=function(){Boards.updater("query-results","DeleteCtx",$H({}),true,Boards.success)};this.saveCtx=function(){Boards.updater("query-results","SaveCtx",$H({contextId:$F("ctx-id"),contextName:$F("ctx-name"),sortField:$F("ctx-sort"),sortOrder:($F("ctx-order-true")?"ASC":"DESC"),share:($("ctx-share")?$("ctx-share").checked:false),jiraFilter:Boards.getMSValue("jira-filter"),statusIds:Boards.getMSValue("status-sel-filter"),assignee:Boards.getMSValue("assign-sel-filter"),personalFilterOn:($F("personal-filter")?true:false),componentIds:Boards.getMSValue("component-filter"),unresolvedFilterOn:($F("unresolved-filter")?true:false),doneFilterOn:($F("done-filter")?true:false),typeIds:Boards.getMSValue("type-filter"),priorityIds:Boards.getMSValue("priority-filter"),jiraHilite:Boards.getMSValue("jira_highlight"),hiliteStatusIds:Boards.getMSValue("status-sel-highlight"),hiliteComponentIds:Boards.getMSValue("component-highlight"),hiliteUnresolvedFilterOn:($F("unresolved-highlight")?true:false),hiliteDoneFilterOn:($F("done-highlight")?true:false),hiliteTypeIds:Boards.getMSValue("type-highlight"),hilitePriorityIds:Boards.getMSValue("priority-highlight"),hiliteAssignee:Boards.getMSValue("assign-sel-highlight")}),true,Boards.success)};this.findIssue=function(A){return Boards.getBoard(A.split("_")[1]).findIssue(A)};this.focussedBoard=function(){return Boards.inSearchMode?this.boards.get(10):Boards.mainBoard};this.toggleMyIssues=function(){Boards.updater("confirmation","ToggleMyIssues",$H({}),true,Boards.refreshMain);Boards.refreshToggleBar()};this.toggleSubs=function(){Boards.updater("confirmation","ToggleSubs",$H({}),true,Boards.refreshMain);Boards.refreshToggleBar()};this.togglePending=function(){Boards.updater("confirmation","TogglePending",$H({}),true,Boards.refreshMain);Boards.refreshToggleBar()};this.refreshAll=function(){if(!Boards.is("TaskBoard")){Boards.mainBoard.refreshBreadcrumbs();Boards.mainBoard.refreshMainBoard();Boards.refreshColumn()}else{Boards.reloadBoard()}};this.refreshProjectcrumbs=function(){Boards.updater("gh-projectcrumbs","GHRefreshProjectcrumbs",$H({}),true,Boards.doneWorking)};this.refreshMain=function(){Boards.mainBoard.refreshMainBoard()};this.refreshColumn=function(A){Boards.boards.values().each(function(B){if(!B.isMain()){Boards.removeBoard(B.id)}});this.updater("gh_column_contents","RefreshColumn",$H({colPage:(A?A:Boards.colPagination.currentPage)}),true,Boards.doneWorking)};this.refreshToggleBar=function(){if($("assignedToMe")&&$("assignedToMe").checked||$("hide-subs")&&$("hide-subs").checked||$("toggle-pending")&&$("toggle-pending").checked){$("gh-mods").addClassName("gh-active")}else{$("gh-mods").removeClassName("gh-active")}};this.inavigator=function(B,A){if(Boards.inSearchMode){Boards.submit("SBIssueNavigator",$H({searchKey:$F("searchKey"),searchType:$F("searchType"),navInfo:(A?A:"")}))}else{Boards.submit((Boards.is("TaskBoard")?"TB":"PB")+"IssueNavigator",$H({dropBoardId:B,stepId:B,navInfo:(A?A:"")}))}};this.addCharCounter=function(E,A,B){var C=B?E:E;var D=B?"charCnt_"+E:"charCnt_"+E;Event.observe(C,"keydown",GH.Util.charCounter.bindAsEventListener(this,C,A,D));Event.observe(C,"keyup",GH.Util.charCounter.bindAsEventListener(this,C,A,D));GH.Util.write(D,(A-$F(C).length))};this.setIssueDisplay=function(A){Boards.mainBoard.setIssueDisplay(A)};this.toggleScreen=function(){if($("Screen_chk").className=="icon_l no-icon"){GH.Util.setClassName("Screen_chk","icon_l chkbtn");GH.Util.hide("header");Boards.request("FullScreen")}else{GH.Util.setClassName("Screen_chk","icon_l no-icon");GH.Util.show("header");Boards.request("NormalScreen")}};this.toggleLegend=function(A){if(!GH.Util.isVisible("gh-legend")){GH.Util.setClassName("Legend_chk","icon_l chkbtn");Boards.updater("gh-legend","GetLegend",$H({}),true,Boards.doneWorking)}else{GH.Util.hide("gh-legend");GH.Util.setClassName("Legend_chk","icon_l no-icon");Boards.request("CloseLegend")}};this.getPref=function(){Boards.updater("confirmation","GetUserPreferences",$H({}),true,Board.doneWorking)};this.savePref=function(){var A=$H({refreshRate:$F("rRate"),opacityRatio:$F("oRatio"),useJIRAIFrame:($F("JIRAIFrame")?true:false)});A=A.merge({maxVBIssues:$F("maxVBIssues")});A=A.merge({maxTBIssues:$F("maxTBIssues"),autoAssignOn:($("autoAssign")&&$F("autoAssign")?true:false),maxParents:($("maxParents")?$F("maxParents"):0)});A=A.merge({withDates:($F("withDates")?true:false),withForecast:($F("withForecast")?true:false),withLabels:($F("withLabels")?true:false),precision:$F("precision")});Boards.updater("query-results","SaveUserPreferences",A,true,Boards.doneWorking)};this.closePopups=function(){$$("[class*=closable]").each(function(A){GH.Util.hide(A)})};this.hideSpinner=function(){GH.Util.hide("waiting_display")};this.editLabel=function(C,B){var A=Boards.ctx+"/secure/popups/IssuePicker.jspa?";A+="formName="+C+"&";A+="linkFieldName="+B+"&";A+="currentIssue=false&";A+="singleSelectOnly=true&";A+="showSubTasks=false&";A+="showSubTasksParent=true&";A+="selectedProjectId="+Boards.selectedProjectId;Boards.winPicker=GH.Util.openWindow(A,"IssueSelectorPopup","status=no,resizable=yes,top=100,left=200,width=520,height=600,scrollbars=yes,resizable");Boards.winPicker.opener=self;Boards.winPicker.focus()};this.editCFU=function(C,A,B){GH.Util.switchView("cfEdit_"+C,"cfTxt_"+C);Boards.winPicker=GH.Util.openWindow(Boards.ctx+"/secure/popups/"+A+"Browser.jspa?formName=form_"+C+(B?"&multiSelect=true":"")+"&element=newField_CFSimpleIn_"+C,A);Boards.winPicker.opener=self;Boards.winPicker.focus()};this.getMSValue=function(D){var C="";var A=$F(D);for(var B=0;B<A.length;B++){C=C+A[B]+","}return A.length>0?C.substring(0,C.length-1):C};this.expandAllBoards=function(){var A="";Boards.boards.values().each(function(B){if(!B.isExpanded()){A=A+B.id+",";GH.Util.removeClassName(B.boxId,"hidden")}});if(A!=""){Boards.request("ToggleBox",$H({dropBoardIds:A.substring(0,A.length-1)}))}};this.colapseAllBoards=function(){var A="";Boards.boards.values().each(function(B){if(B.isExpanded()){A=A+B.id+",";GH.Util.addClassName(B.boxId,"hidden")}});if(A!=""){Boards.request("ToggleBox",$H({dropBoardIds:A.substring(0,A.length-1)}))}};this.toggleColumn=function(){if(GH.Util.hasClassName("gh","gh-column-hidden")){GH.Util.removeClassName("gh","gh-column-hidden")}else{GH.Util.addClassName("gh","gh-column-hidden")}Boards.screenSizeHandler();Boards.request("ToggleBox",$H({dropBoardIds:"col"}))};this.toggleAutoRefresh=function(){Boards.autoRefresh=$("Refresh_chk").className=="icon_l chkbtn";if(!Boards.autoRefresh){GH.Util.setClassName("Refresh_chk","icon_l chkbtn");Boards.request("StartRefresh")}else{GH.Util.setClassName("Refresh_chk","icon_l no-icon");Boards.request("StopRefresh")}Boards.autoRefresh=!Boards.autoRefresh;Boards.doRefresh(0,Boards.delay)};this.doRefresh=function(B,A){if(!Boards.autoRefresh){return }if(B<A||GH.Util.innerValue("confirmation")!=""||Boards.inSearchMode||Boards.AJSpopup!=null){setTimeout("Boards.doRefresh("+(B+1)+","+A+")",1000)}else{Boards.reloadBoard()}};this.doClick=function(A){Boards.clickCount++;setTimeout(function(){if(Boards.clickCount%2==1){Boards.clickCount=0;A()}},250);return true};this.getIssueAt=function(B,A){var C;B.each(function(D){if(D.index==A){C=D;throw $break}});return C};this.batchUpdate=function(B,A,C){Boards.updater("confirmation","Update",$H({issueKeys:Boards.addSelectedSubs(C),dropBoardId:A,selectedBoardId:B}),true,Boards.doneWorking)};this.working=function(){Boards.closeAJSPopup();Boards.createDialog();GH.Util.hideAll(["confirmation","search"]);GH.Util.showAll(["overlay","dialog","waiting_display","opt_wait","popup_wait","search_wait"])};this.doneWorking=function(){Boards.success();if(Boards.inSearchMode){GH.Util.switchView("search","waiting_display")}else{GH.Util.write("confirmation","");setTimeout("GH.Util.hideAll(['overlay', 'dialog'])",200)}if(Boards.callCount<1){Boards.callCount=0;GH.Util.hideAll(["opt_wait","popup_wait","search_wait"])}};this.success=function(){Boards.callCount--};this.request=function(A,B){B=B?B:$H({});B=B.merge({decorator:"none",selectedProjectId:Boards.selectedProjectId,type:Boards.type()});new Ajax.Request(Boards.ctx+"/secure/"+A+".jspa",{method:"post",parameters:B.toQueryString()})};this.updater=function(E,C,D,B,A){Boards.callCount++;D=D?D:$H({});D=D.merge({decorator:"none",selectedProjectId:Boards.selectedProjectId});if(D.get("type")==null){D=D.merge({type:Boards.type()})}if(D.get("selectedBoardId")==null){D=D.merge({selectedBoardId:Boards.mainBoard.id})}if(!Boards.is("TaskBoard")&&D.get("colPage")==null){D=D.merge({colPage:Boards.colPagination.currentPage})}if(Boards.inSearchMode&&D.get("searchKey")==null){D=D.merge({inSearchMode:true,searchKey:$F("searchKey"),searchType:$F("searchType")})}if(!B){Boards.closePopups();Boards.working()}else{GH.Util.showAll(["opt_wait","popup_wait","search_wait"])}new Ajax.Updater(E,Boards.ctx+"/secure/"+C+".jspa",{method:"post",parameters:D.toQueryString(),evalScripts:true,onSuccess:function(F){if(A){A.call(this,F)}}})};this.submit=function(B,C,A){C=C?C:$H({});if(C.get("type")==null){C=C.merge({type:Boards.type()})}if(C.get("selectedProjectId")==null){C=C.merge({selectedProjectId:Boards.selectedProjectId})}if(C.get("selectedBoardId")==null){C=C.merge({selectedBoardId:Boards.mainBoard.id})}if(Boards.is("TaskBoard")&&C.get("start")==null){C=C.merge({start:Boards.mainBoard.start()})}if(!Boards.is("TaskBoard")&&C.get("colPage")==null){C=C.merge({colPage:Boards.colPagination.currentPage})}if($("configTab")&&C.get("configTab")==null){C=C.merge({configTab:$F("configTab")})}GH.Util.showAll(["opt_wait","popup_wait","search_wait"]);document.forms.GHForm.action=Boards.ctx+"/secure/"+B+".jspa?"+C.toQueryString()+(A?"#"+A:"");Boards.destroy();document.forms.GHForm.submit()};this.createDialog=function(){if(!$("overlay")){var B=document.createElement("div");B.id="dialog";B.style.display="none";B.innerHTML="<div id=waiting_display>&nbsp;</div><div id=confirmation align=center style='display:none;'></div><div id=search align=center style='display:none;'></div>";document.body.insertBefore(B,$("header"));var A=document.createElement("div");A.id="overlay";A.className="gh-overlay";A.style.display="none";document.body.insertBefore(A,$("dialog"))}};this.destroy=function(){Boards.colPagination.clean();$$('span[class^="js-page-drop"] span').each(function(A){Droppables.remove(A)});Boards.boards.keys().each(function(A){Boards.removeBoard(A)});delete Boards.colPagination;delete Boards.cookies;delete Boards.boards};this.type=function(A){if(Boards.inSearchMode){return(A?"SearchBoard":"SB")}else{if(Boards.is("VersionBoard")){return(A?"VersionBoard":"VB")}else{if(Boards.is("ProjectBoard")){return(A?"ProjectBoard":"PB")}else{if(Boards.is("ComponentBoard")){return(A?"ComponentBoard":"CB")}else{if(Boards.is("AssigneeBoard")){return(A?"AssigneeBoard":"AB")}else{if(Boards.is("TaskBoard")){return(A?"TaskBoard":"TB")}else{if(Boards.is("ChartBoard")){return(A?"ChartBoard":"CCB")}else{if(Boards.is("ArchiveChartBoard")){return(A?"ArchiveChartBoard":"ACB")}else{if(Boards.is("ReleaseNotesBoard")){return(A?"ReleaseNotesBoard":"RB")}else{return(A?"Configuration":"")}}}}}}}}}};this.registerPageEvents=function(){GH.Util.addClassName(document.body,"nl");if(Calendar&&!Calendar._TT.WEEKEND){Calendar._TT.WEEKEND="0,6"}if(Calendar&&!Calendar._TT.DAY_FIRST){Calendar._TT.DAY_FIRST="Display %s first"}Event.observe(document.body,"mouseup",Boards.closePopups);if(!Boards.is("ConfigurationBoard")){Event.observe(document,"keydown",Boards.escapeHandler);Event.observe(window,"resize",Boards.screenSizeHandler);Event.observe(document.body,"mouseup",function(){GH.Util.switchView("gh-paginate","gh-mods-bar")})}}};var Page=Class.create();Page.prototype={initialize:function(A){this.id=A;this.issues=$H();this.selectedIssues=$H();this.focussedIssues=$H();this.start=-1;this.pageLocked=false;this.paginationId=this.containerId="Page_"+this.id;this.idxCorr},addIssue:function(F,C,E,D,B){if(this.start!=F||Boards.draggedIssue==null){return }var A=this.issues.set(D,new Issue(C+this.idxCorr,E,D,this,false,true,"window",false,B));if(this.issues.size()>1){A.enableDrop()}return A},load:function(B){this.pageLocked=true;if(this.start!=B||(Boards.draggedIssue!=null&&this.issues.size()==0)){this.clean();this.start=B;var A=$(this.containerId)?$(this.containerId):$(this.paginationId);if(A){A.id=this.paginationId+"-c-"+B;this.containerId=A.id;this.idxCorr=B>Boards.getBoard(this.id).start()?10000:-10000;$$("#gh-pagines span[class*=gh-pointer]").each(function(C){GH.Util.addClassName(C,"hidden")});GH.Util.hide(A);GH.Util.write(A,"");Boards.updater(A.id,"Get"+(Boards.is("TaskBoard")?"TB":"PB")+"Page",$H({start:this.start,stepId:this.id}),true,Boards.success)}}else{if($(this.paginationId+"-"+this.start+"-dd")){this.show(B)}}},show:function(E){GH.Util.hide("opt_wait");var B=$(this.containerId);var C=$(this.paginationId+"-"+this.start+"-dd");if(!B||!C||GH.Util.isVisible(B)){return }B.show();var D=$(this.paginationId+"-"+this.start+"-dd-s");$$("#Page_"+this.id+"-"+this.start+" span[class*=gh-pointer]").each(function(F){GH.Util.removeClassName(F,"hidden")});if(!GH.Util.hasClassName(D,"gh-shadow")){var A=C.getHeight()+Boards.ISSUE_PADDING;C.setStyle({height:A+"px"});D.setStyle({top:"0px",left:"-8px",width:(C.getWidth()+16)+"px",height:(A+14)+"px"});D.innerHTML='<div class="tl"></div><div class="tr"></div><div class="l" style="height:'+(A-8)+'px;"></div><div class="r" style="height:'+(A-8)+'px;"></div><div class="bl"></div><div class="br"></div><div class="b" style="width:'+(C.getWidth()-12)+'px;"></div>';GH.Util.setClassName(D,"gh-shadow");GH.Util.addClassName(this.paginationId+"-"+this.start,"gh-drop-hover");if(Boards.draggedIssue!=null){Droppables.add(C.id,{accept:["gh-issue-wrapper"],triggerIn:function(F){return },triggerOut:function(F){return },hoverclass:"js-rank-page"});Boards.getBoard(this.id).disableDrops()}}this.autoHidePage(E)},autoHidePage:function(A){if(this.start==A){if(this.isLocked()){setTimeout("Boards.getBoard('"+this.id+"').page.autoHidePage("+A+");",500)}else{this.hide()}}},hide:function(){var A=$(this.containerId);if(!A||!GH.Util.isVisible(A)){return }$$("#Page_"+this.id+"-"+this.start+" span[class*=gh-pointer]").each(function(B){GH.Util.addClassName(B,"hidden")});A.hide();this.clean()},notifyPage:function(A){this.pageLocked=A},isLocked:function(){return this.pageLocked||GH.Util.hasClassName(this.paginationId+"-"+this.start+"-dd","js-page")||GH.Util.hasClassName(this.paginationId+"-"+this.start+"-dd","js-rank-page")},getIssue:function(A){return this.issues.get(A)},getIssueAt:function(A){return Boards.getIssueAt(this.issues.values(),A)},findIssue:function(A){return this.getIssue(A.split("_")[2])},cardDropped:function(A){var C=this.start;var B=Boards.getBoard(this.id);this.hide();Boards.updater("confirmation","PageRank",$H({issueKeys:B.selectedIssuesQueryString(),pageRankStart:C,start:B.start()}),true,Boards.doneWorking)},clean:function(){if(this.start>-1){GH.Util.removeClassName(this.paginationId+"-"+this.start,"gh-drop-hover");if(this.issues.size()>0){this.start=-1;Boards.getBoard(this.id).enableDrops();var A=this.issues;this.issues.each(function(B){A.unset(B.key).clear()})}Droppables.remove($(this.paginationId+"-"+this.start+"-dd"))}}};var Board=Class.create();Board.prototype={initialize:function(A){this.id=A;this.boxId=Boards.selectedProjectId+"_"+this.id;this.dropId=Boards.is("TaskBoard")?"gh-step_"+this.id:"drop_"+this.id;this.page=new Page(A);this.issues=$H();this.selectedIssues=$H();this.focussedIssues=$H()},enableDrop:function(){if(!this.isMain()){var A=this.id;Droppables.remove($(this.dropId));Droppables.add(this.dropId,{accept:["gh-marker","gh-issue-wrapper"],onDrop:function(B){if(Boards.isPlanningBoard()){Boards.cardUpdated(A,B)}else{Boards.updatingStatus(A,B)}},hoverclass:"gh-target-hover"})}},disableDrop:function(){Droppables.remove($(this.dropId))},batchMove:function(A){Boards.updater("confirmation","Move",$H({key:A,issueKeys:Boards.addSelectedSubs(),start:this.start()}),true,Boards.doneWorking)},start:function(){return $("start_"+this.id)?$F("start_"+this.id):"0"},addIssue:function(B,A,G,I,C,H,D,F){var E=this.issues.set(G,new Issue(B,A,G,this,I,C,H,D,F));E.enableAll();return E},getIssue:function(A){return this.issues.get(A)},getIssueAt:function(A){return Boards.getIssueAt(this.issues.values(),A)},findIssue:function(B){var A=this.getIssue(B.split("_")[2]);return A?A:this.page.getIssue(B.split("_")[2])},selectedIssuesQueryString:function(){if(!Boards.draggedIssue){return""}var A="";this.selectedIssues.values().each(function(B){GH.Util.hide(B.cKey);A=A+B.key+","});return A.substring(0,A.length-1)},printChart:function(){GH.Util.openWindow(Boards.ctx+"/secure/"+Boards.type()+"PrintChart.jspa?decorator=none&selectedProjectId="+Boards.selectedProjectId+"&selectedBoardId="+this.id+"&chartType="+$F("chartType")+"&fieldId="+($("chartField")?$F("chartField"):"")+"&forMaster="+($("forMaster")?$F("forMaster"):false),"GreenHopper")},showReport:function(){window.location=Boards.ctx+"/secure/"+Boards.type()+"ShowChartReport.jspa?decorator=none&selectedProjectId="+Boards.selectedProjectId+"&selectedBoardId="+this.id+"&chartType="+$F("chartType")+"&fieldId="+($("chartField")?$F("chartField"):"")+"&forMaster="+($("forMaster")?$F("forMaster"):false)},printCards:function(){GH.Util.openWindow(Boards.ctx+"/secure/Print.jspa?decorator=none&selectedProjectId="+Boards.selectedProjectId+"&selectedBoardId="+this.id+"&start="+this.start()+"&type="+Boards.type(),"GreenHopper")},setCurveVisibility:function(A){Boards.updater("confirmation","SetCurveVisible",$H({curveVisible:($F("visible_"+A)?true:false),curveId:A}),true,Boards.doneWorking)},setCurveColor:function(B,A){Boards.updater("confirmation","SetCurveColor",$H({color:A,curveId:B}),true,Boards.doneWorking)},setChart:function(B,A,C){Boards.updater("confirmation",Boards.type()+"SetChartSelection",$H({chartType:B,fieldId:A,forMaster:C}),true,Boards.doneWorking)},setChartType:function(A){this.setChart(A,$("chartField")?$F("chartField"):"",$("forMaster")?$F("forMaster"):false)},setChartField:function(A){this.setChart($F("chartType"),A,$("forMaster")?$F("forMaster"):false)},setChartMaster:function(A){this.setChart($F("chartType"),$("chartField")?$F("chartField"):"",A)},toggle:function(){if(this.isExpanded()){GH.Util.addClassName(this.boxId,"hidden")}else{GH.Util.removeClassName(this.boxId,"hidden")}Boards.request("ToggleBox",$H({dropBoardIds:this.id}))},isExpanded:function(){return !GH.Util.hasClassName(this.boxId,"hidden")},toggleColumn:function(){Boards.working();Boards.submit("ToggleColumn",$H({stepId:this.id}))},initColumns:function(A){if(this.resizeColumn(A)&&this.getIssue(A)){this.getIssue(A).setVisibility()}},resizeColumn:function(D){var C=this.id+"_"+D+"_children";if($(C)){var B=(!Boards.isCompactView()?(D=="orphans"?28:3):0);var A=($(C).getHeight()-B)+"px";$$("#"+C+" [class*=js-step-col]").each(function(E){E.style.minHeight=A});return true}return false},resizeAll:function(){this.issues.values().each(function(A){if(!A.board.resizeColumn(A.key)){throw $break}})},enableRanking:function(A){if(A){Droppables.add("EoL_"+this.id,{accept:["gh-issue-wrapper"],onDrop:function(B){Boards.lastDrop(B)},hoverclass:"x"})}else{Droppables.remove($("EoL_"+this.id))}},disableDrops:function(){this.enableRanking(false);this.issues.values().each(function(A){Droppables.remove($(A.cKey))})},enableDrops:function(){this.enableRanking(true);this.issues.values().each(function(A){A.enableDrop()})},notifyPage:function(A){this.page.notifyPage(A)},isMain:function(){return this.id==Boards.mainBoard.id},colapseAll:function(){this.issues.values().each(function(A){A.colapseSubs()})},expandAll:function(){this.issues.values().each(function(A){A.expandSubs()})},editMaster:function(){Boards.updater("masterEdit_"+this.id,"EditMaster",$H({dropBoardId:this.id}),true,Boards.doneWorking)},cancelMaster:function(){GH.Util.switchView("masterTxt_"+this.id,"masterEdit_"+this.id)},updateMaster:function(){Boards.updater("confirmation","SetMaster",$H({dropBoardId:this.id,masterId:$F("masterIn_"+this.id)}),true,Boards.doneWorking)},release:function(A){Boards.updater("confirmation","Release",$H({dropBoardId:($("swap")&&$F("swap")?$F("swapVersion"):""),confirmed:A}),true,Boards.doneWorking)},getNWDays:function(){Boards.updater("confirmation","NWDays",$H({dropBoardId:this.id}),true,Boards.doneWorking)},addNWDay:function(A){if(!$F("nwDate")){return }Boards.updater("gh-nwd","PBAddNWDay",$H({dropBoardId:this.id,nonWorkingDay:$F("nwDate"),refresh:A}),true,Boards.doneWorking)},removeNWDay:function(A,B){Boards.updater("gh-nwd","PBRemoveNWDay",$H({dropBoardId:this.id,nonWorkingDay:A,refresh:B}),true,Boards.doneWorking)},resetNWDInputs:function(A){Boards.needsRefresh=A;GH.Util.write("query-results","");$("nwDate").value=""},gotoMarker:function(A){Boards.updater("confirmation","Goto"+Boards.type()+"Marker",$H({dropBoardId:this.id,fieldId:A,start:this.start()}),true,Boards.doneWorking)},setMarker:function(A,B){Boards.updater("confirmation","SetMarker",$H({fieldId:A,start:this.start(),markerValue:(B?B:$F("marker_"+A+"In"))}),true,Boards.doneWorking)},moveMarker:function(E,B,C,A,D){if(B!="EoL"&&!this.issues.get(B)){if(this.isMain()){this.refreshMainBoard(B)}else{this.selectBoard(B)}}else{if(B=="EoL"){$("mainBoard_"+this.id).appendChild($("marker_"+E))}else{$("mainBoard_"+this.id).insertBefore($("marker_"+E),$(this.issues.get(B).cKey))}$("marker_"+E).setAttribute("position",B);$("marker_"+E+"In").value=C;GH.Util.write("marker_"+E+"Txt",A);if(D){GH.Util.addClassName("marker_"+E+"Lbl","marker-capacity-set")}else{GH.Util.removeClassName("marker_"+E+"Lbl","marker-capacity-set")}}},setIssueDisplay:function(A){Boards.working();Boards.submit("SetIssueDisplay",$H({issueDisplay:A,start:this.start()}))},selectBoard:function(B){if(this.isMain()){return }var A=Boards.mainBoard;Boards.mainBoard=this;A.clean();A.enableDrop();GH.Util.removeClassName(A.dropId,"gh-selected");GH.Util.addClassName(Boards.mainBoard.dropId,"gh-selected");this.refreshBreadcrumbs();this.refreshMainBoard()},refreshBreadcrumbs:function(){if(!Boards.is("TaskBoard")){Boards.updater("gh-breadcrumbs",Boards.type()+"RefreshBreadcrumbs",$H({selectedBoardId:this.id}),true,Boards.doneWorking)}},refreshMainBoard:function(B,A){if(!Boards.is("TaskBoard")){this.clean();Boards.updater("gh-issues",Boards.type()+"RefreshBoard",$H({selectedBoardId:this.id,start:(B!=null?B:this.start()),issueKeys:(A?A:"")}),true,Boards.doneWorking)}else{Boards.reloadBoard()}},refreshBox:function(A){Boards.updater("box_"+this.id,Boards.type()+"RefreshDrop",$H({dropBoardId:this.id,selectedBoardId:Boards.mainBoard.id}),true,Boards.doneWorking)},refreshStepBoard:function(A){this.clearIssues();Boards.updater("gh-step_"+this.id,"RefreshStep",$H({stepId:this.id,stepStart:(A?A:this.start())}),true,Boards.doneWorking)},refreshParentStep:function(A){Boards.submit("TaskBoard",$H({selectedBoardId:this.id,start:A}))},clean:function(){this.page.hide();this.page.clean();$$("span[class*=js-page-drop]").each(function(A){Droppables.remove(A)});Droppables.remove($("drop_"+this.id));Droppables.remove($("EoL_"+this.id));this.clearIssues()},clearIssues:function(){var B=this.issues;var C=this.selectedIssues;var A=this.focussedIssues;this.issues.each(function(D){C.unset(D.key);A.unset(D.key);B.unset(D.key).clear()})},showNotesInputs:function(C,B){var A=this.notesFields(B);if($("gh-rn-fields")&&C){A=A+","+$F("gh-rn-fields")}GH.Util.hideAll(["gh-bc-charttype","gh-bc-fields","gh-bc-master"]);Boards.updater("gh-issues","RNSetField",$H({type:"RN",includeSubs:($("gh-rn-subs")?$("gh-rn-subs").checked:false),fields:A}),true,Boards.doneWorking)},showNotesText:function(A){new Boards.updater("gh-issues","RNCreate",$H({type:"RN",includeSubs:($("gh-rn-subs")?$("gh-rn-subs").checked:false),fields:this.notesFields(),withTxtArea:A}),true,Boards.doneWorking)},showNotesPermlink:function(){window.location=Boards.ctx+"/secure/RunPortlet.jspa?portletKey=com.pyxis.greenhopper.jira:greenhopper-releasenotes&projectid="+Boards.selectedProjectId+"&fields="+this.notesFields()+"&versionId="+this.id+"&includeSubs="+($("gh-rn-subs")?$("gh-rn-subs").checked:false)},notesFields:function(B){var A="";$$('span[class*="js-rn-fields"]').each(function(C){if(!B||GH.Util.innerValue(C)!=B){A=A+","+GH.Util.innerValue(C)}});return A},hierarchy:function(){Boards.submit("ConfigureReport",$H({decorator:"",reportKey:"com.pyxis.jira.links.hierarchy.reports:pyxis.hierarchy.report.version",versionId:this.id,linkTypeId:Boards.linkId,subtasks:true,hierarchyView:"tree",orphans:true,Next:"Next"}))},focusOrFind:function(A){if(this.getIssue(A)){this.focusOn([A],true)}else{Boards.getBoardForIssue(A,Boards.type(),true)}},getDescription:function(){Boards.updater("confirmation","GetDescription",$H({}),true,Boards.doneWorking)},getColCapacity:function(){Boards.updater("confirmation","GetTBCapacity",$H({stepId:this.id}),true,Boards.doneWorking)},setColCapacity:function(A){GH.Util.show("Stats_wait");Boards.updater("statistics-table","SetTBCapacity",$H({stepId:this.id,fieldId:A,maxCapacity:$F(A+"_max"),minCapacity:$F(A+"_min")}),true,Boards.doneWorking)},editCapacity:function(A){if(!GH.Util.hasClassName(A+"_"+this.id,"js-link")){return }GH.Util.write(A+"_"+this.id+"_edit","");Boards.updater(A+"_"+this.id+"_edit","EditCapacity",$H({dropBoardId:this.id,fieldId:A}),true,Boards.success)},setCapacity:function(A){Boards.updater("confirmation","SetCapacity",$H({dropBoardId:this.id,fieldId:A,minCapacity:$F(A+"_"+this.id+"_min"),maxCapacity:$F(A+"_"+this.id+"_max")}),false,Boards.success)},cancelCapacity:function(A){GH.Util.switchView(A+"_"+this.id,A+"_"+this.id+"_edit")},firstSelection:function(){return this.selectedIssues.size()>0?this.selectedIssues.values()[0].key:""},focusOn:function(C,A){this.unfocus(true,true);for(var B=0;B<C.size();B++){if(this.issues.get(C[B])){this.issues.get(C[B]).doFocus(A);A=false}}},unfocus:function(B,D,C){var A=this.id;Boards.boards.values().each(function(E){E.focussedIssues.values().each(function(F){F.unfocus()});if(E.id!=A){E.selectedIssues.values().each(function(F){if(F.key!=C){F.unfocus()}})}else{if(B&&D){E.selectedIssues.values().each(function(F){if(F.key!=C){F.unfocus()}})}}})},editDate:function(A){GH.Util.setValueWithHTML(A+"In_"+this.id,A+"Date_"+this.id);GH.Util.switchView(A+"Edit_"+this.id,A+"Txt_"+this.id)},cancelDate:function(A){GH.Util.switchView(A+"Txt_"+this.id,A+"Edit_"+this.id)},updateDate:function(A){Boards.updater("confirmation","Set"+A+"Date",$H({dropBoardId:this.id,date:$F(A+"In_"+this.id)}),true,Boards.doneWorking)},editName:function(){GH.Util.setValueWithHTML("nameIn_"+this.id,"name_"+this.id);GH.Util.switchView("nameEdit_"+this.id,"nameTxt_"+this.id)},cancelName:function(){GH.Util.switchView("nameTxt_"+this.id,"nameEdit_"+this.id)},doneMoving:function(){var A=this;$$("#mainBoard_"+this.id+' [class^="js-mkr"]').each(function(B){A.gotoMarker(B.id.split("marker_")[1])});Boards.doneWorking()},cancel:function(B,A){if(Boards.inSearchMode){if(A){Boards.retrieve($F("searchKey"),$F("searchType"),Boards.type())}else{this.focusOn(B);Boards.returnToSearch()}}else{Boards.needsRefresh=A;this.focusOn(B);Boards.closePopup()}},updateName:function(){if(GH.Util.trim($F("nameIn_"+this.id))==""){return }Boards.updater("confirmation","Name",$H({dropBoardId:this.id,name:$F("nameIn_"+this.id)}),true,Boards.doneWorking)}};var Issue=Class.create();Issue.prototype={initialize:function(B,A,G,C,I,D,H,E,F){this.board=C;this.id=A;this.key=G;this.cKey="gh-issue_"+C.id+"_"+G;this.grabber="gh-grab_"+C.id+"_"+G;this.dragElement;this.parentIssue;this.parentKey=F?F:"";this.index=B;this.draggable=I;this.rankable=D;this.scrollId=H;this.selectable=E;this.height;this.setZIndex()},enableMenu:function(){if($("gh-menu_"+this.board.id+"_"+this.key)){AJS.$("#gh-menu_"+this.board.id+"_"+this.key).dropDown()}},setZIndex:function(){if((!Boards.is("TaskBoard")||Prototype.Browser.IE)&&$(this.cKey)){$(this.cKey).style.zIndex=Math.max(0,999-this.index)}},disableAll:function(){GH.Util.find("#"+this.cKey+" div[class*=js-link] a",false).each(function(A){Event.stopObserving(A)});Droppables.remove($(this.cKey));Draggables.unregister($(this.cKey));if(this.dragElement){this.dragElement.destroy();this.dragElement=null}},enableAll:function(){this.disableAll();this.enableDrop();this.enableDrag();this.enableMenu();this.enableLinks()},enableDrag:function(){if(!this.rankable&&!this.draggable){return }var B="";if(this.rankable&&Boards.isListView()&&Boards.inSearchMode){B="vertical"}else{if(this.draggable&&Boards.is("TaskBoard")){B="horizontal"}}var A=this;this.dragElement=new Draggable(this.cKey,{handle:this.grabber,scroll:(this.scrollId=="window"?window:$(this.scrollId)),ghosting:false,reverteffect:function(C){$(C).setStyle({left:"0px",top:"0px"})},revert:true,constraint:B,onStart:function(C,D){A.cardMoved(D,C.element)},onEnd:function(C,D){A.cardStopped(D,C.element)}})},enableDrop:function(){if(!this.rankable){return }Droppables.remove($(this.cKey));var A=this;Droppables.add(this.cKey,{accept:["gh-issue-wrapper"],onDrop:function(B){A.cardDropped(B)},hoverclass:(Boards.isListView()||this.board instanceof Page?null:"gh-target-hover")})},enableLinks:function(){GH.Util.find("#"+this.cKey+" div[class*=js-link] a",false).each(function(A){Event.observe(A,"mouseout",function(){GH.Util.addClassName(A.parentNode,"js-link")});Event.observe(A,"mouseover",function(){GH.Util.removeClassName(A.parentNode,"js-link")})})},isSubtask:function(){return this.parentKey!=""},getSubtasks:function(){if(this.isSubtask()){return[]}var C=0;var B=[];var A=this.key;this.board.issues.values().each(function(D){if(D.parentKey==A){B[C++]=D}});return B.sortBy(function(D){return D.index})},getParent:function(){if(this.parentIssue==null){this.parentIssue=this.board.getIssue(this.parentKey)}return this.parentIssue},move:function(B){var A=Boards.focussedBoard().getIssue(B);if(A.parentKey!=this.parentKey){return }else{if(A.index<this.index){this.moveBefore(A)}else{this.moveAfter(A)}}},moveBefore:function(B){var A=this.index;$("mainBoard_"+this.board.id).insertBefore($(this.cKey),$(B.cKey));B.board.issues.values().each(function(C){if(C.index<A&&C.index>=B.index){C.index++;C.setZIndex()}});this.index=B.index-1;this.setZIndex();this.moveSubs(B);this.doFocus()},moveAfter:function(C){var A=this.index;var B=C.getSubtasks();C=B.size()>0?B.last():C;if(C.board.issues.size()==C.index){$("mainBoard_"+this.board.id).appendChild($(this.cKey))}else{$("mainBoard_"+this.board.id).insertBefore($(this.cKey),$(C.cKey).nextSibling)}C.board.issues.values().each(function(D){if(D.index>A&&D.index<=C.index){D.index--;D.setZIndex()}});this.index=C.index+1;this.setZIndex();this.moveSubs(C);this.doFocus()},moveSubs:function(B){if(!this.isSubtask()){var A=this;this.getSubtasks().each(function(C){if(A.board.issues.size()==A.index){$("mainBoard_"+C.board.id).appendChild($(C.cKey))}else{$("mainBoard_"+C.board.id).insertBefore($(C.cKey),$(A.cKey).nextSibling)}B.board.issues.values().each(function(D){if(B.index<C.index&&D.index<C.index&&D.index>A.index){D.index++}else{if(D.index>C.index&&D.index<=A.index){D.index--}}D.setZIndex()});C.index=A.index+1;C.setZIndex();A=C;C.doFocus()})}},toggleSubs:function(){if(!$("colapse_"+this.key)){return }if(GH.Util.hasClassName("colapse_"+this.key,"gh-open")){this.colapseSubs()}else{this.expandSubs()}},colapseSubs:function(){Boards.cookies.setData(this.id,"1");GH.Util.addClassName("colapse_"+this.key,"gh-close");GH.Util.removeClassName("colapse_"+this.key,"gh-open");this.getSubtasks().each(function(A){GH.Util.addClassName(A.cKey,"hidden")});GH.Util.addClassName(this.board.id+"_"+this.key+"_toggle","hidden")},expandSubs:function(){Boards.cookies.removeData(this.id);GH.Util.addClassName("colapse_"+this.key,"gh-open");GH.Util.removeClassName("colapse_"+this.key,"gh-close");this.getSubtasks().each(function(A){GH.Util.removeClassName(A.cKey,"hidden")});GH.Util.removeClassName(this.board.id+"_"+this.key+"_toggle","hidden")},setVisibility:function(){if(this.isSubtask()&&!this.getParent()){return }var A=this.isSubtask()?this.parentKey:this.key;if($("colapse_"+A)){GH.Util.show("colapse_"+A);if(Boards.cookies.getData(this.isSubtask()?this.getParent().id:this.id)){if(GH.Util.hasClassName("colapse_"+A,"gh-open")){GH.Util.addClassName("colapse_"+A,"gh-close");GH.Util.removeClassName("colapse_"+A,"gh-open")}if(this.isSubtask()){GH.Util.addClassName(this.cKey,"hidden")}else{GH.Util.addClassName(this.board.id+"_"+this.key+"_toggle","hidden")}}}},doAction:function(A){this.issueUpdater(A)},doDelete:function(){this.issueUpdater("Delete",$H({}),"query-results")},toggleFlag:function(){this.doAction((!Boards.inSearchMode&&Boards.is("TaskBoard")?"TB":"")+"Flag")},updatingStatus:function(A){Boards.updater("confirmation","UpdatingStatus",$H({key:this.key,stepId:this.board.id,newStepId:A}),false,Boards.success)},updateStatus:function(D){var A=jQuery("input[name=tx]:checked");if(A.size()==0){return }var B=A.val();var C=$H({id:this.id,action:B,stepId:this.board.id,newStepId:D});if($("resolution_"+B)){C=C.merge({resolution:$F("resolution_"+B)})}if($("remaining")){C=C.merge({resetRemaining:($F("remaining")?true:false)})}Boards.updater("confirmation","UpdateStatus",C,false,Boards.success)},updateStatusWithInputs:function(B,D){var C=$H({id:this.id,action:B,stepId:this.board.id,newStepId:D});var A=Boards.getFieldValues("new");C=C.merge({fieldsKeys:A[0].slice(0,-1),fieldsValues:A[1].slice(0,-3)});if($("resolution_"+B)){C=C.merge({resolution:$F("resolution_"+B)})}if($("remaining")){C=C.merge({resetRemaining:($F("remaining")?true:false)})}Boards.updater("popuperrors","UpdateStatusWithInputs",C,false,Boards.success)},updateResolution:function(){var A=$H({resolution:$F("resolutionIn_"+this.key)});if($("remaining")){A=A.merge({resetRemaining:($F("remaining")?true:false)})}this.issueUpdater((Boards.is("TaskBoard")?"TB":"")+"Resolution",A)},editField:function(A){if(!GH.Util.hasClassName("txt_"+this.board.id+"_"+this.key+"_"+A,"js-link")){return }this.cancelEdit();GH.Util.addClassName(this.cKey,"gh-edit-active");GH.Util.addClassName(this.board.id+"_"+this.key+"_"+A,"gh-edit-active");this.issueUpdater((!Boards.inSearchMode&&Boards.is("TaskBoard")?"TB":"")+"EditField",$H({fieldId:A}),"edit_"+this.board.id+"_"+this.key+"_"+A)},editCFU:function(C,A,B){this.editCFS(C);C=this.key+"_"+C;Boards.winPicker=GH.Util.openWindow(Boards.ctx+"/secure/popups/"+A+"Browser.jspa?formName=form_"+C+(B?"&multiSelect=true":"")+"&element=cfIn_"+C,A);Boards.winPicker.opener=self;Boards.winPicker.focus()},updatingField:function(A){this.issueUpdater((!Boards.inSearchMode&&Boards.is("TaskBoard")?"TB":"")+"UpdatingField",$H({fieldId:A}))},updateField:function(B,C){var A="in_"+this.board.id+"_"+this.key+"_"+B;if(!Boards.inSearchMode&&(B=="fixVersions"&&Boards.is("VersionBoard")||B=="components"&&Boards.is("ComponentBoard")||B=="assignee"&&Boards.is("AssigneeBoard"))){Boards.updater("confirmation","Updating",$H({issueKeys:this.key,fieldId:B,dropBoardId:(C?C:$F(A)),selectedBoardId:this.board.id}),false,Boards.success)}else{this.issueUpdater((!Boards.inSearchMode&&Boards.is("TaskBoard")?"TB":"")+"UpdateField",$H({fieldId:B,fieldValue:(C?C:$F(A))}))}},updatePField:function(A){this.issueUpdater((!Boards.inSearchMode&&Boards.is("TaskBoard")?"TB":"")+"UpdatePField",$H({fieldId:A,fieldValue:$F("newField_"+A)}),"query-results")},addingComment:function(){this.issueUpdater((!Boards.inSearchMode&&Boards.is("TaskBoard")?"TB":"GH")+"AddingComment")},addComment:function(A){Boards.updater("query-results",(!Boards.inSearchMode&&Boards.is("TaskBoard")?"TB":"GH")+"AddComment",$H({key:this.key,stepId:this.board.id,comment:$F($("commentIn")),commentLevel:$F($("commentLevel"))}),true,Boards.success)},showFieldEdit:function(A,B){if(B){Calendar.setup({firstDay:0,inputField:"in_"+this.board.id+"_"+this.key+"_"+A,button:"dpicker_"+this.board.id+"_"+this.key+"_"+A,align:"Tl",singleClick:true,ifFormat:B,positionStyle:"absolute"})}GH.Util.switchView("edit_"+this.board.id+"_"+this.key+"_"+A,"txt_"+this.board.id+"_"+this.key+"_"+A);Boards.ffocus("in_"+this.board.id+"_"+this.key+"_"+A)},editLogWork:function(){this.cancelEdit();this.issueUpdater((!Boards.inSearchMode&&Boards.is("TaskBoard")?"TBLogging":"Logging"))},logWork:function(){Boards.updater("query-results","GHLogWork",$H({key:this.key,stepId:this.board.id,comment:$F("commentLogIn"),timeLogged:($("logIn")?$F("logIn"):""),estimate:($("estimateIn")?$F("estimateIn"):""),logDate:($("logDateIn")?$F("logDateIn"):"")}),true,Boards.success)},buildMenu:function(){var C="gh-menu_"+this.board.id+"_"+this.key;GH.Util.show(C);var B=$(C+"-dd").getWidth();var A=$(C+"-dd").getHeight();$(C+"-dd-s").setStyle({display:"block",width:(B+16)+"px",height:(A+14)+"px",left:"0px"});$(C+"-dd-s").innerHTML='<div class="tl" style="left: 1px;"></div><div class="tr"></div><div class="l" style="height:'+(A-8)+'px;left: 1px;"></div><div class="r" style="height:'+(A-8)+'px;"></div><div class="bl"></div><div class="br"></div><div class="b" style="width:'+(B-12)+'px;"></div>'},openMenu:function(){this.cancelEdit();if(GH.Util.innerValue("gh-menu_"+this.board.id+"_"+this.key)==""){this.issueUpdater("Get"+Boards.type()+"CardMenu",$H({}),"gh-menu_"+this.board.id+"_"+this.key)}else{GH.Util.show("gh-menu_"+this.board.id+"_"+this.key)}},issueUpdater:function(B,C,A){GH.Util.hide("gh-menu_"+this.board.id+"_"+this.key);C=C?C:$H({});C=C.merge($H({key:this.key,id:this.id,stepId:this.board.id}));Boards.updater((A?A:"confirmation"),B,C,true,Boards.doneWorking)},cancelEdit:function(){Try.these(function(){if(Boards.winPicker){Boards.winPicker.close()}});GH.Util.removeClassName(this.cKey,"gh-edit-active");var A=this.cKey;$$("#"+this.cKey+' [class*="js-fedit"]').each(function(B){GH.Util.removeClassName(B.parentNode.id,"gh-edit-active");GH.Util.hide(B)});$$("#"+this.cKey+' [class*="js-ftext"]').each(function(B){GH.Util.show(B)})},cardMoved:function(B,A){Boards.draggedIssue=this;if(Prototype.Browser.IE){document.onselectstart=function(){return false}}if(this.isSelected()){if(this.board.selectedIssues.size()>1){var C=$("gh-move-count");GH.Util.write($$("#gh-move-count em")[0],this.board.selectedIssues.size()-1);GH.Util.insertTop($$("#"+this.cKey+" [class^=gh-issue-related]")[0],C);GH.Util.addClassName(this.cKey,"gh-move-many");GH.Util.show("gh-move-count")}}else{this.board.unfocus(true,true);this.select()}GH.Util.addClassName(this.cKey,"gh-move-main")},cardStopped:function(){if(Prototype.Browser.IE){document.onselectstart=function(){return true}}Boards.draggedIssue=null;GH.Util.removeClassName(this.cKey,"gh-move-main");GH.Util.removeClassName(this.cKey,"gh-move-many");GH.Util.hide("gh-move-count");this.board.selectedIssues.values().each(function(A){GH.Util.removeClassName(A.cKey,"gh-move-other")})},activate:function(){this.board.notifyPage(true);if(Boards.draggedIssue.index-this.index==-1){return false}else{if(Boards.draggedIssue.index<this.index){if(this.parentKey!=Boards.draggedIssue.parentKey){if(this.isSubtask()){return false}else{var A=this.board.getIssueAt(this.index-1);if(!A||A.parentKey!=Boards.draggedIssue.parentKey){return false}}}else{var A=this.board.getIssueAt(this.index-1);if(A&&A.parentKey==Boards.draggedIssue.key){return false}}}else{if(this.parentKey!=Boards.draggedIssue.parentKey){return false}}}$(this.cKey).style.paddingTop=Boards.ISSUE_PADDING+"px"},cardDropped:function(A,D){var C="Rank";var E=this;if(Boards.draggedIssue.isSubtask()){if(Boards.draggedIssue.parentKey==E.key){return }else{if(E.isSubtask()){if(Boards.draggedIssue.parentKey!=E.parentKey){C="Moving";E=E.getParent()}else{if(!D&&Boards.isListView()&&Boards.draggedIssue.index-E.index<-1){E=E.board.getIssueAt(E.index-1)}}}else{var B=!D&&Boards.isListView()&&Boards.draggedIssue.index-E.index<-1;if(B){E=E.board.getIssueAt(E.index-1)}if(!E.isSubtask()||Boards.draggedIssue.parentKey!=E.parentKey){C="Moving";if(B){var G=E.board.getIssueAt(E.index+1);E=G.isSubtask()?E:G}}}}}else{if(!D&&Boards.isListView()&&Boards.draggedIssue.index-E.index<-1){E=E.board.getIssueAt(E.index-1)}E=E.isSubtask()?E.getParent():E}if(!E||E.isSelected()){return }if(C=="Rank"){$$('[class^="js-mkr"]').each(function(H){if(D||Boards.draggedIssue.key==$(H.id).readAttribute("position")){$(H.id).setAttribute("position","")}})}var F="";if(E.board instanceof Page){F=E.board.start;E.board.hide()}Boards.updater("confirmation",C,$H({id:E.id,issueKeys:Boards.draggedIssue.board.selectedIssuesQueryString(),start:Boards.mainBoard.start(),pageRankStart:F}),true,Boards.doneWorking)},deactivate:function(){this.board.notifyPage(false);$(this.cKey).style.paddingTop=""},doFocus:function(A){this.cancelEdit();if(this.isSubtask()){if(Boards.isPlanningBoard()||Boards.isCompactView()){if(GH.Util.hasClassName("colapse_"+this.parentKey,"gh-close")){this.getParent().expandSubs()}}else{if($("colapse_"+this.parentKey)){Boards.mainBoard.getIssue(this.parentKey).expandSubs()}}}GH.Util.addClassName(this.cKey,"gh-highlight");this.board.focussedIssues.set(this.key,this);if(this.board.selectedIssues.unset(this.key)){GH.Util.removeClassName(this.cKey,"gh-select")}GH.Util.show(this.cKey);if(A){window.location.hash=this.cKey}},unfocus:function(){if(this.board.focussedIssues.unset(this.key)){GH.Util.removeClassName(this.cKey,"gh-highlight")}if(this.board.selectedIssues.unset(this.key)){GH.Util.removeClassName(this.cKey,"gh-select")}},isSelectable:function(){if(!this.selectable){return false}return this.board.selectedIssues.size()==0||this.board.selectedIssues.values()[0].parentKey==this.parentKey},select:function(){if(this.isSelectable()){GH.Util.addClassName(this.cKey,"gh-select");this.board.selectedIssues.set(this.key,this);return true}return false},isSelected:function(){return this.board.selectedIssues.get(this.key)!=null},multiSelect:function(D){if((!Boards.is("TaskBoard")||Boards.inSearchMode)&&GH.Util.isSelectionModifier(D)){if(!this.isSelected()){this.board.unfocus(false,false);this.select()}else{this.unfocus()}}else{if((!Boards.is("TaskBoard")||Boards.inSearchMode)&&D.shiftKey&&!Prototype.Browser.IE){var E;var C;var A=this.board.issues.values().sortBy(function(F){return F.index});if(this.board.selectedIssues.size()>0){var B=this.board.selectedIssues.values().sortBy(function(F){return F.index});E=B[0];C=B[B.size()-1]}else{A.each(function(F){if(F.isSelected()){E=!E?F:E;C=F}})}if(!E){this.board.unfocus(true,true);this.selectIssues(A[0],A,!this.isSelected())}else{if(E.index==this.index||C.index==this.index){this.unfocus()}else{if(!C||E.index>this.index){this.board.unfocus(true,false);this.selectIssues(E,A,!this.isSelected())}else{if(C.index<this.index){this.board.unfocus(true,false);this.selectIssues(C,A,!this.isSelected())}else{this.board.unfocus(true,false);this.selectIssues(E.index-this.index>this.index-C.index?E:C,A,!this.isSelected())}}}}}else{this.board.unfocus(true,true,this.key);this.select()}}},selectIssues:function(D,C,A){var E=Math.min(D.index,this.index);var B=Math.max(D.index,this.index);C.each(function(F){if(F.index>=E&&F.index<=B){A?F.select():F.unfocus()}else{if(F.index>B){throw $break}}})},refresh:function(B,A){this.board.unfocus(true,true);if(!Boards.is("TaskBoard")&&$("gh-issue_"+this.board.id+"_"+this.parentKey)){this.getParent().issueUpdater("RefreshIssue",$H({id:this.getParent().id,stepId:this.board.id}),this.getParent().cKey)}this.issueUpdater((!Boards.inSearchMode&&Boards.is("TaskBoard")?"TB":"")+"RefreshIssue",$H({id:this.id,stepId:this.board.id}),this.cKey)},equals:function(A){return this.key==A.key},clear:function(){this.disableAll();this.parentIssue=null;this.board=null}};function getIssue(B,A){return Boards.getBoard(B).getIssue(A)}var Ranking=new function(){var A;this.getPage=function(C,D,G,B,H,E){var F=$H({fieldId:B,start:H});if($("ctx_"+B)){F=F.merge({contextName:$F("ctx_"+B)})}if($("newField_fixVersions")){F=F.merge({versionId:$F("newField_fixVersions")})}if(E){F=F.merge({parentKey:E})}new Boards.updater("RankPage_"+B,"GetRankPage",F,true,Boards.success)};this.setRank=function(F,G,E,D,C,B){GH.Util.switchView("RankPage_"+E+"Edit","RankPage_"+E+"Close");GH.Util.write("RankPage_"+E,"");GH.Util.write("RankValue_"+E,C);GH.Util.setValue(E,B);GH.Util.setValue("newField_"+E,B);Ranking.relativeIssue=D};this.closeRank=function(B){GH.Util.switchView("RankPage_"+B+"Edit","RankPage_"+B+"Close");GH.Util.write("RankPage_"+B,"")}};
