/*
* © Altamira Softworks, ltd 2006 - 2010
* info@altamira.sk | http://www.altamira.sk
* All Rights Reserved
*/
$(document).ready(function() {
$('#progressBar').attr('class','step3');
});
function arrive(id) {
if($('#arrive-'+id).is(':visible')){
$('#arrive-'+id).css('display','none');
} else {
$('#arrive-'+id).css('display','block');
}
}
var iNum = 0;
function slideImage(a) {
if (a==1) { iNum++; } else { i = iNum--; }
if (Imgs.length < iNum) {
iNum = 0;
} else if (iNum < 0) {
iNum = Imgs.length - 1;
}
$('.hotelImg').hide().fadeIn(200).attr('src',Imgs[iNum]);
}
function moreHotelInfo() {
if($('.termin-hotel-info').is(':visible')){
$('.termin-hotel-info').slideUp();
} else {
$('.termin-hotel-info').slideDown();
}
}
function checkAvailability(epc,ka1,ka2,ka3,hash,price,gid,toc,board,accomodation_type,duration,typ,zax,get) {
//$('.unavailable_description').fadeOut();
//$('.unavailable').fadeOut();
xhr = $.ajax({
url: 'https://www.reisen.cz/ajax/check_availability.php',
cache: false,
type: "GET",
data: ({
epc : epc,
ka1 : ka1,
ka2 : ka2,
ka3 : ka3,
hsc : hash,
price : price,
board: board,
accomodation_type : accomodation_type,
duration : duration,
typ : typ,
zax : zax,
get : get,
opi : toc
}),
beforeSend: function() {
$('#loading .vaM').hide();
$('#loading .vaM.termin').show();
},
success: function(html){
hashid = hash.replace(':', '_');
xhr = $.ajax({
url: 'https://www.reisen.cz/ajax/gettdh.php',
type: "GET",
data: ({
hsc: hashid
}),
async:false,
success: function(html) {
tdh = html;
}
});
var tdhlink='';
if(typeof tdh !== "undefined" && tdh!='') {
tdhlink = '&i=' + tdh;
}
if(html==2) {
$('#button_'+hashid).html(' ');
$('#button_'+hashid).attr('class','unavailable');
$('#'+hashid).attr('class','unavailable');
var text = (typ == 'flight') ? ' Litujeme, letenka je již vyprodána, vyberte si prosím jinou letenku.' : ' Litujeme, pobyt je již vyprodán, vyberte si prosím jiný pobyt.';
$('#'+hashid).after('
'+text+' |
').hide().fadeIn('slow');
} else if(html==4) {
// $('#button_'+hashid).html(' ');
// $('#button_'+hashid).attr('class','unavailable');
$('#button_'+hashid).html('pokračovat');
$('#'+hashid).attr('class','ondemand');
var text = 'V této chvíli Vám nedokážeme ověřit dostupnost, můžete nám poslat Váš požadavek a jakmile to bude možné, zjistíme Vám detaily a budeme Vás kontaktovat.';
$('#'+hashid).after(' '+text+' |
').hide().fadeIn('slow');
} else if(html==1 || html==3) {
if(html==1) { tdclass = 'selected'; } else { tdclass = 'ondemand'; }
var ondemand;
if (html==3) { ondemand = '&ondemand=1'};
$('#'+hashid).addClass(tdclass);
$('#button_'+hashid).html('pokračovat');
$.ajax({
url: 'https://www.reisen.cz/ajax/offer_available.php',
cache: false,
async:false,
type: "GET",
data: ({
hsc : hash,
price: price,
epc : epc,
ka1 : ka1,
ka2 : ka2,
ka3 : ka3,
hsc : hash,
zax : zax,
typ : typ,
resulttype : html
}),
success: function(html){
var parts = html.split("|");
$('#'+hashid).after(parts[0]).hide().fadeIn('slow');
if ($('#button_'+hashid).parent().find('input.t_vars').size() == 0) return;
var vars = $('#button_'+hashid).parent().find('input.t_vars').val().split('|');
var price = vars[6];
if(parts[1]==1) {
$('#price_'+hashid).addClass('hshnewprice');
$('#pricespan_'+hashid).html(parts[2]);
price = parts[2];
}
var hotelInfoWrapper = $('.boxWrapper .pnlHotelInfo');
var data = {
'hotel': $(hotelInfoWrapper).find('h2').text(),
'stars': $(hotelInfoWrapper).find('.stars').attr('title'),
'country': $(hotelInfoWrapper).find('.tourinfo span').eq(2).text(),
'region': $(hotelInfoWrapper).find('.tourinfo span').eq(1).text(),
'location': $(hotelInfoWrapper).find('.tourinfo span').eq(0).text(),
'ts': vars[0],
'te': vars[1],
'tfrom': vars[2],
'dur': vars[3],
'pln': vars[4],
'acc': vars[5],
'price': price,
'toc': vars[7],
'gid': vars[8]
};
if (vars.length > 1) {
var params = '?t='+(new Date()).getTime();
for (key in data){
params += '&'+key+'='+encodeURIComponent(data[key]);
}
$.ajax({
url: 'https://www.reisen.cz/ajax/save_tour.php'+params
});
}
}
});
}
$('#loading .vaM').show();
$('#loading .vaM.termin').hide();
}
});
}