var URL_BIZ_SEND_EMAIL="/ajax/bizSendEmail";var URL_BIZ_AFFILIATE_LINK="/ajax/bizAffiliateLink";var trigger=false;function validateBizForm(){if(!trigger){trigger=true;jQuery(".biz-button").get(0).disabled=true;jQuery(".form-error").html("");var F=jQuery("#first_name").val();var G=jQuery("#last_name").val();var H=jQuery("#company").val();var J=jQuery("#email").val();var K=jQuery("#phone").val();var B=jQuery("#city").val();var A=jQuery("#promotion_code").val();var M=jQuery("#message").val();var I=jQuery("#package").val();var E=jQuery("#duration").val();var D=jQuery("#watermark").val();var C=jQuery("#ref").val();var L=[];if(F==""){L.push({id:"fld_first_name",msg:GT.gettext("Please enter your first name")})}if(G==""){L.push({id:"fld_last_name",msg:GT.gettext("Please enter your last name")})}if(H==""){L.push({id:"fld_company",msg:GT.gettext("Please enter your company name")})}if(J==""){L.push({id:"fld_email",msg:GT.gettext("Please enter your email address")})}if(K==""){L.push({id:"fld_phone",msg:GT.gettext("Please enter your phone number")})}if(B==""){L.push({id:"fld_city",msg:GT.gettext("Please enter your city/state/country")})}if(I==""){L.push({id:"fld_package",msg:GT.gettext("Please select the package you are interested in")})}if(E==""){L.push({id:"fld_package",msg:GT.gettext("Please select the term for the business package desired")})}if(I!="GoPublish"&&D==""){L.push({id:"fld_watermark",msg:GT.gettext("Please specify a transparent image as your watermark")})}if(!J.match(/^([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$/i)){L.push({id:"fld_email",msg:GT.gettext("Please enter a valid email address")})}for(i=0;i<L.length;i++){content=jQuery("#"+L[i].id+" div.form-error").html();content+=(L[i].msg+"<br />");jQuery("#"+L[i].id+" div.form-error").html(content)}if(L.length>0){jQuery(".biz-button").get(0).disabled=false;trigger=false;return false}else{return true}}}function bizSendEmailComplete(A){parseResponse(A);if(responseArray.code==0){jQuery("#contactus_form").hide();jQuery("#contactus_sent").show();trigger=false}else{if(responseArray.code==1){jQuery("#contact_form_err").html(GT.gettext("Please enter a valid email address")+"<br/>");trigger=false}}}function popupWindow(A){window.open(A)}var aTrigger=false;function getAffiliateLink(){if(!aTrigger){aTrigger=true;var A=jQuery("#affiliate_email").val();var B="";if(A==""){B=GT.gettext("Please enter your email address")+"<br/>"}if(B!=""){jQuery("#affiliate_err").html(B);aTrigger=false}else{if(typeof pageTracker!="undefined"&&pageTracker){pageTracker._trackPageview("/pageTracker/ajax/biz/getLink")}new Ajax.Request(URL_BIZ_AFFILIATE_LINK,{method:"post",parameters:"email="+A,onSuccess:function(D){var C=D.responseText;getAffiliateLinkComplete(C)},onFailure:function(){displayFeedback(GT.gettext("Error contacting the server"))}})}}}function getAffiliateLinkComplete(A){parseResponse(A);if(responseArray.code==0){jQuery("#affiliate_err").html("");jQuery("#affiliate_content").html(responseArray.html);jQuery("html, body").animate({scrollTop:0},"slow");aTrigger=false}else{if(responseArray.code==1){jQuery("#affiliate_err").html(GT.gettext("Please enter a valid email address")+"<br/>");aTrigger=false}}}function clearField(){if(jQuery("#affiliate_email").val()=="Make sure your address is accurate"){jQuery("#affiliate_email").val("")}};
