// // JavaScript Files // function new_site() { newWindow = window.open('http://www.holidays.glaslyn.com/index.htm', 'holidayWin', 'width=950, height=700, scrollbars=yes, resizable=yes') } function cal_page() { newWindow = window.open('http://www.holidays.glaslyn.com/bookings_3.htm', 'holidayWin', 'width=950, height=700, scrollbars=yes, resizable=yes') } function pay_pal() { newWindow = window.open('https://www.paypal.com/uk/cgi-bin/webscr?cmd=_home-general&nav=0', 'holidayWin', 'width=950, height=700, scrollbars=yes, resizable=yes') } function JscriptAlert(Msg) { alert(Msg) } function writeText(txt) { var msg = "Your shopping cart has been updated for a " document.getElementById("room_desc").innerHTML=msg + txt; } function back() { history.go(-1); } function print_page() { document.execCommand("Print"); } function change_background(div) { if (div == "postcode") { document.getElementById("postcode").style.background="#fbfbe1"; document.getElementById("first").style.background="#cdd9e5"; document.getElementById("last").style.background="#cdd9e5"; document.getElementById("email").style.background="#cdd9e5"; document.getElementById("phone").style.background="#cdd9e5"; document.getElementById("security_code").style.background="#c5dfc1"; } if (div == "first") { document.getElementById("postcode").style.background="#cdd9e5"; document.getElementById("first").style.background="#fbfbe1"; document.getElementById("last").style.background="#cdd9e5"; document.getElementById("email").style.background="#cdd9e5"; document.getElementById("phone").style.background="#cdd9e5"; document.getElementById("security_code").style.background="#c5dfc1"; } if (div == "last") { document.getElementById("postcode").style.background="#cdd9e5"; document.getElementById("first").style.background="#cdd9e5"; document.getElementById("last").style.background="#fbfbe1"; document.getElementById("email").style.background="#cdd9e5"; document.getElementById("phone").style.background="#cdd9e5"; document.getElementById("security_code").style.background="#c5dfc1"; } if (div == "email") { document.getElementById("postcode").style.background="#cdd9e5"; document.getElementById("first").style.background="#cdd9e5"; document.getElementById("last").style.background="#cdd9e5"; document.getElementById("email").style.background="#fbfbe1"; document.getElementById("phone").style.background="#cdd9e5"; document.getElementById("security_code").style.background="#c5dfc1"; } if (div == "phone") { document.getElementById("postcode").style.background="#cdd9e5"; document.getElementById("first").style.background="#cdd9e5"; document.getElementById("last").style.background="#cdd9e5"; document.getElementById("email").style.background="#cdd9e5"; document.getElementById("phone").style.background="#fbfbe1"; document.getElementById("security_code").style.background="#c5dfc1"; } if (div == "security_code") { document.getElementById("postcode").style.background="#cdd9e5"; document.getElementById("first").style.background="#cdd9e5"; document.getElementById("last").style.background="#cdd9e5"; document.getElementById("email").style.background="#cdd9e5"; document.getElementById("phone").style.background="#cdd9e5"; document.getElementById("security_code").style.background="#fbfbe1"; } } //=================================================== // drop down menu functions... //=================================================== var timeout = 500; var closetimer = 0; var ddmenuitem = 0; // open hidden layer function mopen(id) { // cancel close timer mcancelclosetime(); // close old layer if(ddmenuitem) ddmenuitem.style.visibility = 'hidden'; // get new layer and show it ddmenuitem = document.getElementById(id); ddmenuitem.style.visibility = 'visible'; } // close showed layer function mclose() { if(ddmenuitem) ddmenuitem.style.visibility = 'hidden'; } // go close timer function mclosetime() { closetimer = window.setTimeout(mclose, timeout); } // cancel close timer function mcancelclosetime() { if(closetimer) { window.clearTimeout(closetimer); closetimer = null; } } // close layer when click-out document.onclick = mclose; /*********************************************** * Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit http://www.dynamicdrive.com/ for this script and 100s more. ***********************************************/ var delayb4scroll=1000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds) var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10) var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)? ////NO NEED TO EDIT BELOW THIS LINE//////////// var copyspeed=marqueespeed var pausespeed=(pauseit==0)? copyspeed: 0 var actualheight='' function scrollmarquee(){ if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8)) //if scroller hasn't reached the end of its height cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px" //move scroller upwards else //else, reset to original position cross_marquee.style.top=parseInt(marqueeheight)+8+"px" } function initializemarquee(){ cross_marquee=document.getElementById("vmarquee") cross_marquee.style.top=0 marqueeheight=document.getElementById("marqueecontainer").offsetHeight actualheight=cross_marquee.offsetHeight //height of marquee content (much of which is hidden from view) if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit cross_marquee.style.height=marqueeheight+"px" cross_marquee.style.overflow="scroll" return } setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll) } //=================================================== // AJAX functionality //=================================================== function ajaxRequest(){ var activexmodes=["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken) for (var i=0; i= min && uInput.length <= max){ return true; }else{ alert("Please enter between " +min+ " and " +max+ " characters"); elem.focus(); return false; } } function madeSelection(elem, helperMsg){ if(elem.value == "Please Choose"){ alert(helperMsg); elem.focus(); return false; }else{ return true; } } function emailValidator(elem, helperMsg){ var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/; if(elem.value.match(emailExp)){ return true; }else{ alert(helperMsg); elem.focus(); return false; } } //--------------------------------------------------------------------