var swfobject=function(){function a(){if(O.readyState=="complete"){O.parentNode.removeChild(O);b()}}function b(){if(!R){if(n.ie&&n.win){var f=z("span");try{var g=t.getElementsByTagName("body")[0].appendChild(f);g.parentNode.removeChild(g)}catch(k){return}}R=true;if(S){clearInterval(S);S=null}f=T.length;for(g=0;g<f;g++)T[g]()}}function c(f){if(R)f();else T[T.length]=f}function d(f){if(typeof B.addEventListener!=A)B.addEventListener("load",f,false);else if(typeof t.addEventListener!=A)t.addEventListener("load", f,false);else if(typeof B.attachEvent!=A)G(B,"onload",f);else if(typeof B.onload=="function"){var g=B.onload;B.onload=function(){g();f()}}else B.onload=f}function e(){for(var f=E.length,g=0;g<f;g++){var k=E[g].id;if(n.pv[0]>0){var l=x(k);if(l){E[g].width=l.getAttribute("width")?l.getAttribute("width"):"0";E[g].height=l.getAttribute("height")?l.getAttribute("height"):"0";if(P(E[g].swfVersion)){n.webkit&&n.webkit<312&&h(l);I(k,true)}else E[g].expressInstall&&!J&&P("6.0.65")&&(n.win||n.mac)?j(E[g]): m(l)}}else I(k,true)}}function h(f){var g=f.getElementsByTagName(F)[0];if(g){var k=z("embed"),l=g.attributes;if(l)for(var r=l.length,u=0;u<r;u++)l[u].nodeName=="DATA"?k.setAttribute("src",l[u].nodeValue):k.setAttribute(l[u].nodeName,l[u].nodeValue);if(g=g.childNodes){l=g.length;for(r=0;r<l;r++)g[r].nodeType==1&&g[r].nodeName=="PARAM"&&k.setAttribute(g[r].getAttribute("name"),g[r].getAttribute("value"))}f.parentNode.replaceChild(k,f)}}function j(f){J=true;var g=x(f.id);if(g){if(f.altContentId){var k= x(f.altContentId);if(k){K=k;U=f.altContentId}}else K=o(g);if(!/%$/.test(f.width)&&parseInt(f.width,10)<310)f.width="310";if(!/%$/.test(f.height)&&parseInt(f.height,10)<137)f.height="137";t.title=t.title.slice(0,47)+" - Flash Player Installation";k="MMredirectURL="+B.location+"&MMplayerType="+(n.ie&&n.win?"ActiveX":"PlugIn")+"&MMdoctitle="+t.title;var l=f.id;if(n.ie&&n.win&&g.readyState!=4){var r=z("div");l+="SWFObjectNew";r.setAttribute("id",l);g.parentNode.insertBefore(r,g);g.style.display="none"; G(B,"onload",function(){g.parentNode.removeChild(g)})}i({data:f.expressInstall,id:Y,width:f.width,height:f.height},{flashvars:k},l)}}function m(f){if(n.ie&&n.win&&f.readyState!=4){var g=z("div");f.parentNode.insertBefore(g,f);g.parentNode.replaceChild(o(f),g);f.style.display="none";G(B,"onload",function(){f.parentNode.removeChild(f)})}else f.parentNode.replaceChild(o(f),f)}function o(f){var g=z("div");if(n.win&&n.ie)g.innerHTML=f.innerHTML;else if(f=f.getElementsByTagName(F)[0])if(f=f.childNodes)for(var k= f.length,l=0;l<k;l++)!(f[l].nodeType==1&&f[l].nodeName=="PARAM")&&f[l].nodeType!=8&&g.appendChild(f[l].cloneNode(true));return g}function i(f,g,k){var l,r=x(k);if(r){if(typeof f.id==A)f.id=k;if(n.ie&&n.win){var u="";for(var w in f)if(f[w]!=Object.prototype[w])if(w.toLowerCase()=="data")g.movie=f[w];else if(w.toLowerCase()=="styleclass")u+=' class="'+f[w]+'"';else if(w.toLowerCase()!="classid")u+=" "+w+'="'+f[w]+'"';w="";for(var s in g)if(g[s]!=Object.prototype[s])w+='<param name="'+s+'" value="'+ g[s]+'" />';r.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+u+">"+w+"</object>";V[V.length]=f.id;l=x(f.id)}else if(n.webkit&&n.webkit<312){s=z("embed");s.setAttribute("type",W);for(u in f)if(f[u]!=Object.prototype[u])if(u.toLowerCase()=="data")s.setAttribute("src",f[u]);else if(u.toLowerCase()=="styleclass")s.setAttribute("class",f[u]);else u.toLowerCase()!="classid"&&s.setAttribute(u,f[u]);for(var C in g)g[C]!=Object.prototype[C]&&C.toLowerCase()!="movie"&&s.setAttribute(C, g[C]);r.parentNode.replaceChild(s,r);l=s}else{s=z(F);s.setAttribute("type",W);for(var y in f)if(f[y]!=Object.prototype[y])if(y.toLowerCase()=="styleclass")s.setAttribute("class",f[y]);else y.toLowerCase()!="classid"&&s.setAttribute(y,f[y]);for(var D in g)g[D]!=Object.prototype[D]&&D.toLowerCase()!="movie"&&p(s,D,g[D]);r.parentNode.replaceChild(s,r);l=s}}return l}function p(f,g,k){var l=z("param");l.setAttribute("name",g);l.setAttribute("value",k);f.appendChild(l)}function v(f){var g=x(f);if(g&&(g.nodeName== "OBJECT"||g.nodeName=="EMBED"))if(n.ie&&n.win)g.readyState==4?q(f):B.attachEvent("onload",function(){q(f)});else g.parentNode.removeChild(g)}function q(f){if(f=x(f)){for(var g in f)if(typeof f[g]=="function")f[g]=null;f.parentNode.removeChild(f)}}function x(f){var g=null;try{g=t.getElementById(f)}catch(k){}return g}function z(f){return t.createElement(f)}function G(f,g,k){f.attachEvent(g,k);L[L.length]=[f,g,k]}function P(f){var g=n.pv;f=f.split(".");f[0]=parseInt(f[0],10);f[1]=parseInt(f[1],10)|| 0;f[2]=parseInt(f[2],10)||0;return g[0]>f[0]||g[0]==f[0]&&g[1]>f[1]||g[0]==f[0]&&g[1]==f[1]&&g[2]>=f[2]?true:false}function Z(f,g){if(!(n.ie&&n.mac)){var k=t.getElementsByTagName("head")[0],l=z("style");l.setAttribute("type","text/css");l.setAttribute("media","screen");!(n.ie&&n.win)&&typeof t.createTextNode!=A&&l.appendChild(t.createTextNode(f+" {"+g+"}"));k.appendChild(l);if(n.ie&&n.win&&typeof t.styleSheets!=A&&t.styleSheets.length>0){k=t.styleSheets[t.styleSheets.length-1];typeof k.addRule==F&& k.addRule(f,g)}}}function I(f,g){g=g?"visible":"hidden";if(R&&x(f))x(f).style.visibility=g;else Z("#"+f,"visibility:"+g)}function aa(f){return/[\\\"<>\.;]/.exec(f)!=null?encodeURIComponent(f):f}var A="undefined",F="object",W="application/x-shockwave-flash",Y="SWFObjectExprInst",B=window,t=document,H=navigator,T=[],E=[],V=[],L=[],O,S=null,K=null,U=null,R=false,J=false,n=function(){var f=typeof t.getElementById!=A&&typeof t.getElementsByTagName!=A&&typeof t.createElement!=A,g=[0,0,0],k=null;if(typeof H.plugins!= A&&typeof H.plugins["Shockwave Flash"]==F){if((k=H.plugins["Shockwave Flash"].description)&&!(typeof H.mimeTypes!=A&&H.mimeTypes[W]&&!H.mimeTypes[W].enabledPlugin)){k=k.replace(/^.*\s+(\S+\s+\S+$)/,"$1");g[0]=parseInt(k.replace(/^(.*)\..*$/,"$1"),10);g[1]=parseInt(k.replace(/^.*\.(.*)\s.*$/,"$1"),10);g[2]=/r/.test(k)?parseInt(k.replace(/^.*r(.*)$/,"$1"),10):0}}else if(typeof B.ActiveXObject!=A){var l=null,r=false;try{l=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(u){try{l=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); g=[6,0,21];l.AllowScriptAccess="always"}catch(w){if(g[0]==6)r=true}if(!r)try{l=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(s){}}if(!r&&l)try{if(k=l.GetVariable("$version")){k=k.split(" ")[1].split(",");g=[parseInt(k[0],10),parseInt(k[1],10),parseInt(k[2],10)]}}catch(C){}}r=H.userAgent.toLowerCase();var y=H.platform.toLowerCase();k=/webkit/.test(r)?parseFloat(r.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false;l=y?/win/.test(y):/win/.test(r);r=y?/mac/.test(y):/mac/.test(r);return{w3cdom:f, pv:g,webkit:k,ie:false,win:l,mac:r}}();(function(){if(n.w3cdom){c(e);if(n.ie&&n.win)try{t.write("<script id=__ie_ondomload defer=true src=//:><\/script>");(O=x("__ie_ondomload"))&&G(O,"onreadystatechange",a)}catch(f){}if(n.webkit&&typeof t.readyState!=A)S=setInterval(function(){/loaded|complete/.test(t.readyState)&&b()},10);typeof t.addEventListener!=A&&t.addEventListener("DOMContentLoaded",b,null);d(b)}})();(function(){n.ie&&n.win&&window.attachEvent("onunload",function(){for(var f=L.length,g=0;g< f;g++)L[g][0].detachEvent(L[g][1],L[g][2]);f=V.length;for(g=0;g<f;g++)v(V[g]);for(var k in n)n[k]=null;n=null;for(var l in swfobject)swfobject[l]=null;swfobject=null})})();return{registerObject:function(f,g,k){if(!(!n.w3cdom||!f||!g)){var l={};l.id=f;l.swfVersion=g;l.expressInstall=k?k:false;E[E.length]=l;I(f,false)}},getObjectById:function(f){var g=null;if(n.w3cdom)if(f=x(f)){var k=f.getElementsByTagName(F)[0];if(!k||k&&typeof f.SetVariable!=A)g=f;else if(typeof k.SetVariable!=A)g=k}return g},embedSWF:function(f, g,k,l,r,u,w,s,C){if(!(!n.w3cdom||!f||!g||!k||!l||!r)){k+="";l+="";if(P(r)){I(g,false);var y={};if(C&&typeof C===F)for(var D in C)if(C[D]!=Object.prototype[D])y[D]=C[D];y.data=f;y.width=k;y.height=l;var Q={};if(s&&typeof s===F)for(var X in s)if(s[X]!=Object.prototype[X])Q[X]=s[X];if(w&&typeof w===F)for(var M in w)if(w[M]!=Object.prototype[M])if(typeof Q.flashvars!=A)Q.flashvars+="&"+M+"="+w[M];else Q.flashvars=M+"="+w[M];c(function(){i(y,Q,g);y.id==g&&I(g,true)})}else if(u&&!J&&P("6.0.65")&&(n.win|| n.mac)){J=true;I(g,false);c(function(){var N={};N.id=N.altContentId=g;N.width=k;N.height=l;N.expressInstall=u;j(N)})}}},getFlashPlayerVersion:function(){return{major:n.pv[0],minor:n.pv[1],release:n.pv[2]}},hasFlashPlayerVersion:P,createSWF:function(f,g,k){if(n.w3cdom)return i(f,g,k)},removeSWF:function(f){n.w3cdom&&v(f)},createCSS:function(f,g){n.w3cdom&&Z(f,g)},addDomLoadEvent:c,addLoadEvent:d,getQueryParamValue:function(f){var g=t.location.search||t.location.hash;if(f==null)return aa(g);if(g){g= g.substring(1).split("&");for(var k=0;k<g.length;k++)if(g[k].substring(0,g[k].indexOf("="))==f)return aa(g[k].substring(g[k].indexOf("=")+1))}return""},expressInstallCallback:function(){if(J&&K){var f=x(Y);if(f){f.parentNode.replaceChild(K,f);if(U){I(U,true);if(n.ie&&n.win)K.style.display="block"}U=K=null;J=false}}}}}(); function formCheck(a,b,c){var d="Please complete the following fields:\n",e=d.length;if(a.name.value=="")d+=" - We would like to know what to call you\n";if(/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i.test(a.email_address.value)==false)d+=" - You have not entered a valid email address\n";if(d.length==e){$("submitted_"+b).innerHTML="<p>Requesting demo account...</p>";new Ajax.Updater("package_"+c+"_login","/dataPageASP/demo_account.asp",{asynchronous:true,onComplete:function(){document.location.reload("coshh_risk_assessment_contact_us_received.asp")}, parameters:Form.serialize(b)})}else alert(d)} function formCheck_email_contact(a,b,c){var d="Please complete the following fields:\n",e=d.length;if(a.name_email.value=="")d+=" - We would like to know what to call you\n";if(a.email.value=="")d+=" - We would need your email address\n";if(/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i.test(a.email.value)==false)d+=" - You have not entered a valid email address\n";if(d.length==e){document.getElementById("buttonTEXT_email").value="Requesting...";new Ajax.Updater(c,"/dataPageASP/email_me.asp", {asynchronous:true,onComplete:function(){document.location.reload("coshh_risk_assessment_contact_us_received.asp")},parameters:Form.serialize(b)})}else alert(d)} function formCheck_download(a,b,c){var d="Please complete the following fields:\n",e=d.length;if(a.name_download.value=="")d+=" - We would like to know what to call you\n";if(a.email_download.value=="")d+=" - We would need your email address\n";if(a.referral_download.value=="")d+=" - Please let us know how you heard about us (referral)\n";if(/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i.test(a.email_download.value)==false)d+=" - You have not entered a valid email address\n";if(d.length== e){document.getElementById("removeButton").innerHTML="Please wait...";document.free_pack.submit();alert("Your pack will arrive by email shortly. Please check your junk mail folder and that you have adequate mail space available. The attachment is 2 meg in size.");window.location="coshh_risk_assessment_software_downloaded.asp";/*new Ajax.Updater(c,"http://www.coshhtool.co.uk/pack_email.asp",{asynchronous:true,onComplete:function(){alert("Your pack will arrive by email shortly. Please check your junk mail folder and that you have adequate mail space available. The attachment is 2 meg in size.");window.location="coshh_risk_assessment_software_downloaded.asp"},parameters:Form.serialize(b)})*/}else alert(d)} function formCheck_callback(a,b,c){var d="Please complete the following fields:\n",e=d.length;if(a.name.value=="")d+=" - We would like to know what to call you\n";if(a.phone.value=="")d+=" - We would need a telephone number\n";if(d.length==e){document.getElementById("buttonTEXT").value="Requesting...";new Ajax.Updater(c,"/dataPageASP/call_back.asp",{asynchronous:true,onComplete:function(){document.location.reload("coshh_risk_assessment_contact_us_received.asp")},parameters:Form.serialize(b)})}else alert(d)} function show_form(a){$("package_"+a+"_info").hide();return false,$("package_"+a+"_login").appear({duration:1})}function show_package(a){$("package_"+a+"_read").hide();return false,$("package_"+a+"_text").appear({duration:1})}function cancel_form(a){$("package_"+a+"_login").hide();return false,$("package_"+a+"_info").appear({duration:1})} function getFlashMovieObject(a){if(window.document[a])return window.document[a];if(navigator.appName.indexOf("Microsoft Internet")==-1){if(document.embeds&&document.embeds[a])return document.embeds[a]}else return document.getElementById(a)}function StopFlashMovie(){getFlashMovieObject("csSWF").StopPlay()}function PlayFlashMovie(){getFlashMovieObject("csSWF").Play()} var Prototype={Version:"1.6.0",Browser:{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)},BrowserFeatures:{XPath:!!document.evaluate,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement("div").__proto__&&document.createElement("div").__proto__!== document.createElement("form").__proto__},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari)Prototype.BrowserFeatures.SpecificElementExtensions=false;if(Prototype.Browser.WebKit)Prototype.BrowserFeatures.XPath=false; var Class={create:function(){function a(){this.initialize.apply(this,arguments)}var b=null,c=$A(arguments);if(Object.isFunction(c[0]))b=c.shift();Object.extend(a,Class.Methods);a.superclass=b;a.subclasses=[];if(b){var d=function(){};d.prototype=b.prototype;a.prototype=new d;b.subclasses.push(a)}for(b=0;b<c.length;b++)a.addMethods(c[b]);if(!a.prototype.initialize)a.prototype.initialize=Prototype.emptyFunction;return a.prototype.constructor=a}}; Class.Methods={addMethods:function(a){var b=this.superclass&&this.superclass.prototype,c=Object.keys(a);Object.keys({toString:true}).length||c.push("toString","valueOf");for(var d=0,e=c.length;d<e;d++){var h=c[d],j=a[h];if(b&&Object.isFunction(j)&&j.argumentNames().first()=="$super"){var m=j;j=Object.extend(function(o){return function(){return b[o].apply(this,arguments)}}(h).wrap(m),{valueOf:function(){return m},toString:function(){return m.toString()}})}this.prototype[h]=j}return this}}; var Abstract={};Object.extend=function(a,b){for(var c in b)a[c]=b[c];return a}; Object.extend(Object,{inspect:function(a){try{if(a===undefined)return"undefined";if(a===null)return"null";return a.inspect?a.inspect():a.toString()}catch(b){if(b instanceof RangeError)return"...";throw b;}},toJSON:function(a){switch(typeof a){case "undefined":case "function":case "unknown":return;case "boolean":return a.toString()}if(a===null)return"null";if(a.toJSON)return a.toJSON();if(!Object.isElement(a)){var b=[];for(var c in a){var d=Object.toJSON(a[c]);d!==undefined&&b.push(c.toJSON()+": "+ d)}return"{"+b.join(", ")+"}"}},toQueryString:function(a){return $H(a).toQueryString()},toHTML:function(a){return a&&a.toHTML?a.toHTML():String.interpret(a)},keys:function(a){var b=[];for(var c in a)b.push(c);return b},values:function(a){var b=[];for(var c in a)b.push(a[c]);return b},clone:function(a){return Object.extend({},a)},isElement:function(a){return a&&a.nodeType==1},isArray:function(a){return a&&a.constructor===Array},isHash:function(a){return a instanceof Hash},isFunction:function(a){return typeof a== "function"},isString:function(a){return typeof a=="string"},isNumber:function(a){return typeof a=="number"},isUndefined:function(a){return typeof a=="undefined"}}); Object.extend(Function.prototype,{argumentNames:function(){var a=this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip");return a.length==1&&!a[0]?[]:a},bind:function(){if(arguments.length<2&&arguments[0]===undefined)return this;var a=this,b=$A(arguments),c=b.shift();return function(){return a.apply(c,b.concat($A(arguments)))}},bindAsEventListener:function(){var a=this,b=$A(arguments),c=b.shift();return function(d){return a.apply(c,[d||window.event].concat(b))}},curry:function(){if(!arguments.length)return this; var a=this,b=$A(arguments);return function(){return a.apply(this,b.concat($A(arguments)))}},delay:function(){var a=this,b=$A(arguments),c=b.shift()*1E3;return window.setTimeout(function(){return a.apply(a,b)},c)},wrap:function(a){var b=this;return function(){return a.apply(this,[b.bind(this)].concat($A(arguments)))}},methodize:function(){if(this._methodized)return this._methodized;var a=this;return this._methodized=function(){return a.apply(null,[this].concat($A(arguments)))}}}); Function.prototype.defer=Function.prototype.delay.curry(0.01);Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+'Z"'};var Try={these:function(){for(var a,b=0,c=arguments.length;b<c;b++){var d=arguments[b];try{a=d();break}catch(e){}}return a}};RegExp.prototype.match=RegExp.prototype.test; RegExp.escape=function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}; var PeriodicalExecuter=Class.create({initialize:function(a,b){this.callback=a;this.frequency=b;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1E3)},execute:function(){this.callback(this)},stop:function(){if(this.timer){clearInterval(this.timer);this.timer=null}},onTimerEvent:function(){if(!this.currentlyExecuting)try{this.currentlyExecuting=true;this.execute()}finally{this.currentlyExecuting=false}}}); Object.extend(String,{interpret:function(a){return a==null?"":String(a)},specialChar:{"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r","\\":"\\\\"}}); Object.extend(String.prototype,{gsub:function(a,b){var c="",d=this,e;for(b=arguments.callee.prepareReplacement(b);d.length>0;)if(e=d.match(a)){c+=d.slice(0,e.index);c+=String.interpret(b(e));d=d.slice(e.index+e[0].length)}else{c+=d;d=""}return c},sub:function(a,b,c){b=this.gsub.prepareReplacement(b);c=c===undefined?1:c;return this.gsub(a,function(d){if(--c<0)return d[0];return b(d)})},scan:function(a,b){this.gsub(a,b);return String(this)},truncate:function(a,b){a=a||30;b=b===undefined?"...":b;return this.length> a?this.slice(0,a-b.length)+b:String(this)},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")},extractScripts:function(){var a=new RegExp(Prototype.ScriptFragment,"img"),b=new RegExp(Prototype.ScriptFragment,"im");return(this.match(a)||[]).map(function(c){return(c.match(b)||["",""])[1]})},evalScripts:function(){return this.extractScripts().map(function(a){return eval(a)})}, escapeHTML:function(){var a=arguments.callee;a.text.data=this;return a.div.innerHTML},unescapeHTML:function(){var a=new Element("div");a.innerHTML=this.stripTags();return a.childNodes[0]?a.childNodes.length>1?$A(a.childNodes).inject("",function(b,c){return b+c.nodeValue}):a.childNodes[0].nodeValue:""},toQueryParams:function(a){var b=this.strip().match(/([^?#]*)(#.*)?$/);if(!b)return{};return b[1].split(a||"&").inject({},function(c,d){if((d=d.split("="))[0]){var e=decodeURIComponent(d.shift());d=d.length> 1?d.join("="):d[0];if(d!=undefined)d=decodeURIComponent(d);if(e in c){Object.isArray(c[e])||(c[e]=[c[e]]);c[e].push(d)}else c[e]=d}return c})},toArray:function(){return this.split("")},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)},times:function(a){return a<1?"":(new Array(a+1)).join(this)},camelize:function(){var a=this.split("-"),b=a.length;if(b==1)return a[0];for(var c=this.charAt(0)=="-"?a[0].charAt(0).toUpperCase()+a[0].substring(1): a[0],d=1;d<b;d++)c+=a[d].charAt(0).toUpperCase()+a[d].substring(1);return c},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},underscore:function(){return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase()},dasherize:function(){return this.gsub(/_/,"-")},inspect:function(a){var b=this.gsub(/[\x00-\x1f\\]/,function(c){var d=String.specialChar[c[0]];return d?d:"\\u00"+c[0].charCodeAt().toPaddedString(2, 16)});if(a)return'"'+b.replace(/"/g,'\\"')+'"';return"'"+b.replace(/'/g,"\\'")+"'"},toJSON:function(){return this.inspect(true)},unfilterJSON:function(a){return this.sub(a||Prototype.JSONFilter,"#{1}")},isJSON:function(){return/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/.test(this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))},evalJSON:function(a){var b=this.unfilterJSON();try{if(!a||b.isJSON())return eval("("+b+")")}catch(c){}throw new SyntaxError("Badly formed JSON string: "+this.inspect());},include:function(a){return this.indexOf(a)> -1},startsWith:function(a){return this.indexOf(a)===0},endsWith:function(a){var b=this.length-a.length;return b>=0&&this.lastIndexOf(a)===b},empty:function(){return this==""},blank:function(){return/^\s*$/.test(this)},interpolate:function(a,b){return(new Template(this,b)).evaluate(a)}}); if(Prototype.Browser.WebKit||Prototype.Browser.IE)Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},unescapeHTML:function(){return this.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">")}});String.prototype.gsub.prepareReplacement=function(a){if(Object.isFunction(a))return a;var b=new Template(a);return function(c){return b.evaluate(c)}};String.prototype.parseQuery=String.prototype.toQueryParams; Object.extend(String.prototype.escapeHTML,{div:document.createElement("div"),text:document.createTextNode("")});with(String.prototype.escapeHTML)div.appendChild(text); var Template=Class.create({initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(a){if(Object.isFunction(a.toTemplateReplacements))a=a.toTemplateReplacements();return this.template.gsub(this.pattern,function(b){if(a==null)return"";var c=b[1]||"";if(c=="\\")return b[2];var d=a,e=b[3],h=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;b=h.exec(e);if(b==null)return c;for(;b!=null;){var j=b[1].startsWith("[")?b[2].gsub("\\\\]","]"):b[1];d=d[j];if(null==d||""== b[3])break;e=e.substring("["==b[3]?b[1].length:b[0].length);b=h.exec(e)}return c+String.interpret(d)}.bind(this))}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/; var $break={},Enumerable={each:function(a,b){var c=0;a=a.bind(b);try{this._each(function(e){a(e,c++)})}catch(d){if(d!=$break)throw d;}return this},eachSlice:function(a,b,c){b=b?b.bind(c):Prototype.K;for(var d=-a,e=[],h=this.toArray();(d+=a)<h.length;)e.push(h.slice(d,d+a));return e.collect(b,c)},all:function(a,b){a=a?a.bind(b):Prototype.K;var c=true;this.each(function(d,e){c=c&&!!a(d,e);if(!c)throw $break;});return c},any:function(a,b){a=a?a.bind(b):Prototype.K;var c=false;this.each(function(d,e){if(c= !!a(d,e))throw $break;});return c},collect:function(a,b){a=a?a.bind(b):Prototype.K;var c=[];this.each(function(d,e){c.push(a(d,e))});return c},detect:function(a,b){a=a.bind(b);var c;this.each(function(d,e){if(a(d,e)){c=d;throw $break;}});return c},findAll:function(a,b){a=a.bind(b);var c=[];this.each(function(d,e){a(d,e)&&c.push(d)});return c},grep:function(a,b,c){b=b?b.bind(c):Prototype.K;var d=[];if(Object.isString(a))a=new RegExp(a);this.each(function(e,h){a.match(e)&&d.push(b(e,h))});return d}, include:function(a){if(Object.isFunction(this.indexOf))if(this.indexOf(a)!=-1)return true;var b=false;this.each(function(c){if(c==a){b=true;throw $break;}});return b},inGroupsOf:function(a,b){b=b===undefined?null:b;return this.eachSlice(a,function(c){for(;c.length<a;)c.push(b);return c})},inject:function(a,b,c){b=b.bind(c);this.each(function(d,e){a=b(a,d,e)});return a},invoke:function(a){var b=$A(arguments).slice(1);return this.map(function(c){return c[a].apply(c,b)})},max:function(a,b){a=a?a.bind(b): Prototype.K;var c;this.each(function(d,e){d=a(d,e);if(c==undefined||d>=c)c=d});return c},min:function(a,b){a=a?a.bind(b):Prototype.K;var c;this.each(function(d,e){d=a(d,e);if(c==undefined||d<c)c=d});return c},partition:function(a,b){a=a?a.bind(b):Prototype.K;var c=[],d=[];this.each(function(e,h){(a(e,h)?c:d).push(e)});return[c,d]},pluck:function(a){var b=[];this.each(function(c){b.push(c[a])});return b},reject:function(a,b){a=a.bind(b);var c=[];this.each(function(d,e){a(d,e)||c.push(d)});return c}, sortBy:function(a,b){a=a.bind(b);return this.map(function(c,d){return{value:c,criteria:a(c,d)}}).sort(function(c,d){c=c.criteria;d=d.criteria;return c<d?-1:c>d?1:0}).pluck("value")},toArray:function(){return this.map()},zip:function(){var a=Prototype.K,b=$A(arguments);if(Object.isFunction(b.last()))a=b.pop();var c=[this].concat(b).map($A);return this.map(function(d,e){return a(c.pluck(e))})},size:function(){return this.toArray().length},inspect:function(){return"#<Enumerable:"+this.toArray().inspect()+ ">"}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any});function $A(a){if(!a)return[];if(a.toArray)return a.toArray();for(var b=a.length,c=new Array(b);b--;)c[b]=a[b];return c} if(Prototype.Browser.WebKit){function $A(a){if(!a)return[];if(!(Object.isFunction(a)&&a=="[object NodeList]")&&a.toArray)return a.toArray();for(var b=a.length,c=new Array(b);b--;)c[b]=a[b];return c}}Array.from=$A;Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse)Array.prototype._reverse=Array.prototype.reverse; Object.extend(Array.prototype,{_each:function(a){for(var b=0,c=this.length;b<c;b++)a(this[b])},clear:function(){this.length=0;return this},first:function(){return this[0]},last:function(){return this[this.length-1]},compact:function(){return this.select(function(a){return a!=null})},flatten:function(){return this.inject([],function(a,b){return a.concat(Object.isArray(b)?b.flatten():[b])})},without:function(){var a=$A(arguments);return this.select(function(b){return!a.include(b)})},reverse:function(a){return(a!== false?this:this.toArray())._reverse()},reduce:function(){return this.length>1?this:this[0]},uniq:function(a){return this.inject([],function(b,c,d){if(0==d||(a?b.last()!=c:!b.include(c)))b.push(c);return b})},intersect:function(a){return this.uniq().findAll(function(b){return a.detect(function(c){return b===c})})},clone:function(){return[].concat(this)},size:function(){return this.length},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]"},toJSON:function(){var a=[];this.each(function(b){b= Object.toJSON(b);b!==undefined&&a.push(b)});return"["+a.join(", ")+"]"}});if(Object.isFunction(Array.prototype.forEach))Array.prototype._each=Array.prototype.forEach;if(!Array.prototype.indexOf)Array.prototype.indexOf=function(a,b){b||(b=0);var c=this.length;if(b<0)b=c+b;for(;b<c;b++)if(this[b]===a)return b;return-1};if(!Array.prototype.lastIndexOf)Array.prototype.lastIndexOf=function(a,b){b=isNaN(b)?this.length:(b<0?this.length+b:b)+1;a=this.slice(0,b).reverse().indexOf(a);return a<0?a:b-a-1}; Array.prototype.toArray=Array.prototype.clone;function $w(a){if(!Object.isString(a))return[];return(a=a.strip())?a.split(/\s+/):[]}if(Prototype.Browser.Opera)Array.prototype.concat=function(){for(var a=[],b=0,c=this.length;b<c;b++)a.push(this[b]);b=0;for(c=arguments.length;b<c;b++)if(Object.isArray(arguments[b]))for(var d=0,e=arguments[b].length;d<e;d++)a.push(arguments[b][d]);else a.push(arguments[b]);return a}; Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16)},succ:function(){return this+1},times:function(a){$R(0,this,true).each(a);return this},toPaddedString:function(a,b){b=this.toString(b||10);return"0".times(a-b.length)+b},toJSON:function(){return isFinite(this)?this.toString():"null"}});$w("abs round ceil floor").each(function(a){Number.prototype[a]=Math[a].methodize()});function $H(a){return new Hash(a)} var Hash=Class.create(Enumerable,function(){function a(c,d){if(Object.isUndefined(d))return c;return c+"="+encodeURIComponent(String.interpret(d))}if(function(){var c=0,d=function(h){this.key=h};d.prototype.key="foo";for(var e in new d("bar"))c++;return c>1}()){function b(c){var d=[];for(var e in this._object){var h=this._object[e];if(!d.include(e)){d.push(e);var j=[e,h];j.key=e;j.value=h;c(j)}}}}else{function b(c){for(var d in this._object){var e=this._object[d],h=[d,e];h.key=d;h.value=e;c(h)}}}return{initialize:function(c){this._object= Object.isHash(c)?c.toObject():Object.clone(c)},_each:b,set:function(c,d){return this._object[c]=d},get:function(c){return this._object[c]},unset:function(c){var d=this._object[c];delete this._object[c];return d},toObject:function(){return Object.clone(this._object)},keys:function(){return this.pluck("key")},values:function(){return this.pluck("value")},index:function(c){var d=this.detect(function(e){return e.value===c});return d&&d.key},merge:function(c){return this.clone().update(c)},update:function(c){return(new Hash(c)).inject(this, function(d,e){d.set(e.key,e.value);return d})},toQueryString:function(){return this.map(function(c){var d=encodeURIComponent(c.key);if((c=c.value)&&typeof c=="object")if(Object.isArray(c))return c.map(a.curry(d)).join("&");return a(d,c)}).join("&")},inspect:function(){return"#<Hash:{"+this.map(function(c){return c.map(Object.inspect).join(": ")}).join(", ")+"}>"},toJSON:function(){return Object.toJSON(this.toObject())},clone:function(){return new Hash(this)}}}()); Hash.prototype.toTemplateReplacements=Hash.prototype.toObject;Hash.from=$H; var ObjectRange=Class.create(Enumerable,{initialize:function(a,b,c){this.start=a;this.end=b;this.exclusive=c},_each:function(a){for(var b=this.start;this.include(b);){a(b);b=b.succ()}},include:function(a){if(a<this.start)return false;if(this.exclusive)return a<this.end;return a<=this.end}}),$R=function(a,b,c){return new ObjectRange(a,b,c)},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){this.include(a)||this.responders.push(a)},unregister:function(a){this.responders=this.responders.without(a)},dispatch:function(a,b,c,d){this.each(function(e){if(Object.isFunction(e[a]))try{e[a].apply(e,[b,c,d])}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.isString(this.options.parameters))this.options.parameters=this.options.parameters.toQueryParams()}}); Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,b,c){$super(c);this.transport=Ajax.getTransport();this.request(b)},request:function(a){this.url=a;this.method=this.options.method;a=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){a._method=this.method;this.method="post"}this.parameters=a;if(a=Object.toQueryString(a))if(this.method=="get")this.url+=(this.url.include("?")?"&":"?")+a;else if(/Konqueror|Safari|KHTML/.test(navigator.userAgent))a+= "&_=";try{var b=new Ajax.Response(this);this.options.onCreate&&this.options.onCreate(b);Ajax.Responders.dispatch("onCreate",this,b);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);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||a:null;this.transport.send(this.body);!this.options.asynchronous&&this.transport.overrideMimeType&& this.onStateChange()}catch(c){this.dispatchException(c)}},onStateChange:function(){var a=this.transport.readyState;a>1&&!(a==4&&this._complete)&&this.respondToReadyState(this.transport.readyState)},setRequestHeaders:function(){var a={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){a["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)a.Connection="close"}if(typeof this.options.requestHeaders=="object"){var b=this.options.requestHeaders;if(Object.isFunction(b.push))for(var c=0,d=b.length;c<d;c+=2)a[b[c]]=b[c+1];else $H(b).each(function(h){a[h.key]=h.value})}for(var e in a)this.transport.setRequestHeader(e,a[e])},success:function(){var a=this.getStatus();return!a||a>=200&&a<300},getStatus:function(){try{return this.transport.status|| 0}catch(a){return 0}},respondToReadyState:function(a){a=Ajax.Request.Events[a];var b=new Ajax.Response(this);if(a=="Complete"){try{this._complete=true;(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(b,b.headerJSON)}catch(c){this.dispatchException(c)}var d=b.getHeader("Content-type");if(this.options.evalJS=="force"||this.options.evalJS&&d&&d.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))this.evalResponse()}try{(this.options["on"+ a]||Prototype.emptyFunction)(b,b.headerJSON);Ajax.Responders.dispatch("on"+a,this,b,b.headerJSON)}catch(e){this.dispatchException(e)}if(a=="Complete")this.transport.onreadystatechange=Prototype.emptyFunction},getHeader:function(a){try{return this.transport.getResponseHeader(a)}catch(b){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(a){this.dispatchException(a)}},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(a){this.request=a;a=this.transport=a.transport;var b=this.readyState=a.readyState;if(b>2&&!Prototype.Browser.IE||b==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(a.responseText);this.headerJSON=this._getHeaderJSON()}if(b==4){a=a.responseXML;this.responseXML=a===undefined?null:a;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)}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"))return null;try{return this.transport.responseText.evalJSON(a.sanitizeJSON)}catch(b){this.request.dispatchException(b)}}}); Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,b,c,d){this.container={success:b.success||b,failure:b.failure||(b.success?null:b)};d=d||{};var e=d.onComplete;d.onComplete=function(h,j){this.updateContent(h.responseText);Object.isFunction(e)&&e(h,j)}.bind(this);$super(c,d)},updateContent:function(a){var b=this.container[this.success()?"success":"failure"],c=this.options;c.evalScripts||(a=a.stripScripts());if(b=$(b))if(c.insertion)if(Object.isString(c.insertion)){var d={};d[c.insertion]= a;b.insert(d)}else c.insertion(b,a);else b.update(a);this.success()&&this.onComplete&&this.onComplete.bind(this).defer()}}); Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,b,c,d){$super(d);this.onComplete=this.options.onComplete;this.frequency=this.options.frequency||2;this.decay=this.options.decay||1;this.updater={};this.container=b;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 $(a){if(arguments.length>1){for(var b=0,c=[],d=arguments.length;b<d;b++)c.push($(arguments[b]));return c}if(Object.isString(a))a=document.getElementById(a);return Element.extend(a)}if(Prototype.BrowserFeatures.XPath)document._getElementsByXPath=function(a,b){var c=[];a=document.evaluate(a,$(b)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);b=0;for(var d=a.snapshotLength;b<d;b++)c.push(Element.extend(a.snapshotItem(b)));return c};if(!window.Node)var Node={}; Node.ELEMENT_NODE||Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12}); (function(){var a=this.Element;this.Element=function(b,c){c=c||{};b=b.toLowerCase();var d=Element.cache;if(Prototype.Browser.IE&&c.name){b="<"+b+' name="'+c.name+'">';delete c.name;return Element.writeAttribute(document.createElement(b),c)}d[b]||(d[b]=Element.extend(document.createElement(b)));return Element.writeAttribute(d[b].cloneNode(false),c)};Object.extend(this.Element,a||{})}).call(window);Element.cache={}; Element.Methods={visible:function(a){return $(a).style.display!="none"},toggle:function(a){a=$(a);Element[Element.visible(a)?"hide":"show"](a);return a},hide:function(a){$(a).style.display="none";return a},show:function(a){$(a).style.display="";return a},remove:function(a){a=$(a);a.parentNode.removeChild(a);return a},update:function(a,b){a=$(a);if(b&&b.toElement)b=b.toElement();if(Object.isElement(b))return a.update().insert(b);b=Object.toHTML(b);a.innerHTML=b.stripScripts();b.evalScripts.bind(b).defer(); return a},replace:function(a,b){a=$(a);if(b&&b.toElement)b=b.toElement();else if(!Object.isElement(b)){b=Object.toHTML(b);var c=a.ownerDocument.createRange();c.selectNode(a);b.evalScripts.bind(b).defer();b=c.createContextualFragment(b.stripScripts())}a.parentNode.replaceChild(b,a);return a},insert:function(a,b){a=$(a);if(Object.isString(b)||Object.isNumber(b)||Object.isElement(b)||b&&(b.toElement||b.toHTML))b={bottom:b};var c,d,e;for(position in b){c=b[position];position=position.toLowerCase();d= Element._insertionTranslations[position];if(c&&c.toElement)c=c.toElement();if(Object.isElement(c))d.insert(a,c);else{c=Object.toHTML(c);e=a.ownerDocument.createRange();d.initializeRange(a,e);d.insert(a,e.createContextualFragment(c.stripScripts()));c.evalScripts.bind(c).defer()}}return a},wrap:function(a,b,c){a=$(a);if(Object.isElement(b))$(b).writeAttribute(c||{});else b=Object.isString(b)?new Element(b,c):new Element("div",b);a.parentNode&&a.parentNode.replaceChild(b,a);b.appendChild(a);return b}, inspect:function(a){a=$(a);var b="<"+a.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(c){var d=c.first();c=c.last();if(d=(a[d]||"").toString())b+=" "+c+"="+d.inspect(true)});return b+">"},recursivelyCollect:function(a,b){a=$(a);for(var c=[];a=a[b];)a.nodeType==1&&c.push(Element.extend(a));return c},ancestors:function(a){return $(a).recursivelyCollect("parentNode")},descendants:function(a){return $A($(a).getElementsByTagName("*")).each(Element.extend)},firstDescendant:function(a){for(a= $(a).firstChild;a&&a.nodeType!=1;)a=a.nextSibling;return $(a)},immediateDescendants:function(a){if(!(a=$(a).firstChild))return[];for(;a&&a.nodeType!=1;)a=a.nextSibling;if(a)return[a].concat($(a).nextSiblings());return[]},previousSiblings:function(a){return $(a).recursivelyCollect("previousSibling")},nextSiblings:function(a){return $(a).recursivelyCollect("nextSibling")},siblings:function(a){a=$(a);return a.previousSiblings().reverse().concat(a.nextSiblings())},match:function(a,b){if(Object.isString(b))b= new Selector(b);return b.match($(a))},up:function(a,b,c){a=$(a);if(arguments.length==1)return $(a.parentNode);var d=a.ancestors();return b?Selector.findElement(d,b,c):d[c||0]},down:function(a,b,c){a=$(a);if(arguments.length==1)return a.firstDescendant();var d=a.descendants();return b?Selector.findElement(d,b,c):d[c||0]},previous:function(a,b,c){a=$(a);if(arguments.length==1)return $(Selector.handlers.previousElementSibling(a));var d=a.previousSiblings();return b?Selector.findElement(d,b,c):d[c||0]}, next:function(a,b,c){a=$(a);if(arguments.length==1)return $(Selector.handlers.nextElementSibling(a));var d=a.nextSiblings();return b?Selector.findElement(d,b,c):d[c||0]},select:function(){var a=$A(arguments),b=$(a.shift());return Selector.findChildElements(b,a)},adjacent:function(){var a=$A(arguments),b=$(a.shift());return Selector.findChildElements(b.parentNode,a).without(b)},identify:function(a){a=$(a);var b=a.readAttribute("id"),c=arguments.callee;if(b)return b;do b="anonymous_element_"+c.counter++; while($(b));a.writeAttribute("id",b);return b},readAttribute:function(a,b){a=$(a);if(Prototype.Browser.IE){var c=Element._attributeTranslations.read;if(c.values[b])return c.values[b](a,b);if(c.names[b])b=c.names[b];if(b.include(":"))return!a.attributes||!a.attributes[b]?null:a.attributes[b].value}return a.getAttribute(b)},writeAttribute:function(a,b,c){a=$(a);var d={},e=Element._attributeTranslations.write;if(typeof b=="object")d=b;else d[b]=c===undefined?true:c;for(var h in d){b=e.names[h]||h;c= d[h];if(e.values[h])b=e.values[h](a,c);if(c===false||c===null)a.removeAttribute(b);else c===true?a.setAttribute(b,b):a.setAttribute(b,c)}return a},getHeight:function(a){return $(a).getDimensions().height},getWidth:function(a){return $(a).getDimensions().width},classNames:function(a){return new Element.ClassNames(a)},hasClassName:function(a,b){if(a=$(a)){a=a.className;return a.length>0&&(a==b||(new RegExp("(^|\\s)"+b+"(\\s|$)")).test(a))}},addClassName:function(a,b){if(a=$(a)){a.hasClassName(b)||(a.className+= (a.className?" ":"")+b);return a}},removeClassName:function(a,b){if(a=$(a)){a.className=a.className.replace(new RegExp("(^|\\s+)"+b+"(\\s+|$)")," ").strip();return a}},toggleClassName:function(a,b){if(a=$(a))return a[a.hasClassName(b)?"removeClassName":"addClassName"](b)},cleanWhitespace:function(a){a=$(a);for(var b=a.firstChild;b;){var c=b.nextSibling;b.nodeType==3&&!/\S/.test(b.nodeValue)&&a.removeChild(b);b=c}return a},empty:function(a){return $(a).innerHTML.blank()},descendantOf:function(a,b){a= $(a);b=$(b);if(a.compareDocumentPosition)return(a.compareDocumentPosition(b)&8)===8;if(a.sourceIndex&&!Prototype.Browser.Opera){var c=a.sourceIndex,d=b.sourceIndex,e=b.nextSibling;if(!e){do b=b.parentNode;while(!(e=b.nextSibling)&&b.parentNode)}if(e)return c>d&&c<e.sourceIndex}for(;a=a.parentNode;)if(a==b)return true;return false},scrollTo:function(a){a=$(a);var b=a.cumulativeOffset();window.scrollTo(b[0],b[1]);return a},getStyle:function(a,b){a=$(a);b=b=="float"?"cssFloat":b.camelize();var c=a.style[b]; if(!c)c=(a=document.defaultView.getComputedStyle(a,null))?a[b]:null;if(b=="opacity")return c?parseFloat(c):1;return c=="auto"?null:c},getOpacity:function(a){return $(a).getStyle("opacity")},setStyle:function(a,b){a=$(a);var c=a.style;if(Object.isString(b)){a.style.cssText+=";"+b;return b.include("opacity")?a.setOpacity(b.match(/opacity:\s*(\d?\.?\d*)/)[1]):a}for(var d in b)if(d=="opacity")a.setOpacity(b[d]);else c[d=="float"||d=="cssFloat"?c.styleFloat===undefined?"cssFloat":"styleFloat":d]=b[d]; return a},setOpacity:function(a,b){a=$(a);a.style.opacity=b==1||b===""?"":b<1.0E-5?0:b;return a},getDimensions:function(a){a=$(a);var b=$(a).getStyle("display");if(b!="none"&&b!=null)return{width:a.offsetWidth,height:a.offsetHeight};b=a.style;var c=b.visibility,d=b.position,e=b.display;b.visibility="hidden";b.position="absolute";b.display="block";var h=a.clientWidth;a=a.clientHeight;b.display=e;b.position=d;b.visibility=c;return{width:h,height:a}},makePositioned:function(a){a=$(a);var b=Element.getStyle(a, "position");if(b=="static"||!b){a._madePositioned=true;a.style.position="relative";if(window.opera){a.style.top=0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=""}return a},makeClipping:function(a){a=$(a);if(a._overflow)return a;a._overflow=Element.getStyle(a,"overflow")||"auto";if(a._overflow!=="hidden")a.style.overflow="hidden";return a},undoClipping:function(a){a= $(a);if(!a._overflow)return a;a.style.overflow=a._overflow=="auto"?"":a._overflow;a._overflow=null;return a},cumulativeOffset:function(a){var b=0,c=0;do{b+=a.offsetTop||0;c+=a.offsetLeft||0;a=a.offsetParent}while(a);return Element._returnOffset(c,b)},positionedOffset:function(a){var b=0,c=0;do{b+=a.offsetTop||0;c+=a.offsetLeft||0;if(a=a.offsetParent){if(a.tagName=="BODY")break;var d=Element.getStyle(a,"position");if(d=="relative"||d=="absolute")break}}while(a);return Element._returnOffset(c,b)},absolutize:function(a){a= $(a);if(a.getStyle("position")!="absolute"){var b=a.positionedOffset(),c=b[1];b=b[0];var d=a.clientWidth,e=a.clientHeight;a._originalLeft=b-parseFloat(a.style.left||0);a._originalTop=c-parseFloat(a.style.top||0);a._originalWidth=a.style.width;a._originalHeight=a.style.height;a.style.position="absolute";a.style.top=c+"px";a.style.left=b+"px";a.style.width=d+"px";a.style.height=e+"px";return a}},relativize:function(a){a=$(a);if(a.getStyle("position")!="relative"){a.style.position="relative";var b=parseFloat(a.style.top|| 0)-(a._originalTop||0),c=parseFloat(a.style.left||0)-(a._originalLeft||0);a.style.top=b+"px";a.style.left=c+"px";a.style.height=a._originalHeight;a.style.width=a._originalWidth;return a}},cumulativeScrollOffset:function(a){var b=0,c=0;do{b+=a.scrollTop||0;c+=a.scrollLeft||0;a=a.parentNode}while(a);return Element._returnOffset(c,b)},getOffsetParent:function(a){if(a.offsetParent)return $(a.offsetParent);if(a==document.body)return $(a);for(;(a=a.parentNode)&&a!=document.body;)if(Element.getStyle(a,"position")!= "static")return $(a);return $(document.body)},viewportOffset:function(a){var b=0,c=0,d=a;do{b+=d.offsetTop||0;c+=d.offsetLeft||0;if(d.offsetParent==document.body&&Element.getStyle(d,"position")=="absolute")break}while(d=d.offsetParent);d=a;do if(!Prototype.Browser.Opera||d.tagName=="BODY"){b-=d.scrollTop||0;c-=d.scrollLeft||0}while(d=d.parentNode);return Element._returnOffset(c,b)},clonePosition:function(a,b,c){c=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0}, c||{});b=$(b);var d=b.viewportOffset();a=$(a);var e=[0,0],h=null;if(Element.getStyle(a,"position")=="absolute"){h=a.getOffsetParent();e=h.viewportOffset()}if(h==document.body){e[0]-=document.body.offsetLeft;e[1]-=document.body.offsetTop}if(c.setLeft)a.style.left=d[0]-e[0]+c.offsetLeft+"px";if(c.setTop)a.style.top=d[1]-e[1]+c.offsetTop+"px";if(c.setWidth)a.style.width=b.offsetWidth+"px";if(c.setHeight)a.style.height=b.offsetHeight+"px";return a}};Element.Methods.identify.counter=1; Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}}; if(!document.createRange||Prototype.Browser.Opera)Element.Methods.insert=function(a,b){a=$(a);if(Object.isString(b)||Object.isNumber(b)||Object.isElement(b)||b&&(b.toElement||b.toHTML))b={bottom:b};var c=Element._insertionTranslations,d,e,h,j;for(e in b){d=b[e];e=e.toLowerCase();h=c[e];if(d&&d.toElement)d=d.toElement();if(Object.isElement(d))h.insert(a,d);else{d=Object.toHTML(d);j=(e=="before"||e=="after"?a.parentNode:a).tagName.toUpperCase();if(c.tags[j]){j=Element._getContentFromAnonymousElement(j, d.stripScripts());if(e=="top"||e=="after")j.reverse();j.each(h.insert.curry(a))}else a.insertAdjacentHTML(h.adjacency,d.stripScripts());d.evalScripts.bind(d).defer()}}return a}; if(Prototype.Browser.Opera){Element.Methods._getStyle=Element.Methods.getStyle;Element.Methods.getStyle=function(a,b){switch(b){case "left":case "top":case "right":case "bottom":if(Element._getStyle(a,"position")=="static")return null;default:return Element._getStyle(a,b)}};Element.Methods._readAttribute=Element.Methods.readAttribute;Element.Methods.readAttribute=function(a,b){if(b=="title")return a.title;return Element._readAttribute(a,b)}}else if(Prototype.Browser.IE){$w("positionedOffset getOffsetParent viewportOffset").each(function(a){Element.Methods[a]= Element.Methods[a].wrap(function(b,c){c=$(c);var d=c.getStyle("position");if(d!="static")return b(c);c.setStyle({position:"relative"});b=b(c);c.setStyle({position:d});return b})});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(a,b){function c(h){return h.replace(/alpha\([^\)]*\)/gi,"")}a=$(a);var d=a.currentStyle;if(d&&!d.hasLayout||!d&&a.style.zoom=="normal")a.style.zoom=1;d=a.getStyle("filter");var e=a.style;if(b==1||b===""){(d=c(d))?(e.filter=d):e.removeAttribute("filter");return a}else if(b<1.0E-5)b=0;e.filter=c(d)+"alpha(opacity="+b*100+")";return a};Element._attributeTranslations={read:{names:{"class":"className", "for":"htmlFor"},values:{_getAttr:function(a,b){return a.getAttribute(b,2)},_getAttrNode:function(a,b){return(a=a.getAttributeNode(b))?a.value:""},_getEv:function(a,b){return(b=a.getAttribute(b))?b.toString().slice(23,-2):null},_flag:function(a,b){return $(a).hasAttribute(b)?b:null},style:function(a){return a.style.cssText.toLowerCase()},title:function(a){return a.title}}}};Element._attributeTranslations.write={names:Object.clone(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").each(function(a){Element._attributeTranslations.write.names[a.toLowerCase()]=a;Element._attributeTranslations.has[a.toLowerCase()]=a});(function(a){Object.extend(a,{href:a._getAttr,src:a._getAttr,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)}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<1.0E-5?0:b;return a};else if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=b==1||b===""?"":b<1.0E-5?0:b;if(b==1)if(a.tagName=="IMG"&&a.width){a.width++;a.width--}else try{var c=document.createTextNode(" ");a.appendChild(c);a.removeChild(c)}catch(d){}return a};Element.Methods.cumulativeOffset=function(a){var b=0,c=0;do{b+=a.offsetTop||0;c+=a.offsetLeft||0;if(a.offsetParent==document.body)if(Element.getStyle(a,"position")=="absolute")break; a=a.offsetParent}while(a);return Element._returnOffset(c,b)}} if(Prototype.Browser.IE||Prototype.Browser.Opera)Element.Methods.update=function(a,b){a=$(a);if(b&&b.toElement)b=b.toElement();if(Object.isElement(b))return a.update().insert(b);b=Object.toHTML(b);var c=a.tagName.toUpperCase();if(c in Element._insertionTranslations.tags){$A(a.childNodes).each(function(d){a.removeChild(d)});Element._getContentFromAnonymousElement(c,b.stripScripts()).each(function(d){a.appendChild(d)})}else a.innerHTML=b.stripScripts();b.evalScripts.bind(b).defer();return a}; if(document.createElement("div").outerHTML)Element.Methods.replace=function(a,b){a=$(a);if(b&&b.toElement)b=b.toElement();if(Object.isElement(b)){a.parentNode.replaceChild(b,a);return a}b=Object.toHTML(b);var c=a.parentNode,d=c.tagName.toUpperCase();if(Element._insertionTranslations.tags[d]){var e=a.next();d=Element._getContentFromAnonymousElement(d,b.stripScripts());c.removeChild(a);e?d.each(function(h){c.insertBefore(h,e)}):d.each(function(h){c.appendChild(h)})}else a.outerHTML=b.stripScripts(); b.evalScripts.bind(b).defer();return a};Element._returnOffset=function(a,b){var c=[a,b];c.left=a;c.top=b;return c};Element._getContentFromAnonymousElement=function(a,b){var c=new Element("div");a=Element._insertionTranslations.tags[a];c.innerHTML=a[0]+b+a[1];a[2].times(function(){c=c.firstChild});return $A(c.childNodes)}; Element._insertionTranslations={before:{adjacency:"beforeBegin",insert:function(a,b){a.parentNode.insertBefore(b,a)},initializeRange:function(a,b){b.setStartBefore(a)}},top:{adjacency:"afterBegin",insert:function(a,b){a.insertBefore(b,a.firstChild)},initializeRange:function(a,b){b.selectNodeContents(a);b.collapse(true)}},bottom:{adjacency:"beforeEnd",insert:function(a,b){a.appendChild(b)}},after:{adjacency:"afterEnd",insert:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)},initializeRange:function(a, b){b.setStartAfter(a)}},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(){this.bottom.initializeRange=this.top.initializeRange;Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD})}).call(Element._insertionTranslations); Element.Methods.Simulated={hasAttribute:function(a,b){b=Element._attributeTranslations.has[b]||b;return(a=$(a).getAttributeNode(b))&&a.specified}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement("div").__proto__){window.HTMLElement={};window.HTMLElement.prototype=document.createElement("div").__proto__;Prototype.BrowserFeatures.ElementExtensions=true} Element.extend=function(){if(Prototype.BrowserFeatures.SpecificElementExtensions)return Prototype.K;var a={},b=Element.Methods.ByTag,c=Object.extend(function(d){if(!d||d._extendedByPrototype||d.nodeType!=1||d==window)return d;var e=Object.clone(a),h=d.tagName,j;b[h]&&Object.extend(e,b[h]);for(j in e){h=e[j];if(Object.isFunction(h)&&!(j in d))d[j]=h.methodize()}d._extendedByPrototype=Prototype.emptyFunction;return d},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(a, Element.Methods);Object.extend(a,Element.Methods.Simulated)}}});c.refresh();return c}();Element.hasAttribute=function(a,b){if(a.hasAttribute)return a.hasAttribute(b);return Element.Methods.Simulated.hasAttribute(a,b)}; Element.addMethods=function(a){function b(o){o=o.toUpperCase();Element.Methods.ByTag[o]||(Element.Methods.ByTag[o]={});Object.extend(Element.Methods.ByTag[o],a)}function c(o,i,p){p=p||false;for(var v in o){var q=o[v];if(Object.isFunction(q))if(!p||!(v in i))i[v]=q.methodize()}}function d(o){var i,p={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(p[o])i="HTML"+p[o]+"Element";if(window[i])return window[i];i="HTML"+o+"Element";if(window[i])return window[i];i="HTML"+o.capitalize()+"Element";if(window[i])return window[i];window[i]={};window[i].prototype=document.createElement(o).__proto__; return window[i]}var e=Prototype.BrowserFeatures,h=Element.Methods.ByTag;if(!a){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var j=a;a=arguments[1]}if(j)Object.isArray(j)?j.each(b):b(j);else Object.extend(Element.Methods,a||{});if(e.ElementExtensions){c(Element.Methods, HTMLElement.prototype);c(Element.Methods.Simulated,HTMLElement.prototype,true)}if(e.SpecificElementExtensions)for(var m in Element.Methods.ByTag){e=d(m);Object.isUndefined(e)||c(h[m],e.prototype)}Object.extend(Element,Element.Methods);delete Element.ByTag;Element.extend.refresh&&Element.extend.refresh();Element.cache={}}; document.viewport={getDimensions:function(){var a={};$w("width height").each(function(b){var c=b.capitalize();a[b]=self["inner"+c]||document.documentElement["client"+c]||document.body["client"+c]});return a},getWidth:function(){return this.getDimensions().width},getHeight:function(){return this.getDimensions().height},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop|| document.body.scrollTop)}}; var Selector=Class.create({initialize:function(a){this.expression=a.strip();this.compileMatcher()},compileMatcher:function(){if(Prototype.BrowserFeatures.XPath&&!/(\[[\w-]*?:|:checked)/.test(this.expression))return this.compileXPathMatcher();var a=this.expression,b=Selector.patterns,c=Selector.criteria,d,e;if(Selector._cache[a])this.matcher=Selector._cache[a];else{for(this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];a&&d!=a&&/\S/.test(a);){d=a; for(var h in b){e=b[h];if(e=a.match(e)){this.matcher.push(Object.isFunction(c[h])?c[h](e):(new Template(c[h])).evaluate(e));a=a.replace(e[0],"");break}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher}},compileXPathMatcher:function(){var a=this.expression,b=Selector.patterns,c=Selector.xpath,d,e;if(Selector._cache[a])this.xpath=Selector._cache[a];else{for(this.matcher=[".//*"];a&&d!=a&&/\S/.test(a);){d=a;for(var h in b)if(e=a.match(b[h])){this.matcher.push(Object.isFunction(c[h])? c[h](e):(new Template(c[h])).evaluate(e));a=a.replace(e[0],"");break}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath}},findElements:function(a){a=a||document;if(this.xpath)return document._getElementsByXPath(this.xpath,a);return this.matcher(a)},match:function(a){this.tokens=[];for(var b=this.expression,c=Selector.patterns,d=Selector.assertions,e,h;b&&e!==b&&/\S/.test(b);){e=b;for(var j in c){h=c[j];if(h=b.match(h))if(d[j]){this.tokens.push([j,Object.clone(h)]);b=b.replace(h[0], "")}else return this.findElements(document).include(a)}}b=true;for(j=0;d=this.tokens[j];j++){c=d[0];d=d[1];if(!Selector.assertions[c](a,d)){b=false;break}}return b},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+">"}}); Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(a){if(a[1]=="*")return"";return"[local-name()='"+a[1].toLowerCase()+"' or local-name()='"+a[1].toUpperCase()+"']"},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:"[@#{1}]",attr:function(a){a[3]=a[5]||a[6];return(new Template(Selector.xpath.operators[a[2]])).evaluate(a)},pseudo:function(a){var b=Selector.xpath.pseudos[a[1]]; if(!b)return"";if(Object.isFunction(b))return b(a);return(new Template(Selector.xpath.pseudos[a[1]])).evaluate(a)},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]", "only-child":"[not(preceding-sibling::* or following-sibling::*)]",empty:"[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]",checked:"[@checked]",disabled:"[@disabled]",enabled:"[not(@disabled)]",not:function(a){for(var b=a[6],c=Selector.patterns,d=Selector.xpath,e,h,j=[];b&&e!=b&&/\S/.test(b);){e=b;for(var m in c)if(a=b.match(c[m])){h=Object.isFunction(d[m])?d[m](a):(new Template(d[m])).evaluate(a);j.push("("+h.substring(1,h.length-1)+")");b=b.replace(a[0],"");break}}return"[not("+ j.join(" and ")+")]"},"nth-child":function(a){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",a)},"nth-last-child":function(a){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",a)},"nth-of-type":function(a){return Selector.xpath.pseudos.nth("position() ",a)},"nth-last-of-type":function(a){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",a)},"first-of-type":function(a){a[6]="1";return Selector.xpath.pseudos["nth-of-type"](a)},"last-of-type":function(a){a[6]= "1";return Selector.xpath.pseudos["nth-last-of-type"](a)},"only-of-type":function(a){var b=Selector.xpath.pseudos;return b["first-of-type"](a)+b["last-of-type"](a)},nth:function(a,b){var c=b[6];if(c=="even")c="2n+0";if(c=="odd")c="2n+1";if(b=c.match(/^(\d+)$/))return"["+a+"= "+b[1]+"]";if(b=c.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(b[1]=="-")b[1]=-1;c=b[1]?Number(b[1]):1;b=b[2]?Number(b[2]):0;return(new Template("[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]")).evaluate({fragment:a, a:c,b:b})}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c); c = false;',className:'n = h.className(n, r, "#{1}", c); c = false;',id:'n = h.id(n, r, "#{1}", c); c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}"); c = false;',attr:function(a){a[3]=a[5]||a[6];return(new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;')).evaluate(a)},pseudo:function(a){if(a[6])a[6]=a[6].replace(/"/g,'\\"');return(new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;')).evaluate(a)}, descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s)|(?=:))/,attrPresence:/^\[([\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/}, assertions:{tagName:function(a,b){return b[1].toUpperCase()==a.tagName.toUpperCase()},className:function(a,b){return Element.hasClassName(a,b[1])},id:function(a,b){return a.id===b[1]},attrPresence:function(a,b){return Element.hasAttribute(a,b[1])},attr:function(a,b){a=Element.readAttribute(a,b[1]);return Selector.operators[b[2]](a,b[3])}},handlers:{concat:function(a,b){for(var c=0,d;d=b[c];c++)a.push(d);return a},mark:function(a){for(var b=0,c;c=a[b];b++)c._counted=true;return a},unmark:function(a){for(var b= 0,c;c=a[b];b++)c._counted=undefined;return a},index:function(a,b,c){a._counted=true;if(b){a=a.childNodes;b=a.length-1;for(var d=1;b>=0;b--){var e=a[b];if(e.nodeType==1&&(!c||e._counted))e.nodeIndex=d++}}else{b=0;d=1;for(a=a.childNodes;e=a[b];b++)if(e.nodeType==1&&(!c||e._counted))e.nodeIndex=d++}},unique:function(a){if(a.length==0)return a;for(var b=[],c,d=0,e=a.length;d<e;d++)if(!(c=a[d])._counted){c._counted=true;b.push(Element.extend(c))}return Selector.handlers.unmark(b)},descendant:function(a){for(var b= Selector.handlers,c=0,d=[],e;e=a[c];c++)b.concat(d,e.getElementsByTagName("*"));return d},child:function(a){for(var b=0,c=[],d;d=a[b];b++)for(var e=0,h;h=d.childNodes[e];e++)h.nodeType==1&&h.tagName!="!"&&c.push(h);return c},adjacent:function(a){for(var b=0,c=[],d;d=a[b];b++)(d=this.nextElementSibling(d))&&c.push(d);return c},laterSibling:function(a){for(var b=Selector.handlers,c=0,d=[],e;e=a[c];c++)b.concat(d,Element.nextSiblings(e));return d},nextElementSibling:function(a){for(;a=a.nextSibling;)if(a.nodeType== 1)return a;return null},previousElementSibling:function(a){for(;a=a.previousSibling;)if(a.nodeType==1)return a;return null},tagName:function(a,b,c,d){c=c.toUpperCase();var e=[],h=Selector.handlers;if(a){if(d){if(d=="descendant"){for(b=0;d=a[b];b++)h.concat(e,d.getElementsByTagName(c));return e}else a=this[d](a);if(c=="*")return a}for(b=0;d=a[b];b++)d.tagName.toUpperCase()==c&&e.push(d);return e}else return b.getElementsByTagName(c)},id:function(a,b,c,d){c=$(c);var e=Selector.handlers;if(!c)return[]; if(!a&&b==document)return[c];if(a){if(d)if(d=="child")for(b=0;d=a[b];b++){if(c.parentNode==d)return[c]}else if(d=="descendant")for(b=0;d=a[b];b++){if(Element.descendantOf(c,d))return[c]}else if(d=="adjacent")for(b=0;d=a[b];b++){if(Selector.handlers.previousElementSibling(c)==d)return[c]}else a=e[d](a);for(b=0;d=a[b];b++)if(d==c)return[c];return[]}return c&&Element.descendantOf(c,b)?[c]:[]},className:function(a,b,c,d){if(a&&d)a=this[d](a);return Selector.handlers.byClassName(a,b,c)},byClassName:function(a, b,c){a||(a=Selector.handlers.descendant([b]));b=" "+c+" ";for(var d=0,e=[],h,j;h=a[d];d++){j=h.className;if(j.length!=0)if(j==c||(" "+j+" ").include(b))e.push(h)}return e},attrPresence:function(a,b,c){a||(a=b.getElementsByTagName("*"));b=[];for(var d=0,e;e=a[d];d++)Element.hasAttribute(e,c)&&b.push(e);return b},attr:function(a,b,c,d,e){a||(a=b.getElementsByTagName("*"));b=Selector.operators[e];e=[];for(var h=0,j;j=a[h];h++){var m=Element.readAttribute(j,c);m!==null&&b(m,d)&&e.push(j)}return e},pseudo:function(a, b,c,d,e){if(a&&e)a=this[e](a);a||(a=d.getElementsByTagName("*"));return Selector.pseudos[b](a,c,d)}},pseudos:{"first-child":function(a){for(var b=0,c=[],d;d=a[b];b++)Selector.handlers.previousElementSibling(d)||c.push(d);return c},"last-child":function(a){for(var b=0,c=[],d;d=a[b];b++)Selector.handlers.nextElementSibling(d)||c.push(d);return c},"only-child":function(a){for(var b=Selector.handlers,c=0,d=[],e;e=a[c];c++)!b.previousElementSibling(e)&&!b.nextElementSibling(e)&&d.push(e);return d},"nth-child":function(a, b,c){return Selector.pseudos.nth(a,b,c)},"nth-last-child":function(a,b,c){return Selector.pseudos.nth(a,b,c,true)},"nth-of-type":function(a,b,c){return Selector.pseudos.nth(a,b,c,false,true)},"nth-last-of-type":function(a,b,c){return Selector.pseudos.nth(a,b,c,true,true)},"first-of-type":function(a,b,c){return Selector.pseudos.nth(a,"1",c,false,true)},"last-of-type":function(a,b,c){return Selector.pseudos.nth(a,"1",c,true,true)},"only-of-type":function(a,b,c){var d=Selector.pseudos;return d["last-of-type"](d["first-of-type"](a, b,c),b,c)},getIndices:function(a,b,c){if(a==0)return b>0?[b]:[];return $R(1,c).inject([],function(d,e){0==(e-b)%a&&(e-b)/a>=0&&d.push(e);return d})},nth:function(a,b,c,d,e){if(a.length==0)return[];if(b=="even")b="2n+0";if(b=="odd")b="2n+1";c=Selector.handlers;var h=[],j=[],m;c.mark(a);for(var o=0;m=a[o];o++)if(!m.parentNode._counted){c.index(m.parentNode,d,e);j.push(m.parentNode)}if(b.match(/^\d+$/)){b=Number(b);for(o=0;m=a[o];o++)m.nodeIndex==b&&h.push(m)}else if(m=b.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(m[1]== "-")m[1]=-1;o=m[1]?Number(m[1]):1;m=m[2]?Number(m[2]):0;b=Selector.pseudos.getIndices(o,m,a.length);o=0;for(d=b.length;m=a[o];o++)for(e=0;e<d;e++)m.nodeIndex==b[e]&&h.push(m)}c.unmark(a);c.unmark(j);return h},empty:function(a){for(var b=0,c=[],d;d=a[b];b++)d.tagName=="!"||d.firstChild&&!d.innerHTML.match(/^\s*$/)||c.push(d);return c},not:function(a,b,c){var d=Selector.handlers;b=(new Selector(b)).findElements(c);d.mark(b);c=0;for(var e=[],h;h=a[c];c++)h._counted||e.push(h);d.unmark(b);return e},enabled:function(a){for(var b= 0,c=[],d;d=a[b];b++)d.disabled||c.push(d);return c},disabled:function(a){for(var b=0,c=[],d;d=a[b];b++)d.disabled&&c.push(d);return c},checked:function(a){for(var b=0,c=[],d;d=a[b];b++)d.checked&&c.push(d);return c}},operators:{"=":function(a,b){return a==b},"!=":function(a,b){return a!=b},"^=":function(a,b){return a.startsWith(b)},"$=":function(a,b){return a.endsWith(b)},"*=":function(a,b){return a.include(b)},"~=":function(a,b){return(" "+a+" ").include(" "+b+" ")},"|=":function(a,b){return("-"+ a.toUpperCase()+"-").include("-"+b.toUpperCase()+"-")}},matchElements:function(a,b){b=(new Selector(b)).findElements();var c=Selector.handlers;c.mark(b);for(var d=0,e=[],h;h=a[d];d++)h._counted&&e.push(h);c.unmark(b);return e},findElement:function(a,b,c){if(Object.isNumber(b)){c=b;b=false}return Selector.matchElements(a,b||"*")[c||0]},findChildElements:function(a,b){var c=b.join(",");b=[];c.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(m){b.push(m[1].strip())});c=[];for(var d=Selector.handlers, e=0,h=b.length,j;e<h;e++){j=new Selector(b[e].strip());d.concat(c,j.findElements(a))}return h>1?d.unique(c):c}});function $$(){return Selector.findChildElements(document,$A(arguments))} var Form={reset:function(a){$(a).reset();return a},serializeElements:function(a,b){if(typeof b!="object")b={hash:!!b};else if(b.hash===undefined)b.hash=true;var c,d,e=false,h=b.submit;a=a.inject({},function(j,m){if(!m.disabled&&m.name){c=m.name;d=$(m).getValue();if(d!=null&&(m.type!="submit"||!e&&h!==false&&(!h||c==h)&&(e=true)))if(c in j){Object.isArray(j[c])||(j[c]=[j[c]]);j[c].push(d)}else j[c]=d}return j});return b.hash?a:Object.toQueryString(a)}}; Form.Methods={serialize:function(a,b){return Form.serializeElements(Form.getElements(a),b)},getElements:function(a){return $A($(a).getElementsByTagName("*")).inject([],function(b,c){Form.Element.Serializers[c.tagName.toLowerCase()]&&b.push(Element.extend(c));return b})},getInputs:function(a,b,c){a=$(a);a=a.getElementsByTagName("input");if(!b&&!c)return $A(a).map(Element.extend);for(var d=0,e=[],h=a.length;d<h;d++){var j=a[d];b&&j.type!=b||c&&j.name!=c||e.push(Element.extend(j))}return e},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(a){a=$(a).getElements().findAll(function(c){return"hidden"!=c.type&&!c.disabled});var b=a.findAll(function(c){return c.hasAttribute("tabIndex")&&c.tabIndex>=0}).sortBy(function(c){return c.tabIndex}).first();return b?b:a.find(function(c){return["input","select","textarea"].include(c.tagName.toLowerCase())})},focusFirstElement:function(a){a=$(a);a.findFirstElement().activate(); return a},request:function(a,b){a=$(a);b=Object.clone(b||{});var c=b.parameters,d=a.readAttribute("action")||"";if(d.blank())d=window.location.href;b.parameters=a.serialize(true);if(c){if(Object.isString(c))c=c.toQueryParams();Object.extend(b.parameters,c)}if(a.hasAttribute("method")&&!b.method)b.method=a.method;return new Ajax.Request(d,b)}};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"].include(a.type)))a.select()}catch(b){}return a},disable:function(a){a=$(a);a.blur();a.disabled=true;return a},enable:function(a){a=$(a);a.disabled=false;return a}};var Field=Form.Element,$F=Form.Element.Methods.getValue; Form.Element.Serializers={input:function(a,b){switch(a.type.toLowerCase()){case "checkbox":case "radio":return Form.Element.Serializers.inputSelector(a,b);default:return Form.Element.Serializers.textarea(a,b)}},inputSelector:function(a,b){if(b===undefined)return a.checked?a.value:null;else a.checked=!!b},textarea:function(a,b){if(b===undefined)return a.value;else a.value=b},select:function(a,b){if(b===undefined)return this[a.type=="select-one"?"selectOne":"selectMany"](a);else for(var c,d,e=!Object.isArray(b), h=0,j=a.length;h<j;h++){c=a.options[h];d=this.optionValue(c);if(e){if(d==b){c.selected=true;return}}else c.selected=b.include(d)}},selectOne:function(a){var b=a.selectedIndex;return b>=0?this.optionValue(a.options[b]):null},selectMany:function(a){var b,c=a.length;if(!c)return null;var d=0;for(b=[];d<c;d++){var e=a.options[d];e.selected&&b.push(this.optionValue(e))}return b},optionValue:function(a){return Element.extend(a).hasAttribute("value")?a.value:a.text}}; Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,b,c,d){$super(d,c);this.element=$(b);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();this.element.tagName.toLowerCase()=="form"?this.registerFormCallbacks():this.registerCallback(this.element)},onElementEvent:function(){var a=this.getValue();if(this.lastValue!=a){this.callback(this.element,a);this.lastValue=a}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(a){if(a.type)switch(a.type.toLowerCase()){case "checkbox":case "radio":Event.observe(a, "click",this.onElementEvent.bind(this));break;default:Event.observe(a,"change",this.onElementEvent.bind(this));break}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});if(!window.Event)var Event={}; Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{},relatedTarget:function(a){switch(a.type){case "mouseover":a=a.fromElement;break;case "mouseout":a=a.toElement;break;default:return null}return Element.extend(a)}}); Event.Methods=function(){var a;if(Prototype.Browser.IE){var b={0:1,1:4,2:2};a=function(c,d){return c.button==b[d]}}else a=Prototype.Browser.WebKit?function(c,d){switch(d){case 0:return c.which==1&&!c.metaKey;case 1:return c.which==1&&c.metaKey;default:return false}}:function(c,d){return c.which?c.which===d+1:c.button===d};return{isLeftClick:function(c){return a(c,0)},isMiddleClick:function(c){return a(c,1)},isRightClick:function(c){return a(c,2)},element:function(c){c=Event.extend(c).target;return Element.extend(c.nodeType== Node.TEXT_NODE?c.parentNode:c)},findElement:function(c,d){c=Event.element(c);return c.match(d)?c:c.up(d)},pointer:function(c){return{x:c.pageX||c.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft),y:c.pageY||c.clientY+(document.documentElement.scrollTop||document.body.scrollTop)}},pointerX:function(c){return Event.pointer(c).x},pointerY:function(c){return Event.pointer(c).y},stop:function(c){Event.extend(c);c.preventDefault();c.stopPropagation();c.stopped=true}}}(); Event.extend=function(){var a=Object.keys(Event.Methods).inject({},function(b,c){b[c]=Event.Methods[c].methodize();return b});if(Prototype.Browser.IE){Object.extend(a,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});return function(b){if(!b)return false;if(b._extendedByPrototype)return b;b._extendedByPrototype=Prototype.emptyFunction;var c=Event.pointer(b);Object.extend(b,{target:b.srcElement,relatedTarget:Event.relatedTarget(b), pageX:c.x,pageY:c.y});return Object.extend(b,a)}}else{Event.prototype=Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(Event.prototype,a);return Prototype.K}}(); Object.extend(Event,function(){function a(i){if(i._eventID)return i._eventID;arguments.callee.id=arguments.callee.id||1;return i._eventID=++arguments.callee.id}function b(i){if(i&&i.include(":"))return"dataavailable";return i}function c(i){return o[i]=o[i]||{}}function d(i,p){i=c(i);return i[p]=i[p]||[]}function e(i,p,v){var q=a(i);q=d(q,p);if(q.pluck("handler").include(v))return false;var x=function(z){if(!Event||!Event.extend||z.eventName&&z.eventName!=p)return false;Event.extend(z);v.call(i,z)}; x.handler=v;q.push(x);return x}function h(i,p,v){return d(i,p).find(function(q){return q.handler==v})}function j(i,p,v){var q=c(i);if(!q[p])return false;q[p]=q[p].without(h(i,p,v))}function m(){for(var i in o)for(var p in o[i])o[i][p]=null}var o=Event.cache;window.attachEvent&&window.attachEvent("onunload",m);return{observe:function(i,p,v){i=$(i);var q=b(p);p=e(i,p,v);if(!p)return i;i.addEventListener?i.addEventListener(q,p,false):i.attachEvent("on"+q,p);return i},stopObserving:function(i,p,v){i= $(i);var q=a(i),x=b(p);if(!v&&p){d(q,p).each(function(G){i.stopObserving(p,G.handler)});return i}else if(!p){Object.keys(c(q)).each(function(G){i.stopObserving(G)});return i}var z=h(q,p,v);if(!z)return i;i.removeEventListener?i.removeEventListener(x,z,false):i.detachEvent("on"+x,z);j(q,p,v);return i},fire:function(i,p,v){i=$(i);if(i==document&&document.createEvent&&!i.dispatchEvent)i=document.documentElement;if(document.createEvent){var q=document.createEvent("HTMLEvents");q.initEvent("dataavailable", true,true)}else{q=document.createEventObject();q.eventType="ondataavailable"}q.eventName=p;q.memo=v||{};document.createEvent?i.dispatchEvent(q):i.fireEvent(q.eventType,q);return q}}}());Object.extend(Event,Event.Methods);Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize()}); (function(){function a(){if(!c){b&&window.clearInterval(b);document.fire("dom:loaded");c=true}}var b,c=false;if(document.addEventListener)if(Prototype.Browser.WebKit){b=window.setInterval(function(){/loaded|complete/.test(document.readyState)&&a()},0);Event.observe(window,"load",a)}else document.addEventListener("DOMContentLoaded",a,false);else{document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");$("__onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange= null;a()}}}})();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf; var Insertion={Before:function(a,b){return Element.insert(a,{before:b})},Top:function(a,b){return Element.insert(a,{top:b})},Bottom:function(a,b){return Element.insert(a,{bottom:b})},After:function(a,b){return Element.insert(a,{after:b})}},$continue=new Error('"throw $continue" is deprecated, use "return" instead'),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(a,b,c){if(this.includeScrollOffsets)return this.withinIncludingScrolloffsets(a,b,c);this.xcomp=b;this.ycomp=c;this.offset=Element.cumulativeOffset(a);return c>=this.offset[1]&&c<this.offset[1]+a.offsetHeight&&b>=this.offset[0]&&b<this.offset[0]+a.offsetWidth},withinIncludingScrolloffsets:function(a,b,c){var d=Element.cumulativeScrollOffset(a);this.xcomp=b+d[0]-this.deltaX;this.ycomp=c+d[1]-this.deltaY;this.offset=Element.cumulativeOffset(a); return this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+a.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+a.offsetWidth},overlap:function(a,b){if(!a)return 0;if(a=="vertical")return(this.offset[1]+b.offsetHeight-this.ycomp)/b.offsetHeight;if(a=="horizontal")return(this.offset[0]+b.offsetWidth-this.xcomp)/b.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(a,b,c){c=c||{};return Element.clonePosition(b,a,c)}}; if(!document.getElementsByClassName)document.getElementsByClassName=function(a){function b(c){return c.blank()?null:"[contains(concat(' ', @class, ' '), ' "+c+" ')]"}a.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(c,d){d=d.toString().strip();return(d=/\s/.test(d)?$w(d).map(b).join(""):b(d))?document._getElementsByXPath(".//*"+d,c):[]}:function(c,d){d=d.toString().strip();var e=[],h=/\s/.test(d)?$w(d):null;if(!h&&!d)return e;c=$(c).getElementsByTagName("*");d=" "+d+" ";for(var j= 0,m,o;m=c[j];j++)if(m.className&&(o=" "+m.className+" ")&&(o.include(d)||h&&h.all(function(i){return!i.toString().blank()&&o.include(" "+i+" ")})))e.push(Element.extend(m));return e};return function(c,d){return $(d||document.body).getElementsByClassName(c)}}(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){this.include(a)||this.set($A(this).concat(a).join(" "))},remove:function(a){this.include(a)&&this.set($A(this).without(a).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);Element.addMethods(); var _gaq=_gaq||[];_gaq.push(["_setAccount","UA-2169465-2"]);_gaq.push(["_trackPageview"]);(function(){var a=document.createElement("script");a.type="text/javascript";a.async=true;a.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(a)})();