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); }); } var fixFixer = false; var fixFixerTimer = false; function fixerFix(e) { fixFixer = true; fixFixerTimer = window.setInterval(function(){$(".fixer").css({height:$(e).height()+"px"})},10); window.setTimeout(function(){fixFixer = false;window.clearTimeout(fixFixerTimer);},200); } function onresize() { if($("#menu").length) menuOffset = Math.round($("#menu").offset().top); $('header').attr({style:""}).trigger('detach.ScrollToFixed');$(".fixer").remove(); if(($(window).width()>991) && ($(window).height()+$("header").height())) $("header").scrollToFixed({postUnfixed:function() {fixerFix("header");},postFixed:function() {fixerFix("header");},dontSetWidth:true,spacerClass:"fixer"}); resrc(); } var hash = ""; var $w = 0; function welcome() { w = setTimeout(function(){ $(".welcome").last().before("
").fadeOut(1000,function(){$("#slide1.welcome").remove(); $(".welcome").delay(1000).fadeOut(1500,function(){$(".welcome").remove();}); }); }, 1000); $(document).on("click",".welcome a",function(e){e.preventDefault();clearTimeout(w);$(".welcome").stop(true).fadeOut(500);}); } $(document).ready(function(){ $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: "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; }); $("#malelogo").on("click",function(e){ $.scrollTo(0,1000); }); 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(); $("#poptavka form").on("submit",function(e){ e.preventDefault(); if(($btn=$(this).find(".button")).hasClass("moment")) ; else { $btn.addClass("moment"); $.post(PATH+"poptavka.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 getElementsByClassJmeno(strClass, strTag, objContElm) { strTag = strTag || "*"; objContElm = objContElm || document; var objColl = objContElm.getElementsByTagName(strTag); if (!objColl.length && strTag == "*" && objContElm.all) objColl = objContElm.all; var arr = new Array(); var delim = strClass.indexOf('|') != -1 ? '|' : ' '; var arrClass = strClass.split(delim); for (var i = 0, j = objColl.length; i < j; i++) { var arrObjClass = objColl[i].className.split(' '); if (delim == ' ' && arrClass.length > arrObjClass.length) continue; var c = 0; comparisonLoop: for (var k = 0, l = arrObjClass.length; k < l; k++) { for (var m = 0, n = arrClass.length; m < n; m++) { if (arrClass[m] == arrObjClass[k]) c++; if (( delim == '|' && c == 1) || (delim == ' ' && c == arrClass.length)) { arr.pushit(objColl[i]); break comparisonLoop; } } } } return arr; } Array.prototype.pushit = function(value) { this[this.length] = value; } function protectit(cl,slovo) { mejly = getElementsByClassJmeno(cl,'a'); for (var i = 0, j = mejly.length; i < j; i++) { var mejl = (mejly[i].title) ? mejly[i].title.split(slovo) : mejly[i].innerHTML.split(slovo); antiSpam.mailTo(mejly[i], { 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; realemail = email + '@' + domain; email = email + '@​' + domain; a.href = 'mailto:' + realemail; 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(); $("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 = getElementsByClassJmeno('out','a',document.getElementById(e)); for (var i = 0, j = linky.length; i < j; i++) { // linky[i].setAttribute("target","_blank"); linky[i].setAttribute("onclick","return outlink(this.href)"); } } /* SCROLLTOFIXED */ (function(a){a.isScrollToFixed=function(b){return !!a(b).data("ScrollToFixed")};a.ScrollToFixed=function(d,i){var m=this;m.$el=a(d);m.el=d;m.$el.data("ScrollToFixed",m);var c=false;var H=m.$el;var I;var F;var k;var e;var z;var E=0;var r=0;var j=-1;var f=-1;var u=null;var A;var g;function v(){H.trigger("preUnfixed.ScrollToFixed");l();H.trigger("unfixed.ScrollToFixed");f=-1;E=H.offset().top;r=H.offset().left;if(m.options.offsets){r+=(H.offset().left-H.position().left)}if(j==-1){j=r}I=H.css("position");c=true;if(m.options.bottom!=-1){H.trigger("preFixed.ScrollToFixed");x();H.trigger("fixed.ScrollToFixed")}}function o(){var J=m.options.limit;if(!J){return 0}if(typeof(J)==="function"){return J.apply(H)}return J}function q(){return I==="fixed"}function y(){return I==="absolute"}function h(){return !(q()||y())}function x(){if(!q()){var J=H[0].getBoundingClientRect();u.css({display:H.css("display"),width:J.width,height:J.height,"float":H.css("float")});cssOptions={"z-index":m.options.zIndex,position:"fixed",top:m.options.bottom==-1?t():"",bottom:m.options.bottom==-1?"":m.options.bottom,"margin-left":"0px"};if(!m.options.dontSetWidth){cssOptions.width=H.css("width")}H.css(cssOptions);H.addClass(m.options.baseClassName);if(m.options.className){H.addClass(m.options.className)}I="fixed"}}function b(){var K=o();var J=r;if(m.options.removeOffsets){J="";K=K-E}cssOptions={position:"absolute",top:K,left:J,"margin-left":"0px",bottom:""};if(!m.options.dontSetWidth){cssOptions.width=H.css("width")}H.css(cssOptions);I="absolute"}function l(){if(!h()){f=-1;u.css("display","none");H.css({"z-index":z,width:"",position:F,left:"",top:e,"margin-left":""});H.removeClass("scroll-to-fixed-fixed");if(m.options.className){H.removeClass(m.options.className)}I=null}}function w(J){if(J!=f){H.css("left",r-J);f=J}}function t(){var J=m.options.marginTop;if(!J){return 0}if(typeof(J)==="function"){return J.apply(H)}return J}function B(){if(!a.isScrollToFixed(H)||H.is(":hidden")){return}var M=c;var L=h();if(!c){v()}else{if(h()){E=H.offset().top;r=H.offset().left}}var J=a(window).scrollLeft();var N=a(window).scrollTop();var K=o();if(m.options.minWidth&&a(window).width()m.options.maxWidth){if(!h()||!M){p();H.trigger("preUnfixed.ScrollToFixed");l();H.trigger("unfixed.ScrollToFixed")}}else{if(m.options.bottom==-1){if(K>0&&N>=K-t()){if(!L&&(!y()||!M)){p();H.trigger("preAbsolute.ScrollToFixed");b();H.trigger("unfixed.ScrollToFixed")}}else{if(N>=E-t()){if(!q()||!M){p();H.trigger("preFixed.ScrollToFixed");x();f=-1;H.trigger("fixed.ScrollToFixed")}w(J)}else{if(!h()||!M){p();H.trigger("preUnfixed.ScrollToFixed");l();H.trigger("unfixed.ScrollToFixed")}}}}else{if(K>0){if(N+a(window).height()-H.outerHeight(true)>=K-(t()||-n())){if(q()){p();H.trigger("preUnfixed.ScrollToFixed");if(F==="absolute"){b()}else{l()}H.trigger("unfixed.ScrollToFixed")}}else{if(!q()){p();H.trigger("preFixed.ScrollToFixed");x()}w(J);H.trigger("fixed.ScrollToFixed")}}else{w(J)}}}}}function n(){if(!m.options.bottom){return 0}return m.options.bottom}function p(){var J=H.css("position");if(J=="absolute"){H.trigger("postAbsolute.ScrollToFixed")}else{if(J=="fixed"){H.trigger("postFixed.ScrollToFixed")}else{H.trigger("postUnfixed.ScrollToFixed")}}}var D=function(J){if(H.is(":visible")){c=false;B()}else{l()}};var G=function(J){(!!window.requestAnimationFrame)?requestAnimationFrame(B):B()};var C=function(){var K=document.body;if(document.createElement&&K&&K.appendChild&&K.removeChild){var M=document.createElement("div");if(!M.getBoundingClientRect){return null}M.innerHTML="x";M.style.cssText="position:fixed;top:100px;";K.appendChild(M);var N=K.style.height,O=K.scrollTop;K.style.height="3000px";K.scrollTop=500;var J=M.getBoundingClientRect().top;K.style.height=N;var L=(J===100);K.removeChild(M);K.scrollTop=O;return L}return null};var s=function(J){J=J||window.event;if(J.preventDefault){J.preventDefault()}J.returnValue=false};m.init=function(){m.options=a.extend({},a.ScrollToFixed.defaultOptions,i);z=H.css("z-index");m.$el.css("z-index",m.options.zIndex);u=a("
");I=H.css("position");F=H.css("position");k=H.css("float");e=H.css("top");if(h()){m.$el.after(u)}a(window).bind("resize.ScrollToFixed",D);a(window).bind("scroll.ScrollToFixed",G);if("ontouchmove" in window){a(window).bind("touchmove.ScrollToFixed",B)}if(m.options.preFixed){H.bind("preFixed.ScrollToFixed",m.options.preFixed)}if(m.options.postFixed){H.bind("postFixed.ScrollToFixed",m.options.postFixed)}if(m.options.preUnfixed){H.bind("preUnfixed.ScrollToFixed",m.options.preUnfixed)}if(m.options.postUnfixed){H.bind("postUnfixed.ScrollToFixed",m.options.postUnfixed)}if(m.options.preAbsolute){H.bind("preAbsolute.ScrollToFixed",m.options.preAbsolute)}if(m.options.postAbsolute){H.bind("postAbsolute.ScrollToFixed",m.options.postAbsolute)}if(m.options.fixed){H.bind("fixed.ScrollToFixed",m.options.fixed)}if(m.options.unfixed){H.bind("unfixed.ScrollToFixed",m.options.unfixed)}if(m.options.spacerClass){u.addClass(m.options.spacerClass)}H.bind("resize.ScrollToFixed",function(){u.height(H.height())});H.bind("scroll.ScrollToFixed",function(){H.trigger("preUnfixed.ScrollToFixed");l();H.trigger("unfixed.ScrollToFixed");B()});H.bind("detach.ScrollToFixed",function(J){s(J);H.trigger("preUnfixed.ScrollToFixed");l();H.trigger("unfixed.ScrollToFixed");a(window).unbind("resize.ScrollToFixed",D);a(window).unbind("scroll.ScrollToFixed",G);H.unbind(".ScrollToFixed");u.remove();m.$el.removeData("ScrollToFixed")});D()};m.init()};a.ScrollToFixed.defaultOptions={marginTop:0,limit:0,bottom:-1,zIndex:1000,baseClassName:"scroll-to-fixed-fixed"};a.fn.scrollToFixed=function(b){return this.each(function(){(new a.ScrollToFixed(this,b))})}})(jQuery);