$(document).ready(function(){prepBody();prepSiteNav();prepSectionNav();prepLogo();prepForms();prepThickbox();$("#contentFeedback").hide().slideDown("slow");window.setTimeout("$(\"#contentFeedback\").fadeOut(\"slow\")",3000);$("#greetingWelcome").hide().slideDown("slow");window.setTimeout("$(\"#greetingWelcome\").fadeOut(\"slow\")",5000);calcLoadTime();});function prepBody(){if(document.images){document.body.className+=" hasimages";}}function prepSearch(){if(document.getElementById){if(!document.getElementById("searchInput")){return;}q=document.getElementById("searchInput");if(q){if(q.value==""){q.value="Search";}q.onfocus=function(){if(this.value=="Search"){this.value="";}};q.onblur=function(){if(this.value==""){this.value="Search";}};}}}function prepSiteNav(){if(document.all&&document.getElementById){$("#navMain li").bind("mouseover",function(){this.className+=" active";});$("#navMain li").bind("mouseout",function(){this.className=this.className.replace(" active","");});}}function prepSectionNav(){if(document.body.id&&(document.body.id!="")){var l=document.getElementById(document.body.id.replace("page-","s-"));if(l&&(l.parentNode.parentNode.id=="navSection"&&l.childNodes&&l.childNodes.length>1)){l.className+=" expanded";}else{if(l&&(l.parentNode.parentNode.id!="navSection")){l.parentNode.parentNode.className+=" expanded";}}if(l){l.className+=" selected";}}}function prepLogo(){$("#brandingLogo a").hover(function(){if(!document.getElementById("branding").className.match("active")){document.getElementById("branding").className+=" active";}},function(){if(document.getElementById("branding").className.match("active")){document.getElementById("branding").className=document.getElementById("branding").className.replace("active","");}});}function prepForms(){$(".formFields input").bind("focus",function(){$(this).parents("li").addClass("focused");$(this).siblings("p").addClass("focused");}).bind("blur",function(){$(this).siblings("p").removeClass("focused");$(this).parents("li").removeClass("focused");});$(".formFields textarea").bind("focus",function(){$(this).parents("li").addClass("focused");}).bind("blur",function(){$(this).parents("li").removeClass("focused");});$(".formFields select").bind("focus",function(){$(this).parents("li").addClass("focused");}).bind("blur",function(){$(this).parents("li").removeClass("focused");});$(".formFields li").each(function(){reqItems=$(this).filter(".required");if(reqItems.length){$(this).find("label.desc").addClass("required");}$(".required:last",this).bind("blur",function(){checkRequired($(this).parents("li").get(0));});$("input:last",this).bind("blur",function(){$(this).parents("li").removeClass("focused");$(this).siblings("p").removeClass("focused");});$("select:last",this).bind("blur",function(){$(this).parents("li").removeClass("focused");});$("textarea:last",this).bind("blur",function(){$(this).parents("li").removeClass("focused");});});$(".formFields .email").unbind("blur").bind("blur",function(){var _2=0;if(window.RegExp){var _3="a";var _4=new RegExp(_3);if(_4.test(_3)){_2=1;}}if($(this).val()==""){addError(this,"This field is required.");}else{if(!_2){var _5=eval(str.indexOf(".")>2)&&(str.indexOf("@")>0)?1:0;}else{var r1=new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");var r2=new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");var _8=eval(!r1.test(this.value)&&r2.test(this.value))?1:0;}if(!_8){addError(this,"There appears to be a problem with this email address.</p>");}else{removeError($(this).parents("li").get(0));}}$(this).parents("li").removeClass("focused");});}function prepThickbox(){$("a.thickbox").filter(".ajax").each(function(){if(!this.href.match(/\?/)){this.href+="?";}if(!this.href.match("method=")){this.href+="&method=ajax";}if(!this.href.match("width=")){this.href+="&width=300";}if(!this.href.match("height=")){this.href+="&height=300";}if(this.id&&(this.id=="linkSignin"||this.id=="linkAboutYou")){this.href+="&referrer="+window.location.pathname;}});}function checkRequired(_9){var _a;$(_9).find(".required").each(function(){if($(this).val()==""){_a=1;}});if(_a){addError(_9,"This field is required.");}else{removeError(_9);}}function addError(_b,_c){var _d=$(_b).parents("li").get(0);$(_d).addClass("error");$(_d).find("p.error").remove();$("label.desc",_d).after("<p class=\"problem error\">"+_c+"</p>");$("p.error",_d).fadeIn("slow");$(_d).find(".required").addClass("problem");}function removeError(_e){container=$(_e);container.removeClass("error");container.find("p.error").fadeOut("slow");container.find(".required").removeClass("problem");}function calcLoadTime(){var _f=new Date().getTime();var _10=_f-pageInitTime;var _11=self.location.pathname;if(_11.charAt(_11.length-1)=="/"){_11=_11.substr(0,_11.length-1);}}