function addLoadEvent(a){var b=window.onload;if(typeof window.onload!="function"){window.onload=a}else{window.onload=function(){b();a()}}}addLoadEvent(function(){getDimensions()});function getCookie(b){if(document.cookie.length>0){var c=document.cookie.indexOf(b+"=");if(c!=-1){c=c+b.length+1;var a=document.cookie.indexOf(";",c);if(a==-1){a=document.cookie.length}return unescape(document.cookie.substring(c,a))}}return""}function getElement(a){var b;if(document.getElementById){b=document.getElementById(a)}else{if(document.all){b=document.all[a]}}return b}function getElementsByClassName(f,d){if(!d){d=document.getElementsByTagName("body")[0]}var a=new Array();var c=new RegExp("\\b"+f+"\\b");var e=d.getElementsByTagName("*");for(var b=0;b<e.length;b++){if(c.test(e[b].className)){a.push(e[b])}}return a}function toggleDisplay(a,c,d){var b=getElement(a);if(d==true){b.style.display=c}else{b.style.display=b.style.display?"":c}}function toggleVisible(a,c){var b=getElement(a);b.style.visibility=c}function toggleClass(a,c,d){var b=getElement(a);b.className=(b.className!=d)?d:c}function isEmail(b){var a=/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9])+(\.[a-zA-Z0-9_-]+)+$/;return a.test(b)}function isDate(b){var a=/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}$/;return a.test(b)}function isNumber(b){var a=/^\d*$/;return a.test(b)}function isAlphanumeric(b){var a=/^[0-9a-zA-Z]*$/;return a.test(b)}function restrictValues(c,a){var b="";for(i=0;i<c.value.length;i++){x=c.value.charAt(i);if(a.indexOf(x,0)!=-1){b+=x}}c.value=b}function restrictLength(b,d){var c=b.value.length;if(c>d){b.value=b.value.substring(0,d);return false}var a=getElement("counter");if(a!=null){a.innerHTML=d-c}}var sendData;var scriptPath;function processAjax(a){var b;if(window.XMLHttpRequest){b=new XMLHttpRequest()}else{if(window.ActiveXObject){b=new ActiveXObject("Microsoft.XMLHTTP")}}b.onreadystatechange=function(){var c;if(b.readyState==4&&b.status==200){c=b.responseText}if(c){a(c)}};b.open("POST",scriptPath,true);b.setRequestHeader("Content-Type","application/x-www-form-urlencoded");b.send(sendData)}var winWidth;var winHeight;function getDimensions(){if(self.outerWidth){winWidth=self.outerWidth;winHeight=self.outerHeight}else{if(document.body){winWidth=document.body.clientWidth;winHeight=document.body.clientHeight;winHeight+=120}}}var newWindow="";function popupWindow(e,d,a){getDimensions();var b=winWidth/2-e/2;var c=winHeight/2-d/2;this.name="main";if(newWindow&&!newWindow.closed){newWindow.close()}newWindow=window.open(a,"","left="+b+",top="+c+",width="+e+",height="+d+",status=0,scrollbars=1,resizable=1")}function sendWindowForm(formName){var activeForm=eval("document.forms."+formName);activeForm.target="main";activeForm.submit();window.close()}function checkForm(formName){var thisForm=eval("document.forms."+formName);if((formName=="contact_form")||(formName=="friend_form")){if(thisForm.sender.value==""){alert("Please enter your name.");thisForm.sender.focus();return false}else{if((thisForm.email.value=="")||(!isEmail(thisForm.email.value))){alert("Please enter a valid email address.");thisForm.email.focus();return false}else{if((formName=="friend_form")&&((thisForm.recipient1.value=="")||(!isEmail(thisForm.recipient1.value)))){alert("Please enter a valid email address to send the message to.");thisForm.recipient1.focus();return false}else{if((formName=="friend_form")&&((thisForm.recipient2.value!="")&&(!isEmail(thisForm.recipient2.value)))){alert("Please enter a valid email address to send the message to or leave it blank.");thisForm.recipient2.focus();return false}else{if((formName=="friend_form")&&((thisForm.recipient3.value!="")&&(!isEmail(thisForm.recipient3.value)))){alert("Please enter a valid email address to send the message to or leave it blank.");thisForm.recipient3.focus();return false}else{if(thisForm.message.value==""){alert("Please enter your message.");thisForm.message.focus();return false}else{return true}}}}}}}if(formName=="trial_form"){if(thisForm.bride.value==""){alert("Please enter the bride's name.");thisForm.bride.focus();return false}else{if((thisForm.brideLastName)&&(thisForm.brideLastName.value=="")){alert("Please enter the bride's last name.");thisForm.brideLastName.focus();return false}else{if(thisForm.groom.value==""){alert("Please enter the groom's name.");thisForm.groom.focus();return false}else{if((thisForm.groomLastName)&&(thisForm.groomLastName.value=="")){alert("Please enter the groom's last name.");thisForm.groomLastName.focus();return false}else{if((thisForm.email.value=="")||(!isEmail(thisForm.email.value))){alert("Please enter a valid email address.");thisForm.email.focus();return false}else{if((thisForm.address1)&&(thisForm.address1.value=="")){alert("Please enter your postal address. ");thisForm.address1.focus();return false}else{if((thisForm.city)&&(thisForm.city.value=="")){alert("Please enter your town or city. ");thisForm.city.focus();return false}else{if((thisForm.postcode)&&(thisForm.postcode.value=="")){alert("Please enter your postcode or zipcode. ");thisForm.postcode.focus();return false}else{if((thisForm.weddingDate.value!="")&&(!isDate(thisForm.weddingDate.value))){if(dateFormat=="euro"){alert("Please enter the date in dd/mm/yyyy format or leave it blank. ")}else{alert("Please enter the date in mm/dd/yyyy format or leave it blank.")}thisForm.weddingDate.focus();return false}else{if((thisForm.subdomain.value=="")||(!isAlphanumeric(thisForm.subdomain.value))){alert("Please enter your chosen website address using only letters and numbers.");thisForm.subdomain.focus();return false}else{if(available==false){alert("The website address you have chosen is not available. Please choose a different address.");thisForm.subdomain.focus();return false}else{return true}}}}}}}}}}}}if(formName=="findSite_form"){var bride=thisForm.bride.value;var groom=thisForm.groom.value;if(((bride.length<3)&&(groom.length<8))||((groom.length<3)&&(bride.length<8))){alert("Please enter at least 3 characters in each box to continue.");thisForm.bride.focus();return false}else{return true}}if(formName=="submitTip_form"){if(thisForm.tipText.value==""){alert("Please enter your wedding tip.");thisForm.tipText.focus();return false}else{if(thisForm.tipText.value.length>140){alert("Your tip must not be longer than 140 characters.");thisForm.tipText.focus();return false}else{return true}}}if(formName=="error_form"){if(thisForm.url.value==""){alert("Please enter the website address where the error occurred.");thisForm.url.focus();return false}else{if(thisForm.description.value==""){alert("Please enter a description of the problem.");thisForm.description.focus();return false}else{if((thisForm.email.value!="")&&(!isEmail(thisForm.email.value))){alert("Please enter a valid email address or leave it blank.");thisForm.email.focus();return false}else{return true}}}}};