﻿function BookHotel(){if(valueFormat==0){if(getObj("aspnetForm")!=null){getObj("aspnetForm").id="selectHotelForm"}getObj("selectHotelForm").target="_blank";getObj("selectHotelForm").action="http://book.bestwestern.com/bestwestern/priceAvail.do?resumeSearch=true&propertyCode=62087&suppressSSLPopup=true&disablenav=true&sob=P511"}SendMail()}function Validate1(){var b=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;if(getObj("Name").value==""){alert("Please enter your name");getObj("RequiredFieldValidator1").style.visibility="hidden";getObj("RequiredFieldValidator3").style.visibility="visible";getObj("Name").focus();return false}if(getObj("FromEmail").value==""){alert("Please enter your valid email address");getObj("RequiredFieldValidator3").style.visibility="hidden";getObj("RequiredFieldValidator1").style.visibility="visible";getObj("FromEmail").focus();return false}if(!b.test(getObj("FromEmail").value)){alert("Please enter your valid email address");getObj("RequiredFieldValidator1").style.visibility="hidden";getObj("RegularExpressionValidator1").style.visibility="visible";getObj("FromEmail").focus();return false}if(getObj("ToEmail").value==""){alert("Please enter a valid email address of the recipient");getObj("RequiredFieldValidator2").style.visibility="visible";getObj("ToEmail").focus();return false}if(!b.test(getObj("ToEmail").value)){alert("Please enter a valid email address of the recipient");getObj("RegularExpressionValidator2").style.visibility="visible";getObj("ToEmail").focus();return false}if(getObj("Subject").value==""){alert("Please enter a subject line for the email");getObj("RequiredFieldValidator4").style.visibility="visible";getObj("Subject").focus();return false}var a=0;if(confirm("Your email has been sent!  Would you like to subscribe to our hotel e-newsletter to receive updates on specials happening in and around our hotel?")){a=1}window.getObj("hidMail").value=a;return true}function Validate2(){var a=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;if(getObj("FromEmail").value==""){alert("Please enter your valid email address");getObj("RequiredFieldValidator3").style.visibility="hidden";getObj("RequiredFieldValidator1").style.visibility="visible";getObj("FromEmail").focus();return false}if(!a.test(getObj("FromEmail").value)){alert("Please enter your valid email address");getObj("RequiredFieldValidator1").style.visibility="hidden";getObj("RequiredFieldValidator3").style.visibility="hidden";getObj("RegularExpressionValidator1").style.visibility="visible";getObj("FromEmail").focus();return false}window.getObj("hidMail").value=1;return true}var XmlHttp;function CreateXmlHttp(){try{XmlHttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{XmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){XmlHttp=null}}if(!XmlHttp&&typeof XMLHttpRequest!="undefined"){XmlHttp=new XMLHttpRequest()}}function RelativePath(){var a=self.location.href;a=a.toLowerCase();var e="";var b="localhost/";var d="server/";var c="bwcampbellriver.com/";if(a.lastIndexOf(b)>1){e="http://localhost/BWPlusAustrianChaletCampbellRiver/"}else{if(a.lastIndexOf(c)>1){e="http://www.bwcampbellriver.com/"}}return e}function SendMail(){CreateXmlHttp();if(XmlHttp){XmlHttp.onreadystatechange=HandleResponseSendMail;XmlHttp.open("POST",RelativePath()+"BookAjax.aspx",true);this.XmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");XmlHttp.setRequestHeader("Connection","close");XmlHttp.send("Book=yes")}}function HandleResponseSendMail(){if(XmlHttp.readyState==4){if(XmlHttp.status==200){}else{alert("There was a problem retrieving data from the server.")}}};
