function errorsuppressor(){ return true; } window.onerror=errorsuppressor; var isIE = false; function getHTTPObject() { var xmlhttp; if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else if (window.ActiveXObject) { isIE = true; try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(err1) { try { xmlhttp = new ActiveXObject("Msml2.XMLHTTP"); } catch(err2) { xmlhttp = false; } } } return xmlhttp; } function vyplnObjednavku(){ http = getHTTPObject(); if (http) { http.open("GET", "/user/vyplneniObjednavky.php?rand="+(Math.random()*9), false); http.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); http.send(null); doVyplneniObjednavkyOutput();; } } function vyplnObjednavkuKlientem(id){ http = getHTTPObject(); if (http) { http.open("GET", "/user/vyplneniObjednavky.php?klient="+id+"&rand="+(Math.random()*9), false); http.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); http.send(null); doVyplneniObjednavkyOutput();; } } function doVyplneniObjednavkyOutput() { if (http.readyState == 4) { xmldoc = http.responseXML; if(!xmldoc) { return true; } os_udaje = xmldoc.getElementsByTagName("vypis_osobnich_udaju"); for(i=0; i 0) { msg.innerHTML = 'Litujeme, ale tento kód je neúplný nebo není platný. V případě uplatňování dárkových poukazů, uveďte jejich čísla do poznámky v objednávce.'; msg.className = 'err'; } else { msg.innerHTML = ''; } } //*/ } /* slevove kody - konec */ function set_position(id,podle,co,oco) { if (co == "top"){ document.getElementById(id).style.top=document.getElementById(podle).offsetTop+oco+"px"; } else if (co=="left"){ document.getElementById(id).style.left=document.getElementById(podle).offsetLeft+oco+"px"; } } function clearBackground(id){ if (el = document.getElementById(id)) { el.style.background = "white"; } } function headerQuestionOn(){ el = document.getElementById('header_question'); if (el.style.visibility != "visible") el.style.visibility = "visible"; } function headerQuestionOff(){ el = document.getElementById('header_question'); if (el.style.visibility != "hidden") el.style.visibility = "hidden"; } function headerOperatorkaOn(){ el = document.getElementById('header_operatorka'); if (el.style.visibility != "visible") el.style.visibility = "visible"; } function headerOperatorkaOff(){ el = document.getElementById('header_operatorka'); if (el.style.visibility != "hidden") el.style.visibility = "hidden"; } var elToFluentVisible; function fluentVisible() { for (var i=0;i<11;i++) setTimeout('setOpacity('+i+')',100*i); return false; } function setOpacity(value) { elToFluentVisible.style.opacity = value/10; elToFluentVisible.style.filter = 'alpha(opacity=' + value*10 + ')'; } var last_global_id; function menu_on(id) { for(i=1;i<=8;i++) { if(i!=id) { if (el = document.getElementById('menu'+String(i))) el.style.visibility="hidden"; last_global_id = null; } } el = document.getElementById('menu'+String(id)); last_global_id = el; setTimeout(function(){ if (el && last_global_id == el){ el.style.visibility="visible"; last_global_id = el; } },500); } function menu_off(id) { if (el = document.getElementById('menu'+String(id))) el.style.visibility="hidden"; } function userShowDestinace() { var obj = document.forms['user_setup_form'].elements['zeme[]']; var el; for(var i=0; i 0 && $('input.akcniCenaPolozkaExim').length > 0) { if ($('input.akcniCenaPolozkaExim').val() > 0) { $('em.akcniCenaPriplatekExim').show(); $('input.akcniCenaPriplatekExim').attr('value',$('.cenovaPolozkaDospeli:first').val()); } else { $('em.akcniCenaPriplatekExim').hide(); $('input.akcniCenaPriplatekExim').attr('value',0); } } } var upraveneCenovePolozky = new Array(); function objZpracovaniFlagu (inputElm, maxPocetPevnychLuzek, maxPocetPristylek, maxPocetPristylekDospeli) { if (!isElementInCPFlagArray(inputElm)) upraveneCenovePolozky.push(inputElm); if (typeof(GPojisteniDospeli) !== 'undefined') { doplnPolozkyPojisteni(); } akcniPolozkaEximDeti(); // dopocitani poctu osob/luzek var pocetDospelych = 0; var pocetDeti = 0; var pocetInfanti = 0; var pocetPevnychLuzek = 0; var pocetPevnychLuzekDospeli = 0; var pocetPristylek = 0; var pocetPristylekDospeli = 0; var pocetTmp = 0; $('.cenovaPolozkaDospeli').each(function(){ if ($(this).val().length == 0) pocetTmp = 0; else pocetTmp = parseInt($(this).val()); pocetDospelych += pocetTmp*parseInt($(this).attr('rel')); }); $('.cenovaPolozkaDeti').each(function(){ if ($(this).val().length == 0) pocetTmp = 0; else pocetTmp = parseInt($(this).val()); pocetDeti += pocetTmp*parseInt($(this).attr('rel')); }); $('.cenovaPolozkaInfanti').each(function(){ if ($(this).val().length == 0) pocetTmp = 0; else pocetTmp = parseInt($(this).val()); pocetInfanti += pocetTmp*parseInt($(this).attr('rel')); }); $('.obsazenePevneLuzko').each(function(){ if ($(this).val().length == 0) pocetTmp = 0; else pocetTmp = parseInt($(this).val()); pocetPevnychLuzek += pocetTmp*parseInt($(this).attr('rel')); if ($(this).hasClass("cenovaPolozkaDospeli")) { pocetPevnychLuzekDospeli += pocetTmp*parseInt($(this).attr('rel')); } }); $('.obsazenaPristylka').each(function(){ if ($(this).val().length == 0) pocetTmp = 0; else pocetTmp = parseInt($(this).val()); pocetPristylek += pocetTmp*parseInt($(this).attr('rel')); if ($(this).hasClass("cenovaPolozkaDospeli")) { pocetPristylekDospeli += pocetTmp*parseInt($(this).attr('rel')); } }); if ($('.taxyDospeli').length > 0) { $('.taxyDospeli').each(function(){ if (!isElementInCPFlagArray(this)) $(this).val(pocetDospelych); }); } if ($('.taxyPevneLuzkoDospeli').length > 0) { $('.taxyPevneLuzkoDospeli').each(function(){ if (!isElementInCPFlagArray(this)) $(this).val(pocetPevnychLuzekDospeli); }); } if ($('.taxyDite').length > 0) { $('.taxyDite').each(function(){ if (!isElementInCPFlagArray(this)) $(this).val(pocetDeti-pocetInfanti); }); } if ($('.taxyOsoba').length > 0) { $('.taxyOsoba').each(function(){ if (!isElementInCPFlagArray(this)) $(this).val(pocetDospelych+pocetDeti-pocetInfanti); }); } var pocetPokoju = 0; if ($('.neobsazeneLuzko').length > 0) { while (pocetPevnychLuzek > maxPocetPevnychLuzek) { pocetPevnychLuzek -= maxPocetPevnychLuzek; pocetPokoju += 1; } if (pocetPevnychLuzek > 0) { pocetPokoju += 1; $('.neobsazeneLuzko').val(maxPocetPevnychLuzek-pocetPevnychLuzek); } else $('.neobsazeneLuzko').val(0); } if (maxPocetPristylek > 0 && ($('.neobsazenaPrvniPristylka').length > 0 || $('.neobsazenaDalsiPristylka').length > 0)) { while (pocetPristylek > maxPocetPristylek) { pocetPristylek -= maxPocetPristylek; pocetPokoju -= 1; } if (pocetPristylek <= maxPocetPristylek) { pocetPokoju -= 1; if (pocetPristylek == 0) { $('.neobsazenaPrvniPristylka').val(pocetPokoju+1); $('.neobsazenaDalsiPristylka').val(pocetPokoju*(maxPocetPristylek-1)+maxPocetPristylek-1); } else { $('.neobsazenaPrvniPristylka').val(pocetPokoju); $('.neobsazenaDalsiPristylka').val(pocetPokoju*(maxPocetPristylek-1)+maxPocetPristylek-pocetPristylek); } } else $('.neobsazenaPrvniPristylka, .neobsazenaDalsiPristylka').val(0); } } function isElementInCPFlagArray(inputElm) { var exist = false; for (var i = 0; i < upraveneCenovePolozky.length; i++) { if (inputElm == upraveneCenovePolozky[i]) { exist = true; break; } } return exist; } function countOrderSum() { var sum = 0; var regexp = /[^0-9]/; var val = ''; var form = document.forms['obj_form']; var ceny = form.elements['ceny[]']; var hodnoty = form.elements['hodnoty[]']; var aktualniCena; if (ceny && hodnoty) { if (!ceny.length) { val = hodnoty.value; hodnoty.value = val.replace(regexp, ''); nasobek = hodnoty.value == "" ? parseFloat(0) : parseFloat(hodnoty.value); aktualniCena = parseFloat(ceny.value); sum += (aktualniCena*nasobek); } else { for(i=0; i < ceny.length; i++) { val = hodnoty[i].value; hodnoty[i].value = val.replace(regexp, ''); nasobek = hodnoty[i].value == "" ? parseFloat(0) : parseFloat(hodnoty[i].value); aktualniCena = parseFloat(ceny[i].value); sum += (aktualniCena*nasobek); } } } ceny = form.elements['ceny_skipasy[]']; hodnoty = form.elements['hodnoty_skipasy[]']; if (ceny && hodnoty) { if (!ceny.length) { val = hodnoty.value; hodnoty.value = val.replace(regexp, ''); nasobek = hodnoty.value == "" ? parseFloat(0) : parseFloat(hodnoty.value); aktualniCena = parseFloat(ceny.value); sum += (aktualniCena*nasobek); } else { for(i=0; i < ceny.length; i++) { val = hodnoty[i].value; hodnoty[i].value = val.replace(regexp, ''); nasobek = hodnoty[i].value == "" ? parseFloat(0) : parseFloat(hodnoty[i].value); aktualniCena = parseFloat(ceny[i].value); sum += (aktualniCena*nasobek); } } } ceny = form.elements['ceny_pojisteni[]']; hodnoty = form.elements['hodnoty_pojisteni[]']; if (ceny && hodnoty) { if (!ceny.length) { val = hodnoty.value; hodnoty.value = val.replace(regexp, ''); nasobek = hodnoty.value == "" ? parseFloat(0) : parseFloat(hodnoty.value); aktualniCena = parseFloat(ceny.value); sum += (aktualniCena*nasobek); } else { for(i=0; i < ceny.length; i++) { val = hodnoty[i].value; hodnoty[i].value = val.replace(regexp, ''); nasobek = hodnoty[i].value == "" ? parseFloat(0) : parseFloat(hodnoty[i].value); aktualniCena = parseFloat(ceny[i].value); sum += (aktualniCena*nasobek); } } } ceny = form.elements['ceny_parkovani[]']; hodnoty = form.elements['hodnoty_parkovani[]']; if (ceny && hodnoty) { if (!ceny.length) { val = hodnoty.value; hodnoty.value = val.replace(regexp, ''); nasobek = hodnoty.value == "" ? parseFloat(0) : parseFloat(hodnoty.value); aktualniCena = parseFloat(ceny.value); sum += (aktualniCena*nasobek); } else { for(i=0; i < ceny.length; i++) { val = hodnoty[i].value; hodnoty[i].value = val.replace(regexp, ''); nasobek = hodnoty[i].value == "" ? parseFloat(0) : parseFloat(hodnoty[i].value); aktualniCena = parseFloat(ceny[i].value); sum += (aktualniCena*nasobek); } } } form.elements['celkem'].value = sum; target = document.getElementById('obj_celkova_suma_1'); target.innerHTML = formatNumber(sum); /* polozky k tisku */ if (typeof(interniUzivatel) !== 'undefined') { var vetsichJakNula = 0; $('#show_cenik input[type=text]').each(function(){ if ($(this).val() > 0) { vetsichJakNula++; $(this).parent().parent().removeClass('off_on_print'); } else { $(this).parent().parent().addClass('off_on_print'); } }); if (vetsichJakNula == 0) { $('#show_cenik input[type=text]').parent().parent().removeClass('off_on_print'); } } if ($('input.zvyhodneneParkovani').length > 0 && parseInt($('input.zvyhodneneParkovani').val()) > 1) { alert("Při objednání více než jednoho parkování se cena může lišit. Konečnou cenu parkování Vám sdělí operátorka."); } } function orderAmount(el) { if(el.value == '0') { el.value = ''; el.focus(); } } function formatNumber(n, d) { // round to 2 decimals if cents present n = (Math.round(n * 100) / 100).toString().split('.'); myNum = n[0].toString(); fmat = new Array(); len = myNum.length; d = d == null ? ' ' : d; i = 1; deci = ','; for(i; i < len + 1; i++) fmat[i] = myNum.charAt(i-1); fmat = fmat.reverse(); for(i = 1; i < len; i++) { if(i % 3 == 0) { fmat[i] += d; } } var val = fmat.reverse().join('') + ( n[1] == null ? '' : (deci + n[1]) ); return val; } function kontrola(formular) { if (formular.celkem.value==0 || formular.celkem.value=='') { alert("Nezadali jste žádné údaje pro výpočet ceny!"); return false; } if (formular.jmeno.value=="") { alert("Jméno je nutné vyplnit!"); formular.jmeno.focus(); return false; } if (formular.prijmeni.value=="") { alert("Příjmení je nutné vyplnit!"); formular.prijmeni.focus(); return false; } if (formular.pocet_dospelych.value=="") { alert("Počet dospělých je nutné vyplnit!"); formular.pocet_dospelych.focus(); return false; } if (formular.pocet_deti.value=="") { alert("Počet dětí je nutné vyplnit!"); formular.pocet_deti.focus(); return false; } if (formular.telefon.value=="") { alert("Telefon je nutné vyplnit!"); formular.telefon.focus(); return false; } if (formular.email.value=="") { alert("E-mailovou adresu je nutné je nutné vyplnit!"); formular.telefon.focus(); return false; } /* if (formular.ulice.value=="") { alert("Ulici je nutné vyplnit!"); formular.ulice.focus(); return false; } if (formular.cp.value=="") { alert("Číslo popisné je nutné vyplnit!"); formular.cp.focus(); return false; } if (formular.obec.value=="") { alert("Obec je nutné vyplnit!"); formular.obec.focus(); return false; } if (formular.psc.value=="") { alert("PSČ je nutné vyplnit!"); formular.psc.focus(); return false; } */ // po uspesnem odeslani formulare zablokuju tlacitko Objednat (zdvojene objednavky) $('#obj_submit_btn').attr('disabled','disabled'); // pro jistotu ho za 20s zase odblokuju setTimeout(function(){$('#obj_submit_btn').attr('disabled','');},20000); return true; } function clipboardChange(idZ, activeTab) { if (activeTab) { if ($('.zakaznik_nadpis').length == 0) activateTab(zakaznik_tabs_pos['schranka'], 'zakaznik_tabs'); else // nova verze zakaznickeho boxu activateTabZakaznik('3', 'zakaznik_tabs'); } var action = 'add'; if (document.images) { if (document.images['schranka_'+String(idZ)].src.indexOf('add') > 0) { action = 'add'; document.images['schranka_'+String(idZ)].src = '/img/schranka_text_remove.gif'; } else { action = 'remove'; document.images['schranka_'+String(idZ)].src = '/img/schranka_text_add.gif'; } } http = getHTTPObject(); if (http) { http.open("GET", '/clipboard.php?action='+action+'&zajezd_id='+String(idZ)+'&rand='+(Math.random()*9), false); http.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); http.send(null); if (http.readyState == 4) { if (el = document.getElementById('schranka_pocet_z')){ el.innerHTML = http.responseText; } /* if (el = document.getElementById('zakaznik_tabs:tab'+zakaznik_tabs_pos['registrace'])) { if ( http.responseText == 0) el.style.display=''; else el.style.display='none'; } if (el = document.getElementById('zakaznik_tabs:tab'+zakaznik_tabs_pos['schranka'])) { if (http.responseText == 0 && document.getElementById('zakaznik_tabs:tab'+zakaznik_tabs_pos['registrace'])) el.style.display='none'; else el.style.display=''; } */ if ( http.responseText != 0){ //activateTab(zakaznik_tabs_pos['schranka'],'zakaznik_tabs'); document.getElementById('schranka_ul').className = 'active_href'; } else { /*if (document.getElementById('zakaznik_tabs:tab'+zakaznik_tabs_pos['registrace'])) activateTab(1,'zakaznik_tabs');*/ document.getElementById('schranka_ul').className = 'non_active_href'; } } propagateScript('/clipboard.php?action='+action+'&zajezd_id='+String(idZ)+'&rand='+(Math.random()*9)); } return false; } function clipboardClear(){ if (document.getElementById('schranka_pocet_z').innerHTML != '0'){ if (confirm('Opravdu chcete vymazat obsah schránky?')){ http = getHTTPObject(); if (http) { http.open("GET", "/clipboard.php?action=clear&rand="+(Math.random()*9), false); http.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); http.send(null); if (http.readyState == 4) { if (el = document.getElementById('schranka_pocet_z')){ el.innerHTML = '0'; var zaj_ids = http.responseText.split(";"); for(var i=0; i= 0) { active = 'active_b'; } else { active = 'active_o'; } var tNo = parseInt(tabNo); var i = 1; while (el = document.getElementById(tabbed_pane_id + ':tab' + i)) { el.className = i == tNo ? active : ''; i++; } var elem; if (prevTab[tabbed_pane_id] != 100) document.getElementById(tabbed_pane_id+":content"+prevTab[tabbed_pane_id]).style.display = 'none'; document.getElementById(tabbed_pane_id + ':content' + tabNo).style.display = 'block'; prevTab[tabbed_pane_id] = tabNo; setCookie(tabbed_pane_id,tabNo); setVyskaLevehoSloupce(); } function activateTabZakaznik(tabNo) { $('#zakaznik_tabs div.tabbed_pane_tab').hide(); $('#zakaznik_tabs .tab' + tabNo).show(); $('#zakaznik_tabs .zakaznik_nadpis').html($('#zakaznik_tabs .tab' + tabNo + ' .skryty_nadpis').html()); setCookie('zakaznik_tabs',tabNo); setVyskaLevehoSloupce(); } function tabOver(el) { over = ''; if (el.parentNode.className.indexOf('blue') >= 0) { over = 'over_b'; } else { over = 'over_o'; } if (el.className.indexOf('active') < 0) { el.className = over; } } function tabOut(el, side) { if (el.className.indexOf('active') < 0) { el.className = side; } } function dispAtiveContent(tabbed_pane_id){ var i = 1; var el = null; el = document.getElementById(tabbed_pane_id + ':tab' + i); while (el && el.className.indexOf('active') < 0) { i++; el = document.getElementById(tabbed_pane_id + ':tab' + i); } if (el){ document.getElementById(tabbed_pane_id+":content"+i).style.display = 'block'; prevTab[tabbed_pane_id] = i; if (tabbed_pane_id == 'hledani_tabs' && i==2) { ssfReload(); } } else { prevTab[tabbed_pane_id] = 100; if (getCookie(tabbed_pane_id) < 100) activateTab(1,tabbed_pane_id); else document.getElementById(tabbed_pane_id + ':close').style.display = 'none'; } } function closeTabbedPane(tabbed_pane_id){ document.getElementById(tabbed_pane_id + ':close').style.display = 'none'; var i = 1; while (el = document.getElementById(tabbed_pane_id + ':tab' + i)) { el.className = ''; i++; } if (prevTab[tabbed_pane_id] != 100) document.getElementById(tabbed_pane_id+":content"+prevTab[tabbed_pane_id]).style.display = 'none'; setCookie(tabbed_pane_id,100); prevTab[tabbed_pane_id] = 100; } // end - funkce pro zalozky // this function returns the x, y position // works in IE and Mozilla. function getElementPosition(element){ var x=0,y=0; while (element!=null){ x+=element.offsetLeft;//-element.scrollLeft; y+=element.offsetTop;//-element.scrollTop; element=element.offsetParent; } return {x:x,y:y}; } function setAdFoxPosition(main_id, main_old_y){ //alert(main_id); if ((adFox = document.getElementById('ban760')) && adFox.className.indexOf('af_760')){ elm1 = document.getElementById('urceni_vysky_menu'); elm2 = document.getElementById('urceni_vysky_main'); menuYpos = getElementPosition(elm1).y; mainYpos = getElementPosition(elm2).y; //alert("(" + main_old_y + " + " + adFox.offsetHeight + ") >= " + "(" + (menuYpos+4) + ")"); if ((main_old_y + adFox.offsetHeight) >= (menuYpos+4)){ adFox.style.position = 'static'; if (navigator.appName != "Microsoft Internet Explorer") { mainx = document.getElementById(main_id); mainx_vyska = main_old_y + adFox.offsetHeight - getElementPosition(mainx).y + 5; mainx.style.height = mainx_vyska + "px"; } } else { elm1Y = elm1.offsetTop; adFoxY = adFox.offsetTop; if (navigator.appName=="Microsoft Internet Explorer") { elm1Y = elm1.offsetTop; adFox.style.position = 'absolute'; adFox.style.left = '0px'; adFoxNewTop = elm1Y - adFox.offsetHeight - 24; } else { adFox.style.position = 'relative'; adFoxOldTop = parseInt(adFox.style.top); if (!adFoxOldTop) adFoxOldTop = 0; adFoxNewTop = adFoxOldTop + elm1Y - adFoxY - adFox.offsetHeight - 14; //alert("adFoxOldTop = "+adFoxOldTop+"\nadFoxNewTop = "+adFoxNewTop+"\nelm1Y = " // +elm1Y+"\nadFox.offsetHeight = "+adFox.offsetHeight+"\nadFoxY = "+adFoxY); } adFox.style.top = adFoxNewTop + "px"; } } } function setVyskaLevehoSloupce(){ elm1 = document.getElementById('urceni_vysky_menu'); elm2 = document.getElementById('urceni_vysky_main'); elm1Y = getElementPosition(elm1).y; elm2Y = getElementPosition(elm2).y; //alert(elm1Y + " -- " + elm2Y); if (elm2Y < elm1Y+4){ var mainx; if (!(mainx = document.getElementById('main_outer'))) if (!(mainx = document.getElementById('main_outer_index'))) if (!(mainx = document.getElementById('main_outer_results'))) if (!(mainx = document.getElementById('user_main_outer'))); //alert('mainx.id = '+mainx.getAttribute('id')+'\n' + elm1Y + " -- " + elm2Y); elm1Y = elm1Y - 7; mainx_vyska = elm1Y - getElementPosition(mainx).y; //mainx.style.height = mainx_vyska + "px"; // nastavuji pouze min-height kvuli dynamicky se menicimu obsahu $(mainx).css('min-height',mainx_vyska + "px"); setTimeout("setAdFoxPosition('"+mainx.getAttribute('id')+"', "+elm2Y+")",500); } } function setMinSirka() { if (screen.width < 820){ var mainx; if (!(mainx = document.getElementById('main_outer'))) if (!(mainx = document.getElementById('main_outer_index'))) if (!(mainx = document.getElementById('main_outer_results'))) if (!(mainx = document.getElementById('user_main_outer'))); h_img = document.getElementById("header_img"); el_rc = document.getElementById("rc"); if (mainx) { mainx.style.width = '700px'; } if (h_img) { h_img.style.width = '965px'; } } } function nerozhodujeClick(formName, elName, nerozhoduje){ var chL = document.forms[formName].elements[elName].length; if (nerozhoduje) { document.forms[formName].elements[elName][0].checked = true; var i = 1; while(i ' +$(this).html()+''); } else { // nahoru $(this).css("text-decoration","none"); $(this).html(' ' +$(this).html()+''); } } $(this).addClass("animatedReady"); } } }); } // odkazy do noveho okna s ikonkou function makeNewWinIcons() { $('#show_BETA a[target*=blank]:not([class~=normal]), .makeNewWinIcons a[target*=blank]:not([class~=normal])').each(function() { if ($(this).children($('font[class*=icon-newwin]')).length < 2) { //pokud jeste nema ikonu, tak ji pridam $(this).css("text-decoration","none"); $(this).html('' + $(this).html() +' '); } }); } // thru=cat $(document).ready(function() { /* $('#catalogue_data:not([class~=not_thru]) a:not([class~=not_thru])').each(function() { if($(this).attr('name').length == 0) { if ($(this).attr('href').lastIndexOf('?') >= 0) $(this).attr('href', $(this).attr('href')+"&thru=cat"); else $(this).attr('href', $(this).attr('href')+"?thru=cat"); } }); */ }); function online_check_result(termin_id, odkaz) { if($(odkaz).attr('disabled') == 'disabled') return false; $(odkaz).attr('disabled', 'disabled'); if($("#online_check").length > 0) { $("#online_check").remove(); } var $dialog = $('
').dialog({ autoOpen: false, closeText: 'Zavřít', width: 600, title: 'Ověření dostupnosti online', beforeclose: function() { $(odkaz).removeAttr('disabled'); } }); $dialog.dialog('open'); $dialog.html(''); $.ajax({ type: "POST", url: '/inc/ajax/online_check/onlinecheck.php?hash='+randomString(), data: 'termin_id='+termin_id, success: function(ret){ $dialog.html(ret); } }); return false; } function online_check_result_advanced(termin_id) { var data = $("#check_form").serialize(); $("#online_check").html(''); $.ajax({ type: "POST", url: '/inc/ajax/online_check/onlinecheck.php?advanced=1&hash='+randomString(), data: data+'&termin_id='+termin_id, success: function(ret){ $("#online_check").html(ret); } }); return false; } function online_rezaportal_prebooking(termin_id) { var data = $("#check_form").serialize(); $("#online_check").html(''); $.ajax({ type: "POST", url: '/inc/ajax/online_check/rezaportal_prebooking.php?hash='+randomString(), data: data+'&termin_id='+termin_id, success: function(ret){ $("#online_check").html(ret); } }); return false; } function addRoomsRows() { var count = $("#unit option:selected").val(); $("#addedRooms").html(" "); for (var i=1; i <= count; i++) { $("#addedRooms").html($("#addedRooms").html() + "" + i + ".   Dospělí: " + " Děti: " + " Infanti:
" ); } } // rozsiri jQuery o $.URLEncode(string) a $.URLDecode(string) $.extend({URLEncode:function(c){var o='';var x=0;c=c.toString();var r=/(^[a-zA-Z0-9_.]*)/; while(x1 && m[1]!=''){o+=m[1];x+=m[1].length; }else{if(c[x]==' ')o+='+';else{var d=c.charCodeAt(x);var h=d.toString(16); o+='%'+(h.length<2?'0':'')+h.toUpperCase();}x++;}}return o;}, URLDecode:function(s){var o=s;var binVal,t;var r=/(%[^%]{2})/; while((m=r.exec(o))!=null && m.length>1 && m[1]!=''){b=parseInt(m[1].substr(1),16); t=String.fromCharCode(b);o=o.replace(m[1],t);}return o;} }); function askForOdjezd(odkaz, data) { if($(odkaz).attr('disabled') == 'disabled') return false; $(odkaz).attr('disabled', 'disabled'); var $dialog = $('
').dialog({ autoOpen: false, closeText: 'Zavřít', width: 400, title: 'Upřesněte prosím termín odjezdu', beforeclose: function() { $(odkaz).removeAttr('disabled'); $dialog.html(" "); } }); $dialog.dialog('open'); $dialog.html(''); $.ajax({ type: "POST", url: '/inc/results_askForOdjezd.php?hash='+randomString(), data: data, success: function(ret){ $dialog.html(ret); $("#dleCeny").click(function () { var znak = '&'; if (odkaz.href.indexOf('?') < 0) znak = '?'; var no_steps = odkaz.href.replace(/&steps=[^&]+/, ""); window.location = no_steps + znak + $("#results_odjezdInterval").serialize(); }); } }); return false; } function validateEmail(email) { var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; if(!emailReg.test(email)) { return false; } else { return true; } } function sendMailDialog(odkaz, data) { if($(odkaz).attr('disabled') == 'disabled') return false; $(odkaz).attr('disabled', 'disabled'); var $dialog = $('
').dialog({ autoOpen: false, closeText: 'Zavřít', width: 400, title: 'Poslat informace o zájezdu e-mailem sobě nebo přátelům', beforeclose: function() { $(odkaz).removeAttr('disabled'); $dialog.html(" "); } }); $dialog.dialog('open'); $dialog.html('


'+ '

'+ '

'+ '
'); $('#submit_dialog').submit(function() { data += '&'+$("#submit_dialog").serialize(); $dialog.html(''); $.ajax({ type: "POST", url: '/inc/ajax/show_sendMail.php?hash='+randomString(), data: data, success: function(ret){ $dialog.html(ret); setTimeout(function () { $dialog.dialog('close'); },4000); } }); return false; }); return false; } function trackEventRegistrace(pageId) { _gaq.push(['_trackEvent', 'Registrace', (pageId && pageId.length > 0 ? pageId : "N/A"), document.location.protocol +"//"+ document.location.hostname + document.location.pathname]); } function trackEventVstupRTB(action, label) { if (window.location.hash.indexOf("zdroj=plo-rtb") > 0 || window.location.hash.indexOf("zdroj=plort") > 0) { _gaq.push(['_trackEvent', 'Vstup RTB', action, label]); } } // min-width obsahu pro IE6 $(document).ready(function() { $('#main, #main_outer_results').append('
 
'); if ($('#site_map span').length == 0 || $('#site_map').css('visibility') == 'hidden') { $('#header_img_new').css('padding-bottom', '0px'); $('#main_wrapper #rc').css('top', '0'); $('#site_map').hide(); } }); // debouncing function from John Hann // stejne jako query resize() metoda, ale je volana az po dokonceni resizingu, vola se smartresize() (function($,sr){ var debounce = function (func, threshold, execAsap) { var timeout; return function debounced () { var obj = this, args = arguments; function delayed () { if (!execAsap) func.apply(obj, args); timeout = null; }; if (timeout) clearTimeout(timeout); else if (execAsap) func.apply(obj, args); timeout = setTimeout(delayed, threshold || 100); }; } jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); }; })(jQuery,'smartresize');