$("document").ready(function(){$("input,textarea,select").filter("input[type=text],input[type=password],textarea").keypress(function(a){if(a.which==60){a.stopPropagation();a.preventDefault()}}).blur(function(a){var c=$(this).val(),b=false;while(c.match(/<|&#/g)){c=c.replace(/<|&#/g,"");b=true}if(b){$(this).val(c);alert("Your answer contained invalid characters. These have been removed.")}}).end().filter("input:not([type=submit][type=radio]),textarea,select").focus(function(a){$(a.target).addClass("focus")}).blur(function(a){$(a.target).removeClass("focus")});$("a[rel=external]").click(function(){window.open(this.href);return false})});function formatAsMoney(a){a-=0;a=(Math.round(a*100))/100;return(a==Math.floor(a))?a+".00":((a*10==Math.floor(a*10))?a+"0":a)}(function(b){b.fn.rolloverButton=function(d){if(b.browser.msie&&parseInt(b.browser.version)<7){return this.each(function(){b(this).mouseover(function(){b(this).addClass(d)}).mouseout(function(){b(this).removeClass(d)})})}else{return this}};b.fn.scrollTo=function(d){return this.each(function(){var e=b(this).offset().top;if(d&&(e>d)){e=e-d}b("html, body").animate({scrollTop:e},"slow")})};b.fn.captcha=function(d){return this.each(function(){var e=b(this).find(".captchaimage"),f=e.get(0).src;b(this).find(".captchaplay").click(function(){soundManager.play("captcha","CaptchaAudio.aspx");return false}).end().find(".captchareload").click(function(){if(d){b(d).val("")}e.get(0).src=f+"?"+(new Date()).getTime();soundManager.destroySound("captcha");return false})})};b.fn.helptip=function(d){var e={tipselector:function(f){return b(f).next(".ttip")},offsetX:0,offsetY:0,offsetLeft:0,elOffset:false,vertical:false};if(d){jQuery.extend(e,d)}if(e.vertical==true){e.offsetY=b(this).outerHeight(true)+5;e.offsetX=0+e.offsetX-b(this).outerWidth()}return this.each(function(){b(this).hover(function(){var f=(e.elOffset)?{top:this.offsetTop,left:this.offsetLeft}:{top:b(this).offset().top,left:b(this).offset().left},g=e.tipselector(this);f.left=(e.offsetLeft>0)?e.offsetLeft:f.left;f.left=(g.hasClass("tipbottom"))?f.left:(g.hasClass("tipleft"))?f.left-g.width()-e.offsetX:f.left+b(this).width()+e.offsetX;f.top=f.top+e.offsetY;g.css(f).show()},function(){e.tipselector(this).hide()}).click(function(){return false})})};jQuery.each(["backgroundColor","color"],function(e,d){jQuery.fx.step[d]=function(f){if(f.state==0){f.start=c(f.elem,d);f.end=a(f.end)}f.elem.style[d]="rgb("+[Math.max(Math.min(parseInt((f.pos*(f.end[0]-f.start[0]))+f.start[0]),255),0),Math.max(Math.min(parseInt((f.pos*(f.end[1]-f.start[1]))+f.start[1]),255),0),Math.max(Math.min(parseInt((f.pos*(f.end[2]-f.start[2]))+f.start[2]),255),0)].join(",")+")"}});function a(e){var d;if(e&&e.constructor==Array&&e.length==3){return e}if(d=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(e)){return[parseInt(d[1]),parseInt(d[2]),parseInt(d[3])]}if(d=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(e)){return[parseFloat(d[1])*2.55,parseFloat(d[2])*2.55,parseFloat(d[3])*2.55]}if(d=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(e)){return[parseInt(d[1],16),parseInt(d[2],16),parseInt(d[3],16)]}if(d=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(e)){return[parseInt(d[1]+d[1],16),parseInt(d[2]+d[2],16),parseInt(d[3]+d[3],16)]}}function c(f,d){var e;do{e=jQuery.curCSS(f,d);if(e!=""&&e!="transparent"||jQuery.nodeName(f,"body")){break}d="backgroundColor"}while(f=f.parentNode);return a(e)}})(jQuery);Array.prototype.strIndex=function(d,a){var b=-1;var c;$.each(this,function(e,f){if(!a){c=f.toString().toLowerCase()}else{c=f[a].toString().toLowerCase()}if(c===d.toString().toLowerCase()){b=e}});return b};Array.prototype.toInt=function(){return $.map(this,function(b,a){return parseInt(b,10)})};function JSONToString(c){var a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},b={"boolean":function(d){return String(d)},"null":function(d){return"null"},number:function(d){return isFinite(d)?String(d):"null"},string:function(d){if(/["\\\x00-\x1f]/.test(d)){d=d.replace(/([\x00-\x1f\\"])/g,function(f,e){var g=a[e];if(g){return g}g=e.charCodeAt();return"\\u00"+Math.floor(g/16).toString(16)+(g%16).toString(16)})}return'"'+d+'"'},array:function(e){var h=["["],d,m,k,g=e.length,j;for(k=0;k<g;k+=1){j=e[k];m=b[typeof j];if(m){j=m(j);if(typeof j=="string"){if(d){h[h.length]=","}h[h.length]=j;d=true}}}h[h.length]="]";return h.join("")},object:function(e){if(e){if(e instanceof Array){return b.array(e)}var g=["{"],d,k,j,h;for(j in e){h=e[j];k=b[typeof h];if(k){h=k(h);if(typeof h=="string"){if(d){g[g.length]=","}g.push(b.string(j),":",h);d=true}}}g[g.length]="}";return g.join("")}return"null"}};return b.object(c)}(function(a){a.fn.compactlabels=function(){return this.each(function(){var c=this;var b=a(this).attr("for");if(b){var d=a("#"+b);if(d.length>0){a(this).addClass("over-label").click(function(){d.focus()});if(d.val()!==""){a(c).css("text-indent","-1000px")}d.focus(function(){a(c).css("text-indent","-1000px")}).blur(function(){if(a(this).val()===""){a(c).css("text-indent","0px")}})}}})}})(jQuery);