Poplatek z hotelové kapacity ' + ((days * 1) + 1) + ' x ' + poplatek2a + ' Kč
');
}
}
}
}
}
function df_checkPriceComplete(price) {
$('#priceComplete').find(".df_right").text(price);
$('#df_hook_info_price').text(price);
}
function df_removePrice(unique) {
$("#variation_hook_"+unique).parent().find(".price").find("div").remove();
}
var date_ajax;
function df_dateInputChange(elm) {
var name = $(elm).attr('id');
var value = $(elm).val();
date_ajax = ajaxCreateHttp(true);
ajaxRequest("handle.php?cmd=df_changeInterval", ajax_empty,"df_interval_name="+name+"&df_interval_value="+value, date_ajax);
}
function ajax_empty() {
var completePrice = null;
try {
var tmpax = null
if (date_ajax && date_ajax.readyState == 4) {
tmpax = date_ajax;
}
if (remove_ajax && remove_ajax.readyState == 4) {
tmpax = remove_ajax;
}
if (tmpax) {
completePrice = $(tmpax.responseXML.getElementsByTagName("completeprice")[0]).text();
date_ajax = null;
remove_ajax = null;
}
} catch (e) {
}
if (completePrice) {
df_checkPriceComplete(completePrice);
df_updateHooks();
}
}
var addition;
var $this;
function df_addAddition(id, obj, add) {
$('.sloupec2 .info').hide();
$this = $(obj);
addition = ajaxCreateHttp(true);
ajaxRequest("handle.php?cmd=df_addAddition", ajax_addAddition,"id="+id+'&add='+add, addition);
return false;
}
function ajax_addAddition() {
if (addition.readyState == 4) {
var overdiv = document.createElement("div");
var td1 = document.createElement("td");
var tr = document.createElement("tr");
$(td1).attr("colspan", "2");
$(td1).append(overdiv);
$(tr).append(td1);
try {
addition.responseXML.normalize();
} catch (e) {
}
var l = $(addition.responseXML.getElementsByTagName("label")[0]).text();
var unique = $(addition.responseXML.getElementsByTagName("unique")[0]).text();
var oid = $(addition.responseXML.getElementsByTagName("oid")[0]).text();
var price = $(addition.responseXML.getElementsByTagName("price")[0]).text();
var itemurl = $(addition.responseXML.getElementsByTagName("url")[0]).text();
var label = document.createElement("div");
$(label).addClass("label");
var buttons = document.createElement("div");
$(buttons).addClass("buttons");
$(label).html(l);
var removelabel = 'odebrat';
var button = document.createElement("div");
var link = document.createElement("a");
$(link).attr("href", "#");
$(link).attr("title", removelabel);
$(link).text(removelabel);
var link2 = document.createElement("a");
$(link2).attr("href", itemurl);
$(link2).attr("title", 'detail');
$(link2).attr('target', '_blank');
$(link2).text('detail');
$(button).append(link2);
$(button).append(link);
$(buttons).append(button);
$(overdiv).append(label);
$(link).click(function(){
return df_removeFromSession(this, oid, unique);
});
if (price) {
var pricediv = document.createElement("div");
var priceleft = document.createElement("div");
var priceright = document.createElement("div");
$(pricediv).addClass("price");
$(pricediv).text(price);
$(overdiv).append(pricediv);
}
$(overdiv).append(buttons);
var clear = document.createElement('div');
$(clear).addClass('clear');
$(overdiv).append(clear);
$(overdiv).css("display", "none");
$(overdiv).parents('tr').css('display', 'none');
$(overdiv).addClass("dynamic_field");
$this.parents('tr').before(tr);
$(overdiv).slideDown();
$(overdiv).parents('tr').show();
try {
var completeprice = $(addition.responseXML.getElementsByTagName("completeprice")[0]).text();
df_checkPriceComplete(completeprice);
} catch (e) {
}
df_updateHooks();
}
}
function df_updateHooks() {
var products_count = $("form .dynamic_field:has(.buttons a):visible").length;
var txt = String(products_count);
if (products_count == 1) {
txt += ' poloĹľku ';
} else if (products_count>1 && products_count<5) {
txt += ' poloĹľky ';
} else {
txt += ' poloĹľek ';
}
$("#df_hook_info_count").text(txt);
}
var remove_ajax;
function df_removeFromSession(elm, id, unique, add) {
add = add || '';
remove_ajax = ajaxCreateHttp(true);
ajaxRequest("handle.php?cmd=df_removeUnique", ajax_empty,"unique="+unique+"&id="+id+"&add="+add, remove_ajax);
$(elm).parent().parent().slideUp(function(){
$(elm).parent().parent().parent().parent().remove();
$('.poplatek1_' + unique).remove();
$('.poplatek2_' + unique).remove();
$('.addition_' + unique).remove();
});
return false;
}
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
function df_switchAdditionShow(id, el) {
$("#" + id).slideToggle(500, function(){
if($("#" + id).is(':hidden')){
$(el).text($(el).text().indexOf('k pobytu') > -1 ? 'PĹ™iobjednat proceduru k pobytu' : 'PĹ™iobjednat samostatnou proceduru (nesouvisejĂcĂ s pobytem)');
}
else{
$(el).text($(el).text().indexOf('k pobytu') > -1 ? 'ZavĹ™Ăt seznam procedur k pobytu' : 'ZavĹ™Ăt seznam procedur');
}
});
return false;
}
function eraseCookie(name) {
createCookie(name,"",-1);
}