function resrc() { $("img[data-src]").each(function(){ $path = $(this).attr("src").split("/"); $img = $path.pop(); $wxh = $path.pop(); $path = $path.join("/"); $resp = $(this).attr("data-src").split(","); $wx=$wxh.split("x")[0]; i=0;while(i<$resp.length && $(this).width()>$wx) {$wxh = $resp[i]; $wx=$wxh.split("x")[0]; i++;} $src = $path + "/" + $wxh + "/" + $img; /* alert($src);*/ $(this).attr("src",$src); }); } function onresize() { if($("#menu").length) menuOffset = Math.round($("#menu").offset().top); menuHeight = $("#menu").height(); $(".fix").css({height:menuHeight+"px"}); resrc(); } var hash = ""; var menuOffset = 0; var menuHeight = 0; var $w = 0; var dniDopredu = 2; $(document).ready(function(){ $("form .icon-cal2").click(function(){ if($("#ui-datepicker-div:visible").length) $("#form_datum").datepicker("hide"); else $("#form_datum").datepicker("show"); }); var disabledDates = ''; $("#form_datum").datepicker({minDate:dniDopredu, beforeShowDay:function(date){ var string = jQuery.datepicker.formatDate("yy-mm-dd", date); disabled=false; disableTitle = ""; for(i in disabledDates) if(i.indexOf(string)>-1) {disabled=true; disableTitle = disabledDates[i]; break;} return [ !disabled, "", disableTitle ] }}); $("#form_cas").timepicker({timeFormat:"HH:mm",interval:30,dynamic:false,minHour:11,maxHour:22,dropdown:true,scrollbar:true}); // $("section").mousemove(function(e){ // var bg = $(this).css("background-position").split(" "); // var bgY = bg[1]; // var newvalueX = e.pageX/20; // $(this).css("background-position", newvalueX+"px "+bgY); // }); // $("section:not(#fotogalerie),#fotogalerie::after").mousemove(function(e){ // var bg = $(this).css("background-position").split(" "); // var bgX = bg[0]; // var bgY = bg[1]; // var newvalueX = bgX; // var newvalueY = (100+10*((e.pageY-$(this).offset().top)/$(this).height()))+"%"; // $(this).css("background-position", newvalueX+" "+newvalueY); // }); $w = $(window).width(); // $(window).on("resize",function(){onresize();}) //$("#main").disableSelection(); $("a").click(function(){$(this).blur();return true;}); outlinks(); $("body").removeClass("nojs").addClass("js"); // var config = { // move: (window.location.hash!="") ? 0 : "100px", // enter:"bottom", // scale: { direction: 'up', power: '0%' }, // vFactor:0.1 // } // if($("html").hasClass("oldie")) ; else window.sr = new scrollReveal(config); $('select').has("option:selected:disabled").css({color:"#999"}).change(function(){$(this).css({color:"#000"});}).children("option").css({color:"#000"}).filter("option[disabled]").css({color:"#999"}); if($("body").hasClass("nojs")) { // android :) // telefon... } else { // desktop // var s = skrollr.init({ // edgeStrategy: 'set', // easing: { // WTF: Math.random, // inverted: function(p) { // return 1-p; // } // } // }); // $("#menu").after("
"); $("#gotoup").on("click",function(e){ e.preventDefault(); $.scrollTo(0,1000); return false; }); if($(window).scrollTop()>20) $("#gotoup").addClass("ukaz"); else if($("#gotoup").removeClass("ukaz")) ; else $("#gotoup").removeClass("ukaz"); $(window).on('scroll', function (e) { if($(window).scrollTop()>20) $("#gotoup").addClass("ukaz"); else if($("#gotoup").removeClass("ukaz")) ; else $("#gotoup").removeClass("ukaz"); // if($("#menu").length) { // if($("#menu").hasClass("fixed")) { // if($(window).scrollTop()menuOffset) {$("#menu").addClass("fixed").next().css({display:"block"});} // else if($(window).scrollTop()<($("#menu").prev().offset().top + $("#menu").prev().height())) {if(window.location.hash) {history.replaceState({}, "", "#");}} // } // } }); } onresize(); resrc(); // var ths = false; var tds = false; var tdsl = 0; var evenTds = false; // $(document).ready(function(){ // $("table").each(function(){ // ths = $(this).find("thead tr th"); // evenTds = $(this).hasClass("stejneBunky"); // $(this).find("tbody tr").each(function(){ // tds = $(this).children("td"); // tdsl = tds.length; // tds.each(function(i){ // if(evenTds) $(this).css({width:(100/ths.length)+"%"}); // $(this).attr("data-label",ths.eq((ths.length-tdsl)+i).text()); // }); // }); // }); // }); if(window.location.hash=="") $("#submenu").hide(0).delay(1000).slideDown(500); // $("#rezervace form").on("submit",function(e){ // e.preventDefault(); // if(($btn=$(this).find(".button")).hasClass("moment")) ; else { // $btn.addClass("moment"); // $.post(PATH+"rezervace.php",$('#kontakt form').serialize(),function(data) { // $("#poptavka form").find(".button").removeClass("moment"); // if(data.val=="submitted") {$("#poptavka form")[0].reset();} // alert(data.msg); // },"json"); // } // return false; // }); }); /* (function($){ $.fn.ctrl = function(key, callback) { if(typeof key != 'object') key = [key]; callback = callback || function(){ return false; } return $(this).keydown(function(e) { var ret = true; $.each(key,function(i,k){ if(e.keyCode == k.toUpperCase().charCodeAt(0) && e.ctrlKey) { ret = callback(e); } }); return ret; }); }; $.fn.disableSelection = function() { $(window).ctrl(['a','s','c']); return this.each(function() { $(this).attr('unselectable', 'on') .css({'-moz-user-select':'none', '-o-user-select':'none', '-khtml-user-select':'none', '-webkit-user-select':'none', '-ms-user-select':'none', 'user-select':'none'}) .each(function() { $(this).attr('unselectable','on') .bind('selectstart',function(){ return false; }); }); }); }; })(jQuery); */ function protectit(cl,slovo) { mejly = $('a.'+cl); for (var i = 0, j = mejly.length; i < j; i++) { mjl = mejly.get(i); var mejl = (mjl.title) ? mjl.title.split(slovo) : mjl.innerHTML.split(slovo); antiSpam.mailTo(mjl, { email: mejl[0], domain: mejl[1], nameAsEmail: true }); } } var antiSpam = { toSeparatedString: function(obj, delimiter) { if (!obj) return null; if (typeof(obj) == 'string') return obj; var res = ''; for (var i=0; i 0 && delimiter) res += delimiter; res += obj[i]; } return res; }, mailTo: function(id, parameters) { if (!parameters) return; var a = id; if (!a) return; var email = parameters.email; if (!email) return; var domain = parameters.domain; if (!domain) return; email = email + '@' + domain; a.href = 'mailto:' + email; if (!parameters.name) { if (parameters.nameAsEmail) { if(a.title=="") a.innerHTML = email; else a.title = email;} } else a.innerHTML = parameters.name; } } function outlink(href){ var evt = window.event; if(href) var win = window.open(href); if (win){ if (evt && evt.preventDefault) evt.preventDefault(); if (evt) evt.returnValue = false; return false; } else { return true; } } function outlinks(e) { var hostname = window.location.hostname; hostname = hostname.replace("www.","").toLowerCase(); $(((e&&e.id)?'#'+e.id+' ':'body')+" a").each(function(){href = String($(this).attr("href")).toLowerCase(); if((href.indexOf("https://")!=-1 || href.indexOf("http://")!=-1) && href.indexOf(hostname)==-1) $(this).not(".not").addClass("out");}); linky = $(((e&&e.id)?'#'+e.id+' ':'')+'a.out'); for (var i = 0, j = linky.length; i < j; i++) { // linky[i].setAttribute("target","_blank"); linky.get(i).setAttribute("onclick","return outlink(this.href)"); } }