function openMetafaq(mfUrl){
window.name = "mfOpener";
winHandle = window.open(mfUrl.href, "mfWindow",
"width=600,height=460,resizable=yes");
winHandle.focus();
return false;}
function getQuote(){
document.quoteForm.quoteRef.value=document.quoteForm.quoteRef.value.toUpperCase()
document.quoteForm.submit()}
function getSearch(){
if(document.search.q.value == "" || document.search.q.value == "Search Our Site") {
alert("Please enter a search phrase to search our site");
document.search.q.focus(); } else {
document.search.q.value=document.search.q.value.toLowerCase()
document.search.submit()}}
function WriteLayer(ID,parentID,sText){
if(document.layers){var oLayer=(parentID)? eval('document.'+parentID+'.document.'+ID+'.document'): document.layers[ID].document
oLayer.open()
oLayer.write(sText)
oLayer.close()}
else if(document.all)document.all[ID].innerHTML=sText
else if(parseInt(navigator.appVersion)>=5&&navigator.appName=="Netscape"){
document.getElementById(ID).innerHTML=sText}}
function checkformbasic(){
var thefrm=document.basic
var today=new Date()
arrivalday=thefrm.day.options[thefrm.day.selectedIndex].value
arrivalyear=thefrm.my.options[thefrm.my.selectedIndex].value.substr(3,4)
arrivalmonth=thefrm.my.options[thefrm.my.selectedIndex].value.substr(0,3)
thefrm.ArrivalDate.value=thefrm.day.options[thefrm.day.options.selectedIndex].value+thefrm.my.options[thefrm.my.options.selectedIndex].value
if(arrivalmonth=="Jan"){arrivalmonth=1}
if(arrivalmonth=="Feb"){arrivalmonth=2}
if(arrivalmonth=="Mar"){arrivalmonth=3}
if(arrivalmonth=="Apr"){arrivalmonth=4}
if(arrivalmonth=="May"){arrivalmonth=5}
if(arrivalmonth=="Jun"){arrivalmonth=6}
if(arrivalmonth=="Jul"){arrivalmonth=7}
if(arrivalmonth=="Aug"){arrivalmonth=8}
if(arrivalmonth=="Sep"){arrivalmonth=9}
if(arrivalmonth=="Oct"){arrivalmonth=10}
if(arrivalmonth=="Nov"){arrivalmonth=11}
if(arrivalmonth=="Dec"){arrivalmonth=12}
arrivaldate=new Date(arrivalyear,arrivalmonth-1,arrivalday,23,59)
theday=new Date()
if(arrivaldate<theday){
WriteLayer('hotelserror',null,'<div align="center">Your arrival date is earlier than now</div>')
document.getElementById('departdate').style.background='#f7e5ff'
document.getElementById('hotel').style.color='#ff0000'
thefrm.day.focus()
return false }else{
document.getElementById('departdate').style.backgroundColor="#D4ACD1"
document.getElementById('hotel').style.color='#000000'
WriteLayer('hotelserror',null,'<div align="center"><div id="search">Save up to 60% on Airport Hotels</div></div>')}
var count=0
var hotelArray=new Array("ABZ","BFS","BHX","BRS","CVT","CWL","DOV","DUB","MME","EDI","LGW","GLA","LHR","HUY","LBA","LPL","LCY","LTN","MAN","NCL","EMA","NWI","SOU","STN","DSA")
for(i=0;i<hotelArray.length;i++){
if(arrivaldate>jsdate || thefrm.Location.value !=hotelArray[i]){ 
}else{
count=count+1}}
if(count>0){
thefrm.action=thefrm.action
thefrm.method="post"
}else{
thefrm.outday.value=arrivalday
thefrm.outdate.value=thefrm.my.options[thefrm.my.selectedIndex].text
thefrm.profile.value=""
thefrm.airport.value=thefrm.Location.value
thefrm.method="get"
if(thefrm.action=="https://secure.holidayextras.co.uk/book-hotels/c/main,availability/"){
thefrm.action="http://www.holidayextras.co.uk/gochauntry.html?prod=H"}else{
thefrm.action="http://www.holidayextras.co.uk/email/bookingengine/redirect_hotel.asp"}}
thefrm.submit()}
function validateForm(){
var theForm=document.advanced
var arrival=theForm.ArrivalHourMin.value
var depart=theForm.DepartureHourMin.value
arrivalyear=theForm.my.options[theForm.my.selectedIndex].value.substr(3,4)
arrivalmonth=theForm.my.options[theForm.my.selectedIndex].value.substr(0,3)
if(arrivalmonth=="Jan"){arrivalmonth=1}
if(arrivalmonth=="Feb"){arrivalmonth=2}
if(arrivalmonth=="Mar"){arrivalmonth=3}
if(arrivalmonth=="Apr"){arrivalmonth=4}
if(arrivalmonth=="May"){arrivalmonth=5}
if(arrivalmonth=="Jun"){arrivalmonth=6}
if(arrivalmonth=="Jul"){arrivalmonth=7}
if(arrivalmonth=="Aug"){arrivalmonth=8}
if(arrivalmonth=="Sep"){arrivalmonth=9}
if(arrivalmonth=="Oct"){arrivalmonth=10}
if(arrivalmonth=="Nov"){arrivalmonth=11}
if(arrivalmonth=="Dec"){arrivalmonth=12}
arrivalday=theForm.day.options[theForm.day.selectedIndex].value
arrivalhour=theForm.ArrivalHourMin.options[theForm.ArrivalHourMin.selectedIndex].value.substr(0,2)
arrivalmin=theForm.ArrivalHourMin.options[theForm.ArrivalHourMin.selectedIndex].value.substr(3,2)
departmonth=theForm.r_my.options[theForm.r_my.selectedIndex].value.substr(0,3)
if(departmonth=="Jan"){departmonth=1}
if(departmonth=="Feb"){departmonth=2}
if(departmonth=="Mar"){departmonth=3}
if(departmonth=="Apr"){departmonth=4}
if(departmonth=="May"){departmonth=5}
if(departmonth=="Jun"){departmonth=6}
if(departmonth=="Jul"){departmonth=7}
if(departmonth=="Aug"){departmonth=8}
if(departmonth=="Sep"){departmonth=9}
if(departmonth=="Oct"){departmonth=10}
if(departmonth=="Nov"){departmonth=11}
if(departmonth=="Dec"){departmonth=12}
thedepartyear=theForm.r_my.options[theForm.r_my.selectedIndex].value.substr(3,4)
departday=theForm.r_day.options[theForm.r_day.selectedIndex].text
departhour=theForm.DepartureHourMin.options[theForm.DepartureHourMin.selectedIndex].value.substr(0,2)
departmin=theForm.DepartureHourMin.options[theForm.DepartureHourMin.selectedIndex].value.substr(3,2)
if(depart=='' || arrival==''){
}else{
arrivaldate=new Date(arrivalyear,arrivalmonth-1,arrivalday,arrivalhour,arrivalmin)
thedepartdate=new Date(thedepartyear,departmonth-1,departday,departhour,departmin)
theday=new Date()}
if(arrival==''){
WriteLayer('parkingerror',null,'<div align="center">Please enter your approximate arrival time</font>')
document.getElementById('parkingdepartdate').style.backgroundColor="#f7e5ff"
document.getElementById('parkingfrom').style.color='#ff0000'
theForm.ArrivalHourMin.focus()
return false
}else{
document.getElementById('parkingdepartdate').style.backgroundColor="#D4ACD1"
document.getElementById('parkingfrom').style.color='#000000'
WriteLayer('parkingerror',null,'<div align="center"><div id="search">WE GUARANTEE YOU WONT FIND CHEAPER</div></div>')}
if(depart==''){
WriteLayer('parkingerror',null,'<div align="center">Please enter your approximate departure time</font>')
document.getElementById('parkingreturndate').style.backgroundColor='#f7e5ff'
document.getElementById('parkingto').style.color='#ff0000'
theForm.DepartureHourMin.focus()
return false
}else{
document.getElementById('parkingreturndate').style.backgroundColor="#D4ACD1"
document.getElementById('parkingfrom').style.color='#000000'
WriteLayer('parkingerror',null,'<div align="center"><div id="search">WE GUARANTEE YOU WONT FIND CHEAPER</div></div>')}
if(thedepartdate<arrivaldate){
WriteLayer('parkingerror',null,'<div align="center">Your return date is BEFORE your arrival date</div>')
document.getElementById('parkingreturndate').style.backgroundColor="#f7e5ff"
document.getElementById('parkingto').style.color='#ff0000'
theForm.my.focus()
return false
}else{
document.getElementById('parkingreturndate').style.backgroundColor="#D4ACD1"
document.getElementById('parkingfrom').style.color='#000000'
document.getElementById('parkingto').style.color='#000000'
WriteLayer('parkingerror',null,'<div align="center"><div id="search">WE GUARANTEE YOU WONT FIND CHEAPER</div></div>')}
if(arrivaldate<theday){
WriteLayer('parkingerror',null,'<div align="center">Your arrival date is earlier than now</div>')
document.getElementById('parkingdepartdate').style.background='#f7e5ff'
document.getElementById('parkingfrom').style.color='#ff0000'
theForm.r_my.focus()
return false }else{
document.getElementById('parkingdepartdate').style.backgroundColor="#D4ACD1"
document.getElementById('parkingto').style.color='#000000'
WriteLayer('parkingerror',null,'<div align="center"><div id="search">WE GUARANTEE YOU WONT FIND CHEAPER</div></div>')}
return true}
function checkTime(objToRead,objToWrite){
if(document.getElementById){
var timeToCheck=parseInt(objToRead.options[objToRead.selectedIndex].value)
var writeTo=document.getElementById(objToWrite)
var threshold=1200
if(timeToCheck<threshold&&isNaN(timeToCheck)!=true){
writeTo.innerHTML="<div style='text-align:center'>Got an Early Flight?  Why Not Try an Airport Hotel</div>"
if(writeTo.className.indexOf("emError")==-1){
if(writeTo.className !=""){
writeTo.calssName+=" "}
writeTo.className+="emError"}}
else if(timeToCheck>=threshold || isNaN(timeToCheck)){
writeTo.innerHTML="<div style='text-align:center'>Book Now In Two Easy Steps</div>"
if(writeTo.className.indexOf("emError")!=-1){
if(writeTo.className.lastIndexOf(" ")==writeTo.className.length){
writeTo.className=writeTo.className.subStr(0,writeTo.length-1)}
writeTo.className=writeTo.className.replace(new RegExp("emError\\b"),"")}}}}
var title = 0;
var name = "";
var email = "";
var errorTitle = "Please select your title.";
var errorName = "Please enter your surname.";
var erroremail = "Please enter your e-mail address.";
var invalidAddress = "Please enter a valid e-mail address.\nAddress must be in the format user@domain.com";
function setTitleIndex(selectElement)	{
title = selectElement.selectedIndex;}
function checkAddress()	{
var atIndex = email.indexOf("@");
var dotIndex = email.lastIndexOf(".");
var atIndexPlus = atIndex + 2;
var emailLength = email.length - 1;
if (atIndex < 1) { // @ cannot be at the start of the string
return false;}
if (dotIndex < atIndexPlus) { // . cannot be immediatly after @
return false;}
if (dotIndex == emailLength)	{
return false;}
else {
return true;}}
function checkSignup()		{
name = document.sendmail.surname.value;
email = document.sendmail.email.value;
if (title == 0)	{
alert(errorTitle);
return false;}
if (name.length == 0)	{
alert(errorName);
document.sendmail.surname.focus();
return false;}
else if (email.length == 0)	{
alert(erroremail);
document.sendmail.email.focus();
return false;}
else if (!checkAddress())	{
alert(invalidAddress);
return false;}
else	{
document.sendmail.submit();}}
function enterSubmit()	{
if(window.event && window.event.keyCode == 13) {
checkSignup();
return !(window.event && window.event.keyCode == 13);}
else	{
return true;}}