var req; function ismaxlength(buf, maxlengh) { if(maxlengh == "") maxlengh = "16383"; if(buf.length > maxlengh) { //alert("Maxlength: " + maxlengh + ""); return(false); } else { return(true); } } function lXML(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.traveltst.ca" + location); req.open("POST", "http://www.traveltst.ca" + location, true); req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); req.onreadystatechange = pReq; req.send(url); } } function pReq() { if(req.readyState == 4) { if(req.status == 200) { var node = req.responseXML.getElementsByTagName("method"); if(node && (node.length > 0)) { method = req.responseXML.getElementsByTagName("method")[0].firstChild.data; eval(method); } else { alert("Error: No 'method' found in response from server.\n\n" + req.statusText); } } else { alert("Error:\n" + req.statusText); } } } function field_check(fields) { var return_value = new Array(); var url = ""; var err_msg = "A problem with the fields listed below was encountered:\n\n"; //var err_msg = "A problem with the fields listed below was encountered:\n\n"; var err_field = ""; for(key in fields) { var tmp = fields[key].split("|"); if(tmp[3]) { if(tmp[3] == "REQ") { if(tmp[4]) { if(document.getElementById(tmp[1]).value.length > 0) { if(ismaxlength(document.getElementById(tmp[1]).value,tmp[4])) { url += "&" + tmp[0] + "=" + encodeURIComponent(document.getElementById(tmp[1]).value); } else { if(err_field == "") err_field = tmp[2]; err_msg += "'" + tmp[2] + "'(" + (document.getElementById(tmp[1]).value).length + " chars) field exceeded its maximum length of characters (" + tmp[4] + ").\n"; //err_msg += "'" + tmp[2] + "'(" + (document.getElementById(tmp[1]).value).length + " chars) field exceeded its maximum length of characters(" + tmp[4] + ").\n"; } } else { if(err_field == "") err_field = tmp[2]; err_msg += "'" + tmp[2] + "' " + " field missing content! Please update.\n"; //err_msg += "'" + tmp[2] + "' " + " field missing content! Please update.\n"; } } else { if(document.getElementById(tmp[1]).value.length > 0) { url += "&" + tmp[0] + "=" + encodeURIComponent(document.getElementById(tmp[1]).value); } else { if(err_field == "") err_field = tmp[2]; err_msg += "'" + tmp[2] + "' " + " field missing content! Please update.\n"; //err_msg += "'" + tmp[2] + "' " + " field missing content! Please update.\n"; } } //if(tmp[4]) } else if(tmp[3] == "VAL") { //if(tmp[3] == "REQ") url += "&" + tmp[0] + "=" + encodeURIComponent(tmp[4]); } else if(tmp[3] == "CHK") { //if(tmp[3] == "REQ") if(document.getElementById(tmp[1]).checked) { url += "&" + tmp[0] + "=1" ; } else { url += "&" + tmp[0] + "=0" ; } } else { //if(tmp[3] == null) if(tmp[4]) { if(ismaxlength(document.getElementById(tmp[1]).value,tmp[4])) { url += "&" + tmp[0] + "=" + encodeURIComponent(document.getElementById(tmp[1]).value); } else { if(err_field == "") err_field = tmp[2]; err_msg += "'" + tmp[2] + "'(" + (document.getElementById(tmp[1]).value).length + " chars) field exceeded its maximum length of characters (" + tmp[4] + ").\n"; //err_msg += "'" + tmp[2] + "'(" + (document.getElementById(tmp[1]).value).length + " chars) field exceeded its maximum length of characters(" + tmp[4] + ").\n"; } } else { url += "&" + tmp[0] + "=" + encodeURIComponent(document.getElementById(tmp[1]).value); } } } else { //if(tmp[3]) url += "&" + tmp[0] + "=" + encodeURIComponent(document.getElementById(tmp[1]).value); } //if(tmp[3]) } // for return_value[0] = err_field; return_value[1] = err_msg; return_value[2] = url; return return_value; } function field_search(fields) { var return_value = ""; for(key in fields) { var tmp = fields[key].split("|"); if(tmp[1]) { return_value += "&" + tmp[0] + "=" + encodeURIComponent(document.getElementById(tmp[1]).value); } else { return_value += "&" + tmp[0] + "=" + encodeURIComponent(document.getElementById(tmp[0]).value); } } // for return return_value; } /////////////////////////////////// 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 ///////////////////////////////////////// /*********************************** * http://javascripts.vbarsan.com/ * This notice may not be removed ***********************************/ var swidth=215; var sheight=60; var sbcolor="transparent"; var sspeed=2; var restart=sspeed; var rspeed=sspeed; function goup(){if(sspeed!=rspeed*8){sspeed=sspeed*2;restart=sspeed;}} function godown(){if(sspeed>rspeed){sspeed=sspeed/2;restart=sspeed;}} function start(){if(document.getElementById)ns6marquee(document.getElementById('slider'));else if(document.all)iemarquee(slider);else if(document.layers)ns4marquee(document.slider1.document.slider2);}function iemarquee(whichdiv){iediv=eval(whichdiv);iediv.style.pixelTop=sheight+"px";iediv.innerHTML=wholemessage;sizeup=iediv.offsetHeight;ieslide();}function ieslide(){if(iediv.style.pixelTop>=sizeup*(-1)){iediv.style.pixelTop-=sspeed+"px";setTimeout("ieslide()",100);}else{iediv.style.pixelTop=sheight+"px";ieslide();}}function ns4marquee(whichlayer){ns4layer=eval(whichlayer);ns4layer.top=sheight;ns4layer.document.write(wholemessage);ns4layer.document.close();sizeup=ns4layer.document.height;ns4slide();}function ns4slide(){if(ns4layer.top>=sizeup*(-1)){ns4layer.top-=sspeed;setTimeout("ns4slide()",100);}else{ns4layer.top=sheight;ns4slide();}}function ns6marquee(whichdiv){ns6div=eval(whichdiv);ns6div.style.top=sheight+"px";ns6div.innerHTML=wholemessage;sizeup=ns6div.offsetHeight;ns6slide();}function ns6slide(){if(parseInt(ns6div.style.top)>=sizeup*(-1)){ns6div.style.top=parseInt(ns6div.style.top)-sspeed+"px";setTimeout("ns6slide()",100);}else{ns6div.style.top=sheight+"px";ns6slide();}}