function MM_swapImgRestore(){var i,x,a=document.MM_sr;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)x.src=x.oSrc;}
function MM_preloadImages(){var d=document;if(d.images){if(!d.MM_p)d.MM_p=new Array();var i,j=d.MM_p.length,a=MM_preloadImages.arguments;for(i=0;i<a.length;i++)
if(a[i].indexOf("#")!=0){d.MM_p[j]=new Image;d.MM_p[j++].src=a[i];}}}
function MM_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x&&d.getElementById)x=d.getElementById(n);return x;}
function MM_swapImage(){var i,j=0,x,a=MM_swapImage.arguments;document.MM_sr=new Array;for(i=0;i<(a.length-2);i+=3)
if((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;if(!x.oSrc)x.oSrc=x.src;x.src=a[i+2];}}
function showWaitingMessage()
{document.getElementById("waitingMessage").style.visibility="visible";document.getElementById("waitingMessage").style.display="block";document.getElementById("content").style.visibility="hidden";document.getElementById("content").style.display="none";document.getElementById("footer").style.visibility="hidden";document.getElementById("footer").style.display="none";return true;}
function hideWaitingMessage()
{document.getElementById("waitingMessage").style.visibility="hidden";document.getElementById("waitingMessage").style.display="none";document.getElementById("content").style.visibility="visible";document.getElementById("content").style.display="block";return true;}
function TJKpop(){var e=document.getElementById('container');if(e){var a=e.getElementsByTagName('a');for(var i=0;i<a.length;i++){if(a[i].className.indexOf('newwindow')>-1){a[i].className+=a[i].className?' outlink':'outlink';a[i].title+='This link opens in a new window';a[i].onclick=function(){newWin=window.open(this.href,'TJKWin');if(window.focus){newWin.focus()}return false;}}}}}
function init(){var inp=document.getElementsByTagName('input');for(var i=0;i<inp.length;i++){if(inp[i].type=='text'&&inp[i].className.indexOf('check')>-1){inp[i].setAttribute('rel',inp[i].defaultValue)
inp[i].onfocus=function(){if(this.value==this.getAttribute('rel')){this.value='';}
else{return false;}}
inp[i].onblur=function(){if(this.value==''){this.value=this.getAttribute('rel');}
else{return false;}}
inp[i].ondblclick=function(){this.value=this.getAttribute('rel')}}}}
if(document.childNodes){window.onload=init}
var BrowserName=self.navigator.appName;var BrowserVer=parseInt(self.navigator.appVersion,10);var BrowserOK=false;if(BrowserName=="Netscape"){if(BrowserVer>=3.0)BrowserOK=true;}
else if(BrowserName=="Microsoft Internet Explorer"){if(BrowserVer>=3.0)BrowserOK=true;}
var persistmenu="yes"
var persisttype="sitewide"
if(document.getElementById){document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')}
function SwitchMenu(obj){if(document.getElementById){var el=document.getElementById(obj);var ar=document.getElementById("masterdiv").getElementsByTagName("div");if(el.style.display!="block"){for(var i=0;i<ar.length;i++){if(ar[i].className=="submenu")
ar[i].style.display="none";}
el.style.display="block";}else{el.style.display="none";}}}
function get_cookie(Name){var search=Name+"="
var returnvalue="";if(document.cookie.length>0){offset=document.cookie.indexOf(search)
if(offset!=-1){offset+=search.length
end=document.cookie.indexOf(";",offset);if(end==-1)end=document.cookie.length;returnvalue=unescape(document.cookie.substring(offset,end))}}
return returnvalue;}
function onloadfunction(){if(persistmenu=="yes"){var cookiename=(persisttype=="sitewide")?"switchmenu":window.location.pathname
var cookievalue=get_cookie(cookiename)
if(cookievalue!="")
document.getElementById(cookievalue).style.display="block"}}
function savemenustate(){var inc=1,blockid=""
while(document.getElementById("sub"+inc)){if(document.getElementById("sub"+inc).style.display=="block"){blockid="sub"+inc
break}
inc++}
var cookiename=(persisttype=="sitewide")?"switchmenu":window.location.pathname
var cookievalue=(persisttype=="sitewide")?blockid+";path=/":blockid
document.cookie=cookiename+"="+cookievalue}
if(window.addEventListener)
window.addEventListener("load",onloadfunction,false)
else if(window.attachEvent)
window.attachEvent("onload",onloadfunction)
else if(document.getElementById)
window.onload=onloadfunction
if(persistmenu=="yes"&&document.getElementById)
window.onunload=savemenustate
var monthNames=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");function findPos(obj)
{var curtop=0;if(obj.offsetParent)
{do
{curtop+=obj.offsetTop;}while(obj=obj.offsetParent);return curtop;}}
function submitSearch()
{if(validateSearch())
{showWaitingMessage();return true;}
return false;}
function selectFlightType(flightType)
{var retDay=document.getElementById("retDay");var retMonth=document.getElementById("retMonth");if(flightType=="oneway")
{retDay.disabled=true;retMonth.disabled=true;}
else
{retDay.disabled=false;retMonth.disabled=false;}}
function validateSearch()
{var tmpDateDep=document.getElementById("tmpDateDep").value;var tmpDateRet=document.getElementById("tmpDateRet").value;var arrAirport=document.getElementById("arrAirport");var depAirport=document.getElementById("depAirport");if(document.getElementById("depMonth").value=="")
{alert("Please select a departure date");return false;}
else if(document.getElementById("retMonth").value==""&&document.getElementById("searchform").flighttype[0].checked)
{alert("Please select a return date");return false;}
else if(depAirport.selectedIndex==0)
{alert("Please select a departure airport");return false;}
else if(arrAirport.selectedIndex==0)
{alert("Please select an arrival airport");return false;}
else
{return true;}}
function Pad2(x)
{x="00"+x;return String(x).substring(String(x).length,String(x).length-2);}
function DaysInMonth(varMonth,varYear)
{return 32-new Date(varYear,varMonth-1,32).getDate();}
function processPopup(button,inputField)
{var i=0;var xferDirection='ret';if(button.indexOf('Departure')!=-1)
{xferDirection="dep";}
var selectedDate=document.getElementById(inputField).value;var elMonth=document.getElementById(xferDirection+"Month");var optMonth=elMonth.options;var elDay=document.getElementById(xferDirection+"Day");var optDay=elDay.options;var arrSelectedDate=selectedDate.split("/");var day=parseInt(arrSelectedDate[0],10);var month=parseInt(arrSelectedDate[1],10);var year=arrSelectedDate[2];var monthName=monthNames[month-1];for(i=0;i<optMonth.length;i++)
{if(optMonth[i].text.indexOf(monthName)!=-1&&optMonth[i].text.indexOf(year)!=-1)
{optMonth.selectedIndex=i;}}
elDay.value=day;changeDay(xferDirection);if(xferDirection=="dep")
{setDepTmpData();}
else
{setRetTmpData();}}
function changeDay(depOrRet)
{var monthLength=0;var i=0;var elMonth=document.getElementById(depOrRet+"Month");if(elMonth.value=="")return false;var monthName=elMonth.options[elMonth.selectedIndex].text.substr(0,3);var varYear=elMonth.options[elMonth.selectedIndex].text.substring(elMonth.options[elMonth.selectedIndex].text.length-4);var elDay=document.getElementById(depOrRet+"Day");var optDay=elDay.options;var currentlySelectedText=elDay.value;if(currentlySelectedText<1||currentlySelectedText>31)currentlySelectedText=1;if(elMonth.value=="-")
{monthLength=0;}
else
{for(i=0;i<monthNames.length;i++)
{if(monthName==monthNames[i])
{monthLength=DaysInMonth(i+1,varYear);}}}
for(i=elDay.options.length-1;i>=0;i--)
{elDay.remove(i);}
for(i=1;i<=monthLength;i++)
{elDay.options[i-1]=new Option(Pad2(i),i);}
if(monthLength==0)
{elDay.options[0]=new Option("-","0");}
elDay.value=currentlySelectedText;if(depOrRet=="dep")
{setDepTmpData();}
else
{setRetTmpData();}}
function GetDate(depOrRet)
{var i=0;var dDate=new Date();var elMonth=document.getElementById(depOrRet+"Month");var month=elMonth.options[elMonth.selectedIndex].text;var selectedMonth=month.substr(0,3);dDate.setYear(month.substr(month.indexOf(' ')+1,4));dDate.setDate(10);for(i=0;i<monthNames.length;i++)
{if(monthNames[i].indexOf(selectedMonth)!=-1)
{dDate.setMonth(i);break;}}
dDate.setDate(document.getElementById(depOrRet+"Day").selectedIndex+1);return dDate;}
var weekday=new Array(7)
weekday[0]="Sun"
weekday[1]="Mon"
weekday[2]="Tue"
weekday[3]="Wed"
weekday[4]="Thur"
weekday[5]="Fri"
weekday[6]="Sat"
function changeDisplayDay()
{var depDayText=document.getElementById('depDayText');var retDayText=document.getElementById('retDayText');depDayText.innerHTML=weekday[GetDate('dep').getDay()];if(document.getElementById("retMonth").value!="-")
{retDayText.innerHTML=weekday[GetDate('ret').getDay()];}
else
{retDayText.innerHTML=" ";}}
function setRetDate()
{var newDate=new Date();var elMonth=document.getElementById("retMonth");var optMonth=elMonth.options;var elDay=document.getElementById("retDay");var optDay=elDay.options;var i=0;newDate=GetDate('dep');newDate.setDate(newDate.getDate()+7);var day=parseInt(newDate.getDate(),10);var month=parseInt(newDate.getMonth(),10);var year=newDate.getYear();if(year<1900)
{year=year+1900;}
var monthName=monthNames[month];for(i=0;i<optMonth.length;i++)
{if(optMonth[i].text.indexOf(monthName)!=-1&&optMonth[i].text.indexOf(year)!=-1)
{optMonth.selectedIndex=i;}}
changeDay("ret");for(i=0;i<optDay.length;i++)
{if(optDay[i].value==day)
{optDay.selectedIndex=i;}}}
function setDepTmpData()
{var tmpDateDep=document.getElementById("tmpDateDep")
var depDate=new Date();depDate=GetDate('dep');tmpDateDep.value=depDate.getDate()+"/"+(depDate.getMonth()+1)+"/"+depDate.getFullYear();if(document.getElementById("retMonth").value!="-")setRetDate();changeDisplayDay();}
function setRetTmpData()
{var tmpDateRet=document.getElementById("tmpDateRet")
var retDate=new Date();retDate=GetDate('ret');tmpDateRet.value=retDate.getDate()+"/"+(retDate.getMonth()+1)+"/"+retDate.getFullYear();changeDisplayDay();}
function setDropDownByValue(id,val)
{var el=document.getElementById(id);var elOptions=document.getElementById(id).options;var i=0;for(i=0;i<elOptions.length;i++){if(elOptions[i].value==val){elOptions.selectedIndex=i;break;}}}
function setDropDownByText(id,val)
{var el=document.getElementById(id);var elOptions=document.getElementById(id).options;var i=0;for(i=0;i<elOptions.length;i++){if(elOptions[i].text==val){elOptions.selectedIndex=i;break;}}}
function checkCheckBoxes(){var formcheck=document.getElementById("form1");if(formcheck.prepop.checked==true){formcheck.chd_title.value=formcheck.title1.value;formcheck.chd_firstname.value=formcheck.firstname1.value;formcheck.chd_surname.value=formcheck.surname1.value;}
else
{formcheck.chd_title.value="";formcheck.chd_firstname.value="";formcheck.chd_surname.value="";}}
function bgalpha(){var thumb1=document.getElementById("exploreimg");var OverlayObject=document.createElement("div");OverlayObject.style.width="324px";OverlayObject.style.height="30px";OverlayObject.style.left='0px';OverlayObject.style.top='40px';OverlayObject.style.position="absolute";OverlayObject.style.backgroundColor="#004496";OverlayObject.style.zindex="2";OverlayObject.style.filter="alpha(opacity=30)";OverlayObject.style.mozOpacity=".30";OverlayObject.style.opacity=".30";OverlayObject.style.display="block";thumb1.appendChild(OverlayObject);}
function setSkiCarriageTmpData(IntSkiCarriage,CarriagePerUnit,CarriagePerPersonEachWay,intStage){var CarriageTotal=parseFloat(IntSkiCarriage*CarriagePerUnit).toFixed(2);if(IntSkiCarriage=="Please Select"){if(intStage==2){alert("Please select how many pairs of skis/snowboards you wish to add.");return false;}}
else{if(IntSkiCarriage==0){RemoveCarriage(intStage);}
if(IntSkiCarriage>0){document.getElementById("carriagechoice").style.visibility="visible";document.getElementById("carriagechoice").style.display="block";document.getElementById("carriagetotal").style.visibility="visible";document.getElementById("carriagetotal").style.display="block";document.getElementById("carriagesummary").innerHTML=" "+IntSkiCarriage+" Pair(s) of skis / snowboards";document.getElementById("CarriageSummaryDisplay").innerHTML=CarriageTotal;}
document.getElementById("carriagetotalspan").innerHTML=CarriageTotal;document.getElementById("CarriageUnits").value=IntSkiCarriage;document.getElementById("CarriagePrice").value=CarriageTotal;calculateTotalCost()}}
function selectInsurance(boolSelectInsurance,stage,total,InsurancePerPerson){if(boolSelectInsurance=="true"){document.getElementById("insurancechoice").style.visibility="visible";document.getElementById("insurancechoice").style.display="block";document.getElementById("insurancetotal").style.visibility="visible";document.getElementById("insurancetotal").style.display="block";document.getElementById("InsuranceSummaryDisplay").innerHTML=InsurancePerPerson;document.getElementById("InsurancePrice").value=parseFloat(total);document.getElementById("InsuranceConfirmed").value="yes"
if(stage==2){document.getElementById("boolInsuranceFalse").checked=false;document.getElementById("boolInsuranceTrue").checked=true;popup('InsuranceBens','none','hidden');}
calculateTotalCost()}
else{if(stage==1){document.getElementById("InsuranceConfirmed").value="no"
popup('InsuranceBens','block','visible');}
else
{popup('InsuranceBens','none','hidden');RemoveInsurance();document.getElementById("boolInsuranceFalse").checked=true;document.getElementById("boolInsuranceTrue").checked=false;}}}
function RemoveInsurance(){document.getElementById("insurancechoice").style.visibility="hidden";document.getElementById("insurancechoice").style.display="none";document.getElementById("insurancetotal").style.visibility="hidden";document.getElementById("insurancetotal").style.display="none";document.getElementById("InsuranceSummaryDisplay").innerHTML="0.00";document.getElementById("InsurancePrice").value=0;document.getElementById("InsuranceConfirmed").value="yes"
calculateTotalCost()}
function RemoveCarriage(intStage){if(intStage==2){alert("Please remember, passengers who have not pre-booked and present skis or a snowboard at the airport will be charged £25 each way.");}
document.getElementById("IntSkiCarriage").options.selectedIndex=1;document.getElementById("carriagechoice").style.visibility="hidden";document.getElementById("carriagechoice").style.display="none";document.getElementById("carriagetotal").style.visibility="hidden";document.getElementById("carriagetotal").style.display="none";document.getElementById("CarriageSummaryDisplay").innerHTML="0.00";document.getElementById("CarriagePrice").value=0;document.getElementById("CarriageUnits").value=0;calculateTotalCost()}
function submitflightinfo(){IntCarriageInDropDown=document.getElementById("IntSkiCarriage").value
IntCarriageSubmitted=document.getElementById("CarriageUnits").value
var boolSubmitForm=true;if(document.getElementById("InsuranceConfirmed").value=="no"){alert("Please confirm your insurance choice before continuing");boolSubmitForm=false;}
if(document.getElementById("IntSkiCarriage").value=="Please Select"){alert("Please select how many pairs of skis/snowboards you wish to add carriage for before continuing.");return false;}
if(IntCarriageInDropDown!=IntCarriageSubmitted){alert("Before continuing, please confirm the number of ski/board carriages you wish to add by selecting the number in the drop down and clicking the \"Add ski carriage\" button.");return false;}
if(boolSubmitForm){return true;}
else
{return false;}}
function radio_button_checker()
{var OBSelected=false;var IBSelected=false;var OBBookcode="",IBBookcode="";var i=0;var OBCheckboxes=document.forms["flightResults"].bookcodeOB
var IBCheckboxes=document.forms["flightResults"].bookcodeIB
if(OBCheckboxes)
{if(OBCheckboxes.length>1)
{for(i=0;i<OBCheckboxes.length;i++)
{if(OBCheckboxes[i].checked==true)
{OBSelected=true;OBBookcode=OBCheckboxes[i].value;}}}
else
{OBCheckboxes.checked=true;OBSelected=true;}}
if(IBCheckboxes)
{if(IBCheckboxes.length>1)
{for(i=0;i<IBCheckboxes.length;i++)
{if(IBCheckboxes[i].checked==true)
{IBSelected=true;IBBookcode=IBCheckboxes[i].value;}}}
else
{IBCheckboxes.checked=true;IBSelected=true;}}
else
{IBSelected=true;}
if(OBSelected&&IBSelected)
{if(IBCheckboxes)
{var OBDepDate=Date.parse(document.getElementById(OBBookcode).value);var IBDepDate=Date.parse(document.getElementById(IBBookcode).value);if(OBDepDate>IBDepDate)
{alert("Sorry, your selected outbound flight leaves after your selected return flight\nPlease re-select your flights");return false;}
else if(OBDepDate==IBDepDate)
{if(confirm("You have booked your outbound and return flights on the same day. Is this intentional? If not please re-select"))
{return true}
else
{return false;}}}
return true;}
else if((OBCheckboxes)&&(IBCheckboxes)&&(!OBSelected)&&(!IBSelected))
{alert("Please make sure you select an outbound and inbound flight");return false;}
else if((IBCheckboxes)&&(!IBSelected))
{alert("Please make sure you select an inbound flight");return false;}
else if((OBCheckboxes)&&(!OBSelected))
{alert("Please make sure you select an outbound flight");return false;}
return true;}
function validatePage(){var i=1;var theForm=document.forms['form1'];while(document.getElementById("firstname"+i)!=null)
{if(document.getElementById("firstname"+i).value=="")
{alert("Please remember to enter the first names of all the passengers");document.getElementById("firstname"+i).focus();return false;}
i++;}
i=1;while(document.getElementById("surname"+i)!=null)
{if(document.getElementById("surname"+i).value=="")
{alert("Please remember to enter the surnames of all the passengers");document.getElementById("surname"+i).focus();return false;}
i++;}
if(document.forms['form1'].chd_title.value=="none")
{alert("Please select a title");document.forms['form1'].chd_title.focus();return false;}
if(document.forms['form1'].chd_firstname.value=="")
{alert("Please enter your firstname");document.forms['form1'].chd_firstname.focus();return false;}
if(document.forms['form1'].chd_surname.value=="")
{alert("Please enter your surname");document.forms['form1'].chd_surname.focus();return false;}
if(document.forms['form1'].chd_address1.value=="")
{alert("Please enter the first line of your address");document.forms['form1'].chd_address1.focus();return false;}
if(document.forms['form1'].chd_town.value=="")
{alert("Please enter your town");document.forms['form1'].chd_town.focus();return false;}
if(document.forms['form1'].chd_country.value=="")
{alert("Please enter your Country");document.forms['form1'].chd_country.focus();return false;}
if(document.forms['form1'].chd_postCode.value=="")
{alert("Please enter your postcode e.g. RH19 4HY");document.forms['form1'].chd_postCode.focus();return false;}
if(document.forms['form1'].chd_phone.value=="")
{alert("Please enter your phone number");document.forms['form1'].chd_phone.focus();return false;}
if(document.forms['form1'].chd_email.value=="Email Address*"||document.forms['form1'].chd_email.value.indexOf("@")==-1||document.forms['form1'].chd_email.value.indexOf(".")==-1||document.forms['form1'].chd_email.value.indexOf(" ")!=-1||document.forms['form1'].chd_email.value.length<6)
{alert("Please enter a valid email address as an itinerary of your booking will be sent there");document.forms['form1'].chd_email.focus();return false;}
if(theForm.chd_emailConfirm.value!=theForm.chd_email.value)
{alert("Your email address has not been correctly confirmed");theForm.chd_emailConfirm.focus();return false;}
if(document.forms['form1'].mediaCode.value=="")
{alert("Please tell us how you heard about us");document.forms['form1'].mediaCode.focus();return false;}
if(document.forms['form1'].name.value=="")
{alert("Please enter the card holders name");document.forms['form1'].name.focus();return false;}
while(document.forms['form1'].pan.value.indexOf(" ")>-1)
{document.forms['form1'].pan.value=document.forms['form1'].pan.value.replace(" ","");}
if(!document.forms['form1'].pan.value.match(/^[\d]+$/))
{alert("Please enter a valid card number");document.forms['form1'].pan.focus();return false;}
if(!isValidCard())
{alert("Please make sure your card number matches your selected card type");document.forms['form1'].pan.focus();return false;}
if(!document.forms['form1'].chd_security.value.match(/^\d+$/))
{alert("Please enter your cards security number. (Last 3 digits on the back)");document.forms['form1'].chd_security.focus();return false;}
if(document.forms['form1'].type.value!="SWI")
{document.forms['form1'].issue.value="";}
if((document.forms['form1'].issue.value!=""&&!document.forms['form1'].issue.value.match(/^\d+$/)))
{alert("Please remember to enter your issue number if you have a Switch/Maestro or Solo card");document.forms['form1'].issue.focus();return false}
if(document.forms['form1'].confirmBox2.checked!=true)
{alert("Please confirm that all passenger details are as they appear on each of their respective passports");document.forms['form1'].confirmBox2.focus();return false;}
if(document.forms['form1'].confirmBox.checked!=true)
{alert("Please make sure you confirm that you have read our terms and conditions");document.forms['form1'].confirmBox.focus();return false;}
showWaitingMessage();submitForm();}
function isValidCard()
{var pan=document.forms['form1'].pan.value;var type=document.forms['form1'].type.value;if(/^5/.test(pan)&&type=="MC")
{return true;}
else if(/^4/.test(pan)&&(type=="VIS"))
{return true;}
else if((type=="VISD"||type=="SWI")&&(/^[456]/.test(pan)))
{return true;}
return false;}
function submitForm(){document.forms['form1'].submit();}
function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){if(oldonload){oldonload();}
func();}}}
addLoadEvent(TJKpop);addLoadEvent(init);