var Fool=window.Fool||{};Fool.prepare=function(){Fool.onContent(Fool.Util.AddQueryParamsToLinks);document.documentElement.id="jsenabled";Prototype.Browser.IE6=Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==6;Prototype.Browser.FF2=Prototype.Browser.Gecko&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")+8))==2;Prototype.Browser.FF3=Prototype.Browser.Gecko&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")+8))==3;if(Prototype.Browser.IE6){try{document.execCommand("BackgroundImageCache",false,true)}catch(a){}}if(typeof console=="undefined"||Prototype.Browser.IE){window.console={log:function(b){Fool.simpleConsole("log: "+b)},info:function(b){Fool.simpleConsole("info: "+b)},debug:function(b){Fool.simpleConsole("debug: "+b)},warn:function(b){Fool.simpleConsole("warn: "+b)},error:function(b){Fool.simpleConsole("error: "+b)},dir:function(){return},time:function(){return},timeEnd:function(){return},profile:function(){return},profileEnd:function(){return},trace:function(){return},group:function(){return},groupEnd:function(){return}}}};Fool.simpleConsole=function(c){var b=false;if(Prototype.Browser.IE){if(b){if(!$("simpleConsole")){var d=document.createElement("DIV");d.id="simpleConsole";d.style.cssText="font-size:11px;padding:5px;text-align:left; line-height:15px; z-index:9999;position:absolute;width:300px;height:100px;overflow:auto;top:0;left:0;background-color:White;border:1px Solid #ccc;";var a=new Element("a",{id:"simpleConsoleClear",href:"#"}).update("Clear");d.appendChild(a);document.body.appendChild(d)}if($("simpleConsole")){$("simpleConsole").innerHTML=c+"<br />"+$("simpleConsole").innerHTML;Event.observe($("simpleConsoleClear"),"click",function(e){Event.stop(e);$("simpleConsole").update()})}}else{return}}else{return}};Fool.onLoad=function(){Fool.PageLoad.onLoad.apply(null,Array.apply(null,arguments))};Fool.onContent=function(){Fool.PageLoad.onContent.apply(null,Array.apply(null,arguments))};Fool.onUnload=function(){Fool.PageLoad.onUnload.apply(null,Array.apply(null,arguments))};Fool.onResize=function(){Fool.PageLoad.onResize.apply(null,Array.apply(null,arguments))};Fool.namespace=function(){var b=arguments,g=null,e,c,f;for(e=0;e<b.length;e=e+1){f=(""+b[e]).split(".");g=Fool;for(c=(f[0]=="Fool")?1:0;c<f.length;c=c+1){g[f[c]]=g[f[c]]||{};g=g[f[c]]}}return g};Fool.PageLoad=(function(){var c={dataavailable:[],load:[],unload:[],resize:[]};function b(e,d){c[e]=c[e].concat(Array.apply(null,d))}function a(d){c[d.type].each(function(e){e()})}document.observe("dom:loaded",a);Event.observe(window,"load",a);Event.observe(window,"unload",a);Event.observe(window,"resize",a);return{onContent:function(){b("dataavailable",arguments)},onLoad:function(){b("load",arguments)},onUnload:function(){b("unload",arguments)},onResize:function(){b("resize",arguments)}}})();Fool.Util={};Fool.Util.striper=function(a){var e=((a.nodeType)?[$(a)]:$$(a)),b;for(var c=0;c<e.length;c++){b=e[c];Element.addClassName(b,"striped");var d=b.getElementsByTagName((b.tagName=="TABLE")?"tr":"li");for(var f=0;f<d.length;f++){Element.addClassName(d[f],(d[f].className=(f%2)?"even":"odd"))}}};Fool.Util.setLayout=function(){if(Element.getDimensions(document.body).width<1000){Element.addClassName(document.body,"narrow");document.cookie="BodyWidth=narrow; path=/"}else{Element.removeClassName(document.body,"narrow");document.cookie="BodyWidth=standard; path=/; expires=Sat, 1 Jan 2000 00:00:00 UTC;"}};Fool.Util.jumpToMenu={prepare:function(){var a=$$("div.f_JumpToMenu");a.each(function(f,c){var b=f.down("select"),e=b.form||undefined;var d=(e==undefined)?undefined:e.f_JumpToMenuButton;if(d){d.parentNode.removeChild(d)}b.observe("change",Fool.Util.jumpToMenu.controller)})},controller:function(a){if(this.form){this.form.submit();this.options[0].selected=true}else{if(this.value!=""){window.location.href=this.value}}}};Fool.Util.PseudoClass={hover:function(a){var c=(typeof(a)=="string")?$$(a):$A(a);c.each(function(d){d.observe("mouseover",b).observe("mouseout",b)});function b(d){if(this.innerHTML.trim()=="&nbsp;"){return}this[(d.type=="mouseover")?"addClassName":"removeClassName"]("hover")}},active:function(a){var b=(typeof(a)=="string")?$$(a):$A(a);$A(b).each(function(c){if(c.innerHTML.trim()!="&nbsp;"){Event.observe(c,"mousedown",function(){Element.addClassName(c,"active")});Event.observe(c,"mouseup",function(){Element.removeClassName(c,"active")});Event.observe(c,"mouseout",function(){Element.removeClassName(c,"active")})}})}};Fool.Util.Cookies={get:function(b){var a=new RegExp(b+"=([^;]+)").exec(document.cookie);return(a==null)?undefined:decodeURIComponent(a[1])},set:function(c,f,a,h,e,g,b){f=(!!b)?f:encodeURIComponent(f);var d=(c+"="+f);if(a){d+=";expires="+a.toGMTString()}d+=(h)?"; path="+h:"";d+=(e)?"; domain="+e:"";d+=(g)?"; secure":"";document.cookie=d;return(Fool.Util.Cookies.get(c)==f)?true:false},remove:function(a){if(Fool.Util.Cookies.get(a)){return(Fool.Util.Cookies.set(a,"",new Date(0)))?false:true}else{return false}}};Fool.Util.popup=function(c,b,g,f){if(!f){f="resizable=yes"}var a=(screen.width-b)/2;var e=(screen.height-g)/2;f+=((f)?",":"")+"width="+b+",height="+g+",left="+a+",top="+e;var d;if(typeof(c)=="string"){d=c}else{if(typeof(c)=="object"&&c.tagName.toLowerCase()=="a"){d=c.href}}if(d){var i=window.open(d,"popupWin",f);if(i){i.opener=window;i.focus();return false}}};Fool.Util.Interstitial=function(c){var f=c.msg;var a=c.href;var b=c.label;var e=function(g){if(!confirm(f)){g.stop()}};var d=document.createElement("A");Element.extend(d);d.href=a;d.innerHTML=b;d.observe("click",e);return d};Fool.Util.AddQueryParamsToLinks=function(a){Fool.Event.delegate({type:"click",test:function(b){return Element.match(b,"a")},action:function(b,d){var e=Fool.Util.getLinkSource(d);if(!!e){var g=d.href.split("#");var c=g.first();var f=g[1];if((/(&|\?)source=/).test(c)){return false}d.href="#{firstPart}#{queryParamConnector}source=#{source}#{locationConnector}#{hash}".interpolate({firstPart:c,queryParamConnector:(/\?/).test(c)?"&":"?",source:e,hash:(!!f)?"#"+f:""});return true}}.bind(this)})};Fool.Util.getLinkSource=function(c){var a=".qsAdd";var b=c.match(a)?c:c.up(a);if(b){var d=false;b.classNames().each(function(e){if(e.startsWith("qs-source")){d=e.split("-").last();throw $break}},this);return d}return false};Fool.Util.showLoading=function(e){if(typeof(e)=="string"){e=$(e)}if(!e){return}var c="/common/img/progress_spinner.gif";var g=40;var b=e.offsetHeight;var f=parseInt(Element.getStyle(e,"padding-top"));var d=parseInt(Element.getStyle(e,"padding-bottom"));var a=b-f-d;var h=(b-g)/2-f;e.innerHTML='<div style="text-align:center;height:'+a+'px"><img height="'+g+'" src="'+c+'" alt="Loading ..." style="margin-top:'+h+'px" /></div>'};Fool.Util.isEmail=function(a){return a.isEmail()};Fool.Util.getTimeString=function(f){if(!f){f=new Date()}var d,g,c,b,h,e;var a=f.getFullYear().toString();d=(f.getMonth()+1).toString();a+=d.length==1?"0"+d:d;g=f.getDate().toString();a+=g.length==1?"0"+g:g;c=f.getHours().toString();a+=c.length==1?"0"+c:c;b=f.getMinutes().toString();a+=b.length==1?"0"+b:b;h=f.getSeconds().toString();a+=h.length==1?"0"+h:h;e=f.getMilliseconds().toString();if(e.length==1){a+="00"+e}else{if(e.length==2){a+="0"+e}else{a+=e}}return a};Fool.Util.numbersOnly=function(d,b,e){var a=new RegExp("[\x08\x09\x0D.-]");var c=0;var f;if(d.keyCode){c=d.keyCode}else{if(d.which){c=d.which}}var f=String.fromCharCode(c);if(!b&&/\./.test(f)){Event.stop(d);return false}if(!e&&/-/.test(f)){Event.stop(d);return false}if(/[0-9]/.test(f)||a.test(f)){return true}else{Event.stop(d);return false}};Fool.Util.SearchBox=Class.create({initialize:function(a){this.container=$(a);this.input=this.container.down('input[name="q"]');this.defaultValue=this.input.value;this.button=this.container.down('input[type="submit"]')?this.container.down('input[type="submit"]'):this.container.down('input[type="image"]');this.input.observe("focus",this.inputController.bind(this));this.input.observe("blur",this.inputController.bind(this));this.button.observe("mousedown",this.buttonController.bind(this));this.button.observe("mouseover",this.buttonController.bind(this));this.button.observe("mouseout",this.buttonController.bind(this));this.button.observe("mouseup",this.buttonController.bind(this));var b=this;this.container.onsubmit=function(){return !(b.isDefault()||b.isEmpty())}},inputController:function(a){switch(a.type){case"focus":this.clear();break;case"blur":this.restore();break}a.stop()},buttonController:function(a){switch(a.type){case"mousedown":this.changeHoverState("btn_active");break;case"mouseover":this.changeHoverState("btn_hover");break;case"mouseout":this.changeHoverState(null);break;case"mouseup":this.changeHoverState(null);break}a.stop()},changeHoverState:function(a){if(a){this.button.addClassName(a)}else{this.button.removeClassName("btn_active").removeClassName("btn_hover")}},isEmpty:function(){return !!(this.input.value.trim()=="")},isDefault:function(){return !!(this.input.value.trim()==this.defaultValue)},clear:function(){this.input.addClassName("active");if(this.isDefault()){this.input.value=""}},restore:function(){this.input.removeClassName("active");if(this.isEmpty()){this.input.value=this.defaultValue}}});Fool.Util.Corners=(function(){var b;var a={all:["nw","ne","se","sw"],north:["nw","ne"],south:["sw","se"],east:["ne","se"],west:["nw","sw"]};function c(e){var d=$(document.createElement("SPAN"));d.addClassName("corner");d.addClassName(e);b.insert({bottom:d});d=null}return{prepare:function(d){d.each(function(e){$$(e.selector).each(function(f){b=f;a[e.cornerType].each(function(g){c(g)})})})}}})();Fool.Util.Flash=(function(){var b,a=!!(window.attachEvent&&!window.opera),c=!!(a&&document.compatMode);return{activate:function(g){if(!c){return false}var d=$(g),e=d.childNodes.length,f="";while(e--){f+=d.childNodes[e].outerHTML}d.outerHTML=d.outerHTML.replace("</OBJECT>",f+"</OBJECT>")},activateAll:function(){if(!c){return false}var e=document.getElementsByTagName("OBJECT"),d=e.length;while(d--){Fool.Util.Flash.activate(e[d])}},detect:function(j,g,f){j=(j!=undefined)?j:0;g=(g!=undefined)?g:0;f=(f!=undefined)?f:0;var e=false;if(this.version()!=-1){var d=b.split(/,/);var h=d[0];var k=d[1];var i=d[2];if(h>j){e=true}else{if(h==j){if(k>g){e=true}else{if(k==g&&i>=f){e=true}}}}}return e},version:function(){if(b){return b}b=-1;if(a){var f,h;try{f=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");b=f.GetVariable("$version")}catch(h){try{f=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");b="WIN 6,0,21,0";f.AllowScriptAccess="always";b=f.GetVariable("$version")}catch(h){}}if(b){b=b.replace(/WIN /,"")}}else{var d=navigator.plugins;var g=d["Shockwave Flash 2.0"]||d["Shockwave Flash"]||null;if(g){b=g.description.match(/\d+/g).join(",")}}return b}}})();Fool.Widgets=(function(){var a=0,b={},c=100;return{create:function(e,d){if(!Fool.Widgets){}return new Fool.Widgets[e](d)},register:function(d){d.id=d.type+"_"+a++;if(!(d.type in b)){b[d.type]=[]}b[d.type].push(d)},unregister:function(d){var e=b[d.type].length;while(e-->=0){if(d.id==b[d.type][e].id){break}}b[d.type].splice(e,1)},instances:function(e,d){if(e in b){return(d)?b[e].findAll(d):b[e].concat()}else{return undefined}},showAll:function(d){b[d].each(function(e){if(e.isVisible!==true){e.show()}})},hideAll:function(d){b[d].each(function(e){if(e.isVisible!==false){e.hide()}})},nextHighestDepth:function(){return c++}}})();Fool.Widgets.Widget=function(a){this.options=Object.extend(Object.extend({},this.options),a);this.container=$(document.createElement("div"));this.container.className="f_Widget";Fool.Event.initialize(this);Fool.Widgets.register(this)};Fool.Widgets.Widget.prototype={tranport:null,content:null,layout:null,left:function(a){if(isNaN(a)){return Position.cumulativeOffset(this.container)[0]}else{this.container.style.left=a+"px"}},top:function(a){if(isNaN(a)){return Position.cumulativeOffset(this.container)[1]}else{this.container.style.top=a+"px"}},width:function(a){if(isNaN(a)){return this.container.getDimensions().width}else{this.container.style.width=a+"px"}},height:function(a){if(isNaN(a)){return this.container.getDimensions().height}else{this.container.style.height=a+"px"}},applyTheme:function(c){this.theme=c;this.container.className=c.className;this.container.innerHTML=c.template;var a=this.container.getElementsByTagName("*");var b=a.length;while(b--){if(/\blayout\b/i.test(a[b].className)){this.layout=$(a[b]);break}}a=this.layout.getElementsByTagName("*");b=a.length;while(b--){if(/\bcontent\b/i.test(a[b].className)){this.content=$(a[b]);break}}},show:function(){if(this.container.parentNode==undefined||this.container.parentNode.nodeName=="#document-fragment"){document.body.appendChild(this.container)}this.isVisible=true;this.container.show()},hide:function(){this.isVisible=false;this.container.hide()},toggle:function(){this[(this.isVisible)?"hide":"show"]()},destroy:function(){Fool.Widgets.unregister(this);if(this.container.parentNode!=undefined){this.container.remove()}delete this},update:function(a,b){this.content.update(a);if(b){this.show()}},load:function(a,c){if(this.transport&&this.transport.readyState==0){this.transport.abort()}c=c||function(){};var b=function(d){c(d)};this.tranport=new Ajax.Request(a,{method:"get",onSuccess:b})},toString:function(){return this.type}};Fool.Widgets.Hover=function(a){Fool.Widgets.Widget.call(this,a);this.container.style.cssText="position:absolute;display:none";this.applyTheme(Fool.Widgets.Hover.themes[this.options.theme]);this.applyHandlers();if(this.options.isVisible){this.show()}};Fool.Widgets.Hover.prototype=Object.extend(Object.extend({},Fool.Widgets.Widget.prototype),{type:"Hover",isVisible:false,isActive:false,timeout:null,options:{anchor:null,trigger:null,content:null,url:null,template:null,showDelay:150,hideDelay:750,showOn:"mouseover",hideOn:"mouseout",toggleOn:null,isExclusive:false,isVisible:false,orientation:null,theme:"tooltip"},applyHandlers:function(){var a=this.options;if(a.trigger==null){return}if(a.toggleOn){Event.observe(a.trigger,a.toggleOn,this.toggle.bind(this))}else{if(this.options.showOn){Event.observe(a.trigger,a.showOn,this.delay.bind(this,"show"))}if(this.options.hideOn){Event.observe(a.trigger,a.hideOn,this.delay.bind(this,"hide"));Event.observe(this.layout,"mouseover",function(b){if(Element.descendantOf(Event.element(b),this.layout)){this.isActive=true;clearTimeout(this.timeout);this.timeout=null}}.bind(this));Event.observe(this.layout,"mouseout",function(c){var b=(window.event)?window.event.toElement:c.relatedTarget;if(!b||(/\bHTML|BODY\b/i.test(b.nodeName)||Element.descendantOf(b,this.layout)==false)){this.isActive=false;this.delay("hide")}}.bind(this))}}},position:function(){var c=this.options.anchor||this.options.trigger;if(!c){return}this.container.className=this.container.className.replace(/\b[n|s][e|w]\b/i,"");var g=Position.cumulativeOffset(c);var e={top:g[1],left:g[0],width:c.offsetWidth,height:c.offsetHeight};var f=Position.viewportSize(),b=this.width(),h=this.height();var d=(e.left+e.width+b)>f.width;var i=(e.top+e.height+h)>Position.pageScrollTop()+f.height;var a;if(this.options.orientation){a=this.options.orientation}else{if(d){a=(i)?"nw":"sw"}else{a=(i)?"ne":"se"}}this.container.addClassName(a);if(this.theme.layout){this.theme.layout(this,a,e)}},delay:function(a){if(this.timeout!=null){clearTimeout(this.timeout);this.timeout=null}switch(a.toLowerCase()){case"hide":this.isActive=false;this.timeout=window.setTimeout(this.hide.bind(this),this.options.hideDelay);break;case"show":this.isActive=true;this.timeout=window.setTimeout(this.show.bind(this),this.options.showDelay);break}},show:function(){if(this.isVisible){return}if(this.container.parentNode==undefined||this.container.parentNode.nodeName=="#document-fragment"){document.body.appendChild(this.container);if(this.options.url){this.load(this.options.url,this.options.callback?this.options.callback.bind(this):function(b){var a=(b.responseJSON)?this.options.template.evaluate(b.responseJSON):b.responseText;this.update(a,true)}.bind(this))}else{this.update(this.options.content,true)}return}if(this.options.isExclusive){Fool.Widgets.hideAll("Hover")}this.position();this.isVisible=true;this.container.zIndex=Fool.Widgets.nextHighestDepth();this.container.show()}});Fool.Widgets.Hover.themes={};Fool.Widgets.Hover.themes.tooltip={className:"tooltip",template:"<div class='layout' style='border: 1px Solid #333333; background-color:#ffffcc; padding:.25em; float:left;'><div class='content' style='white-space:nowrap;'></div></div>",layout:function(b,a,c){var e=(/e$/.test(a))?c.left+c.width:c.left-b.width();var d=(/^s/.test(a))?c.top+c.height:c.top-c.height;b.left(e);b.top(d)}};Fool.Widgets.Hover.themes.v1={className:"v1",template:"<img class='callout' src='/common/img/spacer.gif' usemap='' /><div class='layout'><div class='t'><div class='l'></div><div class='m'></div><div class='r'></div></div><div class='content'></div><div class='b'><div class='l'></div><div class='m'></div><div class='r'></div></div></div>",layout:function(b,a,d){var g={ne:[-50,0],nw:[50,0],se:[-50,0],sw:[50,0]}[a];var c=b.container.firstChild;if(/se|ne/.test(a)){c.style.left=g[0]*-1+"px"}else{c.style.right=g[0]+"px"}var f=(/e$/.test(a))?d.left+d.width:d.left-b.width();var e=(/^s/.test(a))?d.top+d.height:d.top-b.height();b.left(f+g[0]);b.top(e+g[1])}};Fool.Widgets.Hover.themes.v2={className:Fool.Widgets.Hover.themes.v1.className,template:Fool.Widgets.Hover.themes.v1.template,layout:function(b,a,c){var e=(/e$/.test(a))?c.left+c.width:c.left-b.width();var d=(/^s/.test(a))?c.top+c.height:c.top-b.height();b.left(e);b.top(d)}};Fool.Widgets.Hover.themes.v3={className:"v3",template:"<div class='layout'><div class='t'><div class='l'></div><div class='m'></div><div class='r'></div></div><div class='c'><div class='i'><div class='content'></div></div></div><div class='b'><div class='l'></div><div class='m'></div><div class='r'></div></div></div>",layout:function(b,a,c){var e=c.left+c.width/2-b.width()/2;var d;switch(a){case"n":d=c.top-b.height();break;case"s":d=c.top+c.height;break;default:throw ("Error, unidentified orientation");break}b.left(e);b.top(d)}};Fool.Widgets.Panelize=function(g,h){var g=$(g);var f=g.getChildrenByClassName("f_triggers")[0].getElementsByTagName("a");var e=g.getChildrenByClassName("f_panels")[0].getChildrenByTagName("*");g.triggers=(f.length)?$A(f):$A();g.panels=(e.length)?$A(e):$A();g.activate=function(l){try{var k=$(this.triggers[l]);var i=this.panels[l];if(!k){return}this.triggers.each(function(n){Element.removeClassName($(n).parentNode,"active")});this.panels.each(function(n){n.removeClassName("active");n.addClassName("panel")});i.addClassName("active");Element.addClassName(k.parentNode,"active");k.blur()}catch(m){}};for(var d=0,c=f.length;d<c;d++){var b=f[d];var a=e[d];b.panel=a;a.trigger=b;b.index=a.index=d;b.panelBox=a.panelBox=g;b.activate=function(){this.panelBox.activate(this.index)};function j(i){this.activate();Event.stop(i)}Event.observe(b,"click",j.bindAsEventListener(b))}g.activate((h!=undefined?h:0));g=b=a=undefined;e=f=undefined};function VerifyHasUsername(){if(!isUserNameCreated){Fool.LightBoxes.show("generic","username");return false}else{if(!isLoggedIn){Fool.LightBoxes.show("generic","login");return false}}return true}function VerifyIsLoggedIn(){if(!hasUserName){Fool.LightBoxes.show("generic","register");return false}else{if(!isLoggedIn){Fool.LightBoxes.show("generic","login");return false}}return true}Fool.LightBoxes={urls:{generic:"/Ajax/GenericLightbox.aspx"},show:function(b,f,e){var a=this.urls[b];f=(f)?f:"";e=(e)?e:"";if(a){var d=document.createElement("a");d.href=a+"?action="+f+"&message="+encodeURIComponent(e)+"&ref="+encodeURIComponent(document.location.href);d.className="lbOn";var c=new lightbox(d);c.activate();return true}}};Fool.Event={initialize:function(a){a.listeners=[];a.addListener=function(){for(var b=0;b<arguments.length;b++){var c=arguments[b];this.removeListener(c);this.listeners.push(c)}};a.removeListener=function(d){var c=this.listeners,b=c.length;while(b--){if(c[b]==d){c.splice(b,1)}}};a.dispatch=function(c){var d=$A(arguments).slice(1),f=this.listeners,b=f.length,g;for(var e=0;e<b;e++){g=f[e];if(g&&g[c]){g[c].apply(g,d)}}}}};Fool.Event.delegate=(function(){var b=function(h,i){return h.select(function(j){return Element.descendantOf(i,j.ancestor)})},f=function(j,k,l){var h=j.select(function(m){if(!m.test.call(l,k)){return true}else{m.action(l,k);return false}}),i=k.parentNode;return h.length&&i&&i.tagName?arguments.callee(h,i,l):true},a=[],c=function(h){return a[h]=a[h].select(function(i){return"ancestor" in i})},e=function(j,l){c(j);var i=a[j],k=Event.element(l),h;h=b(i,k);return f(h,k,l)},g=function(h){Event.observe(document,h,e.curry(h))},d=function(h){if(!a.hasOwnProperty(h)){g(h);a[h]=[]}return a[h]};return function(i){var h={test:i.test,action:i.action,ancestor:i.ancestor||document.body};d(i.type||"click").push(h);return function(){delete h.ancestor}}})();Fool.emptyString="";Event.onDOMReady=function(a){return Fool.onContent(a)};Fool.prepare();Fool.Form=(function(){return{setFormButton:function(a){var b=document.createElement("span");b.className="formProcessing";a.parentNode.insertBefore(b,a);b.appendChild(a);Event.observe(a,"click",function(){Fool.Form.preventResubmit(a)})},preventResubmit:function(a){a.style.visibility="hidden"}}})();Fool.Cookie=(function(){return{getCookieValue:function(c,d,b){var a=null;var h=document.cookie.split(";");var g,e;var f;var l;var k=null;for(g=0;g<h.length;g++){f=h[g].substr(0,h[g].indexOf("=")).replace(/ /g,"");if(f==c){k=h[g].substr(h[g].indexOf("=")+1);if(d){var m=k.split(b);for(e=0;e<m.length;e++){l=m[e].substr(0,m[e].indexOf("=")).replace(/ /g,"");if(l==d){k=m[e].substr(m[e].indexOf("=")+1);break}}}break}}return k}}})();Fool.Help={hovers:[],triggers:[],prepare:function(){$$("div.f_help").each(function(e,b){var a="<a class='closeButton' href='javascript:Fool.Help.hovers["+b+"].hide();'>Close</a>";var d=a+e.innerHTML;var c=new Element("img",{src:"/common/img/ico/help.gif",alt:"More Information",style:"cursor:pointer"});if(e.previous()){e.previous().insert(c);e.remove()}Fool.Help.hovers[b]=new Fool.Widgets.Hover({content:d,trigger:c,theme:"v1",toggleOn:"click",isExclusive:true})})}};Fool.Ajax=Fool.Ajax||{};Fool.Ajax.PeriodicalDecayingRequest=Class.create(Ajax.Base,{initialize:function($super,b,a){a.showFeedback=false;$super(a);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.url=b;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.options.onComplete=this.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(a){if(this.options.decay){this.decay=(a.responseText==this.lastData)?(this.decay*this.options.decay):1;this.lastData=a.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.request=new Ajax.Request(this.url,this.options)}});Object.extend(Fool,{string:function(){return Array.prototype.join.call(arguments,"")},getProperty:function(b,a){return b[a]}});Object.extend(Fool.namespace("Fool.Dom"),{up:function(a,b){if(typeof b==="string"){return Element.up.apply(this,arguments)}do{a=a.parentNode}while(!b(a));return a},isTagName:function(b,a){return b.tagName&&b.tagName===a},isElement:function(a){return a.nodeType&&a.nodeType===1},hasClassName:function(a){return Fool.Dom.isElement(a)&&Element.hasClassName.apply(this,arguments)},get:function(a){return document.getElementById(a)},getTextContent:(function(){var a=function(b){return(a=Fool.Dom.getTextContent=b.innerText!==undefined?Fool.getProperty.rcurry("innerText"):Fool.getProperty.rcurry("textContent")).apply(this,arguments)};return function(){return a.apply(this,arguments)}})()});Fool.Options=(function(){var b=function(g,f,e){g=g||{};e=e||true;if(a(f)){return f}var d=c(Object.clone(g),f,e);return d};var a=function(d){if(Object.isElement(d)){return true}if(typeof(d)!="object"){return true}if(Object.isArray(d)){return true}return false};var c=function(d,f,e){for(var g in f){var h;if(e!==true||a(f[g])){h=f[g]}else{h=b(d[g],f[g],e)}d[g]=h}return d};return{setOptions:b}})();var Fn={rcurry:function(b){var a=$A(arguments).slice(1);return function(){return b.apply(this,$A(arguments).concat(a))}},debounce:function(b,a){var c=false;a=a||110;return function(){c&&clearTimeout(c);var e=this,d=arguments;c=setTimeout(function(){return b.apply(e,d)},a)}},callOnce:function(b){var a=function(){var c=b.apply(this,arguments);a=function(){return c};return c};return function(){return a.apply(this,arguments)}},getOnce:function(c){var a=Object.getPropertyName.callOnce();var d=c;var b=function(){var e=d.apply(this,arguments);this[a(this,b)]=function(){return e};return e};return b},functionalize:function(a){return function(b){return a.apply(b,$A(arguments).slice(1))}}};Object.extend(Function.prototype,{rcurry:Fn.rcurry.methodize(),debounce:Fn.debounce.methodize(),callOnce:Fn.callOnce.methodize(),getOnce:Fn.getOnce.methodize(),functionalize:Fn.functionalize.methodize()});Object.extend(Object,{getPropertyName:function(c,b){for(var a in c){if(c[a]===b){return a}}return false}});Element.addMethods();var Env={parameter:function(a){var b=new RegExp(a+"=([^&]+)").exec(location.search);return(b)?decodeURIComponent(b[1]):undefined}};Object.extend(Position,{pageScrollTop:function(){var a;if(self.pageYOffset){a=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){a=document.documentElement.scrollTop}else{if(document.body){a=document.body.scrollTop}}}return a},viewportSize:function(){var c=document.documentElement;var a=window.innerWidth||self.innerWidth||(c&&c.clientWidth)||document.body.clientWidth;var b=window.innerHeight||self.innerHeight||(c&&c.clientHeight)||document.body.clientHeight;return{width:a,height:b}},pageDimensions:function(){var a=document.documentElement;return{width:(a.scrollWidth>a.clientWidth)?a.scrollWidth:a.clientWidth,height:(a.scrollHeight>a.clientHeight)?a.scrollHeight:a.clientHeight}}});Object.extend(String.prototype,{trim:function(){return(this=="")?this:this.ltrim().rtrim()},ltrim:function(){return(this=="")?this:this.replace(/^\s+/gm,"")},rtrim:function(){return(this=="")?this:this.replace(/\s+$/gm,"")},zeroPad:function(a){return"0".string(a-this.length)+this},string:function(a){var c="",b=0;while(b++<a){c+=this}return c},supplant:function interpolate(a){return new Template(this,/(^|.|\r|\n)(\{(.*?)\})/).evaluate(a)},parseString:function(a){var c;switch(a){case"date":c=this.replace(/[\.|-|,]/g," ");var b=c.trim().split(/\s+/);if(b.length==2){c=b[0]+" 01 "+b[1]}c=Date.parse(c);break;case"number":c=parseFloat(this.replace(/%|\$/g,""));if(isNaN(c)){c=Number.NEGATIVE_INFINITY}break;case"text":default:c=this.toLowerCase().replace(/\s/g," ");break}return c},parse:function(a){return this.parseString(a)},sanitize:function(){return this.stripScripts().stripTags()}});Object.extend(Number.prototype,{zeroPad:function(a){return this.toString().zeroPad(a)}});Object.extend(Date.prototype,{format:function(a){if(!this.valueOf()){return" "}var b=this;return a.replace(/(yyyy|mmmm|mmm|mm|dddd|ddd|dd|hh|HH|nn|ss|a\/p)/g,function(c){switch(c){case"yyyy":return b.getFullYear();case"mmmm":return gsMonthNames[b.getMonth()];case"mmm":return gsMonthNames[b.getMonth()].substr(0,3);case"mm":return(b.getMonth()+1).zeroPad(2);case"dddd":return gsDayNames[b.getDay()];case"ddd":return gsDayNames[b.getDay()].substr(0,3);case"dd":return b.getDate().zeroPad(2);case"hh":return b.getHours()<=12?b.getHours().zeroPad(2):(b.getHours()-12).zeroPad(2);case"HH":return b.getHours().zeroPad(2);case"nn":return b.getMinutes().zeroPad(2);case"ss":return b.getSeconds().zeroPad(2);case"a/p":return b.getHours()<12?"am":"pm"}})},inPeriod:function(d,b){if(isNaN(d)){throw" delta is not a number"}if(!b||/day|month|year/i.test(b)==false){throw" unit is unrecognized"}var a={day:"Date",month:"Month",year:"FullYear"},c=new Date();b=b.toLowerCase();c["set"+a[b]](this["get"+a[b]]()+d);return c},inDays:function(b){try{return this.inPeriod(b,"day")}catch(a){throw"Date.prototype.inDays "+a}},inWeeks:function(b){try{return this.inPeriod((isNaN(parseFloat(b)))?b:b*7,"day")}catch(a){throw"Date.prototype.inWeeks "+a}},inMonths:function(b){try{return this.inPeriod(b,"month")}catch(a){throw"Date.prototype.inMonths "+a}},inYears:function(b){try{return this.inPeriod(b,"year")}catch(a){throw"Date.prototype.inYears "+a}}});Element.addMethods({collapse:function(b,a){var c,d=b.firstChild;while(d){if(d.hasChildNodes()&&(a||a==undefined)){Element.collapse(d,a)}c=d.nextSibling;if((/3/.test(d.nodeType)&&!/\S/.test(d.nodeValue))||/8/.test(d.nodeType)){d.parentNode.removeChild(d)}d=c}return b},cssArguments:function(e){if(!e){throw new Error("Element.cssArguments missing required argument")}var c=$(e).className.match(/\S+\s*:\s*\S+/gm),b={};if(c){var a=c.length,g=/(\S+)\s*:\s*(\S+)/,f,d;while(a--&&c[a].match(g)){d=RegExp.$1;f=decodeURIComponent(RegExp.$2);if(/^true$/i.test(f)){f=true}else{if(/^false$/i.test(f)){f=false}else{if(isNaN(parseFloat(f))==false){f=parseFloat(f)}}}b[d]=f}}return b},getText:function(a){var b=$(a);if(b.innerText){return b.innerText}if(b.textContent){return b.textContent}return b.innerHTML.stripScripts().stripTags()},setText:function(a,c){var b=$(a);c=c.sanitize();b.update().appendChild(document.createTextNode(c))},getData:function(b,a){var c=/^data-/;var d=a||c;var e={};$A(b.attributes).each(function(f){var g=f.nodeName;if(g.match(d)){g=g.replace(d,"").camelize();e[g]=f.nodeValue}});return e},getChildrenByTagName:function(d,c){var e=$(d);var b=(c)?c.toLowerCase():"*";var a=new Selector(b);return e.childElements().grep(a)},getChildrenByClassName:function(a,c){var b=a;b.select("."+c)},text:function(a){return Element.getText(a)}});Object.extend(Element,Element.Methods);(function(a){Object.extend(a,{EMAIL:/^[\w\.\-\+\'\&]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,4}){1,2}$/,TICKER:/^[A-Za-z]+(\.[A-Za-z]{1,2})?$/})})(RegExp);(function(c){var b=function(d){return d.test(this)},a={};["email","ticker"].each(function(d){this["is"+d.replace(/^./,String.prototype.toUpperCase.functionalize())]=b.curry(RegExp[d.toUpperCase()])},a);Object.extend(c,a)})(String.prototype);(function(a){Object.extend(a,{update:function(b){this.splice.apply(this,[0,this.length].concat(b));return this}})})(Array.prototype);Function.invoke=function(a){return a.apply(this,$A(arguments).slice(1))};Fool.FocusFirstFormElement=function(){document.observe("dom:loaded",function(){var a=document&&document.forms,c=a&&a[0],d=c&&c.elements,b=d&&d[0];try{b&&b.focus()}catch(f){}})};Fool.sameAs=function(){var a=$A(arguments),b=a.shift();return a.all(function(c){return c===b})};Fool.ActivateLinkButtons=function(){Fool.Event.delegate({type:"click",test:function(a){return Element.match(a,"a[value]")},action:function(d,c){Event.stop(d);var a=c,b=a.up("form");b.insert({bottom:'<input type="hidden" name="{name}" value="{value}" />'.supplant({value:a.getAttribute("value"),name:a.getAttribute("name")})});b.submit();return}})};