var villaID = 500
$(document).ready(function() {
$('input[name=month]').change(function() {
updateResult();
});
updateResult();
$( "#accordionvilla" ).accordion({
autoHeight: false,
navigation: true,
collapsible: true
});
$.swapImage(".swpImg");
$(".villaCarousel").jCarouselLite({
btnNext: ".next",
btnPrev: ".prev",
auto: 500,
speed: 2000
});
$("a.carouselFancybox").fancybox({
'hideOnContentClick': true,
'titlePosition': 'inside'
});
var url = "/ajax/reservation.php?action=showForm&show=default&villaID="+villaID;
$('#reservationsframe').load(url);
});
$(window).bind('beforeunload', function() {
if(getCookie('FV-reservationID') != '') {
return "De reservering is nog niet afgerond!. Weet je zeker dat je deze pagina wilt verlaten en de reservering ongedaan wilt maken?";
}
else {
}
});
$(window).bind('unload', function() {
if(getCookie('FV-reservationID') != '') {
document.cookie = "FV-reservationID=;expires=3600";
}
else {
}
});
//booking funtions
function showOverview(villaID,packageID,type,pax,promoID,hash) {
var url = "//www.funvillas.nl/ajax/availability.php?action=showOverview&villaID=" + villaID + "&packageID=" + packageID + "&type=" + type + "&pax=" + pax + "&promoID=" + promoID + "&couponID=" + getCookie('FV-couponCode') + "&hash=" + hash;
//alert(url);
$("#bookingtabs").tabs('url',0,url);
$("#bookingtabs").tabs('select',0);
$("#bookingtabs").tabs('load',0);
}
function getCookie(c_name) {
if (document.cookie.length>0)
{
c_start=document.cookie.indexOf(c_name + "=");
if (c_start!=-1)
{
c_start=c_start + c_name.length+1;
c_end=document.cookie.indexOf(";",c_start);
if (c_end==-1) c_end=document.cookie.length;
return unescape(document.cookie.substring(c_start,c_end));
}
}
return "";
}
function updateResult() {
var month = $('input:radio[name="month"]:checked').val();
//alert(month);
var url = "/ajax/pricetable.php?year=2016&villaID="+villaID+"&month="+month;
$('#priceframe').load(url);
}