// Secure this javascript from being called and executed on behalf of outside websites. var d = new Array("howdysresort.com", "secure.howdysresort.com"); var domaincheck = document.location.href; //retrieve the current URL of user browser var accepted_ok = false; //set acess to false by default if(domaincheck.indexOf("http") != -1 || domaincheck.indexOf("https") != -1) { // If this is an http or https request. for(r = 0; r < d.length; r++) { if(domaincheck.indexOf(d[r]) != -1) { //if a match is found accepted_ok = true; //set access to true, and break out of loop break; } } } else { accepted_ok = true; } if(!accepted_ok) { alert("You're not allowed to directly link to this .js file on our server!"); history.back(-1); } function getoffset(e) { var t = e.offsetTop; var l = e.offsetLeft; while(e=e.offsetParent) { t += e.offsetTop; l += e.offsetLeft; } var rec = new Array(1); rec[0] = t; rec[1] = l; return rec; } function ismaxlength(buf, maxlengh) { if(maxlengh == "") { maxlengh = "16383"; } if(buf.length > maxlengh) { //alert("Maxlength: " + maxlengh + ""); return(false); } else { return(true); } } function loadXML(location, url) { if(window.XMLHttpRequest) { // Native XMLHttpRequest call req = new XMLHttpRequest(); } else if (window.ActiveXObject) { // IE/Windows ActiveX call req = new ActiveXObject("Microsoft.XMLHTTP"); } if(req) { //alert("load XML:" + "http://www.howdysresort.com" + location); req.open("POST", "http://www.howdysresort.com" + location, true); req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); req.onreadystatechange = processReq; req.send(url); } } function updateFormCookies(form_Name,exp_Days) { var myform=eval("document."+form_Name); var cookies_value; for (var i=0;i",""); tmp_value=tmp_value.replace(";",""); tmp_value=tmp_value.replace("|",""); tmp_value=tmp_value.replace("=",""); tmp_value=tmp_value.replace("'",""); tmp_value=tmp_value.replace("\"",""); cookies_value+="|"+myform.elements[i].name+"="+tmp_value; // s+="
"+"name:"+myform.elements[i].name+" value:"+myform.elements[i].value+" type:"+myform.elements[i].type+"
"; } } // document.write("sting:"+s+"
") ; var cookies_name="formcookies_"+form_Name; var expdate= new Date(); expdate.setTime(expdate.getTime()+(3600*1000*24*exp_Days)); // document.cookie=cookie_Name+"="+new_Value.replace(/(\s)+/g,"*")+";expires="+expdate.toGMTString(); document.cookie=cookies_name+"="+encodeURIComponent(cookies_value)+";expires="+expdate.toGMTString(); // document.write("updateCookies:"+cookies_value); } function getCookiesString(form_Name) { var cookie_name="formcookies_"+form_Name; var tmp_string=document.cookie; var tmp_array=tmp_string.split("; "); for(key in tmp_array) { var tmp_string1=tmp_array[key].split("="); if(cookie_name==tmp_string1[0]) { // document.write("
line:"+tmp_string1[0]+" value:"+tmp_string1[1]+"
"); return tmp_string1[1]; } } return ""; } function getCookiesValue(form_Name,field_Name) { var tmp_string=getCookiesString(form_Name); var tmp_string1=decodeURIComponent(tmp_string); var tmp_array=tmp_string1.split("|"); var thecookie=new Array(); for(key in tmp_array) { var tmp=tmp_array[key].split("="); thecookie[tmp[0]]=tmp[1]; if(field_Name==tmp[0]) { return thecookie[tmp[0]]; } } if (field_Name==null) return thecookie; else return ""; } function retrieveFormCookies(form_Name) { var myform = eval("document."+form_Name); var msg =""; var cookies_array = getCookiesValue(form_Name); //for(key in cookies_array){ // msg += cookies_array[key] + "\n"; //} //alert(msg); for (var i=0;iline:"+tmp_string1[0]+" value:"+tmp_string1[1]+"
"); document.getElementById(tab_Name).style.display = (tmp_string1[1]=="1"?"block":"none"); } } } function sCartAddTo(a, b, c) { if(a) { document.getElementById("cart" + b).src = "/modustpl/img/sCartAddTo.gif"; if(c == 2) { var yes = confirm(req.responseXML.getElementsByTagName("message")[0].firstChild.data); if(yes) { window.location.href = "/index.php?tpl=sCart"; } } } else { document.getElementById("cart" + b).src = "/modustpl/img/loading.gif"; var return_flag = true; var location = "/modustpl/_secureXMLReq.php"; var url = "pid=1&id=" + b; loadXML(location, url); } } function setTabcookies(tab_Name, value, exp_Days) { var cookies_name = tab_Name; var expdate = new Date(); expdate.setTime(expdate.getTime()+(3600*1000*24*exp_Days)); document.cookie = cookies_name + "=" + value + ";expires=" + expdate.toGMTString(); } function showLargePic(l, s) { for(var i = 0; i < document.images.length; i++) { document.images[i].style.border = "0px"; } document.getElementById("imgsmall_" + s).style.border = "2px solid red"; document.getElementById("large_pic").innerHTML = ''; } /* Submit Once form validation- For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com */ function submitonce(theform){ if(document.all||document.getElementById) { //if IE 4+ or NS 6+ for(i=0;i 0)) { method = req.responseXML.getElementsByTagName("method")[0].firstChild.data; eval(method); } else { alert("Error: No 'method' found in responce from server.\n\n" + req.statusText); } } else { alert("Error:\n" + req.statusText); } } } function popUp(URL, width, height) { if(height==null) height=600; if(width==null) width=800; eval("page = window.open(URL, 'popUp', 'toolbar=0, scrollbars=1, location=0, statusbar=1, menubar=0, resizable=1, height=' + height + ', width=' + width + ', left=192, top=144');"); page.focus(); } /////////////////////////////////// Beginning of the Div Show Code ////////////////////////////////////////////// var timer = null; var divShowIsShown = false; var divShowName = null; var divShowWait = null; var divShowWaitMask = null; var divShowIframe = null; function divShow(a) { // show which div name divShowIsShown = true; if(a) { divShowName = document.getElementById(a); } divShowWaitMask.style.display = "block"; divShowIframe.style.display = "block"; divShowName.style.display = "block"; divShowPopup(); } function delayShow() { if(divShowIsShown == true) { timer = setTimeout("divShowPopup();", 200); } } function divShowPopup() { if(divShowWait.style.display == "block") { divShowWait.style.display = "block"; } div_wait_height = divShowWait.offsetHeight; div_wait_width = divShowWait.offsetWidth; var scTop = parseInt(getScrollTop(), 10); var scLeft = parseInt(getScrollLeft() ,10); var fullHeight = getViewportHeight(); var fullWidth = getViewportWidth(); divShowWait.style.top = (scTop + ((fullHeight - div_wait_height) / 2)) + "px"; divShowWait.style.left = (scLeft + ((fullWidth - div_wait_width) / 2)) + "px"; divShowWaitMask.style.height = fullHeight + "px"; divShowIframe.style.height = fullHeight + "px"; if(document.all) { // If IE divShowWaitMask.style.width = fullWidth + "px"; divShowIframe.style.width = fullWidth + "px"; } else { // If Firefox divShowWaitMask.style.width = (fullWidth - 17) + "px"; divShowIframe.style.width = (fullWidth - 17) + "px"; } divShowWaitMask.style.top = scTop + "px"; divShowIframe.style.top = scTop + "px"; divShowWaitMask.style.left = scLeft + "px"; divShowIframe.style.left = scLeft + "px"; if(divShowName != null) { div_name_height = divShowName.offsetHeight; div_name_width = divShowName.offsetWidth; divShowName.style.top = (scTop + ((fullHeight - div_name_height) / 2)) + "px"; divShowName.style.left = (scLeft + ((fullWidth - div_name_width) / 2)) + "px"; } if(divShowWait.style.display == "none") { divShowWait.style.display = "none"; } clearTimeout(timer); } function divShowWaitStart() { document.body.style.cursor = "wait"; if(divShowName != null) { divShowName.style.display = "none"; } divShowWait.style.display = "block"; divShowWaitMask.style.display = "block"; divShowIframe.style.display = "block"; div_wait_height = divShowWait.offsetHeight; div_wait_width = divShowWait.offsetWidth; var scTop = parseInt(getScrollTop(), 10); var scLeft = parseInt(getScrollLeft() ,10); var fullHeight = getViewportHeight(); var fullWidth = getViewportWidth(); divShowWait.style.top = (scTop + ((fullHeight - div_wait_height) / 2)) + "px"; divShowWait.style.left = (scLeft + ((fullWidth - div_wait_width) / 2)) + "px"; divShowWaitMask.style.height = fullHeight + "px"; divShowIframe.style.height = fullHeight + "px"; if(document.all) { // If IE divShowWaitMask.style.width = fullWidth + "px"; divShowIframe.style.width = fullWidth + "px"; } else { // If Firefox divShowWaitMask.style.width = (fullWidth - 17) + "px"; divShowIframe.style.width = (fullWidth - 17) + "px"; } divShowWaitMask.style.top = scTop + "px"; divShowIframe.style.top = scTop + "px"; divShowWaitMask.style.left = scLeft + "px"; divShowIframe.style.left = scLeft + "px"; } function divShowWaitStop() { document.body.style.cursor = "default"; if(divShowName != null) { divShowName.style.display = "block"; divShowPopup(); } divShowWait.style.display = "none"; } if(window.addEventListener) // DOM method for binding an event window.addEventListener("resize", delayShow, false); else if(window.attachEvent) // IE exclusive method for binding an event window.attachEvent("onresize", delayShow); else if(document.getElementById) // support older modern browsers window.onresize = delayShow; if(window.addEventListener) // DOM method for binding an event window.addEventListener("scroll", delayShow, false); else if(window.attachEvent) // IE exclusive method for binding an event window.attachEvent("onscroll", delayShow); else if(document.getElementById) // support older modern browsers window.onscroll = delayShow; function getScrollTop() { if(self.pageYOffset) { // all except Explorer return self.pageYOffset; } else if(document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict return document.documentElement.scrollTop; } else if(document.body) { // all other Explorers return document.body.scrollTop; } } function getScrollLeft() { if(self.pageXOffset) { // all except Explorer return self.pageXOffset; } else if(document.documentElement && document.documentElement.scrollLeft) { // Explorer 6 Strict return document.documentElement.scrollLeft; } else if(document.body) { // all other Explorers return document.body.scrollLeft; } } function getViewportHeight() { if(window.innerHeight != window.undefined) return window.innerHeight; if(document.compatMode == 'CSS1Compat') return document.documentElement.clientHeight; if(document.body) return document.body.clientHeight; return window.undefined; } function getViewportWidth() { var offset = 17; var width = null; if(window.innerWidth != window.undefined) return window.innerWidth; if(document.compatMode == 'CSS1Compat') return document.documentElement.clientWidth; if(document.body) return document.body.clientWidth; } //////////////////////////////////// End of the Div Show Code /////////////////////////////////////////