jQuery(function($){$('body').append('<div id="not-available-question" style="display:none; cursor: default; font-size: 116%; ">\
    <p>Helaas is de reis op deze data niet meer beschikbaar. U kunt beschikbaarheid opvragen voor <strong>dezelfde aanbieding op andere data</strong> of <strong>andere aanbiedingen</strong> bekijken op de door u geselecteerde data.</p>\
    <input type="button" id="other-dates" value="selecteer andere data" /> \
    <input type="button" id="other-offers" value="toon alternatieven" /> \
    <p><strong>Tip</strong> : Gaat uw interesse toch uit naar dit specifieke hotel en reisdata? Wij kunnen in veel gevallen de reis voor u aanvragen bij de leveranciers. Of bieden u desgewenst een passend alternatief. U kunt hiervoor bellen met ons service center.</p>\
    <p>\
        <strong>0900 - STEDENTRIP</strong> (0900-7833368)<br/>\
        <i>15 ct/m, ma-vrij 9-21 uur, zat-zo 10-16 uur</i>\
    </p>\
</div>\
\
<div id="not-enough-units-question" style="display:none; cursor: default; font-size: 116%; ">\
    <p>Er zijn helaas niet voldoende kamers beschikbaar om het door u geselecteerde aantal personen te plaatsen. U kunt beschikbaarheid opvragen voor <strong>dezelfde aanbieding op andere data</strong> of <strong>andere aanbiedingen</strong> bekijken op de door u geselecteerde data.</p>\
    <input type="button" id="other-dates" value="selecteer andere data" /> \
    <input type="button" id="other-offers" value="toon alternatieven" /> \
    <p><strong>Tip</strong> : Gaat uw interesse toch uit naar dit specifieke hotel en reisdata? Wij kunnen in veel gevallen de reis voor u aanvragen bij de leveranciers. Of bieden u desgewenst een passend alternatief. U kunt hiervoor bellen met ons service center.</p>\
    <p><strong>0900 - STEDENTRIP</strong> (0900-7833368)<br/>\
    <i>15 ct/m, ma-vrij 9-21 uur, zat-zo 10-16 uur</i></p>\
</div>\
\
\
<div id="last-minute-booking-stedentrips" style="display:none; cursor: default; font-size: 116%; ">    \
    <p>LAST MINUTE BOEKING:U kunt voor stedentrips tot 4 dagen voor vertrek zelf on-line een reservering maken via onze website. Voor lastminute boekingen kunt u contact opnemen met ons service center via 0900 - STEDENTRIP (0900-7833368, 15ct p/m). Wij zijn telefonisch bereikbaar op weekdagen van 09:00 - 21:00 en op zaterdag en zondag van 10:00 - 16:00.</p>\
    <input type="button" id="continue-stedentrips" value="ga verder"/>\
</div>\
\
<div id="last-minute-booking-hotels" style="display:none; cursor: default; font-size: 116%; ">    \
    <p>LAST MINUTE BOEKING:U kunt voor eigen vervoer reizen tot 3 dagen voor vertrek zelf on-line een reservering maken via onze website. Voor lastminute boekingen kunt u contact opnemen met ons service center via 0900 - STEDENTRIP (0900-7833368, 15ct p/m). Wij zijn telefonisch bereikbaar op weekdagen van 09:00 - 21:00 en op zaterdag en zondag van 10:00 - 16:00.</p>\
    <input type="button" id="continue-hotels" value="ga verder"/>\
</div>');if($('div.info').length>0){$.scrollTo($('#section'));}
if(window.location.host=='gasamen.nl'&&$("select#id_city")!=null){$("select#id_city").prepend("<option value='invalid' class='invalid'>maak keuze</option>");$("select#id_city option[value='invalid']").attr('selected','selected');}
$.preloadImages("/media/images/booking/layout/bezig_192x96.gif");$.blockUI.defaults.message='<h1></h1>';$.blockUI.defaults.css={padding:0,marginLeft:'-125px',width:'256px',top:'40%',left:'50%',textAlign:'center',color:'#000',border:'1px solid #cc0033',background:'#fff url(/media/images/booking/layout/bezig_192x96.gif) no-repeat center center',cursor:'wait',minHeight:'160px'}
$.blockUI.defaults.overlayCSS={backgroundColor:'#fff',opacity:0.5}
busDestinationSet=['parijs.nl','londen.nl','antwerpen.gasamen.nl','berlijn.nl','boedapest.nl','brussel.nl','gent.gasamen.nl','praag.nl','wenen.nl'];var initTransportTypes=function(){if(!$(".action .availability-search-button").length){var availableTransportTypes=$("select#id_city option:selected").attr('class').split(' ');$("select#id_transport option").remove();var section_set=window.location.pathname.split("/");var section=section_set[1];if(section_set[2]=='busreizen')
section=section_set[2];if(section==''||(section!='stedentrips'&&section!='hotels'&&section!='treinreizen'&&section!='busreizen')){$("select#id_transport").append("<option value='invalid'>maak keuze</option>");}
if($.inArray('stedentrips',availableTransportTypes)!=-1){$("select#id_transport").append("<option value='stedentrips'>Vlucht + Hotel</option>");}
if($.inArray('hotels',availableTransportTypes)!=-1){$("select#id_transport").append("<option value='hotels'>Eigen Vervoer</option>");}
if($.inArray('treinreizen',availableTransportTypes)!=-1){$("select#id_transport").append("<option value='treinreizen'>Trein + Hotel</option>");}
if(section_set[2]=='busreizen'||(section_set[2]!='zoek-resultaten'&&section_set.length<=4)){for(bd in busDestinationSet){busDestination=busDestinationSet[bd];if(busDestination==$("select#id_city").val()){$("select#id_transport").append("<option value='busreizen'>Bus + Hotel</option>");}}}
$("#busSelection").hide();$("#dateSelection").show();}
$("select#id_transport option[value='"+section+"']").attr('selected','selected');if($("#nrOfPersons").length){$("#nrOfPersons").show();}
else{$("#nrOfPersonsAdvanced").show();}};if($("select#id_city").length){initTransportTypes();$("select#id_city").change(function(){initTransportTypes();});}
function check_lastminute(){var departure_date=Date.fromString($("#id_departure_date").val());if(departure_date>=new Date(CURRENT_DATE)){if('stedentrips'==$("#id_transport").val()&&new Date(CURRENT_DATE).addDays(BOOKY_DAYSLASTMINUTE_FLIGHT)>departure_date){$("#id_departure_date").val('');$("#id_return_date").val('');$.blockUI({message:$("#last-minute-booking-stedentrips"),css:{background:'#fff',border:'1px solid #cc0033',padding:'32px',width:'475px'}});$("#continue-stedentrips").click($.unblockUI);}
else if('hotels'==$("#id_transport").val()&&new Date(CURRENT_DATE).addDays(BOOKY_DAYSLASTMINUTE_OWNTRANSPORT)>departure_date&&(BOOKING_CITY_ID==""||document.location.indexOf('gasamen.'))==0){$("#id_departure_date").val('');$("#id_return_date").val('');$.blockUI({message:$("#last-minute-booking-hotels"),css:{background:'#fff',border:'1px solid #cc0033',padding:'32px',width:'475px'}});$("#continue-hotels").click($.unblockUI);}}}
$("select#id_transport").change(function(){if($(this).val()=='busreizen'){$("#dateSelection").hide();$("#nrOfPersons").hide();$("#nrOfPersonsAdvanced").hide();$("#busSelection").show();}
else{$("#busSelection").hide();$("#dateSelection").show();if($("#nrOfPersons").length){$("#nrOfPersons").show();}
else{$("#nrOfPersonsAdvanced").show();}}
check_lastminute();});$('#nrOfPersons [name=nrOfAdults]').change(function(){$('#nrOfPersonsAdvanced [name=nrOfAdults]').val($('#nrOfPersons [name=nrOfAdults]').val());});$("input.dateField").datePicker({startDate:CURRENT_PICKER_DATE,showYearNavigation:false,verticalOffset:-20,verticalPosition:$.dpConst.POS_BOTTOM,horizontalPosition:$.dpConst.POS_LEFT});$("a.dp-choose-date").html('&nbsp;&nbsp;&nbsp;&nbsp;');$("input.dateField").attr('readonly','readonly');$("input.dateField").click(function(){$(this).dpDisplay();}).bind('dateSelected',(function(){$(this).moveNext();}));$("#id_departure_date").bind('dpClosed',function(e,selectedDates){var d=selectedDates[0];if(d){$('#id_return_date').dpSetStartDate(d.addDays(1).asString());$('#id_return_date').val(d.addDays(1).asString());check_lastminute();}});if($('#id_departure_date').val()){$('#id_return_date').dpSetStartDate(Date.fromString($('#id_departure_date').val()).addDays(1).asString());}
if($('.info .content').hasClass('slider')){$('.info .content .details').slideUp();}
$('.info-button').click(function(){$('.info .content .details').slideToggle();$('.show-info').slideToggle();});$('.error:not(span.error):not(.long)').wrapInner('<span class="error"></span>');$('.error.long:not(span.error)').wrapInner('<div class="error"></div>');$('.searchButton input').click(function(){$('#searchbox ul.errorlist').remove();$('#searchbox td.error').removeClass('error');var valid=true;if($('#id_city')!=null&&$('#id_city').val()=='invalid'){var parent=$('#id_city').parent();parent.addClass('error');parent.append('<ul class="errorlist"><li>Maak een bestemmingskeuze.</li></ul>');valid=false;}
if($("select#id_transport").val()=='invalid'){var parent=$('select#id_transport').parent();parent.addClass('error');parent.append('<ul class="errorlist"><li>Maak een vervoerskeuze.</li></ul>');valid=false;}
if($('#id_departure_date').val()==''){var parent=$('#id_departure_date').parent();parent.addClass('error');parent.append('<ul class="errorlist"><li>Dit veld is verplicht.</li></ul>');valid=false;}
if($('#id_return_date').val()==''){var parent=$('#id_return_date').parent();parent.addClass('error');parent.append('<ul class="errorlist"><li>Dit veld is verplicht.</li></ul>');valid=false;}
if(!valid)
return false;$.blockUI();var url="http://"+$('#id_city').val()+"/"+$('#id_transport').val()+"/";$(this).parents('form').attr('action',url);});$('#busSelection .searchButton input').unbind('click');$('#busSelection .searchButton input').click(function(){if($('#id_city').val()=='invalid'||$("select#id_transport").val()=='invalid')
return false;$.blockUI();var url="http://"+$('#id_city').val()+"/"+$('#id_city').val().split(".")[0]+"/busreizen/";top.location.href=url;return false;});$('.previous-button.paginator').click(function(){$.blockUI();});$('.next-button.paginator').click(function(){$.blockUI();});$('.next-button:not(.reload):not(.paginator)').click(function(){if($(this).hasClass('availability-search-button')){path=window.location.pathname.split("/");url="/"+$('#id_transport').val()+"/"+path[2]+"/"+path[3]+"/";$(this).parents('form').attr('action',url);}
$.blockUI();$(this).parents('form').submit();return false;});$('.change_link').click(function(){$.blockUI();});$('#travelWithKids a').click(function(){var adult_selector=$('#id_nr_of_adults');$('#nrOfPersons').remove('#id_nr_of_adults');$('#adult-selection').prepend(adult_selector);$('#nrOfPersonsAdvanced').show();$('#nrOfPersons').remove();});$('a[rel=external]').click(function(){window.open(this.href);return false;});var togglePaymentAccount=function(){if($('input.payment_method:checked').val()=='direct_debit'){$('.payment#account').show();}
else{$('.payment#account').hide();}};$('input.payment_method').change(function(){togglePaymentAccount();}).click(function(){togglePaymentAccount();});togglePaymentAccount();var fillNames=function(){$('#id_payment_name').text($('#id_initials').val()+" "+
$('#id_infix').val()+" "+
$('#id_surname').val()+" ");};$('#id_initials,#id_infix,#id_surname').change(function(){fillNames();});if($('#id_initials').val()||$('#id_infix').val()||$('#id_surname').val()){fillNames();}
$('a.resubmit').click(function(){$.blockUI();$('.action form,#booky-form').submit();return false;});$('a.reload').click(function(){$.blockUI();});if($("#not-available-error").length>0){var question=$('#not-available-question');question.append($('#tracking_id'));$.blockUI({message:question,css:{background:'#fff',border:'1px solid #cc0033',padding:'32px',width:'475px'}});$('#not-available-question #other-offers').click(function(){var section_set=window.location.pathname.split("/");var section=section_set[1];var cache_var=String(Math.random()).substring(2);window.location="/"+section+"/zoek-resultaten/?cache="+cache_var;});$('#not-available-question #other-dates').click(function(){var path_set=window.location.pathname.split("/");window.location="/"+path_set[1]+"/"+path_set[path_set.length-3]+"/";});}
if($("#not-enough-units-error").length>0){var question=$('#not-enough-units-question');question.append($('#tracking_id'));$.blockUI({message:question,css:{background:'#fff',border:'1px solid #cc0033',padding:'32px',width:'475px'}});$('#not-enough-units-question #other-offers').click(function(){var section_set=window.location.pathname.split("/");var section=section_set[1];var cache_var=String(Math.random()).substring(2);window.location="/"+section+"/zoek-resultaten/?cache="+cache_var;});$('#not-enough-units-question #other-dates').click(function(){var path_set=window.location.pathname.split("/");window.location="/"+path_set[1]+"/"+path_set[path_set.length-3]+"/";});}});jQuery(function($){var ITEMS_TO_SCROLL=5;var SCROLL_SPEED=800;$('table.flight-selection tbody tr:has(input:checked)').addClass('current');$('#flight-widget .flight-navigate .previous').click(function(){container=$(this).parent().parent().find('.flight-selection tbody');current=container.find('tr.current');previous=container.find('tr.current').prevAll('tr:eq('+ITEMS_TO_SCROLL+')');if(previous.length==0){previous=container.find('tr:first');}
current.removeClass('current');previous.addClass('current');container.scrollTo(previous,{speed:SCROLL_SPEED,axis:'y'});});$('#flight-widget .flight-navigate .next').click(function(){container=$(this).parent().parent().find('.flight-selection tbody');current=container.find('tr.current');next=container.find('tr.current').nextAll('tr:eq('+ITEMS_TO_SCROLL+')');if(next.length==0){next=container.find('tr:last');}
current.removeClass('current');next.addClass('current');container.scrollTo(next,{speed:SCROLL_SPEED,axis:'y'});});$('#flight-widget #flight-select-to table tbody tr input:visible').click(function(){selectedCarrier=$(this).parents('tr').find('input[name="carrier"]').val();$('#flight-widget #flight-select-from table tbody tr').each(function(){if($(this).find('input[name="carrier"][value='+selectedCarrier+']').length>0){$(this).find('input[type="radio"]').removeAttr('disabled');$(this).fadeTo("normal",1.0);}
else{$(this).find('input[type="radio"]').removeAttr('checked');$(this).find('input[type="radio"]').attr('disabled','disabled');$(this).fadeTo("normal",0.5);}});});$('#flight-widget #change-flights a').click(function(){$(this).remove();$('#flight-widget #select-flights').show();$('#flight-widget .summary').remove();$('#flight-widget .select').show();$('#flight-widget .next-button').fadeTo('normal',0.5);$('#flight-widget .next-button').attr('disabled','disabled');$('#flight-widget #flight-select-to table tbody tr input:checked').click();$('#flight-widget .flight-selection tbody').each(function(){$(this).scrollTo($(this).find('tr.current'),{speed:SCROLL_SPEED,axis:'y'});});});$('#flight-widget #select-flights a').click(function(){if($('#flight-widget #flight-select-to table tbody tr input:checked').length>0&&$('#flight-widget #flight-select-from table tbody tr input:checked').length>0){$('#id_repost').val(1);$('#flight-widget form').submit();}
else{alert('U dient zowel een heen- als terugvlucht te selecteren');return false;}});$('#flight-widget #flight-select-to table tbody tr input:checked').click();});;