var Prototype={Version:"1.7",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/.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"),b=document.createElement("form"),a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},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(g){}}return c}};var Class=(function(){var d=(function(){for(var e in {toString:1}){if(e==="toString"){return false}}return true})();function a(){}function b(){var j=null,h=$A(arguments);if(Object.isFunction(h[0])){j=h.shift()}function e(){this.initialize.apply(this,arguments)}Object.extend(e,Class.Methods);e.superclass=j;e.subclasses=[];if(j){a.prototype=j.prototype;e.prototype=new a;j.subclasses.push(e)}for(var g=0,k=h.length;g<k;g++){e.addMethods(h[g])}if(!e.prototype.initialize){e.prototype.initialize=Prototype.emptyFunction}e.prototype.constructor=e;return e}function c(m){var h=this.superclass&&this.superclass.prototype,g=Object.keys(m);if(d){if(m.toString!=Object.prototype.toString){g.push("toString")}if(m.valueOf!=Object.prototype.valueOf){g.push("valueOf")}}for(var e=0,j=g.length;e<j;e++){var l=g[e],k=m[l];if(h&&Object.isFunction(k)&&k.argumentNames()[0]=="$super"){var n=k;k=(function(o){return function(){return h[o].apply(this,arguments)}})(l).wrap(n);k.valueOf=n.valueOf.bind(n);k.toString=n.toString.bind(n)}this.prototype[l]=k}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var E=Object.prototype.toString,D="Null",q="Undefined",x="Boolean",g="Number",u="String",J="Object",v="[object Function]",A="[object Boolean]",h="[object Number]",n="[object String]",j="[object Array]",z="[object Date]",k=window.JSON&&typeof JSON.stringify==="function"&&JSON.stringify(0)==="0"&&typeof JSON.stringify(Prototype.K)==="undefined";function m(L){switch(L){case null:return D;case (void 0):return q}var K=typeof L;switch(K){case"boolean":return x;case"number":return g;case"string":return u}return J}function B(K,M){for(var L in M){K[L]=M[L]}return K}function I(K){try{if(c(K)){return"undefined"}if(K===null){return"null"}return K.inspect?K.inspect():String(K)}catch(L){if(L instanceof RangeError){return"..."}throw L}}function F(K){return H("",{"":K},[])}function H(T,Q,R){var S=Q[T],P=typeof S;if(m(S)===J&&typeof S.toJSON==="function"){S=S.toJSON(T)}var M=E.call(S);switch(M){case h:case A:case n:S=S.valueOf()}switch(S){case null:return"null";case true:return"true";case false:return"false"}P=typeof S;switch(P){case"string":return S.inspect(true);case"number":return isFinite(S)?String(S):"null";case"object":for(var L=0,K=R.length;L<K;L++){if(R[L]===S){throw new TypeError()}}R.push(S);var O=[];if(M===j){for(var L=0,K=S.length;L<K;L++){var N=H(L,S,R);O.push(typeof N==="undefined"?"null":N)}O="["+O.join(",")+"]"}else{var U=Object.keys(S);for(var L=0,K=U.length;L<K;L++){var T=U[L],N=H(T,S,R);if(typeof N!=="undefined"){O.push(T.inspect(true)+":"+N)}}O="{"+O.join(",")+"}"}R.pop();return O}}function y(K){return JSON.stringify(K)}function l(K){return $H(K).toQueryString()}function r(K){return K&&K.toHTML?K.toHTML():String.interpret(K)}function t(K){if(m(K)!==J){throw new TypeError()}var L=[];for(var M in K){if(K.hasOwnProperty(M)){L.push(M)}}return L}function d(K){var L=[];for(var M in K){L.push(K[M])}return L}function C(K){return B({},K)}function w(K){return !!(K&&K.nodeType==1)}function o(K){return E.call(K)===j}var b=(typeof Array.isArray=="function")&&Array.isArray([])&&!Array.isArray({});if(b){o=Array.isArray}function e(K){return K instanceof Hash}function a(K){return E.call(K)===v}function p(K){return E.call(K)===n}function s(K){return E.call(K)===h}function G(K){return E.call(K)===z}function c(K){return typeof K==="undefined"}B(Object,{extend:B,inspect:I,toJSON:k?y:F,toQueryString:l,toHTML:r,keys:Object.keys||t,values:d,clone:C,isElement:w,isArray:o,isHash:e,isFunction:a,isString:p,isNumber:s,isDate:G,isUndefined:c})})();Object.extend(Function.prototype,(function(){var m=Array.prototype.slice;function d(q,n){var p=q.length,o=n.length;while(o--){q[p+o]=n[o]}return q}function k(o,n){o=m.call(o,0);return d(o,n)}function h(){var n=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return n.length==1&&!n[0]?[]:n}function j(p){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var n=this,o=m.call(arguments,1);return function(){var q=k(o,arguments);return n.apply(p,q)}}function g(p){var n=this,o=m.call(arguments,1);return function(r){var q=d([r||window.event],o);return n.apply(p,q)}}function l(){if(!arguments.length){return this}var n=this,o=m.call(arguments,0);return function(){var p=k(o,arguments);return n.apply(this,p)}}function e(p){var n=this,o=m.call(arguments,1);p=p*1000;return window.setTimeout(function(){return n.apply(n,o)},p)}function a(){var n=d([0.01],arguments);return this.delay.apply(this,n)}function c(o){var n=this;return function(){var p=d([n.bind(this)],arguments);return o.apply(this,p)}}function b(){if(this._methodized){return this._methodized}var n=this;return this._methodized=function(){var o=d([this],arguments);return n.apply(null,o)}}return{argumentNames:h,bind:j,bindAsEventListener:g,curry:l,delay:e,defer:a,wrap:c,methodize:b}})());(function(c){function b(){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"}function a(){return this.toISOString()}if(!c.toISOString){c.toISOString=b}if(!c.toJSON){c.toJSON=a}})(Date.prototype);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(){var NATIVE_JSON_PARSE_SUPPORT=window.JSON&&typeof JSON.parse==="function"&&JSON.parse('{"test": true}').test;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"),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()),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(){return this.replace(/-+(.)?/g,function(match,chr){return chr?chr.toUpperCase():""})}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 unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")}function isJSON(){var str=this;if(str.blank()){return false}str=str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@");str=str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");str=str.replace(/(?:^|:|,)(?:\s*\[)+/g,"");return(/^[\],:{}\s]*$/).test(str)}function evalJSON(sanitize){var json=this.unfilterJSON(),cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;if(cx.test(json)){json=json.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())}function parseJSON(){var json=this.unfilterJSON();return JSON.parse(json)}function include(pattern){return this.indexOf(pattern)>-1}function startsWith(pattern){return this.lastIndexOf(pattern,0)===0}function endsWith(pattern){var d=this.length-pattern.length;return d>=0&&this.indexOf(pattern,d)===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||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,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:NATIVE_JSON_PARSE_SUPPORT?parseJSON: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 g=d[1]||"";if(g=="\\"){return d[2]}var b=a,h=d[3],e=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;d=e.exec(h);if(d==null){return g}while(d!=null){var c=d[1].startsWith("[")?d[2].replace(/\\\\]/g,"]"):d[1];b=b[c];if(null==b||""==d[3]){break}h=h.substring("["==d[3]?d[1].length:d[0].length);d=e.exec(h)}return g+String.interpret(b)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function c(A,z){var y=0;try{this._each(function(C){A.call(z,C,y++)})}catch(B){if(B!=$break){throw B}}return this}function t(B,A,z){var y=-B,C=[],D=this.toArray();if(B<1){return D}while((y+=B)<D.length){C.push(D.slice(y,y+B))}return C.collect(A,z)}function b(A,z){A=A||Prototype.K;var y=true;this.each(function(C,B){y=y&&!!A.call(z,C,B);if(!y){throw $break}});return y}function k(A,z){A=A||Prototype.K;var y=false;this.each(function(C,B){if(y=!!A.call(z,C,B)){throw $break}});return y}function l(A,z){A=A||Prototype.K;var y=[];this.each(function(C,B){y.push(A.call(z,C,B))});return y}function v(A,z){var y;this.each(function(C,B){if(A.call(z,C,B)){y=C;throw $break}});return y}function j(A,z){var y=[];this.each(function(C,B){if(A.call(z,C,B)){y.push(C)}});return y}function h(B,A,z){A=A||Prototype.K;var y=[];if(Object.isString(B)){B=new RegExp(RegExp.escape(B))}this.each(function(D,C){if(B.match(D)){y.push(A.call(z,D,C))}});return y}function a(y){if(Object.isFunction(this.indexOf)){if(this.indexOf(y)!=-1){return true}}var z=false;this.each(function(A){if(A==y){z=true;throw $break}});return z}function s(z,y){y=Object.isUndefined(y)?null:y;return this.eachSlice(z,function(A){while(A.length<z){A.push(y)}return A})}function n(y,A,z){this.each(function(C,B){y=A.call(z,y,C,B)});return y}function x(z){var y=$A(arguments).slice(1);return this.map(function(A){return A[z].apply(A,y)})}function r(A,z){A=A||Prototype.K;var y;this.each(function(C,B){C=A.call(z,C,B);if(y==null||C>=y){y=C}});return y}function p(A,z){A=A||Prototype.K;var y;this.each(function(C,B){C=A.call(z,C,B);if(y==null||C<y){y=C}});return y}function e(B,z){B=B||Prototype.K;var A=[],y=[];this.each(function(D,C){(B.call(z,D,C)?A:y).push(D)});return[A,y]}function g(z){var y=[];this.each(function(A){y.push(A[z])});return y}function d(A,z){var y=[];this.each(function(C,B){if(!A.call(z,C,B)){y.push(C)}});return y}function o(z,y){return this.map(function(B,A){return{value:B,criteria:z.call(y,B,A)}}).sort(function(D,C){var B=D.criteria,A=C.criteria;return B<A?-1:B>A?1:0}).pluck("value")}function q(){return this.map()}function u(){var z=Prototype.K,y=$A(arguments);if(Object.isFunction(y.last())){z=y.pop()}var A=[this].concat(y).map($A);return this.map(function(C,B){return z(A.pluck(B))})}function m(){return this.toArray().length}function w(){return"#<Enumerable:"+this.toArray().inspect()+">"}return{each:c,eachSlice:t,all:b,every:b,any:k,some:k,collect:l,map:l,detect:v,findAll:j,select:j,filter:j,grep:h,include:a,member:a,inGroupsOf:s,inject:n,invoke:x,max:r,min:p,partition:e,pluck:g,reject:d,sortBy:o,toArray:q,entries:q,zip:u,size:m,inspect:w,find:v}})();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 t=Array.prototype,o=t.slice,q=t.forEach;function b(y,x){for(var w=0,z=this.length>>>0;w<z;w++){if(w in this){y.call(x,this[w],w,this)}}}if(!q){q=b}function n(){this.length=0;return this}function d(){return this[0]}function h(){return this[this.length-1]}function k(){return this.select(function(w){return w!=null})}function v(){return this.inject([],function(x,w){if(Object.isArray(w)){return x.concat(w.flatten())}x.push(w);return x})}function j(){var w=o.call(arguments,0);return this.select(function(x){return !w.include(x)})}function g(w){return(w===false?this.toArray():this)._reverse()}function m(w){return this.inject([],function(z,y,x){if(0==x||(w?z.last()!=y:!z.include(y))){z.push(y)}return z})}function r(w){return this.uniq().findAll(function(x){return w.detect(function(y){return x===y})})}function s(){return o.call(this,0)}function l(){return this.length}function u(){return"["+this.map(Object.inspect).join(", ")+"]"}function a(y,w){w||(w=0);var x=this.length;if(w<0){w=x+w}for(;w<x;w++){if(this[w]===y){return w}}return -1}function p(x,w){w=isNaN(w)?this.length:(w<0?this.length+w:w)+1;var y=this.slice(0,w).reverse().indexOf(x);return(y<0)?y:w-y-1}function c(){var B=o.call(this,0),z;for(var x=0,y=arguments.length;x<y;x++){z=arguments[x];if(Object.isArray(z)&&!("callee" in z)){for(var w=0,A=z.length;w<A;w++){B.push(z[w])}}else{B.push(z)}}return B}Object.extend(t,Enumerable);if(!t._reverse){t._reverse=t.reverse}Object.extend(t,{_each:q,clear:n,first:d,last:h,compact:k,flatten:v,without:j,reverse:g,uniq:m,intersect:r,clone:s,toArray:s,size:l,inspect:u});var e=(function(){return[].concat(arguments)[0][0]!==1})(1,2);if(e){t.concat=c}if(!t.indexOf){t.indexOf=a}if(!t.lastIndexOf){t.lastIndexOf=p}})();function $H(a){return new Hash(a)}var Hash=Class.create(Enumerable,(function(){function e(r){this._object=Object.isHash(r)?r.toObject():Object.clone(r)}function g(s){for(var r in this._object){var t=this._object[r],u=[r,t];u.key=r;u.value=t;s(u)}}function l(r,s){return this._object[r]=s}function c(r){if(this._object[r]!==Object.prototype[r]){return this._object[r]}}function o(r){var s=this._object[r];delete this._object[r];return s}function q(){return Object.clone(this._object)}function p(){return this.pluck("key")}function n(){return this.pluck("value")}function h(s){var r=this.detect(function(t){return t.value===s});return r&&r.key}function k(r){return this.clone().update(r)}function d(r){return new Hash(r).inject(this,function(s,t){s.set(t.key,t.value);return s})}function b(r,s){if(Object.isUndefined(s)){return r}return r+"="+encodeURIComponent(String.interpret(s))}function a(){return this.inject([],function(v,y){var u=encodeURIComponent(y.key),s=y.value;if(s&&typeof s=="object"){if(Object.isArray(s)){var x=[];for(var t=0,r=s.length,w;t<r;t++){w=s[t];x.push(b(u,w))}return v.concat(x)}}else{v.push(b(u,s))}return v}).join("&")}function m(){return"#<Hash:{"+this.map(function(r){return r.map(Object.inspect).join(": ")}).join(", ")+"}>"}function j(){return new Hash(this)}return{initialize:e,_each:g,set:l,get:c,unset:o,toObject:q,toTemplateReplacements:q,keys:p,values:n,index:h,merge:k,update:d,toQueryString:a,inspect:m,toJSON:q,clone:j}})());Hash.from=$H;Object.extend(Number.prototype,(function(){function d(){return this.toPaddedString(2,16)}function b(){return this+1}function j(l,k){$R(0,this,true).each(l,k);return this}function h(m,l){var k=this.toString(l||10);return"0".times(m-k.length)+k}function a(){return Math.abs(this)}function c(){return Math.round(this)}function e(){return Math.ceil(this)}function g(){return Math.floor(this)}return{toColorPart:d,succ:b,times:j,toPaddedString:h,abs:a,round:c,ceil:e,floor:g}})());function $R(c,a,b){return new ObjectRange(c,a,b)}var ObjectRange=Class.create(Enumerable,(function(){function b(g,d,e){this.start=g;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(g){if(Object.isFunction(g[d])){try{g[d].apply(g,[b,c,a])}catch(h){}}})}};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.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.isString(this.options.parameters)?this.options.parameters:Object.toQueryString(this.options.parameters);if(!["get","post"].include(this.method)){d+=(d?"&":"")+"_method="+this.method;this.method="post"}if(d&&this.method==="get"){this.url+=(this.url.include("?")?"&":"?")+d}this.parameters=d.toQueryParams();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(g){e[g.key]=g.value})}}for(var a in e){this.transport.setRequestHeader(a,e[a])}},success:function(){var a=this.getStatus();return !a||(a>=200&&a<300)||a==304},getStatus:function(){try{if(this.transport.status===1223){return 204}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 g=b.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&g&&g.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,g){this.updateContent(e.responseText);if(Object.isFunction(d)){d(e,g)}}).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(g,a){var c=[];var e=document.evaluate(g,$(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(!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){function d(g,e){if(g==="select"){return false}if("type" in e){return false}return true}var b=(function(){try{var e=document.createElement('<input name="x">');return e.tagName.toLowerCase()==="input"&&e.name==="x"}catch(g){return false}})();var a=c.Element;c.Element=function(h,g){g=g||{};h=h.toLowerCase();var e=Element.cache;if(b&&g.name){h="<"+h+' name="'+g.name+'">';delete g.name;return Element.writeAttribute(document.createElement(h),g)}if(!e[h]){e[h]=Element.extend(document.createElement(h))}var j=d(h,g)?e[h].cloneNode(false):document.createElement(h);return Element.writeAttribute(j,g)};Object.extend(c.Element,a||{});if(a){c.Element.prototype=a.prototype}})(this);Element.idCounter=1;Element.cache={};Element._purgeElement=function(b){var a=b._prototypeUID;if(a){Element.stopObserving(b);b._prototypeUID=void 0;delete Element.Storage[a]}};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 d=(function(){var h=document.createElement("select"),j=true;h.innerHTML='<option value="test">test</option>';if(h.options&&h.options[0]){j=h.options[0].nodeName.toUpperCase()!=="OPTION"}h=null;return j})();var b=(function(){try{var h=document.createElement("table");if(h&&h.tBodies){h.innerHTML="<tbody><tr><td>test</td></tr></tbody>";var k=typeof h.tBodies[0]=="undefined";h=null;return k}}catch(j){return true}})();var a=(function(){try{var h=document.createElement("div");h.innerHTML="<link>";var k=(h.childNodes.length===0);h=null;return k}catch(j){return true}})();var c=d||b||a;var g=(function(){var h=document.createElement("script"),k=false;try{h.appendChild(document.createTextNode(""));k=!h.firstChild||h.firstChild&&h.firstChild.nodeType!==3}catch(j){k=true}h=null;return k})();function e(m,n){m=$(m);var h=Element._purgeElement;var o=m.getElementsByTagName("*"),l=o.length;while(l--){h(o[l])}if(n&&n.toElement){n=n.toElement()}if(Object.isElement(n)){return m.update().insert(n)}n=Object.toHTML(n);var k=m.tagName.toUpperCase();if(k==="SCRIPT"&&g){m.text=n;return m}if(c){if(k in Element._insertionTranslations.tags){while(m.firstChild){m.removeChild(m.firstChild)}Element._getContentFromAnonymousElement(k,n.stripScripts()).each(function(p){m.appendChild(p)})}else{if(a&&Object.isString(n)&&n.indexOf("<link")>-1){while(m.firstChild){m.removeChild(m.firstChild)}var j=Element._getContentFromAnonymousElement(k,n.stripScripts(),true);j.each(function(p){m.appendChild(p)})}else{m.innerHTML=n.stripScripts()}}}else{m.innerHTML=n.stripScripts()}n.evalScripts.bind(n).defer();return m}return e})(),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,g,b,h;for(var a in e){d=e[a];a=a.toLowerCase();g=Element._insertionTranslations[a];if(d&&d.toElement){d=d.toElement()}if(Object.isElement(d)){g(c,d);continue}d=Object.toHTML(d);b=((a=="before"||a=="after")?c.parentNode:c).tagName.toUpperCase();h=Element._getContentFromAnonymousElement(b,d.stripScripts());if(a=="top"||a=="after"){h.reverse()}h.each(g.curry(c));d.evalScripts.bind(d).defer()}return c},wrap:function(b,c,a){b=$(b);if(Object.isElement(c)){$(c).writeAttribute(a||{})}else{if(Object.isString(c)){c=new Element(c,a)}else{c=new Element("div",c)}}if(b.parentNode){b.parentNode.replaceChild(c,b)}c.appendChild(b);return c},inspect:function(b){b=$(b);var a="<"+b.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(g){var e=g.first(),c=g.last(),d=(b[e]||"").toString();if(d){a+=" "+c+"="+d.inspect(true)}});return a+">"},recursivelyCollect:function(a,c,d){a=$(a);d=d||-1;var b=[];while(a=a[c]){if(a.nodeType==1){b.push(Element.extend(a))}if(b.length==d){break}}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(b){var a=[],c=$(b).firstChild;while(c){if(c.nodeType===1){a.push(Element.extend(c))}c=c.nextSibling}return a},previousSiblings:function(a,b){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){b=$(b);if(Object.isString(a)){return Prototype.Selector.match(b,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]:Prototype.Selector.find(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,c,a){b=$(b);if(Object.isNumber(c)){a=c,c=false}if(!Object.isNumber(a)){a=0}if(c){return Prototype.Selector.find(b.previousSiblings(),c,a)}else{return b.recursivelyCollect("previousSibling",a+1)[a]}},next:function(b,d,a){b=$(b);if(Object.isNumber(d)){a=d,d=false}if(!Object.isNumber(a)){a=0}if(d){return Prototype.Selector.find(b.nextSiblings(),d,a)}else{var c=Object.isNumber(a)?a+1:1;return b.recursivelyCollect("nextSibling",a+1)[a]}},select:function(a){a=$(a);var b=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(b,a)},adjacent:function(a){a=$(a);var b=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(b,a.parentNode).without(a)},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,g){e=$(e);var b={},d=Element._attributeTranslations.write;if(typeof c=="object"){b=c}else{b[c]=Object.isUndefined(g)?true:g}for(var a in b){c=d.names[a]||a;g=b[a];if(d.values[a]){c=d.values[a](e,g)}if(g===false||g===null){e.removeAttribute(c)}else{if(g===true){e.setAttribute(c,c)}else{e.setAttribute(c,g)}}}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},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},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),g=[0,0],c=null;b=$(b);if(Element.getStyle(b,"position")=="absolute"){c=Element.getOffsetParent(b);g=Element.viewportOffset(c)}if(c==document.body){g[0]-=document.body.offsetLeft;g[1]-=document.body.offsetTop}if(a.setLeft){b.style.left=(e[0]-g[0]+a.offsetLeft)+"px"}if(a.setTop){b.style.top=(e[1]-g[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"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(g,h){var j=d(b,h);return j===null?g:g-parseInt(j,10)})+"px";default:return d(b,c)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(c,a,b){if(b==="title"){return a.title}return c(a,b)})}else{if(Prototype.Browser.IE){Element.Methods.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 g(h){return h.replace(/alpha\([^\)]*\)/gi,"")}b=$(b);var a=b.currentStyle;if((a&&!a.hasLayout)||(!a&&b.style.zoom=="normal")){b.style.zoom=1}var d=b.getStyle("filter"),c=b.style;if(e==1||e===""){(d=g(d))?c.filter=d:c.removeAttribute("filter");return b}else{if(e<0.00001){e=0}}c.filter=g(d)+"alpha(opacity="+(e*100)+")";return b};Element._attributeTranslations=(function(){var b="className",a="for",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,g){var e=d.getAttributeNode(g);return e?e.value:""},_getEv:(function(){var d=document.createElement("div"),g;d.onclick=Prototype.emptyFunction;var e=d.getAttribute("onclick");if(String(e).indexOf("{")>-1){g=function(h,j){j=h.getAttribute(j);if(!j){return null}j=j.toString();j=j.split("{")[1];j=j.split("}")[0];return j.strip()}}else{if(e===""){g=function(h,j){j=h.getAttribute(j);if(!j){return null}return j.strip()}}}d=null;return g})(),_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,g;g=b[c];c++){if(g.tagName!=="!"){d.push(g)}}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}}}}}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 g=c.next(),a=Element._getContentFromAnonymousElement(b,e.stripScripts());d.removeChild(c);if(g){a.each(function(h){d.insertBefore(h,g)})}else{a.each(function(h){d.appendChild(h)})}}else{c.outerHTML=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(e,d,g){var h=new Element("div"),c=Element._insertionTranslations.tags[e];var a=false;if(c){a=true}else{if(g){a=true;c=["","",0]}}if(a){h.innerHTML="&nbsp;"+c[0]+d+c[1];h.removeChild(h.firstChild);for(var b=c[2];b--;){h=h.firstChild}}else{h.innerHTML=d}return $A(h.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(h){if(typeof window.Element!="undefined"){var k=window.Element.prototype;if(k){var m="_"+(Math.random()+"").slice(2),j=document.createElement(h);k[m]="x";var l=(j[m]!=="x");delete k[m];j=null;return l}}return false}function b(j,h){for(var l in h){var k=h[l];if(Object.isFunction(k)&&!(l in j)){j[l]=k.methodize()}}}var d=c("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(d){return function(j){if(j&&typeof j._extendedByPrototype=="undefined"){var h=j.tagName;if(h&&(/^(?:object|applet|embed)$/i.test(h))){b(j,Element.Methods);b(j,Element.Methods.Simulated);b(j,Element.Methods.ByTag[h.toUpperCase()])}}return j}}return Prototype.K}var a={},e=Element.Methods.ByTag;var g=Object.extend(function(k){if(!k||typeof k._extendedByPrototype!="undefined"||k.nodeType!=1||k==window){return k}var h=Object.clone(a),j=k.tagName.toUpperCase();if(e[j]){Object.extend(h,e[j])}b(k,h);k._extendedByPrototype=Prototype.emptyFunction;return k},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(a,Element.Methods);Object.extend(a,Element.Methods.Simulated)}}});g.refresh();return g})();if(document.documentElement.hasAttribute){Element.hasAttribute=function(a,b){return a.hasAttribute(b)}}else{Element.hasAttribute=Element.Methods.Simulated.hasAttribute}Element.addMethods=function(c){var k=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),BUTTON: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(m){m=m.toUpperCase();if(!Element.Methods.ByTag[m]){Element.Methods.ByTag[m]={}}Object.extend(Element.Methods.ByTag[m],c)}function a(o,n,m){m=m||false;for(var q in o){var p=o[q];if(!Object.isFunction(p)){continue}if(!m||!(q in n)){n[q]=p.methodize()}}}function e(p){var m;var o={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(o[p]){m="HTML"+o[p]+"Element"}if(window[m]){return window[m]}m="HTML"+p+"Element";if(window[m]){return window[m]}m="HTML"+p.capitalize()+"Element";if(window[m]){return window[m]}var n=document.createElement(p),q=n.__proto__||n.constructor.prototype;n=null;return q}var j=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(k.ElementExtensions){a(Element.Methods,j);a(Element.Methods.Simulated,j,true)}if(k.SpecificElementExtensions){for(var l in Element.Methods.ByTag){var g=e(l);if(Object.isUndefined(g)){continue}a(d[l],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(b){var h=Prototype.Browser,e=document,c,d={};function a(){if(h.WebKit&&!e.evaluate){return document}if(h.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body}return document.documentElement}function g(j){if(!c){c=a()}d[j]="client"+j;b["get"+j]=function(){return c[d[j]]};return b["get"+j]()}b.getWidth=g.curry("Width");b.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}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)},purge:function(c){if(!(c=$(c))){return}var a=Element._purgeElement;a(c);var d=c.getElementsByTagName("*"),b=d.length;while(b--){a(d[b])}return null}});(function(){function j(x){var w=x.match(/^(\d+)%?$/i);if(!w){return null}return(Number(w[1])/100)}function q(H,I,x){var A=null;if(Object.isElement(H)){A=H;H=A.getStyle(I)}if(H===null){return null}if((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(H)){return window.parseFloat(H)}var C=H.include("%"),y=(x===document.viewport);if(/\d/.test(H)&&A&&A.runtimeStyle&&!(C&&y)){var w=A.style.left,G=A.runtimeStyle.left;A.runtimeStyle.left=A.currentStyle.left;A.style.left=H||0;H=A.style.pixelLeft;A.style.left=w;A.runtimeStyle.left=G;return H}if(A&&C){x=x||A.parentNode;var z=j(H);var D=null;var B=A.getStyle("position");var F=I.include("left")||I.include("right")||I.include("width");var E=I.include("top")||I.include("bottom")||I.include("height");if(x===document.viewport){if(F){D=document.viewport.getWidth()}else{if(E){D=document.viewport.getHeight()}}}else{if(F){D=$(x).measure("width")}else{if(E){D=$(x).measure("height")}}}return(D===null)?0:D*z}return 0}function h(w){if(Object.isString(w)&&w.endsWith("px")){return w}return w+"px"}function l(x){var w=x;while(x&&x.parentNode){var y=x.getStyle("display");if(y==="none"){return false}x=$(x.parentNode)}return true}var d=Prototype.K;if("currentStyle" in document.documentElement){d=function(w){if(!w.currentStyle.hasLayout){w.style.zoom=1}return w}}function g(w){if(w.include("border")){w=w+"-width"}return w.camelize()}Element.Layout=Class.create(Hash,{initialize:function($super,x,w){$super();this.element=$(x);Element.Layout.PROPERTIES.each(function(y){this._set(y,null)},this);if(w){this._preComputing=true;this._begin();Element.Layout.PROPERTIES.each(this._compute,this);this._end();this._preComputing=false}},_set:function(x,w){return Hash.prototype.set.call(this,x,w)},set:function(x,w){throw"Properties of Element.Layout are read-only."},get:function($super,x){var w=$super(x);return w===null?this._compute(x):w},_begin:function(){if(this._prepared){return}var A=this.element;if(l(A)){this._prepared=true;return}var C={position:A.style.position||"",width:A.style.width||"",visibility:A.style.visibility||"",display:A.style.display||""};A.store("prototype_original_styles",C);var D=A.getStyle("position"),w=A.getStyle("width");if(w==="0px"||w===null){A.style.display="block";w=A.getStyle("width")}var x=(D==="fixed")?document.viewport:A.parentNode;A.setStyle({position:"absolute",visibility:"hidden",display:"block"});var y=A.getStyle("width");var z;if(w&&(y===w)){z=q(A,"width",x)}else{if(D==="absolute"||D==="fixed"){z=q(A,"width",x)}else{var E=A.parentNode,B=$(E).getLayout();z=B.get("width")-this.get("margin-left")-this.get("border-left")-this.get("padding-left")-this.get("padding-right")-this.get("border-right")-this.get("margin-right")}}A.setStyle({width:z+"px"});this._prepared=true},_end:function(){var x=this.element;var w=x.retrieve("prototype_original_styles");x.store("prototype_original_styles",null);x.setStyle(w);this._prepared=false},_compute:function(x){var w=Element.Layout.COMPUTATIONS;if(!(x in w)){throw"Property not found."}return this._set(x,w[x].call(this,this.element))},toObject:function(){var w=$A(arguments);var x=(w.length===0)?Element.Layout.PROPERTIES:w.join(" ").split(" ");var y={};x.each(function(z){if(!Element.Layout.PROPERTIES.include(z)){return}var A=this.get(z);if(A!=null){y[z]=A}},this);return y},toHash:function(){var w=this.toObject.apply(this,arguments);return new Hash(w)},toCSS:function(){var w=$A(arguments);var y=(w.length===0)?Element.Layout.PROPERTIES:w.join(" ").split(" ");var x={};y.each(function(z){if(!Element.Layout.PROPERTIES.include(z)){return}if(Element.Layout.COMPOSITE_PROPERTIES.include(z)){return}var A=this.get(z);if(A!=null){x[g(z)]=A+"px"}},this);return x},inspect:function(){return"#<Element.Layout>"}});Object.extend(Element.Layout,{PROPERTIES:$w("height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height"),COMPOSITE_PROPERTIES:$w("padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height"),COMPUTATIONS:{height:function(y){if(!this._preComputing){this._begin()}var w=this.get("border-box-height");if(w<=0){if(!this._preComputing){this._end()}return 0}var z=this.get("border-top"),x=this.get("border-bottom");var B=this.get("padding-top"),A=this.get("padding-bottom");if(!this._preComputing){this._end()}return w-z-x-B-A},width:function(y){if(!this._preComputing){this._begin()}var x=this.get("border-box-width");if(x<=0){if(!this._preComputing){this._end()}return 0}var B=this.get("border-left"),w=this.get("border-right");var z=this.get("padding-left"),A=this.get("padding-right");if(!this._preComputing){this._end()}return x-B-w-z-A},"padding-box-height":function(x){var w=this.get("height"),z=this.get("padding-top"),y=this.get("padding-bottom");return w+z+y},"padding-box-width":function(w){var x=this.get("width"),y=this.get("padding-left"),z=this.get("padding-right");return x+y+z},"border-box-height":function(x){if(!this._preComputing){this._begin()}var w=x.offsetHeight;if(!this._preComputing){this._end()}return w},"border-box-width":function(w){if(!this._preComputing){this._begin()}var x=w.offsetWidth;if(!this._preComputing){this._end()}return x},"margin-box-height":function(x){var w=this.get("border-box-height"),y=this.get("margin-top"),z=this.get("margin-bottom");if(w<=0){return 0}return w+y+z},"margin-box-width":function(y){var x=this.get("border-box-width"),z=this.get("margin-left"),w=this.get("margin-right");if(x<=0){return 0}return x+z+w},top:function(w){var x=w.positionedOffset();return x.top},bottom:function(w){var z=w.positionedOffset(),x=w.getOffsetParent(),y=x.measure("height");var A=this.get("border-box-height");return y-A-z.top},left:function(w){var x=w.positionedOffset();return x.left},right:function(y){var A=y.positionedOffset(),z=y.getOffsetParent(),w=z.measure("width");var x=this.get("border-box-width");return w-x-A.left},"padding-top":function(w){return q(w,"paddingTop")},"padding-bottom":function(w){return q(w,"paddingBottom")},"padding-left":function(w){return q(w,"paddingLeft")},"padding-right":function(w){return q(w,"paddingRight")},"border-top":function(w){return q(w,"borderTopWidth")},"border-bottom":function(w){return q(w,"borderBottomWidth")},"border-left":function(w){return q(w,"borderLeftWidth")},"border-right":function(w){return q(w,"borderRightWidth")},"margin-top":function(w){return q(w,"marginTop")},"margin-bottom":function(w){return q(w,"marginBottom")},"margin-left":function(w){return q(w,"marginLeft")},"margin-right":function(w){return q(w,"marginRight")}}});if("getBoundingClientRect" in document.documentElement){Object.extend(Element.Layout.COMPUTATIONS,{right:function(x){var y=d(x.getOffsetParent());var z=x.getBoundingClientRect(),w=y.getBoundingClientRect();return(w.right-z.right).round()},bottom:function(x){var y=d(x.getOffsetParent());var z=x.getBoundingClientRect(),w=y.getBoundingClientRect();return(w.bottom-z.bottom).round()}})}Element.Offset=Class.create({initialize:function(x,w){this.left=x.round();this.top=w.round();this[0]=this.left;this[1]=this.top},relativeTo:function(w){return new Element.Offset(this.left-w.left,this.top-w.top)},inspect:function(){return"#<Element.Offset left: #{left} top: #{top}>".interpolate(this)},toString:function(){return"[#{left}, #{top}]".interpolate(this)},toArray:function(){return[this.left,this.top]}});function t(x,w){return new Element.Layout(x,w)}function b(w,x){return $(w).getLayout().get(x)}function p(x){x=$(x);var B=Element.getStyle(x,"display");if(B&&B!=="none"){return{width:x.offsetWidth,height:x.offsetHeight}}var y=x.style;var w={visibility:y.visibility,position:y.position,display:y.display};var A={visibility:"hidden",display:"block"};if(w.position!=="fixed"){A.position="absolute"}Element.setStyle(x,A);var z={width:x.offsetWidth,height:x.offsetHeight};Element.setStyle(x,w);return z}function n(w){w=$(w);if(e(w)||c(w)||o(w)||m(w)){return $(document.body)}var x=(Element.getStyle(w,"display")==="inline");if(!x&&w.offsetParent){return $(w.offsetParent)}while((w=w.parentNode)&&w!==document.body){if(Element.getStyle(w,"position")!=="static"){return m(w)?$(document.body):$(w)}}return $(document.body)}function v(x){x=$(x);var w=0,y=0;if(x.parentNode){do{w+=x.offsetTop||0;y+=x.offsetLeft||0;x=x.offsetParent}while(x)}return new Element.Offset(y,w)}function r(x){x=$(x);var y=x.getLayout();var w=0,A=0;do{w+=x.offsetTop||0;A+=x.offsetLeft||0;x=x.offsetParent;if(x){if(o(x)){break}var z=Element.getStyle(x,"position");if(z!=="static"){break}}}while(x);A-=y.get("margin-top");w-=y.get("margin-left");return new Element.Offset(A,w)}function a(x){var w=0,y=0;do{w+=x.scrollTop||0;y+=x.scrollLeft||0;x=x.parentNode}while(x);return new Element.Offset(y,w)}function u(A){x=$(x);var w=0,z=0,y=document.body;var x=A;do{w+=x.offsetTop||0;z+=x.offsetLeft||0;if(x.offsetParent==y&&Element.getStyle(x,"position")=="absolute"){break}}while(x=x.offsetParent);x=A;do{if(x!=y){w-=x.scrollTop||0;z-=x.scrollLeft||0}}while(x=x.parentNode);return new Element.Offset(z,w)}function s(w){w=$(w);if(Element.getStyle(w,"position")==="absolute"){return w}var A=n(w);var z=w.viewportOffset(),x=A.viewportOffset();var B=z.relativeTo(x);var y=w.getLayout();w.store("prototype_absolutize_original_styles",{left:w.getStyle("left"),top:w.getStyle("top"),width:w.getStyle("width"),height:w.getStyle("height")});w.setStyle({position:"absolute",top:B.top+"px",left:B.left+"px",width:y.get("width")+"px",height:y.get("height")+"px"});return w}function k(x){x=$(x);if(Element.getStyle(x,"position")==="relative"){return x}var w=x.retrieve("prototype_absolutize_original_styles");if(w){x.setStyle(w)}return x}if(Prototype.Browser.IE){n=n.wrap(function(y,x){x=$(x);if(e(x)||c(x)||o(x)||m(x)){return $(document.body)}var w=x.getStyle("position");if(w!=="static"){return y(x)}x.setStyle({position:"relative"});var z=y(x);x.setStyle({position:w});return z});r=r.wrap(function(z,x){x=$(x);if(!x.parentNode){return new Element.Offset(0,0)}var w=x.getStyle("position");if(w!=="static"){return z(x)}var y=x.getOffsetParent();if(y&&y.getStyle("position")==="fixed"){d(y)}x.setStyle({position:"relative"});var A=z(x);x.setStyle({position:w});return A})}else{if(Prototype.Browser.Webkit){v=function(x){x=$(x);var w=0,y=0;do{w+=x.offsetTop||0;y+=x.offsetLeft||0;if(x.offsetParent==document.body){if(Element.getStyle(x,"position")=="absolute"){break}}x=x.offsetParent}while(x);return new Element.Offset(y,w)}}}Element.addMethods({getLayout:t,measure:b,getDimensions:p,getOffsetParent:n,cumulativeOffset:v,positionedOffset:r,cumulativeScrollOffset:a,viewportOffset:u,absolutize:s,relativize:k});function o(w){return w.nodeName.toUpperCase()==="BODY"}function m(w){return w.nodeName.toUpperCase()==="HTML"}function e(w){return w.nodeType===Node.DOCUMENT_NODE}function c(w){return w!==document.body&&!Element.descendantOf(w,document.body)}if("getBoundingClientRect" in document.documentElement){Element.addMethods({viewportOffset:function(w){w=$(w);if(c(w)){return new Element.Offset(0,0)}var x=w.getBoundingClientRect(),y=document.documentElement;return new Element.Offset(x.left-y.clientLeft,x.top-y.clientTop)}})}})();window.$$=function(){var a=$A(arguments).join(", ");return Prototype.Selector.select(a,document)};Prototype.Selector=(function(){function a(){throw new Error('Method "Prototype.Selector.select" must be defined.')}function c(){throw new Error('Method "Prototype.Selector.match" must be defined.')}function d(m,n,j){j=j||0;var h=Prototype.Selector.match,l=m.length,g=0,k;for(k=0;k<l;k++){if(h(m[k],n)&&j==g++){return Element.extend(m[k])}}}function e(j){for(var g=0,h=j.length;g<h;g++){Element.extend(j[g])}return j}var b=Prototype.K;return{select:a,match:c,find:d,extendElements:(Element.extend===b)?b:e,extendElement:Element.extend}})();Prototype._original_property=window.Sizzle;
/*
 * Sizzle CSS Selector Engine - v1.0
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var s=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,l=0,d=Object.prototype.toString,q=false,k=true;[0,0].sort(function(){k=false;return 0});var b=function(G,w,D,y){D=D||[];var e=w=w||document;if(w.nodeType!==1&&w.nodeType!==9){return[]}if(!G||typeof G!=="string"){return D}var E=[],F,B,K,J,C,v,u=true,z=r(w),I=G;while((s.exec(""),F=s.exec(I))!==null){I=F[3];E.push(F[1]);if(F[2]){v=F[3];break}}if(E.length>1&&m.exec(G)){if(E.length===2&&g.relative[E[0]]){B=h(E[0]+E[1],w)}else{B=g.relative[E[0]]?[w]:b(E.shift(),w);while(E.length){G=E.shift();if(g.relative[G]){G+=E.shift()}B=h(G,B)}}}else{if(!y&&E.length>1&&w.nodeType===9&&!z&&g.match.ID.test(E[0])&&!g.match.ID.test(E[E.length-1])){var L=b.find(E.shift(),w,z);w=L.expr?b.filter(L.expr,L.set)[0]:L.set[0]}if(w){var L=y?{expr:E.pop(),set:a(y)}:b.find(E.pop(),E.length===1&&(E[0]==="~"||E[0]==="+")&&w.parentNode?w.parentNode:w,z);B=L.expr?b.filter(L.expr,L.set):L.set;if(E.length>0){K=a(B)}else{u=false}while(E.length){var x=E.pop(),A=x;if(!g.relative[x]){x=""}else{A=E.pop()}if(A==null){A=w}g.relative[x](K,A,z)}}else{K=E=[]}}if(!K){K=B}if(!K){throw"Syntax error, unrecognized expression: "+(x||G)}if(d.call(K)==="[object Array]"){if(!u){D.push.apply(D,K)}else{if(w&&w.nodeType===1){for(var H=0;K[H]!=null;H++){if(K[H]&&(K[H]===true||K[H].nodeType===1&&j(w,K[H]))){D.push(B[H])}}}else{for(var H=0;K[H]!=null;H++){if(K[H]&&K[H].nodeType===1){D.push(B[H])}}}}}else{a(K,D)}if(v){b(v,e,D,y);b.uniqueSort(D)}return D};b.uniqueSort=function(u){if(c){q=k;u.sort(c);if(q){for(var e=1;e<u.length;e++){if(u[e]===u[e-1]){u.splice(e--,1)}}}}return u};b.matches=function(e,u){return b(e,null,null,u)};b.find=function(A,e,B){var z,x;if(!A){return[]}for(var w=0,v=g.order.length;w<v;w++){var y=g.order[w],x;if((x=g.leftMatch[y].exec(A))){var u=x[1];x.splice(1,1);if(u.substr(u.length-1)!=="\\"){x[1]=(x[1]||"").replace(/\\/g,"");z=g.find[y](x,e,B);if(z!=null){A=A.replace(g.match[y],"");break}}}}if(!z){z=e.getElementsByTagName("*")}return{set:z,expr:A}};b.filter=function(D,C,G,w){var v=D,I=[],A=C,y,e,z=C&&C[0]&&r(C[0]);while(D&&C.length){for(var B in g.filter){if((y=g.match[B].exec(D))!=null){var u=g.filter[B],H,F;e=false;if(A==I){I=[]}if(g.preFilter[B]){y=g.preFilter[B](y,A,G,I,w,z);if(!y){e=H=true}else{if(y===true){continue}}}if(y){for(var x=0;(F=A[x])!=null;x++){if(F){H=u(F,y,x,A);var E=w^!!H;if(G&&H!=null){if(E){e=true}else{A[x]=false}}else{if(E){I.push(F);e=true}}}}}if(H!==undefined){if(!G){A=I}D=D.replace(g.match[B],"");if(!e){return[]}break}}}if(D==v){if(e==null){throw"Syntax error, unrecognized expression: "+D}else{break}}v=D}return A};var g=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(A,e,z){var x=typeof e==="string",B=x&&!/\W/.test(e),y=x&&!B;if(B&&!z){e=e.toUpperCase()}for(var w=0,v=A.length,u;w<v;w++){if((u=A[w])){while((u=u.previousSibling)&&u.nodeType!==1){}A[w]=y||u&&u.nodeName===e?u||false:u===e}}if(y){b.filter(e,A,true)}},">":function(z,u,A){var x=typeof u==="string";if(x&&!/\W/.test(u)){u=A?u:u.toUpperCase();for(var v=0,e=z.length;v<e;v++){var y=z[v];if(y){var w=y.parentNode;z[v]=w.nodeName===u?w:false}}}else{for(var v=0,e=z.length;v<e;v++){var y=z[v];if(y){z[v]=x?y.parentNode:y.parentNode===u}}if(x){b.filter(u,z,true)}}},"":function(w,u,y){var v=l++,e=t;if(!/\W/.test(u)){var x=u=y?u:u.toUpperCase();e=p}e("parentNode",u,v,w,x,y)},"~":function(w,u,y){var v=l++,e=t;if(typeof u==="string"&&!/\W/.test(u)){var x=u=y?u:u.toUpperCase();e=p}e("previousSibling",u,v,w,x,y)}},find:{ID:function(u,v,w){if(typeof v.getElementById!=="undefined"&&!w){var e=v.getElementById(u[1]);return e?[e]:[]}},NAME:function(v,y,z){if(typeof y.getElementsByName!=="undefined"){var u=[],x=y.getElementsByName(v[1]);for(var w=0,e=x.length;w<e;w++){if(x[w].getAttribute("name")===v[1]){u.push(x[w])}}return u.length===0?null:u}},TAG:function(e,u){return u.getElementsByTagName(e[1])}},preFilter:{CLASS:function(w,u,v,e,z,A){w=" "+w[1].replace(/\\/g,"")+" ";if(A){return w}for(var x=0,y;(y=u[x])!=null;x++){if(y){if(z^(y.className&&(" "+y.className+" ").indexOf(w)>=0)){if(!v){e.push(y)}}else{if(v){u[x]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(u,e){for(var v=0;e[v]===false;v++){}return e[v]&&r(e[v])?u[1]:u[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var u=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(u[1]+(u[2]||1))-0;e[3]=u[3]-0}e[0]=l++;return e},ATTR:function(x,u,v,e,y,z){var w=x[1].replace(/\\/g,"");if(!z&&g.attrMap[w]){x[1]=g.attrMap[w]}if(x[2]==="~="){x[4]=" "+x[4]+" "}return x},PSEUDO:function(x,u,v,e,y){if(x[1]==="not"){if((s.exec(x[3])||"").length>1||/^\w/.test(x[3])){x[3]=b(x[3],null,null,u)}else{var w=b.filter(x[3],u,v,true^y);if(!v){e.push.apply(e,w)}return false}}else{if(g.match.POS.test(x[0])||g.match.CHILD.test(x[0])){return true}}return x},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(v,u,e){return !!b(e[3],v).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(u,e){return e===0},last:function(v,u,e,w){return u===w.length-1},even:function(u,e){return e%2===0},odd:function(u,e){return e%2===1},lt:function(v,u,e){return u<e[3]-0},gt:function(v,u,e){return u>e[3]-0},nth:function(v,u,e){return e[3]-0==u},eq:function(v,u,e){return e[3]-0==u}},filter:{PSEUDO:function(z,v,w,A){var u=v[1],x=g.filters[u];if(x){return x(z,w,v,A)}else{if(u==="contains"){return(z.textContent||z.innerText||"").indexOf(v[3])>=0}else{if(u==="not"){var y=v[3];for(var w=0,e=y.length;w<e;w++){if(y[w]===z){return false}}return true}}}},CHILD:function(e,w){var z=w[1],u=e;switch(z){case"only":case"first":while((u=u.previousSibling)){if(u.nodeType===1){return false}}if(z=="first"){return true}u=e;case"last":while((u=u.nextSibling)){if(u.nodeType===1){return false}}return true;case"nth":var v=w[2],C=w[3];if(v==1&&C==0){return true}var y=w[0],B=e.parentNode;if(B&&(B.sizcache!==y||!e.nodeIndex)){var x=0;for(u=B.firstChild;u;u=u.nextSibling){if(u.nodeType===1){u.nodeIndex=++x}}B.sizcache=y}var A=e.nodeIndex-C;if(v==0){return A==0}else{return(A%v==0&&A/v>=0)}}},ID:function(u,e){return u.nodeType===1&&u.getAttribute("id")===e},TAG:function(u,e){return(e==="*"&&u.nodeType===1)||u.nodeName===e},CLASS:function(u,e){return(" "+(u.className||u.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(y,w){var v=w[1],e=g.attrHandle[v]?g.attrHandle[v](y):y[v]!=null?y[v]:y.getAttribute(v),z=e+"",x=w[2],u=w[4];return e==null?x==="!=":x==="="?z===u:x==="*="?z.indexOf(u)>=0:x==="~="?(" "+z+" ").indexOf(u)>=0:!u?z&&e!==false:x==="!="?z!=u:x==="^="?z.indexOf(u)===0:x==="$="?z.substr(z.length-u.length)===u:x==="|="?z===u||z.substr(0,u.length+1)===u+"-":false},POS:function(x,u,v,y){var e=u[2],w=g.setFilters[e];if(w){return w(x,v,u,y)}}}};var m=g.match.POS;for(var o in g.match){g.match[o]=new RegExp(g.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source);g.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+g.match[o].source)}var a=function(u,e){u=Array.prototype.slice.call(u,0);if(e){e.push.apply(e,u);return e}return u};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(n){a=function(x,w){var u=w||[];if(d.call(x)==="[object Array]"){Array.prototype.push.apply(u,x)}else{if(typeof x.length==="number"){for(var v=0,e=x.length;v<e;v++){u.push(x[v])}}else{for(var v=0;x[v];v++){u.push(x[v])}}}return u}}var c;if(document.documentElement.compareDocumentPosition){c=function(u,e){if(!u.compareDocumentPosition||!e.compareDocumentPosition){if(u==e){q=true}return 0}var v=u.compareDocumentPosition(e)&4?-1:u===e?0:1;if(v===0){q=true}return v}}else{if("sourceIndex" in document.documentElement){c=function(u,e){if(!u.sourceIndex||!e.sourceIndex){if(u==e){q=true}return 0}var v=u.sourceIndex-e.sourceIndex;if(v===0){q=true}return v}}else{if(document.createRange){c=function(w,u){if(!w.ownerDocument||!u.ownerDocument){if(w==u){q=true}return 0}var v=w.ownerDocument.createRange(),e=u.ownerDocument.createRange();v.setStart(w,0);v.setEnd(w,0);e.setStart(u,0);e.setEnd(u,0);var x=v.compareBoundaryPoints(Range.START_TO_END,e);if(x===0){q=true}return x}}}}(function(){var u=document.createElement("div"),v="script"+(new Date).getTime();u.innerHTML="<a name='"+v+"'/>";var e=document.documentElement;e.insertBefore(u,e.firstChild);if(!!document.getElementById(v)){g.find.ID=function(x,y,z){if(typeof y.getElementById!=="undefined"&&!z){var w=y.getElementById(x[1]);return w?w.id===x[1]||typeof w.getAttributeNode!=="undefined"&&w.getAttributeNode("id").nodeValue===x[1]?[w]:undefined:[]}};g.filter.ID=function(y,w){var x=typeof y.getAttributeNode!=="undefined"&&y.getAttributeNode("id");return y.nodeType===1&&x&&x.nodeValue===w}}e.removeChild(u);e=u=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){g.find.TAG=function(u,y){var x=y.getElementsByTagName(u[1]);if(u[1]==="*"){var w=[];for(var v=0;x[v];v++){if(x[v].nodeType===1){w.push(x[v])}}x=w}return x}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){g.attrHandle.href=function(u){return u.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=b,v=document.createElement("div");v.innerHTML="<p class='TEST'></p>";if(v.querySelectorAll&&v.querySelectorAll(".TEST").length===0){return}b=function(z,y,w,x){y=y||document;if(!x&&y.nodeType===9&&!r(y)){try{return a(y.querySelectorAll(z),w)}catch(A){}}return e(z,y,w,x)};for(var u in e){b[u]=e[u]}v=null})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}g.order.splice(1,0,"CLASS");g.find.CLASS=function(u,v,w){if(typeof v.getElementsByClassName!=="undefined"&&!w){return v.getElementsByClassName(u[1])}};e=null})()}function p(u,z,y,D,A,C){var B=u=="previousSibling"&&!C;for(var w=0,v=D.length;w<v;w++){var e=D[w];if(e){if(B&&e.nodeType===1){e.sizcache=y;e.sizset=w}e=e[u];var x=false;while(e){if(e.sizcache===y){x=D[e.sizset];break}if(e.nodeType===1&&!C){e.sizcache=y;e.sizset=w}if(e.nodeName===z){x=e;break}e=e[u]}D[w]=x}}}function t(u,z,y,D,A,C){var B=u=="previousSibling"&&!C;for(var w=0,v=D.length;w<v;w++){var e=D[w];if(e){if(B&&e.nodeType===1){e.sizcache=y;e.sizset=w}e=e[u];var x=false;while(e){if(e.sizcache===y){x=D[e.sizset];break}if(e.nodeType===1){if(!C){e.sizcache=y;e.sizset=w}if(typeof z!=="string"){if(e===z){x=true;break}}else{if(b.filter(z,[e]).length>0){x=e;break}}}e=e[u]}D[w]=x}}}var j=document.compareDocumentPosition?function(u,e){return u.compareDocumentPosition(e)&16}:function(u,e){return u!==e&&(u.contains?u.contains(e):true)};var r=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var h=function(e,A){var w=[],x="",y,v=A.nodeType?[A]:A;while((y=g.match.PSEUDO.exec(e))){x+=y[0];e=e.replace(g.match.PSEUDO,"")}e=g.relative[e]?e+"*":e;for(var z=0,u=v.length;z<u;z++){b(e,v[z],w)}return b.filter(x,w)};window.Sizzle=b})();(function(c){var d=Prototype.Selector.extendElements;function a(e,g){return d(c(e,g||document))}function b(g,e){return c.matches(e,[g]).length==1}Prototype.Selector.engine=c;Prototype.Selector.select=a;Prototype.Selector.match=b})(Sizzle);window.Sizzle=Prototype._original_property;delete Prototype._original_property;var Form={reset:function(a){a=$(a);a.reset();return a},serializeElements:function(j,d){if(typeof d!="object"){d={hash:!!d}}else{if(Object.isUndefined(d.hash)){d.hash=true}}var e,h,a=false,g=d.submit,b,c;if(d.hash){c={};b=function(k,l,m){if(l in k){if(!Object.isArray(k[l])){k[l]=[k[l]]}k[l].push(m)}else{k[l]=m}return k}}else{c="";b=function(k,l,m){return k+(k?"&":"")+encodeURIComponent(l)+"="+encodeURIComponent(m)}}return j.inject(c,function(k,l){if(!l.disabled&&l.name){e=l.name;h=$(l).getValue();if(h!=null&&l.type!="file"&&(l.type!="submit"||(!a&&g!==false&&(!g||e==g)&&(a=true)))){k=b(k,e,h)}}return k})}};Form.Methods={serialize:function(b,a){return Form.serializeElements(Form.getElements(b),a)},getElements:function(e){var g=$(e).getElementsByTagName("*"),d,a=[],c=Form.Element.Serializers;for(var b=0;d=g[b];b++){a.push(d)}return a.inject([],function(h,j){if(c[j.tagName.toLowerCase()]){h.push(Element.extend(j))}return h})},getInputs:function(h,c,d){h=$(h);var a=h.getElementsByTagName("input");if(!c&&!d){return $A(a).map(Element.extend)}for(var e=0,j=[],g=a.length;e<g;e++){var b=a[e];if((c&&b.type!=c)||(d&&b.name!=d)){continue}j.push(Element.extend(b))}return j},disable:function(a){a=$(a);Form.getElements(a).invoke("disable");return a},enable:function(a){a=$(a);Form.getElements(a).invoke("enable");return a},findFirstElement:function(b){var c=$(b).getElements().findAll(function(d){return"hidden"!=d.type&&!d.disabled});var a=c.findAll(function(d){return d.hasAttribute("tabIndex")&&d.tabIndex>=0}).sortBy(function(d){return d.tabIndex}).first();return a?a:c.find(function(d){return/^(?:input|select|textarea)$/i.test(d.tagName)})},focusFirstElement:function(b){b=$(b);var a=b.findFirstElement();if(a){a.activate()}return b},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=(function(){function b(j,k){switch(j.type.toLowerCase()){case"checkbox":case"radio":return g(j,k);default:return e(j,k)}}function g(j,k){if(Object.isUndefined(k)){return j.checked?j.value:null}else{j.checked=!!k}}function e(j,k){if(Object.isUndefined(k)){return j.value}else{j.value=k}}function a(l,o){if(Object.isUndefined(o)){return(l.type==="select-one"?c:d)(l)}var k,m,p=!Object.isArray(o);for(var j=0,n=l.length;j<n;j++){k=l.options[j];m=this.optionValue(k);if(p){if(m==o){k.selected=true;return}}else{k.selected=o.include(m)}}}function c(k){var j=k.selectedIndex;return j>=0?h(k.options[j]):null}function d(m){var j,n=m.length;if(!n){return null}for(var l=0,j=[];l<n;l++){var k=m.options[l];if(k.selected){j.push(h(k))}}return j}function h(j){return Element.hasAttribute(j,"value")?j.value:j.text}return{input:b,inputSelector:g,textarea:e,select:a,selectOne:c,selectMany:d,optionValue:h,button:e}})();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 E={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 g=document.documentElement;var F="onmouseenter" in g&&"onmouseleave" in g;var a=function(G){return false};if(window.attachEvent){if(window.addEventListener){a=function(G){return !(G instanceof window.Event)}}else{a=function(G){return true}}}var t;function C(H,G){return H.which?(H.which===G+1):(H.button===G)}var q={0:1,1:4,2:2};function A(H,G){return H.button===q[G]}function D(H,G){switch(G){case 0:return H.which==1&&!H.metaKey;case 1:return H.which==2||(H.which==1&&H.metaKey);case 2:return H.which==3;default:return false}}if(window.attachEvent){if(!window.addEventListener){t=A}else{t=function(H,G){return a(H)?A(H,G):C(H,G)}}}else{if(Prototype.Browser.WebKit){t=D}else{t=C}}function x(G){return t(G,0)}function v(G){return t(G,1)}function p(G){return t(G,2)}function d(I){I=E.extend(I);var H=I.target,G=I.type,J=I.currentTarget;if(J&&J.tagName){if(G==="load"||G==="error"||(G==="click"&&J.tagName.toLowerCase()==="input"&&J.type==="radio")){H=J}}if(H.nodeType==Node.TEXT_NODE){H=H.parentNode}return Element.extend(H)}function r(H,I){var G=E.element(H);if(!I){return G}while(G){if(Object.isElement(G)&&Prototype.Selector.match(G,I)){return Element.extend(G)}G=G.parentNode}}function u(G){return{x:c(G),y:b(G)}}function c(I){var H=document.documentElement,G=document.body||{scrollLeft:0};return I.pageX||(I.clientX+(H.scrollLeft||G.scrollLeft)-(H.clientLeft||0))}function b(I){var H=document.documentElement,G=document.body||{scrollTop:0};return I.pageY||(I.clientY+(H.scrollTop||G.scrollTop)-(H.clientTop||0))}function s(G){E.extend(G);G.preventDefault();G.stopPropagation();G.stopped=true}E.Methods={isLeftClick:x,isMiddleClick:v,isRightClick:p,element:d,findElement:r,pointer:u,pointerX:c,pointerY:b,stop:s};var z=Object.keys(E.Methods).inject({},function(G,H){G[H]=E.Methods[H].methodize();return G});if(window.attachEvent){function k(H){var G;switch(H.type){case"mouseover":case"mouseenter":G=H.fromElement;break;case"mouseout":case"mouseleave":G=H.toElement;break;default:return null}return Element.extend(G)}var w={stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}};E.extend=function(H,G){if(!H){return false}if(!a(H)){return H}if(H._extendedByPrototype){return H}H._extendedByPrototype=Prototype.emptyFunction;var I=E.pointer(H);Object.extend(H,{target:H.srcElement||G,relatedTarget:k(H),pageX:I.x,pageY:I.y});Object.extend(H,z);Object.extend(H,w);return H}}else{E.extend=Prototype.K}if(window.addEventListener){E.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(E.prototype,z)}function o(K,J,L){var I=Element.retrieve(K,"prototype_event_registry");if(Object.isUndefined(I)){e.push(K);I=Element.retrieve(K,"prototype_event_registry",$H())}var G=I.get(J);if(Object.isUndefined(G)){G=[];I.set(J,G)}if(G.pluck("handler").include(L)){return false}var H;if(J.include(":")){H=function(M){if(Object.isUndefined(M.eventName)){return false}if(M.eventName!==J){return false}E.extend(M,K);L.call(K,M)}}else{if(!F&&(J==="mouseenter"||J==="mouseleave")){if(J==="mouseenter"||J==="mouseleave"){H=function(N){E.extend(N,K);var M=N.relatedTarget;while(M&&M!==K){try{M=M.parentNode}catch(O){M=K}}if(M===K){return}L.call(K,N)}}}else{H=function(M){E.extend(M,K);L.call(K,M)}}}H.handler=L;G.push(H);return H}function j(){for(var G=0,H=e.length;G<H;G++){E.stopObserving(e[G]);e[G]=null}}var e=[];if(Prototype.Browser.IE){window.attachEvent("onunload",j)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}var n=Prototype.K,h={mouseenter:"mouseover",mouseleave:"mouseout"};if(!F){n=function(G){return(h[G]||G)}}function y(J,I,K){J=$(J);var H=o(J,I,K);if(!H){return J}if(I.include(":")){if(J.addEventListener){J.addEventListener("dataavailable",H,false)}else{J.attachEvent("ondataavailable",H);J.attachEvent("onlosecapture",H)}}else{var G=n(I);if(J.addEventListener){J.addEventListener(G,H,false)}else{J.attachEvent("on"+G,H)}}return J}function m(M,J,N){M=$(M);var I=Element.retrieve(M,"prototype_event_registry");if(!I){return M}if(!J){I.each(function(P){var O=P.key;m(M,O)});return M}var K=I.get(J);if(!K){return M}if(!N){K.each(function(O){m(M,J,O.handler)});return M}var L=K.length,H;while(L--){if(K[L].handler===N){H=K[L];break}}if(!H){return M}if(J.include(":")){if(M.removeEventListener){M.removeEventListener("dataavailable",H,false)}else{M.detachEvent("ondataavailable",H);M.detachEvent("onlosecapture",H)}}else{var G=n(J);if(M.removeEventListener){M.removeEventListener(G,H,false)}else{M.detachEvent("on"+G,H)}}I.set(J,K.without(H));return M}function B(J,I,H,G){J=$(J);if(Object.isUndefined(G)){G=true}if(J==document&&document.createEvent&&!J.dispatchEvent){J=document.documentElement}var K;if(document.createEvent){K=document.createEvent("HTMLEvents");K.initEvent("dataavailable",G,true)}else{K=document.createEventObject();K.eventType=G?"ondataavailable":"onlosecapture"}K.eventName=I;K.memo=H||{};if(document.createEvent){J.dispatchEvent(K)}else{J.fireEvent(K.eventType,K)}return E.extend(K)}E.Handler=Class.create({initialize:function(I,H,G,J){this.element=$(I);this.eventName=H;this.selector=G;this.callback=J;this.handler=this.handleEvent.bind(this)},start:function(){E.observe(this.element,this.eventName,this.handler);return this},stop:function(){E.stopObserving(this.element,this.eventName,this.handler);return this},handleEvent:function(H){var G=E.findElement(H,this.selector);if(G){this.callback.call(this.element,H,G)}}});function l(I,H,G,J){I=$(I);if(Object.isFunction(G)&&Object.isUndefined(J)){J=G,G=null}return new E.Handler(I,H,G,J).start()}Object.extend(E,E.Methods);Object.extend(E,{fire:B,observe:y,stopObserving:m,on:l});Element.addMethods({fire:B,observe:y,stopObserving:m,on:l});Object.extend(document,{fire:B.methodize(),observe:y.methodize(),stopObserving:m.methodize(),on:l.methodize(),loaded:false});if(window.Event){Object.extend(window.Event,E)}else{window.Event=E}})();(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(g){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){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,g){g=g.toString().strip();var h=[],j=(/\s/.test(g)?$w(g):null);if(!j&&!g){return h}var c=$(e).getElementsByTagName("*");g=" "+g+" ";for(var d=0,l,k;l=c[d];d++){if(l.className&&(k=" "+l.className+" ")&&(k.include(g)||(j&&j.all(function(m){return !m.toString().blank()&&k.include(" "+m+" ")})))){h.push(Element.extend(l))}}return h};return function(d,c){return $(c||document.body).getElementsByClassName(d)}}(Element.Methods)}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);(function(){window.Selector=Class.create({initialize:function(a){this.expression=a.strip()},findElements:function(a){return Prototype.Selector.select(this.expression,a)},match:function(a){return Prototype.Selector.match(a,this.expression)},toString:function(){return this.expression},inspect:function(){return"#<Selector: "+this.expression+">"}});Object.extend(Selector,{matchElements:function(g,h){var a=Prototype.Selector.match,d=[];for(var c=0,e=g.length;c<e;c++){var b=g[c];if(a(b,h)){d.push(Element.extend(b))}}return d},findElement:function(g,h,b){b=b||0;var a=0,d;for(var c=0,e=g.length;c<e;c++){d=g[c];if(Prototype.Selector.match(d,h)&&b===a++){return Element.extend(d)}}},findChildElements:function(b,c){var a=c.toArray().join(", ");return Prototype.Selector.select(a,b||document)}})})();var Facebox=Class.create({initialize:function(a){this.settings={loading_image:"/img/facebox/loading.gif",close_image:"/img/facebox/closelabel.gif",image_types:new RegExp("."+["png","jpg","jpeg","gif"].join("|")+"$","i"),inited:true,facebox_html:'	  <div id="facebox" style="display:none;"> 	    <div class="popup"> 	      <table> 	        <tbody> 	          <tr> 	            <td class="tl"/><td class="b"/><td class="tr"/> 	          </tr> 	          <tr> 	            <td class="b"/> 	            <td class="body"> 	              <div class="content"> 	              </div> 	              <div class="footer"> 	                <a href="#" class="close"> 	                  <img src="/img/facebox/closelabel.gif" title="close" class="close_image" /> 	                </a> 	              </div> 	            </td> 	            <td class="b"/> 	          </tr> 	          <tr> 	            <td class="bl"/><td class="b"/><td class="br"/> 	          </tr> 	        </tbody> 	      </table> 	    </div> 	  </div>'};if(a){Object.extend(this.settings,a)}$$("body").first().insert({bottom:this.settings.facebox_html});this.preload=[new Image(),new Image()];this.preload[0].src=this.settings.close_image;this.preload[1].src=this.settings.loading_image;f=this;$$("#facebox .b:first, #facebox .bl, #facebox .br, #facebox .tl, #facebox .tr").each(function(b){f.preload.push(new Image());f.preload.slice(-1).src=b.getStyle("background-image").replace(/url\((.+)\)/,"$1")});this.watchClickEvents();fb=this;Event.observe($$("#facebox .close").first(),"click",function(b){Event.stop(b);fb.close()});Event.observe($$("#facebox .close_image").first(),"click",function(b){Event.stop(b);fb.close()})},watchClickEvents:function(b){var a=this;$$("a[rel=facebox]").each(function(d,c){Event.stopObserving(d,"click");Event.observe(d,"click",function(g){Event.stop(g);a.click_handler(d,g)})});$$("input[rel=facebox]").each(function(d,c){Event.stopObserving(d,"click");Event.observe(d,"click",function(g){Event.stop(g);a.click_handler($(d.id+"_facebox"),g)})})},loading:function(){if($$("#facebox .loading").length==1){return true}contentWrapper=$$("#facebox .content").first();contentWrapper.childElements().each(function(c,b){c.remove()});contentWrapper.insert({bottom:'<div class="loading"><img src="'+this.settings.loading_image+'"/></div>'});var a=document.viewport.getScrollOffsets()},reveal:function(g,c){this.loading();box=$("facebox");if(!box.visible()){box.show()}contentWrapper=$$("#facebox .content").first();if(c){contentWrapper.addClassName(c)}contentWrapper.insert({bottom:g});load=$$("#facebox .loading").first();if(load){load.remove()}$$("#facebox .body").first().childElements().each(function(j,h){j.show()});var e=document.viewport.getScrollOffsets();var d=$("facebox").getWidth();if($$("#facebox .body")[0]){d=$$("#facebox .body")[0].getWidth()+20}if(navigator.userAgent.indexOf("MSIE 6")>=0){var b=$$("select").invoke("setStyle",{visibility:"hidden"})}if(false){var a=0;if(document.viewport.getHeight()==0){a=document.body.clientHeight}else{a=document.viewport.getHeight()}$("facebox").setStyle({top:e.top+(a/2)-($("facebox").getHeight()/2)+"px",left:e.left+(document.body.clientWidth/2)-($("facebox").getWidth()/2)+"px"});$("facebox").setStyle({width:d+"px"})}else{$("facebox").setStyle({top:e.top+(document.viewport.getHeight()/2)-($("facebox").getHeight()/2)+"px",left:e.left+(document.viewport.getWidth()/2)-($("facebox").getWidth()/2)+"px"});$("facebox").setStyle({width:d+"px"})}document.body.insert({bottom:'<div id="overlay"></div>'});if($$(".drag-handle").length>0){$$("#facebox .footer")[0].addClassName("drag-handle-footer");new Draggable("facebox",{revert:false,handle:"drag-handle"});new Draggable("facebox",{revert:false,handle:"drag-handle-footer"})}},close:function(){$("facebox").hide();if(navigator.userAgent.indexOf("MSIE 6")>=0){var a=$$("select").invoke("setStyle",{visibility:"visible"})}},click_handler:function(c,j){this.loading();Event.stop(j);var l=c.rel.match(/facebox\[\.(\w+)\]/);if(l){l=l[1]}if(c.href.match(/#/)){var a=window.location.href.split("#")[0];var k=c.href.replace(a+"#","");var m=$(k);var h=new Element(m.tagName);h.innerHTML=m.innerHTML;this.reveal(h,l)}else{if(c.href.match(this.settings.image_types)){var g=new Image();b=this;g.onload=function(){b.reveal('<div class="image"><img src="'+g.src+'" /></div>',l)};g.src=c.href}else{var b=this;a=c.href;if(window.location.href.indexOf("https")>=0){if(a.indexOf("?")>=0){a+=";ssl=true"}else{a+="?ssl=true"}}new Ajax.Request(a,{method:"get",onFailure:function(d){$("facebox").show();b.reveal(d.responseText,l)},onSuccess:function(d){$("facebox").show();b.reveal(d.responseText,l)}})}}},appear:function(e){this.loading();var a=e.rel.match(/facebox\[\.(\w+)\]/);if(a){a=a[1]}if(e.href.match(/#/)){var b=window.location.href.split("#")[0];var j=e.href.replace(b+"#","");var k=$(j);var g=new Element(k.tagName);g.innerHTML=k.innerHTML;this.reveal(g,a)}else{if(e.href.match(this.settings.image_types)){var h=new Image();c=this;h.onload=function(){c.reveal('<div class="image"><img src="'+h.src+'" /></div>',a)};h.src=e.href}else{var c=this;b=e.href;new Ajax.Request(b,{method:"get",onFailure:function(d){$("facebox").show();c.reveal(d.responseText,a)},onSuccess:function(d){$("facebox").show();c.reveal(d.responseText,a)}})}}}});var facebox;Event.observe(window,"load",function(a){facebox=new Facebox()});var checkall=true;var isIE=UserAgent().indexOf("Internet Explorer")!=-1;var isNN=UserAgent().indexOf("Netscape")!=-1;var caOpenAnalyzer=true;var httpDomain="";var caWin;var emailRegex=/^\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b$/i;var queryDelimiter="&";if(document.domain.indexOf("developer.hmc")>-1){httpDomain="http://www.developer.hmc"}else{httpDomain="http://www.ivantagehealth.com"}function BrowserSupportsAjax(){return true}function StopEventPropagation(a){isIE?a.cancelBubble=true:a.stopPropagation()}function EventTarget(a){return(isIE?a.srcElement:a.target)}function syncSidebar(){var a=readCookie("sidebar_display");if($("sidebar")){if(a=="none"){$("sidebar").id="sidebar-hidden";$("info").id="info-only"}}else{if($("sidebar-hidden")){if(a==""){$("sidebar-hidden").id="sidebar";$("info-only").id="info"}}}}function toggleSidebar(){if($("sidebar")){$("sidebar").id="sidebar-hidden";$("info").id="info-only";createCookie("sidebar_display","none",0)}else{$("sidebar-hidden").id="sidebar";$("info-only").id="info";eraseCookie("sidebar_display")}}function toggleSidebarOLD(){$("sidebar").toggle();if($("info")){$("info").id="info-only"}else{if($("info-wide")){$("info-wide").id="info-wide"}else{$("info-only").id="info"}}}function findInArray(a,c){for(var b=0;b<a.length;b++){if(a[b].toLowerCase()==c.toLowerCase()){return(b)}}return(-1)}function DeselectAll(b){var a=document.getElementsByTagName("input");for(i=0;i<a.length;i++){if(a[i].name.indexOf(b)!=-1){a[i].checked=false}}}function SelectAll(b){var a=document.getElementsByTagName("input");for(i=0;i<a.length;i++){if(a[i].name.indexOf(b)!=-1){if(checkall){a[i].checked=true}else{a[i].checked=false}}}checkall=!checkall}function checkspell(){try{var b=new ActiveXObject("ieSpell.ieSpellExtension");b.CheckAllLinkedDocuments(document)}catch(a){if(a.number==-2146827859){if(confirm("ieSpell not detected.  Click Ok to goto download page.")){window.open("http://www.iespell.com/download.php","DownLoad")}}else{}}}function HideShowSwap(a,d){var c=$(a);var b=$(d);if(c.style.display=="none"){c.style.display="block";b.style.display="none"}else{c.style.display="none";b.style.display="block"}}function SwapClass(b){if($(b)){var a=$(b);if(a.className=="selectedMenu"){a.className="unselectedMenu"}else{a.className="selectedMenu"}}}function UserAgent(){var a=navigator.userAgent.toLowerCase();if(a.indexOf("opera")!=-1){return"Opera"}if(a.indexOf("staroffice")!=-1){return"Star Office"}if(a.indexOf("beonex")!=-1){return"Beonex"}if(a.indexOf("chimera")!=-1){return"Chimera"}if(a.indexOf("netpositive")!=-1){return"NetPositive"}if(a.indexOf("phoenix")!=-1){return"Phoenix"}if(a.indexOf("firefox")!=-1){return"Firefox"}if(a.indexOf("safari")!=-1){return"Safari"}if(a.indexOf("skipstone")!=-1){return"SkipStone"}if(a.indexOf("msie")!=-1){return"Internet Explorer"}if(a.indexOf("netscape")!=-1){return"Netscape"}if(a.indexOf("mozilla/5.0")!=-1){return"Mozilla"}if(a.indexOf("/")!=-1){if(a.substr(0,a.indexOf("/"))!="mozilla"){return navigator.userAgent.substr(0,a.indexOf("/"))}else{return"Netscape"}}else{if(a.indexOf(" ")!=-1){return navigator.userAgent.substr(0,a.indexOf(" "))}else{return navigator.userAgent}}}function copyText(b){var a;if(b.type=="text"||b.type=="textarea"){a=b.createTextRange()}else{a=document.body.createTextRange();a.moveToElementText(b)}a.scrollIntoView();a.select();if(confirm("Copy the selected text to the ClipBoard?")){a.execCommand("Copy")}a.collapse(false);a.select()}function getNameNoPath(b){var c=new RegExp(/([^\/\\]+)$/);var a=c.exec(b);if(a==null){return null}else{return a[0]}}function Trim(a){a=a.replace(/^\s+/g,"");return a.replace(/\s+$/g,"")}function fAdd(d,c,h,a,g,b){new Ajax.Request("/client/briefcase/utils/AJAX_request.a4p",{method:"get",parameters:"method="+encodeURIComponent('add item("'+d+'":"'+c+'":"'+h+'":'+a+':"'+g+'")'),asynchronous:true,evalscripts:true});if($("facebox-content")){$("facebox-content").innerHTML="Item was added to your briefcase!"}else{var e=b.up();e.removeClassName("tool-briefcase");e.addClassName("tool-tick");e.innerHTML="Added to briefcase!"}}function DeleteKC(b,c,a){$("KC_"+b).style.display="none";new Ajax.Request("/hmc/full/choosers/attribute/process_xml_request.a4p",{method:"get",parameters:"type=delete&wpType="+c+"&deleteKC="+b+"&wpKey="+a,asynchronous:true})}function DeleteTag(b,c,a){$("Tag_"+b).style.display="none";new Ajax.Request("/hmc/full/choosers/attribute/process_xml_request.a4p",{method:"get",parameters:"type=delete&wpType="+c+"&deleteTag="+b+"&wpKey="+a,asynchronous:true})}function DeleteWP(d,c,b,e,a){$("ATTWP_"+d+"_"+c+"_"+a).hide();new Ajax.Request("/hmc/full/choosers/search/fuses/process_xml_request.a4p",{method:"get",parameters:"type=delete&destType="+d+"&destKey="+c+"&srcType="+b+"&srcKey="+e,asynchronous:true})}function SetFlag(c,b){new Ajax.Request("/hmc/utils/AJAX_request.a4p",{method:"get",parameters:"method="+encodeURIComponent('Set Flag("'+c+'":'+b+")"),asynchronous:true});var a=$("flaglink_"+b);var d=a.getAttribute("href");d=d.replace("SetFlag","ClearFlag");a.setAttribute("href",d);$("flagimg_"+b).src="/img/icons/flag_set.gif"}function ClearFlag(c,b){new Ajax.Request("/hmc/utils/AJAX_request.a4p",{method:"get",parameters:"method="+encodeURIComponent('Clear Flag("'+c+'":'+b+")"),asynchronous:true});var a=$("flaglink_"+b);var d=a.getAttribute("href");d=d.replace("ClearFlag","SetFlag");a.setAttribute("href",d);$("flagimg_"+b).src="/img/icons/flag_clear.gif"}function ElementsByClassName(a,d){var b=new Array();elems=document.getElementsByTagName(d);for(var c=0;c<elems.length;c++){if(elems[c].className.indexOf(a)>=0){b.push(elems[c])}}return(b)}function URIEncode(b){var a="";if(b!=null){for(i=0;i<b.length;i++){if(b.charAt(i)==" "){a=a+"%20"}else{if(b.charAt(i)=='"'){a=a+"%22"}else{if(b.charAt(i)=="#"){a=a+"%23"}else{if(b.charAt(i)=="$"){a=a+"%24"}else{if(b.charAt(i)=="%"){a=a+"%25"}else{if(b.charAt(i)=="&"){a=a+"%26"}else{if(b.charAt(i)=="'"){a=a+"%27"}else{if(b.charAt(i)=="("){a=a+"%28"}else{if(b.charAt(i)==")"){a=a+"%29"}else{if(b.charAt(i)=="*"){a=a+"%2A"}else{if(b.charAt(i)=="+"){a=a+"%2B"}else{if(b.charAt(i)==","){a=a+"%2C"}else{if(b.charAt(i)=="/"){a=a+"%2F"}else{if(b.charAt(i)==":"){a=a+"%3A"}else{if(b.charAt(i)==";"){a=a+"%3B"}else{if(b.charAt(i)=="<"){a=a+"%3C"}else{if(b.charAt(i)=="="){a=a+"%3D"}else{if(b.charAt(i)==">"){a=a+"%3E"}else{if(b.charAt(i)=="?"){a=a+"%3F"}else{if(b.charAt(i)=="@"){a=a+"%40"}else{if(b.charAt(i)=="["){a=a+"%5B"}else{if(b.charAt(i)=="\\"){a=a+"%5C"}else{if(b.charAt(i)=="]"){a=a+"%5D"}else{if(b.charAt(i)=="^"){a=a+"%5E"}else{if(b.charAt(i)=="_"){a=a+"%5F"}else{if(b.charAt(i)=="`"){a=a+"%60"}else{if(b.charAt(i)=="{"){a=a+"%7B"}else{if(b.charAt(i)=="|"){a=a+"%7C"}else{if(b.charAt(i)=="}"){a=a+"%7D"}else{a=a+b.charAt(i)}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}return(a)}function hideshowItem(a){hideshow($(a))}function hideshowWithOC(a){if($(a)){hideshow($(a));hideshow($(a+"Open"));hideshow($(a+"Close"))}}function hideWithOC(a){if($(a)){hideItem(a);hideItem(a+"Open");showItem(a+"Close")}}function showWithOC(a){if($(a)){showItem(a);showItem(a+"Open");hideItem(a+"Close")}}function hideItem(a){setDisplay($(a),"none")}function showItem(a){setDisplay($(a),"")}function hideshow(a){if(!$){return}if(a.style.display=="none"){a.style.display=""}else{a.style.display="none"}}function setDisplay(b,a){if(!$){return}else{b.style.display=a}}function ExpandPartnerList(e){var d=0;var c;var b=$("PartnerScrollDiv_"+e);if(b.className==""||b.className=="ScrollableDIV_small"){b.className="ScrollableDIV";d=0;c=b.getElementsByTagName("DIV");for(i=0;i<c.length;i++){c[i].style.display="";d++}$("PRU_FooterIMG_"+e).src="/img/arrows/arrUpDeSel.gif";$("PRU_FooterIMG_"+e).onmouseover="/img/arrows/arrUpSel.gif";$("PRU_FooterIMG_"+e).onmouseout="/img/arrows/arrUpDeSel.gif";$("PRU_SelectAll_"+e).style.display="block";$("dd_search_div").show();if(d!=0){$("PRU_EmptyDIV_"+e).hide()}}else{d=0;c=b.getElementsByTagName("DIV");for(i=0;i<c.length;i++){if(c[i].id!="PRU_EmptyDIV_"+e){var a=c[i].getElementsByTagName("input");if(a[0].checked==false){c[i].style.display="none"}else{d++}}}if(d==0){$("PRU_EmptyDIV_"+e).show()}if(d>4){b.className="ScrollableDIV_small"}else{b.className=""}$("PRU_FooterIMG_"+e).src="/img/arrows/arrDownDeSel.gif";$("PRU_FooterIMG_"+e).onmouseover="/img/arrows/arrDownSel.gif";$("PRU_FooterIMG_"+e).onmouseout="/img/arrows/arrDownDeSel.gif";$("PRU_SelectAll_"+e).hide();$("dd_search_div").hide()}}function PRU_ActionAll(g,c,d){var b=$("PartnerScrollDiv_"+g);var e=b.getElementsByTagName("DIV");for(i=0;i<e.length;i++){if(e[i].id!="PRU_EmptyDIV_"+g){var a=e[i].getElementsByTagName("input");a[0].checked=c}}StopEventPropagation(d)}function InitializePartnerDropDown(a,b){if(a==0){$("PRU_EmptyDIV_"+b).show()}else{$("PRU_EmptyDIV_"+b).hide()}if(a>5){$("PartnerScrollDiv_"+b).className="ScrollableDIV_small"}$("PRU_FooterIMG_"+b).onmouseover="/img/arrows/arrDownSel.gif";$("PRU_FooterIMG_"+b).onmouseout="/img/arrows/arrDownDeSel.gif";$("dd_search_"+b).observe("keypress",function(d){var e=d.currentTarget;var c=$F(e).toLowerCase();$$("#PartnerScrollDiv_"+b+" .PRU_Item").each(function(h,g){if(c===""){h.show()}else{if(h.innerHTML.toLowerCase().indexOf(c)<0){h.hide()}else{h.show()}}},d)})}function setDocumentDomain(){var a=document.domain;var b=httpDomain.substring(11);document.domain=b;return(a)}function openAnalyzerApplication(a){if(caOpenAnalyzer){setDocumentDomain();var b="width=1000,height=760,scrollbars=1,status=1,resizable=1";a+=queryDelimiter+"iBRef=1";if(!caWin){caWin=window.open(a,"caApplication",b)}else{if(caWin.closed){caWin=window.open(a,"caApplication",b)}else{caWin.focus();caWin.location.href=a}}}else{}}function uploadAttachment(){window.frames.upload_frame.document.upload_frame_form.submit()}function createCookie(c,d,e){var a;if(e){var b=new Date();b.setTime(b.getTime()+(e*24*60*60*1000));a="; expires="+b.toGMTString()}else{a=""}document.cookie=c+"="+d+a+"; path=/"}function readCookie(b){var e=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var g=a[d];while(g.charAt(0)==" "){g=g.substring(1,g.length)}if(g.indexOf(e)==0){return g.substring(e.length,g.length)}}return""}function eraseCookie(a){createCookie(a,"",-1)}function adjustiFrameSize(b,a){window.setTimeout(function(){var d=window.frames[b].document.getElementById(a);var c=d.offsetHeight+15;$(b).setStyle({height:c+"px"})},100)}function submitHelpChanges(a){var j=$F("HelpTitleEdit");var h=$F("HelpMessageEdit");var b=$F("HelpwikiEdit");var e=$F("DirectLinkURL");var d,g;if(document.location.hostname.indexOf("ib.")===0){a=URIEncode(a);d="/asp/help/help_save.html";g="id="+encodeURIComponent(a)+"&title="+encodeURIComponent(j)+"&msg="+encodeURIComponent(h)+"&wiki="+encodeURIComponent(b)+"&link="+encodeURIComponent(e)}else{d="/help/AJAX_request.a4p";g="method="+encodeURIComponent("SaveHelp("+a+':"'+j+'":"'+h+'":"'+b+'":"'+e+'")')}var c=new Ajax.Updater("return_message",d,{method:"post",parameters:g})}function showHelpRequest(){$("help_request_offer").hide();$("help_request_div").show()}function hideHelpRequest(){$("help_request_offer").show();$("help_request_div").hide()}function submitHelpRequest(a){var c=URIEncode($F("help_request_input"));var d,e;if(document.location.hostname.indexOf("ib.")===0){d="/asp/help/help_request.html";a=URIEncode(a);e="id="+a+"&req="+c}else{d="/help/AJAX_request.a4p";e="method="+encodeURIComponent("HelpRequest("+a+':"'+c+'")')}var b=new Ajax.Updater("help_request_complete",d,{method:"post",parameters:e,onComplete:function(){$("help_request_offer").style.display="none";$("help_request_div").style.display="none"}})}function refreshHelpIcon(a){var c,d;if(document.location.hostname.indexOf("ib.")===0){c="/asp/help_icon.html";d="nohelpspan=true&id="+a}else{c="/help/ajax/AJAX_request.a4p";d="method="+encodeURIComponent("RefreshHelp("+a+":true)")}var b=new Ajax.Updater("help_link_"+a,c,{method:"get",parameters:d})}function toggleEdit(a){if(a){$$(".help_view").each(function(b){b.hide()});$$(".help_edit").each(function(b){b.show()})}}var wall_url="/client/wall/";function wall_showLoading(a){document.getElementById("wallposts_"+a).innerHTML="<div class='wall_loading'>Loading...</div>"}function wall_setWallHTML(b,a){$("wall_"+b).replace('<div id="wall_'+b+'" class="wall_container">'+a+"</div>")}function wall_ajax(a){a.params=a.params?a.params:{};a.success=a.success?a.success:function(){return};a.failure=a.failure?a.failure:function(){return};if(typeof(wall_ajax_helper)=="undefined"){if(wall_prototypeIsLoaded()){wall_ajax_helper=wall_ajax_prototype}else{if(wall_jQueryIsLoaded()){wall_ajax_helper=wall_ajax_jquery}else{if(wall_extjsIsLoaded()){wall_ajax_helper=wall_ajax_extjs}else{wall_error("You cannot use AJAX because this page has loaded none of (Prototype, jQuery, Ext). ")}}}}wall_ajax_helper(a)}function wall_error(a){alert("ERROR:\nUsers: Please contact HMC at (781) 449-5287.\n\nProgrammers: "+a)}function wall_prototypeIsLoaded(){return typeof(Prototype)=="object"}function wall_jQueryIsLoaded(){return typeof(jQuery)=="object"}function wall_extjsIsLoaded(){return typeof(Ext)=="object"}function wall_ajax_prototype(a){new Ajax.Request(a.url,{method:"post",parameters:a.params,onSuccess:function(b){a.success(b.responseText)},onFailure:function(b){a.failure(b.responseText)}})}function wall_ajax_jquery(a){wall_error("please implement wall_ajax_jquery in hmc-wall.js")}function wall_ajax_extjs(a){wall_error("please implement wall_ajax_extjs in hmc-wall.js")}function wall_post(a){var c=document.getElementById("post_editor_"+a);var b=c.value;c.value="";wall_showLoading(a);wall_ajax({url:wall_url+"ajax/post.a4d",params:{wallkey:a,text:b},success:function(d){wall_setWallHTML(a,d)}})}function post_delete(b,a){wall_showLoading(b);wall_ajax({url:wall_url+"ajax/delete.a4d",params:{postkey:a},success:function(c){wall_setWallHTML(b,c)}})}function post_reply(g,b){newId="wallpost_reply_"+g+"_"+b;if(document.getElementById(newId)===null){var d=document.getElementById("wallpost_"+g+"_"+b);var a=document.getElementById("wall_"+g+"_replyBox_container");var c=a.innerHTML;c=c.replace("replyBox_editor","replyBox_editor_"+b);c=c.replace("pReply()","post_reply_submit("+g+","+b+")");c=c.replace("pCancel()","post_reply_cancel("+g+","+b+")");var e=document.createElement("div");e.setAttribute("class","post_replyBox");e.id=(newId);e.style.paddingLeft="50px";e.innerHTML=c;d.appendChild(e)}}function post_reply_submit(b,a){var c=document.getElementById("replyBox_editor_"+a).value;wall_showLoading(b);wall_ajax({url:wall_url+"ajax/reply.a4d",params:{parentKey:a,text:c},success:function(d){wall_setWallHTML(b,d)}})}function post_reply_cancel(c,b){var a=document.getElementById("wallpost_reply_"+c+"_"+b);a.parentNode.removeChild(a)}function wall_saveSubsOpts(d){wall_hideSubsOpts(d);var e=document.getElementsByName("subscriptionType");var c="";for(var b=0;b<e.length;b++){if(e[b].checked){c=e[b].value}}var a=document.getElementById("unsubscribe_all").checked;wall_ajax({url:wall_url+"ajax/subsOpts.a4d",params:{wallkey:d,subsType:c,unsubscribe_all:a},success:function(g){wall_setWallHTML(d,g)}})}function wall_showSubsOpts(a){document.getElementById("showSubsOpts_"+a).style.display="none";document.getElementById("subscription_options_"+a).style.display="block"}function wall_hideSubsOpts(a){document.getElementById("showSubsOpts_"+a).style.display="block";document.getElementById("subscription_options_"+a).style.display="none"}function post_editor_onfocus(b,a){if(!a.emptied){a.value="";a.emptied=true}a.removeClassName("emptyText")}function editMe(b){var c;if(typeof(b==="string")){c=$(b)}else{c=b}var a=document.createElement("textarea");a.innerHTML=c.innerHTML;a.id=c.identify()+"_ta";a.addClassName("HMCedit");a.onblur=function(){loseFocus(a.identify())};c.replace(a);a.focus()}function loseFocus(a){var b;if(typeof(a==="string")){b=$(a)}else{b=a}if(b.value==""){removeNote(b)}saveChanges()}function editDetails(e){var g;if(typeof(e==="string")){g=$(e)}else{g=e}var d;var a;var h;var b=g.up(".HMCtaskWithLink");var c=b.down(".HMCeditor");toggleTaskItem(c.identify(),"blind")}function addThisPage(){var c=pageTitle();var a=window.location;var b=newNote(c,a,"");b.style.display="none";$("HMCtasks").insert({bottom:b});toggleTaskItem(b.identify(),"appear");saveChanges()}function linkToCurrent(b){var c;if(typeof(b==="string")){c=$(b)}else{c=b}var a=c.up(".HMCtaskWithLink");var d=a.down(".HMChiddenLoc");d.value=window.location;saveChanges()}function pageTitle(){var a=document.title;if(a===""){a="Click to edit title..."}return(a)}function newNote(d,a,b){var c=document.createElement("li");c.addClassName("HMCtaskWithLink");c.innerHTML='<textarea spellcheck="false" class="HMCnote" href="#" onblur="loseFocus(this);">'+d+"</textarea>";c.innerHTML=c.innerHTML+'<div style="display:none;" class="HMCeditor"><span class="HMCeditorHeader">Page URL: <a href="#" onclick="linkToCurrent(this);return(false);">[make current page]</a></span><br /><textarea onblur="saveChanges();" class="HMChiddenLoc">'+a+'</textarea><br /><span class="HMCeditorHeader">Notes:</span><br /><textarea onblur="saveChanges();" class="HMChiddenNotes">'+b+"</textarea></div>";c.innerHTML=c.innerHTML+'<br /><a class="HMCoption" href="'+a+'" onmouseover="updateLink(this);">visit page</a>';c.innerHTML=c.innerHTML+'<a class="HMCoption" href="#" onclick="javascript:editDetails(this);return(false);">edit</a>';c.innerHTML=c.innerHTML+'<a href="#" class="HMCoption" onclick="javascript:removeNote(this);return(false);">delete</a>';return(c)}function removeNote(a){var b;if(typeof(a==="string")){b=$(a)}else{b=a}if(b.up(".HMCtaskWithLink")){b=b.up(".HMCtaskWithLink")}toggleTaskItem(b.identify(),"appear");window.setTimeout('$("'+b.identify()+'").remove();saveChanges();',1000)}function updateLink(c){var d;if(typeof(c==="string")){d=$(c)}else{d=c}var b=d.up(".HMCtaskWithLink");var a=b.down(".HMChiddenLoc").value;if(a.indexOf("http://")===-1){a="http://"+a}d.href=a}function saveChanges(){var d="";var b=$$(".HMCtaskWithLink");for(iX=0;iX<b.length;iX++){d=d+URIEncode(b[iX].down(".HMCnote").value)+",,,";d=d+URIEncode(b[iX].down(".HMChiddenLoc").value)+",,,";d=d+URIEncode(b[iX].down(".HMChiddenNotes").value);d=d+";;;"}if(onIBside()){var a="/asp/TaskBox/saveContent.html"}else{var a="/TaskBox/saveContent.a4p"}var c=URIEncode($("HMCtasks").innerHTML);new Ajax.Request(a,{method:"get",parameters:"TaskListContent="+d})}function loadTaskBoxContent(){window.setTimeout("loadTaskBoxTimeout();",250)}function loadTaskBoxTimeout(){var a=Math.floor(Math.random()*1001);if(onIBside()){var b="/asp/TaskBox/loadContent.html?rand="+a}else{var b="/TaskBox/loadContent.a4p?rand="+a}new Ajax.Request(b,{method:"get",onSuccess:function(g){var d=g.responseText.split(";;;");for(i=0;i<d.length;i++){var c=d[i].split(",,,");if(c.length===3){var e=newNote(c[0],c[1],c[2]);e.style.display="none";$("HMCtasks").insert({bottom:e});toggleTaskItem(e.identify(),"appear")}}}})}function rigCloseButton(){$("facebox").down(".close").onclick=function(){saveChanges()}}function onIBside(){var a=window.location.href.toLowerCase();if(a.indexOf("http://ib")!=-1){return true}else{return false}}function clearList(){var a=$$(".HMCtaskWithLink");var b;for(b=0;b<a.length;b++){toggleTaskItem(a[b].identify(),"fade");if(b==a.length-1){window.setTimeout('$("'+a[b].identify()+'").remove();saveChanges();',1250)}else{window.setTimeout('$("'+a[b].identify()+'").remove();',1000)}}}function toggleTaskItem(b,a){if(typeof(Effect)!="undefined"){if((a=="appear")|(a=="slide")|(a=="blind")){Effect.toggle(b,a)}else{$(b).toggle()}}else{$(b).toggle()}};
