var gullTab; //used to move county / town title when auto complete is not visible gullTab ='Tab'; function displayDirectSearch(strBookingURL, gullSet) { //hidden controls to hold parameters passed in for button click event below gullHidFld("hdnTypedSearch", ""); gullHidFld("hdnBookingURL", strBookingURL); gullHidFld("hdnAffiliateID", gullSet["AffiliateID"]); gullHidFld("hdnProviderID", gullSet["ProviderID"]); gullHidFld("hdnTownLevel", gullSet["TownLevel"]); gullHidFld("hdnPremType", gullSet["PremType"]); gullHidFld("hdnSharing", gullSet["Sharing"]); gullHidFld("hdnPremName", gullSet["PremName"]); gullHidFld("hdnGrade", gullSet["Grade"]); gullHidFld("hdnPrice", gullSet["Price"]); gullHidFld("hdnFacilities", gullSet["Facilities"]); gullHidFld("hdnoptional", gullSet["Optional"]); gullHidFld("hdnPremTypeShow", gullSet["PremTypeShow"]); var strGullSurroundStyle; strGullSurroundStyle = ""; if(gullSet["BackgroundColor"] != "") { strGullSurroundStyle = 'style="background-color:' + gullSet["BackgroundColor"] + '"'; } if(gullSet["BackgroundImage"] !="") { strGullSurroundStyle = 'style="background:transparent url(' + gullSet["BackgroundImage"] + ') no-repeat 0 0"'; } gullOut('
'); //gullOut(''); var gullBasicCss = 'gullBasic'; if (gullSet["AdvancedTabShow"] == 'yes' || gullSet["Facilities"] == 'yes') { gullOut('
'); gullOut(''); gullOut('
'); } else { gullBasicCss = 'gullBasicDown'; } gullOut('
'); gullOut('
Find Accommodation
'); if(gullSet["TypeLocationShow"]=="yes") { gullOut('
Type Location
'); gullOut(''); gullTab = ''; } if(gullSet["TypeLocationShow"]=="yes" && gullSet["LocationShow"]=="yes") { gullOut('
-Or Choose-
'); } if(gullSet["LocationShow"]=="yes") { gullOut('
Location
'); //location combo (mandatory) if(gullSet["TownLevel"]=="yes") { gullOut(''); } gullOption("","please select"); gullOption("GY,,,0","Galway County"); gullOption("GY,G1,,0","Galway City"); gullOption(((gullSet["Location"]=="")?"":""),"---------------------------"); gullOption("DU,,,0","Dublin County"); gullOption("DU,D1,,0","Dublin City"); gullOption("DU,D1,DCC,0","Dublin City Centre"); gullOption("DU,N,D089,0","Dublin Airport"); gullOption("GY,,,0","Galway County"); gullOption("KY,,,0","Kerry County"); gullOption("CK,,,0","Cork County"); gullOption("CE,,,0","Clare County"); gullOption(((gullSet["Location"]=="")?"":""),"---------------------------"); gullOption("AM,,,0","Antrim County"); gullOption("AH,,,0","Armagh County"); gullOption("AM,BC,B719,0","Belfast City"); gullOption("CW,,,0","Carlow County"); gullOption("CN,,,0","Cavan County"); gullOption("CE,,,0","Clare County"); gullOption("CK,C1,,0","Cork City"); gullOption("CK,,,0","Cork County"); gullOption("DY,FV,L709,0","Derry City"); gullOption("DY,,,0","Derry County"); gullOption("DL,,,0","Donegal County"); gullOption("DN,,,0","Down County"); //gullOption("DU,N,,0">Dublin County North') ; //gullOption("DU,S,,0">Dublin County South') ; //gullOption("DU,W,,0">Dublin County West') ; //gullOption("" ' + ((gullSet["Location"]=="")?"":"") + '>---------------------------') ; //gullOption("CK,N,,0">Cork(North) County') ; gullOption("FH,,,0",'Fermanagh County'); gullOption("GY,G1,,0",'Galway City'); gullOption("GY,,,0",'Galway County'); gullOption("KY,,,0",'Kerry County'); gullOption("KE,,,0",'Kildare County'); gullOption("KK,,K037,0",'Kilkenny City'); gullOption("KK,,,0",'Kilkenny County'); gullOption("LS,,,0",'Laois County'); gullOption("LM,,,0",'Leitrim County'); gullOption("LK,L1,,0" ,'Limerick City'); gullOption("LK,,,0",'Limerick County'); gullOption("DY,FV,L709,0",'Londonderry City'); gullOption("DY,,,0",'Londonderry County'); gullOption("LD,,,0",'Longford County'); gullOption("LH,,,0",'Louth County'); gullOption("MO,,,0",'Mayo County'); gullOption("MH,,,0",'Meath County'); gullOption("MN,,,0",'Monaghan County'); gullOption("OY,,,0",'Offaly County'); gullOption("RN,,,0",'Roscommon County'); gullOption("CE,,S020,0",'Shannon Airport'); gullOption("SO,,,0",'Sligo County'); gullOption("TI,,,0",'Tipperary County'); gullOption("TE,,,0",'Tyrone County'); gullOption("WD,W1,,0",'Waterford City'); gullOption("WD,,,0",'Waterford County'); gullOption("WH,,,0",'Westmeath County'); gullOption("WX,,,0",'Wexford County'); gullOption("WW,,,0",'Wicklow County'); gullOut(''); gullSetSelectedIndex("hdnLocation", gullSet["Location"]); //gullOut('
') gullOut('
'); } else { gullHidFld("hdnLocation", gullSet["Location"]); } if(gullSet["TownLevel"]=="yes"){ //town level combo (optional) - see event on location combo - also remove event from body onload on your html page to initially display town level combo gullOut('
'); } if(gullSet["PremTypeShow"]=="yes"){ //premises type combo (mandatory) gullOut('
Accommodation
'); gullOut('
'); gullSetSelectedIndex("gullSelAccomType", gullSet["PremType"]); } else { gullHidFld("hdnPremType2", gullSet["PremType"]); } //party details (mandatory) //gullOut('
') gullOut('
'); gullOut('
Adults'); gullOut('
'); if(gullSet["Children"] =='yes') { gullOut('
Children'); gullOut('
'); } if(gullSet["Infants"]=='yes') { gullOut('
Infants'); gullOut('
'); } gullOut('
'); //gullOut('
') //Arrival Date (mandatory) gullOut(''); gullOut('
Arrival Date
'); gullOut(' '); gullOut('
'); ///////gullOut('Calendar') if(gullSet["TownLevel"]=="yes"){ var gullLocation = getField('hdnLocation'); showTowns(gullLocation.value); } //num nights (mandatory) gullOut('
Night(s)
'); gullOut('
'); gullOut('
'); // end of basic search surround gullOut('
'); gullOut('
'); //property name (optional) if(gullSet["PremName"]=='yes') { gullOut('
Property Name
'); gullOut('
'); } //grade (optional) if(gullSet["Grade"]=='yes') { gullOut('
Grade
'); gullOut('
'+ gullChkFld("chkGrade5") + '5 Star
'); gullOut('
'+ gullChkFld("chkGrade4") + '4 Star
'); gullOut('
'+ gullChkFld("chkGrade3") + '3 Star
'); gullOut('
'+ gullChkFld("chkGrade2") + '2 Star
'); gullOut('
'+ gullChkFld("chkGrade1") + '1 Star
'); gullOut('
All Grades
'); } //price (optional) if(gullSet["Price"]=='yes') { gullOut('
Price
'); gullOut('
From
'); gullOut('
To
'); } //sharing combo (optional) if(gullSet["Sharing"]=='yes') { gullOut('
Sharing:
'); gullOut('
'); } gullOut('
'); // end of gullOptContainer //facilities (optional) if (gullSet["Facilities"]=='yes') { gullOut('
Facilities
'); gullOut('
'); gullOut('
'+ gullChkFld("checkAccess",'AD,') + 'Access For Disabled
'); gullOut('
'+ gullChkFld("checkBaby" ) + 'Babysitting Facilities
'); gullOut('
'+ gullChkFld("checkWIFI" ) + 'WIFI Internet Access
'); gullOut('
'+ gullChkFld("checkPrivate" ) + 'Private Car Parking
'); gullOut('
'+ gullChkFld("checkSpa") + 'Spa
'); gullOut('
'); gullOut('
'); gullOut('
'+ gullChkFld("checkConference") + 'Conference Facilities
'); gullOut('
'+ gullChkFld("checkSwimming") + 'Swimming pool
'); gullOut('
'+ gullChkFld("checkPetsinside") + 'Pets Welcome Inside
'); gullOut('
'+ gullChkFld("checkLift") + 'Lift
'); gullOut('
'+ gullChkFld("checkAirCon") + 'Air Conditioning
'); gullOut('
'); } //gullOut('
'); //gullOut('
'); gullOut(''); //gullOut(''); //gullOut(''); InitUnobtrusiveJavaScriptFunctions(); gullSetupAutoComplete(); } function displayDirectSearchHorizontal(strBookingURL, gullSet) { //hidden controls to hold parameters passed in for button click event below gullHidFld("hdnTypedSearch", ""); gullHidFld("hdnBookingURL", strBookingURL); gullHidFld("hdnAffiliateID", gullSet["AffiliateID"]); gullHidFld("hdnProviderID", gullSet["ProviderID"]); gullHidFld("hdnTownLevel", gullSet["TownLevel"]); gullHidFld("hdnPremType", gullSet["PremType"]); gullHidFld("hdnSharing", gullSet["Sharing"]); gullHidFld("hdnPremName", gullSet["PremName"]); gullHidFld("hdnGrade", gullSet["Grade"]); gullHidFld("hdnPrice", gullSet["Price"]); gullHidFld("hdnFacilities", gullSet["Facilities"]); gullHidFld("hdnoptional", gullSet["Optional"]); gullHidFld("hdnPremTypeShow", gullSet["PremTypeShow"]); var strGullSurroundStyle; strGullSurroundStyle = ""; if(gullSet["BackgroundColor"] != "") { strGullSurroundStyle = 'style="background-color:' + gullSet["BackgroundColor"] + '"'; } if(gullSet["BackgroundImage"] !="") { strGullSurroundStyle = 'style="background:transparent url(' + gullSet["BackgroundImage"] + ') no-repeat 0 0"'; } gullOut('
'); //gullOut(''); var gullBasicCss = 'gullBasic'; if (gullSet["AdvancedTabShow"] == 'yes' || gullSet["Facilities"] == 'yes') { gullOut('
'); gullOut(''); gullOut('
'); } else { gullBasicCss = 'gullBasicDown'; } gullOut('
'); gullOut('
Find Accommodation
'); if(gullSet["TypeLocationShow"]=="yes") { gullOut('
Type Location
'); gullOut(''); gullTab = ''; } if(gullSet["TypeLocationShow"]=="yes" && gullSet["LocationShow"]=="yes") { gullOut('
-Or Choose-
'); } if(gullSet["LocationShow"]=="yes") { gullOut('
Location
'); //location combo (mandatory) if(gullSet["TownLevel"]=="yes") { gullOut(''); } gullOption("","please select"); gullOption("GY,,,0","Galway County"); gullOption("GY,G1,,0","Galway City"); gullOption(((gullSet["Location"]=="")?"":""),"---------------------------"); gullOption("DU,,,0","Dublin County"); gullOption("DU,D1,,0","Dublin City"); gullOption("DU,D1,DCC,0","Dublin City Centre"); gullOption("DU,N,D089,0","Dublin Airport"); gullOption("GY,,,0","Galway County"); gullOption("KY,,,0","Kerry County"); gullOption("CK,,,0","Cork County"); gullOption("CE,,,0","Clare County"); gullOption(((gullSet["Location"]=="")?"":""),"---------------------------"); gullOption("AM,,,0","Antrim County"); gullOption("AH,,,0","Armagh County"); gullOption("AM,BC,B719,0","Belfast City"); gullOption("CW,,,0","Carlow County"); gullOption("CN,,,0","Cavan County"); gullOption("CE,,,0","Clare County"); gullOption("CK,C1,,0","Cork City"); gullOption("CK,,,0","Cork County"); gullOption("DY,FV,L709,0","Derry City"); gullOption("DY,,,0","Derry County"); gullOption("DL,,,0","Donegal County"); gullOption("DN,,,0","Down County"); //gullOption("DU,N,,0">Dublin County North') ; //gullOption("DU,S,,0">Dublin County South') ; //gullOption("DU,W,,0">Dublin County West') ; //gullOption("" ' + ((gullSet["Location"]=="")?"":"") + '>---------------------------') ; //gullOption("CK,N,,0">Cork(North) County') ; gullOption("FH,,,0",'Fermanagh County'); gullOption("GY,G1,,0",'Galway City'); gullOption("GY,,,0",'Galway County'); gullOption("KY,,,0",'Kerry County'); gullOption("KE,,,0",'Kildare County'); gullOption("KK,,K037,0",'Kilkenny City'); gullOption("KK,,,0",'Kilkenny County'); gullOption("LS,,,0",'Laois County'); gullOption("LM,,,0",'Leitrim County'); gullOption("LK,L1,,0" ,'Limerick City'); gullOption("LK,,,0",'Limerick County'); gullOption("DY,FV,L709,0",'Londonderry City'); gullOption("DY,,,0",'Londonderry County'); gullOption("LD,,,0",'Longford County'); gullOption("LH,,,0",'Louth County'); gullOption("MO,,,0",'Mayo County'); gullOption("MH,,,0",'Meath County'); gullOption("MN,,,0",'Monaghan County'); gullOption("OY,,,0",'Offaly County'); gullOption("RN,,,0",'Roscommon County'); gullOption("CE,,S020,0",'Shannon Airport'); gullOption("SO,,,0",'Sligo County'); gullOption("TI,,,0",'Tipperary County'); gullOption("TE,,,0",'Tyrone County'); gullOption("WD,W1,,0",'Waterford City'); gullOption("WD,,,0",'Waterford County'); gullOption("WH,,,0",'Westmeath County'); gullOption("WX,,,0",'Wexford County'); gullOption("WW,,,0",'Wicklow County'); gullOut(''); gullSetSelectedIndex("hdnLocation", gullSet["Location"]); //gullOut('
') gullOut('
'); } else { gullHidFld("hdnLocation", gullSet["Location"]); } if(gullSet["TownLevel"]=="yes"){ //town level combo (optional) - see event on location combo - also remove event from body onload on your html page to initially display town level combo gullOut('
'); } if(gullSet["PremTypeShow"]=="yes"){ //premises type combo (mandatory) gullOut('
Accommodation
'); gullOut('
'); gullSetSelectedIndex("gullSelAccomType", gullSet["PremType"]); } else { gullHidFld("hdnPremType2", gullSet["PremType"]); } //party details (mandatory) //gullOut('
') gullOut('
'); gullOut('
Adults
'); gullOut('
'); if(gullSet["Children"] =='yes') { gullOut('
Children
'); gullOut('
'); } if(gullSet["Infants"]=='yes') { gullOut('
Infants
'); gullOut('
'); } //num nights (mandatory) gullOut('
Night(s)
'); gullOut('
'); gullOut('
'); //gullOut('
') //Arrival Date (mandatory) gullOut(''); gullOut('
Arrival Date
'); gullOut(' '); gullOut('
'); ///////gullOut('Calendar') if(gullSet["TownLevel"]=="yes"){ var gullLocation = getField('hdnLocation'); showTowns(gullLocation.value); } gullOut('
'); // end of basic search surround gullOut('
'); gullOut('
'); //property name (optional) if(gullSet["PremName"]=='yes') { gullOut('
Property Name
'); gullOut('
'); } //grade (optional) if(gullSet["Grade"]=='yes') { gullOut('
Grade
'); gullOut('
'+ gullChkFld("chkGrade5") + '5 Star
'); gullOut('
'+ gullChkFld("chkGrade4") + '4 Star
'); gullOut('
'+ gullChkFld("chkGrade3") + '3 Star
'); gullOut('
'+ gullChkFld("chkGrade2") + '2 Star
'); gullOut('
'+ gullChkFld("chkGrade1") + '1 Star
'); gullOut('
All Grades
'); } //price (optional) if(gullSet["Price"]=='yes') { gullOut('
Price
'); gullOut('
From
'); gullOut('
To
'); } //sharing combo (optional) if(gullSet["Sharing"]=='yes') { gullOut('
Sharing:
'); gullOut('
'); } gullOut('
'); // end of gullOptContainer //facilities (optional) if (gullSet["Facilities"]=='yes') { gullOut('
Facilities
'); gullOut('
'); gullOut('
'+ gullChkFld("checkAccess",'AD,') + 'Access For Disabled
'); gullOut('
'+ gullChkFld("checkBaby" ) + 'Babysitting Facilities
'); gullOut('
'+ gullChkFld("checkWIFI" ) + 'WIFI Internet Access
'); gullOut('
'+ gullChkFld("checkPrivate" ) + 'Private Car Parking
'); gullOut('
'+ gullChkFld("checkSpa") + 'Spa
'); gullOut('
'); gullOut('
'); gullOut('
'+ gullChkFld("checkConference") + 'Conference Facilities
'); gullOut('
'+ gullChkFld("checkSwimming") + 'Swimming pool
'); gullOut('
'+ gullChkFld("checkPetsinside") + 'Pets Welcome Inside
'); gullOut('
'+ gullChkFld("checkLift") + 'Lift
'); gullOut('
'+ gullChkFld("checkAirCon") + 'Air Conditioning
'); gullOut('
'); } //gullOut('
'); //gullOut('
'); gullOut(''); //gullOut(''); //gullOut(''); InitUnobtrusiveJavaScriptFunctions(); gullSetupAutoComplete(); } function subx() { var gullYearMonth = getField('date_sel_mm').value.split("|"); var gullYear = gullYearMonth[0]; var gullMonth = gullYearMonth[1]; var gullDaySel = getField('date_sel_dd').value; var gullLocation = getField('hdnLocation'); var gullUrl = getField('hdnBookingURL').value; var gullAffiliateID = getField('hdnAffiliateID').value; var gullProviderID = getField( 'hdnProviderID').value; var gullNumAdults = getField('gullSelNumAdults').value; var gullNumChildren = getField('selNumChildren'); var gullNumInfants = getField('selNumInfants'); var gullNumNights = getField('gullSelNumNights'); var gullTypedSearch = getField('hdnTypedSearch'); var gullHasTypedLocation = getField('gullTypedLocation'); var gullPremName = getField('txtPremName'); if((gullTypedSearch.value == '' || gullTypedSearch.value == '/') && gullHasTypedLocation && gullHasTypedLocation.value != '') { var gullTypedSearchXmlMatch = checkTypedLocation(gullHasTypedLocation.value); if(gullTypedSearchXmlMatch != "") { gullTypedSearch.value = gullTypedSearchXmlMatch; } } if(isValidDate(gullDaySel,gullMonth-1,gullYear)) { //variable to hold our deepLink var deepLink; if (( gullLocation.value == '' && (gullTypedSearch.value == '' || gullTypedSearch.value == '/') && gullPremName.value == '')) { alert('Please select a location.'); gullLocation.focus(); return; } //build the URL for deepLinking deepLink = gullUrl + "?affiliatevisitid=1" + "&affiliateid=" + gullAffiliateID + "&ProvID=" + gullProviderID + "&IsAdvanced=1"; if (gullTypedSearch.value == '' || gullTypedSearch.value == '/') { var gullTownLevel = getField('hdnTownLevel'); var gullTown = getField('gullSelTowns'); if(gullTownLevel.value=='yes' && gullTown.value != 'Any Town' && gullTown.value != '') { deepLink += "&hdnLocation=" + gullTown.value; } else { deepLink += "&hdnLocation=" + gullLocation.value; } } else { deepLink += "&hdnLocation=" + gullTypedSearch.value; } var gullTypeShowHide = getField('hdnPremTypeShow'); if(gullTypeShowHide.value=="yes"){ var gullAccomType = getField('gullSelAccomType'); deepLink += "&selAccomType=" + gullAccomType.value; } else { var gullAccomType = getField('hdnPremType2'); deepLink += "&selAccomType=" + gullAccomType.value; } deepLink += "&selArriveDay=" + gullDaySel; deepLink += "&selArriveMonth=" + gullMonth; deepLink += "&selArriveYear=" + gullYear; deepLink += "&selNumAdults=" + gullNumAdults; if(gullNumChildren == undefined) { deepLink += "&selNumChildren=0"; } else { deepLink += "&selNumChildren=" + gullNumChildren.value; } if(gullNumInfants == undefined) { deepLink += "&selNumInfants=0"; } else { deepLink += "&selNumInfants=" + gullNumInfants.value; } deepLink += "&selNumNights=" + gullNumNights.value; var gullFacilities = getField('hdnFacilities'); if(gullFacilities.value =='yes') { var gullFacPri = getField('checkPrivate'); var gullFacAcc = getField('checkAccess'); var gullFacSpa = getField('checkSpa'); var gullFacBab = getField('checkBaby'); var gullFacCon = getField('checkConference'); var gullFacWif = getField('checkWIFI'); var gullFacSwm = getField('checkSwimming'); var gullFacPet = getField('checkPetsinside'); var gullFacLift = getField('checkLift'); var gullFacAirCon = getField('checkAirCon'); var s = new String(''); if ((gullFacPri) && (gullFacPri.checked)) s += "PC,"; if ((gullFacAcc) && (gullFacAcc.checked)) s += "AD,"; if ((gullFacSpa) && (gullFacSpa.checked)) s += "S2,"; if ((gullFacBab) && (gullFacBab.checked)) s += "BS,"; if ((gullFacCon) && (gullFacCon.checked)) s += "CF,"; if ((gullFacWif) && (gullFacWif.checked)) s += "WI,"; if ((gullFacSwm) && (gullFacSwm.checked)) s += "SO,"; if ((gullFacPet) && (gullFacPet.checked)) s += "PW,"; if ((gullFacLift) && (gullFacPet.checked)) s += "LF,"; if ((gullFacAirCon) && (gullFacPet.checked)) s += "AC,"; if (s!='') { deepLink += "&strfacilities=" + s; } } var gullIsShare = getField('hdnSharing'); if(gullIsShare.value == 'yes') { var gullShare = getField('gullSelSharing'); deepLink += "&selSharing=" + gullShare.value; } var gullShowPrice = getField('hdnPrice'); if(gullShowPrice.value=='yes') { var gullPriceFrom = getField('txtPriceFrom'); var gullPriceTo = getField('txtPriceTo'); if(gullPriceTo.value == '') { deepLink += "&selPriceUpper=5000"; } else { deepLink += "&selPriceUpper=" + gullPriceTo.value; } if(gullPriceFrom.value == '') { deepLink += "&selPriceLower=0"; } else { deepLink += "&selPriceLower=" + gullPriceFrom.value; } } var gullShowPremName = getField('hdnPremName'); if(gullShowPremName.value=='yes' && gullPremName.value!='') { deepLink += "&txtPremName=" + gullPremName.value; } var gullShowPremGrade = getField('hdnGrade'); if(gullShowPremGrade.value=='yes') { var gullGradeAll = getField('chkGradeAll'); var gullGrade1 = getField('chkGrade1'); var gullGrade2 = getField('chkGrade2'); var gullGrade3 = getField('chkGrade3'); var gullGrade4 = getField('chkGrade4'); var gullGrade5 = getField('chkGrade5'); if (gullGradeAll.checked){ deepLink += "&chkGradeAll=" + gullGradeAll.value;} else{deepLink += "&chkGradeAll=N";} if (gullGrade1.checked){ deepLink += "&chkGrade1=" + gullGrade1.value;} else{deepLink += "&chkGrade1=N";} if (gullGrade2.checked){ deepLink += "&chkGrade2=" + gullGrade2.value;} else{deepLink += "&chkGrade2=N";} if (gullGrade3.checked){ deepLink += "&chkGrade3=" + gullGrade3.value;} else{deepLink += "&chkGrade3=N";} if (gullGrade4.checked){ deepLink += "&chkGrade4=" + gullGrade4.value;} else{deepLink += "&chkGrade4=N";} if (gullGrade5.checked){ deepLink += "&chkGrade5=" + gullGrade5.value;} else{deepLink += "&chkGrade5=N";} } var gullHasOptional = getField('hdnoptional'); if (gullHasOptional.value!='' && gullHasOptional.value!='/') { deepLink += "&" + gullHasOptional.value; } deepLink += "&strAction=search" + "&intInterPageSearchType=9" + "&intDirectPremSpecificSearch=0" + "&strDirectSearchRootURL=" + document.location.href + "&selCurrency=978" + "&SearchSource=10"; if(gullHasTypedLocation) { gullHasTypedLocation.value = ''; } gullTypedSearch.value = ''; //redirect page to our deepLink URL //gullOut(deepLink); window.location.href = deepLink; } } function isValidDate(day,month,year) { /* Purpose: return true if the date is valid, false otherwise Arguments: day integer representing day of month month integer representing month of year year integer representing year Variables: dteDate - date object */ var dteDate; var todaysDateTime; todaysDateTime = new Date(); //set up a Date object based on the day, month and year arguments //javascript months start at 0 (0-11 instead of 1-12) //dteDate=new Date(year,month,day,"23","59","59"); dteDate=new Date(year,month,day,"23","59","59"); if (dteDate>=todaysDateTime) { /* Javascript Dates are a little too forgiving and will change the date to a reasonable guess if it's invalid. We'll use this to our advantage by creating the date object and then comparing it to the details we put it. If the Date object is different, then it must have been an invalid date to start with... */ return ((day==dteDate.getDate()) && (month==dteDate.getMonth()) && (year==dteDate.getFullYear())); } else { return false; } } function showhideDiv(div) { var gullBasicOptionDiv = getField('gullBasic'); var gullOptGradeDiv = getField('gullOptContainer'); var gullFacilitiesDiv = getField('gullFac'); var gullBasicTab = getField('gullBasicTab'); var gullOptTab = getField('gullOptionTab'); var gullFacilTab = getField('gullFacilitisTab'); if(div == 'gullBasic') { gullBasicOptionDiv.style.display = 'block'; if(gullOptGradeDiv) gullOptGradeDiv.style.display = 'none'; if(gullFacilitiesDiv) gullFacilitiesDiv.style.display = 'none'; gullBasicTab.className = 'gullCurrentTab'; if(gullOptTab) gullOptTab.className = ''; if(gullFacilTab) gullFacilTab.className = ''; } else if(div == 'gullOptContainer') { gullBasicOptionDiv.style.display = 'none'; if(gullOptGradeDiv) gullOptGradeDiv.style.display = 'block'; if(gullFacilitiesDiv) gullFacilitiesDiv.style.display = 'none'; gullBasicTab.className = ''; if(gullOptTab) gullOptTab.className = 'gullCurrentTab'; if(gullFacilTab) gullFacilTab.className = ''; } else if(div == 'gullFac') { gullBasicOptionDiv.style.display = 'none'; if(gullOptGradeDiv) gullOptGradeDiv.style.display = 'none'; if(gullFacilitiesDiv) gullFacilitiesDiv.style.display = 'block'; gullBasicTab.className = ''; if(gullOptTab) gullOptTab.className = ''; if(gullFacilTab) gullFacilTab.className = 'gullCurrentTab'; } var gullListArea = getField('as_gullTypedLocation'); if (gullListArea) { gullListArea.style.visibility = "hidden"; } return false; } function gullSetSelectedIndex(DropDownControlID, ValueToMatch) { if (ValueToMatch!='') { for(var i=0;i< getField(DropDownControlID).length;i++) { var ddlText = getField(DropDownControlID).options[i].value; if( ddlText == ValueToMatch) { getField(DropDownControlID).selectedIndex=i; break; } } } else { getField(DropDownControlID).selectedIndex = 0; } } function gullOut(Html) { document.write(Html); } function gullOption(value, text) { gullOut(''); } function createNumericOnlyOption(maxOption, selectedNum) { for (var Count = 1; Count <= maxOption; Count ++) { if(Count == selectedNum) { gullOut(''); } else { gullOut(''); } } } function getField(ID) { return document.getElementById(ID); } function gullHidFld(idName, value) { gullOut(''); } function gullChkFld(idName, value) { if(value) { return ''; } else { return ''; } } function gullHideIE6DropDowns(numberOfMatches) { if(numberOfMatches <= 1 || numberOfMatches >= 6) getField("hdnLocation").className = 'gullHide'; if(numberOfMatches == 2 || numberOfMatches >= 6) getField("gullSelTowns").className = 'gullHide'; if(numberOfMatches == 3 || numberOfMatches >= 6) getField("gullSelAccomType").className = 'gullHide'; if(numberOfMatches == 4 || numberOfMatches >= 6) getField("selNumChildren").className = 'gullHide'; if(numberOfMatches == 4 || numberOfMatches >= 6) getField("gullSelNumAdults").className = 'gullHide'; if(numberOfMatches == 5 || numberOfMatches >= 6) getField("date_sel_dd").className = 'gullHide'; if(numberOfMatches == 5 || numberOfMatches >= 6) getField("date_sel_mm").className = 'gullHide'; if(numberOfMatches >= 6 || numberOfMatches >= 6) getField("gullSelNumNights").className = 'gullHide'; } function gullShowIE6DropDowns() { getField("hdnLocation").className = 'gullLocationCombo'; getField("gullSelTowns").className = 'gullTowns'; getField("gullSelAccomType").className = 'gullPremType'; getField("selNumChildren").className = 'gullNumChildren'; getField("gullSelNumAdults").className = 'gullNumAdults'; getField("date_sel_dd").className = 'gullDays'; getField("date_sel_mm").className = 'gullMonthYear'; getField("gullSelNumNights").className = 'gullNumNight'; } // Unobtrusive JavaScript function InitUnobtrusiveJavaScriptFunctions() { // add function to change num nights if self catering its selected var gullAccomType = getField('gullSelAccomType'); if (gullAccomType) { gullAccomType.onchange = function () { var gullNumNight = getField('gullSelNumNights'); if(gullAccomType.value == 2) gullNumNight.value = 7; else { gullNumNight.value = 1; } } } }