var widgetid = '66c700260c4b7_1'; function runYourFunctionWhenJQueryIsLoaded() { if (window.jQuery){ jQuery(document).ready(function($) { if (typeof adtspecialmessages != "undefined") { var datesmsg = adtspecialmessages.datesmsg; var fromdatemsg = adtspecialmessages.fromdatemsg; var todatemsg = adtspecialmessages.todatemsg; } else{ var datesmsg = 'Please select airports/resorts and dates'; var fromdatemsg = 'Please select to airport'; var todatemsg = 'Please select to airport and departure date'; } $(document).on('click', '.ADT-SW-WIDGET-PLACEHOLDER_1 .flight_only_tab'+widgetid, function(){ activeinactive('flight_only','1' ,widgetid, 'flt'); }); if($('#ui-datepicker-div').length > 0) { $('#ui-datepicker-div').remove(); } $(document).on('click', '.ADT-SW-WIDGET-PLACEHOLDER_1 .flight_hotel_tab'+widgetid, function(){ activeinactive('flight_hotel','1', widgetid, 'rlt'); }); $(document).on('click', '.ADT-SW-WIDGET-PLACEHOLDER_1 .hotel_only_tab'+widgetid, function(){ activeinactive('hotel_only','1', widgetid, 'rlt'); }); $('.ADT-SW-WIDGET-PLACEHOLDER_1').find( ".flight_only_tab"+widgetid ).trigger( "click" ); $(document).on('click', '.ADT-SW-WIDGET-PLACEHOLDER_1 .addroom2', function(){ jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.room2').show(); jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.addroom2').hide(); }); $(document).on('click', '.ADT-SW-WIDGET-PLACEHOLDER_1 .removeroom2', function(){ jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.room2').hide(); jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.addroom2').show(); }); $(document).on('click', '.ADT-SW-WIDGET-PLACEHOLDER_1 .addroom3', function(){ jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.room3').show(); jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.addroom3').hide(); }); $(document).on('click', '.ADT-SW-WIDGET-PLACEHOLDER_1 .removeroom3', function(){ jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.room3').hide(); jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.addroom3').show(); }); jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.rlt').hide(); $(document).on('change', '.ADT-SW-WIDGET-PLACEHOLDER_1 #ADT-BookOneWayFlights-FH'+widgetid, function(){ if(this.checked) { jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.returning').css('visibility', 'hidden'); } else { jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.returning').css('visibility', 'visible'); } }); $(document).on('change', '.ADT-SW-WIDGET-PLACEHOLDER_1 #ADT-BookChildNumber1-FH'+widgetid, function(){ if($(this).val()!="0") { var val = parseInt($(this).val()); jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.chroom1').show(); jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.chroom1 .childage').hide(); for(z=1;z<=val;z++) { jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.chroom1_'+z).find('.childage').show(); } } else { jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.chroom1').hide(); } }); $(document).on('change', '.ADT-SW-WIDGET-PLACEHOLDER_1 #ADT-BookChildNumber2-FH'+widgetid, function(){ if($(this).val()!="0") { var val = parseInt($(this).val()); jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.chroom2').show(); jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.chroom2 .childage').hide(); for(z=1;z<=val;z++) { jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.chroom2_'+z).find('.childage').show(); } } else { jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.chroom2').hide(); } }); $(document).on('change', '.ADT-SW-WIDGET-PLACEHOLDER_1 #ADT-BookChildNumber3-FH'+widgetid, function(){ if($(this).val()!="0") { var val = parseInt($(this).val()); jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.chroom3').show(); jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.chroom3 .childage').hide(); for(z=1;z<=val;z++) { jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.chroom3_'+z).find('.childage').show(); } } else { jQuery('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.chroom3').hide(); } }); $(document).on('focus', ':input', function() { $(this).attr('autocomplete', 'off'); }); $(document).on('click', '.ADT-SW-WIDGET-PLACEHOLDER_1 #ADT-SearchFlightsAndHotels'+widgetid, function(){ var froma = $.trim($('.ADT-SW-WIDGET-PLACEHOLDER_1').find('#ADT-BookLeaving-FH'+widgetid).val()); var toa = $.trim($('.ADT-SW-WIDGET-PLACEHOLDER_1').find('#ADT-BookDestinationAirport-F'+widgetid).val()); if(toa =="") { toa = $.trim($('.ADT-SW-WIDGET-PLACEHOLDER_1').find('#ADT-BookDestinationAirport-F_2'+widgetid).val()); } var fromdate = $.trim($('.ADT-SW-WIDGET-PLACEHOLDER_1').find('#ADT-BookDateLeaving-FH'+widgetid).val()); var todate = $.trim($('.ADT-SW-WIDGET-PLACEHOLDER_1').find('#ADT-BookDateReturning-FH'+widgetid).val()); var oneway = $('.ADT-SW-WIDGET-PLACEHOLDER_1 #ADT-BookOneWayFlights-FH'+widgetid).prop('checked'); if(oneway) { if(froma!="" && toa!="" && fromdate!="") { //$('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.adtrezcommloader').show(); $('.ADT-SW-WIDGET-PLACEHOLDER_1').find('#ADT-Form'+widgetid).submit(); } else { $('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.btrip'+widgetid).text(datesmsg).show().fadeOut( 5000 ); } } else{ if(froma!="" && toa!="" && fromdate!="" && todate!="") { //$('body').css({'filter':'alpha(opacity=20)', 'zoom':'1', 'opacity':'0.2', 'z-index':'999'}); //$('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.adtrezcommloader').show(); $('.ADT-SW-WIDGET-PLACEHOLDER_1').find('#ADT-Form'+widgetid).submit(); } else { $('.ADT-SW-WIDGET-PLACEHOLDER_1').find('.btrip'+widgetid).text(datesmsg).show().fadeOut( 5000 ); } } }); var brandurl=""; if(basearpt=="100"){brandurl="https://birmingham.airportdirecttravel.co.uk/processdata.php";} if(basearpt=="269"){brandurl="https://exeter.airportdirecttravel.co.uk/processdata.php";} if(basearpt=="657"){brandurl="https://londonsouthend.airportdirecttravel.co.uk/processdata.php";} if(basearpt=="440"){brandurl="https://travel.gatwickairport.com/processdata.php";} if(basearpt=="689"){brandurl="https://southampton.airportdirecttravel.co.uk/processdata.php";} if(basearpt=="96"){brandurl="https://belfastcity.airportdirecttravel.co.uk/processdata.php";} if(basearpt=="207"){brandurl="https://cardiff.airportdirecttravel.co.uk/processdata.php";} if(basearpt=="91"){brandurl="https://belfastinternational.airportdirecttravel.co.uk/processdata.php";} if(basearpt=="540"){brandurl="https://newquay.airportdirecttravel.co.uk/processdata.php";} if(basearpt=="432"){brandurl="https://derry.airportdirecttravel.co.uk/processdata.php";} if(basearpt=="378"){brandurl="https://jersey.airportdirecttravel.co.uk/processdata.php";} if(basearpt=="547"){brandurl="https://norwich.airportdirecttravel.co.uk/processdata.php";} if(basearpt=="118"){brandurl="https://bournemouth.airportdirecttravel.co.uk/processdata.php";} if(brandurl=="") { brandurl="https://sw.airportdirecttravel.com/swwork/processdata_bfs.php"; } console.log('widget loaded'); console.log(brandurl); $('.ADT-SW-WIDGET-PLACEHOLDER_1').html('