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