(function(a){(jQuery.browser=jQuery.browser||{}).mobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))})(navigator.userAgent||navigator.vendor||window.opera);
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;
$(this).attr("src",$src);
});
}
var slideDva = 0;
var slideTri = 0;
var slideCtyri = 0;
var slides = false;
var slide = 0;
function uvodniFoto() {
$e = $("#uvod .bg").eq(0);
slide++;
$e.before("
");
if(slide>=slides.length) slide=0;
$e.prev().css({opacity:0}).animate({opacity:1},1500);
setTimeout(function(){
$e.css({opacity:1}).animate({opacity:0},1500,function(){$e.remove();});
},60);
}
function odskrol($e) {
$.scrollTo($("#"+$e).offset().top-$("header").height(),1000,{axis:'y'});
}
var $uf;
$(document).ready(function(){
slideDva = $("#uvod .bg").eq(0).data("slide-2");
slideTri = $("#uvod .bg").eq(0).data("slide-3");
slideCtyri = $("#uvod .bg").eq(0).data("slide-4");
slides = (slideCtyri) ? [0,slideDva,slideTri,slideCtyri] : [0,slideDva,slideTri];
var pagesections = new Object();
$nav = "";
if($("main section").length) {
for(i=0;i<$("section").length;i++) {
sectionid = $("section").eq(i).prop("id");
h = $("section").eq(i).find("h1").eq(0);
if(h.length==0) h = $("section").eq(i).find("h2").eq(0);
if(h.length!=0) pagesections[sectionid] = (h.text()) ? h.text() : sectionid;
}
$("main").before($nav);
for(i in pagesections) {if(pagesections[i]) $("#sectionnav").append(""+pagesections[i]+"");}
}
$("#sectionnav a").on("click",function(){$(this).tooltip('hide');odskrol($(this).data("href"));$(this).blur();return false;});
$("#gotoup").on("click",function(e){
e.preventDefault(); $("#bread .breadMain").click(); return false;
});
$("#form_zajem_prohlidka").on("change",function(e){
if($(this).prop("checked")==true) $("#jazykProhlidky").slideDown(500); else $("#jazykProhlidky").slideUp(500);
});
waypoints = $('section');
waypoints.waypoint(function(direction) {
if (direction === 'down') {
if((sectionnavlink=$("#sectionnav a[data-href='"+this.element.id+"']")).length) {
$("#sectionnav a.cur").removeClass("cur");
sectionnavlink.addClass("cur");
}
}
},{offset:'50%'});
waypoints.waypoint(function(direction) {
if (direction === 'up') {
if((sectionnavlink=$("#sectionnav a[data-href='"+this.element.id+"']")).length) {
$("#sectionnav a.cur").removeClass("cur");
sectionnavlink.addClass("cur");
}
}
},{offset:'0%'});
$('[data-toggle="tooltip"]').tooltip({'container':'body'});
$uf = setInterval('uvodniFoto();',8500);
$(window).on("resize",function(){
if($("#nav").width()+30 > $(".container").last().offset().left) $("#bread").css({paddingLeft:($("#nav").width()+30)-($(".container").last().offset().left)+"px"}); else $("#bread").css({paddingLeft:0});
});
if($("#nav").width()+30 > $(".container").last().offset().left) $("#bread").css({paddingLeft:($("#nav").width()+30)-($(".container").last().offset().left)+"px"}); else $("#bread").css({paddingLeft:0});
$(document).on("click",".breadMain",function(){$.scrollTo(0,1000);});
if($(window).scrollTop()>20) $("#gotoup").addClass("ukaz"); else if($("#gotoup").removeClass("ukaz")) ; else $("#gotoup").removeClass("ukaz");
$(document).on("scroll",function(){
if($(window).scrollTop()>20) $("#gotoup").addClass("ukaz"); else if($("#gotoup").removeClass("ukaz")) ; else $("#gotoup").removeClass("ukaz");
if($(document).scrollTop()>$("main h1").eq(0).offset().top) $("#bread").addClass("scrolled");
else $("#bread").removeClass("scrolled");
})
$("body").removeClass("no-js").addClass("js");
$w = $(window).width();
resrc();
//$("#main").disableSelection();
// $("a").click(function(){$(this).blur();return true;});
$("a.down").on("click",function(e){
e.preventDefault(); odskrol($(this).prop("href").split("#")[1]); return false;
});
$("form .icon-cal2").click(function(){
if($("#ui-datepicker-div:visible").length) $("#form_datum").datepicker("hide"); else $("#form_datum").datepicker("show");
});
$("#proFirmyInput").val(0);
$("#proFirmyBtn").click(function(){
$("#proFirmyInput").val(1);
$("#proFirmy").slideDown(500);
$(this).css({display:"none"});;
$("#proNeFirmyBtn").css({display:"inline-block"});
return false;
});
$("#proNeFirmyBtn").click(function(){
$("#proFirmyInput").val(0);
$("#proFirmy").slideUp(500);
$(this).css({display:"none"});
$("#proFirmyBtn").css({display:"inline-block"});
return false;
});
$("#switchMenu").click(function(){
$("#menuWrap").addClass("active");
});
$("#menuClose,#menuWrap").click(function(){
$("#menuWrap").removeClass("active");
});
$("#menuContainer a").click(function(){
$("#menuWrap").removeClass("active");
window.location.href = $(this).prop("href");
return false;
});
$("#menuContainer").click(function(e){
e.stopPropagation();
return false;
});
$("header").scrollToFixed();
var disabledDates = {"2016-05-14":""};
$("#form_datum").datepicker({minDate:2,
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:00",dynamic:false,minHour:9,maxHour:22,scrollbar:true});
$(document).on("mouseenter","td.ui-datepicker-unselectable",function(){
if(title = $(this).attr("title")) {
$(this).data("title",title).prop("title","");
$(this).closest(".ui-datepicker-calendar").after(""+title+"
");
$(".datepicker-alert").css({maxHeight:0}).animate({maxHeight:"200px"},200);
}
return true;
});
$(document).on("mouseleave","td.ui-datepicker-unselectable",function(){
if(title = $(this).data("title")) {
$(this).prop("title",title).data("title","");
$(this).closest(".ui-datepicker-calendar").next(".datepicker-alert").remove();
}
return true;
});
var lastY = 0;
var currentY = 0;
var curD = false;
$(document).on('touchstart', function (e){
lastY = e.originalEvent.touches[0].clientY;
});
$(document).on("touchmove mousewheel DOMMouseWheel","#menuWrap",function(event){
if(event.originalEvent.touches && (currentY = event.originalEvent.touches[0].clientY))
curD = (currentY>lastY) ? 1 : -1;
else if(delta = (event.type == 'DOMMouseScroll' ?
event.originalEvent.detail * -40 :
event.originalEvent.wheelDelta)) {
curD = (delta>0) ? 1 : ((delta<0) ? -1 : 0);
}
if((curD<0 && ($("#menuContainer").scrollTop()>=0 && ($("#menuContainer > ul").outerHeight()+20-$("#menuContainer").scrollTop())>$(window).height())) || (curD>0 && ($("#menuContainer").scrollTop()>0)))
{
if(event.target.closest("#menuContainer"))
event.stopPropagation();
return true;
}
{
event.preventDefault();
event.stopPropagation();
return false;
}
});
if(!$.browser.mobile) {
var s = skrollr.init({
edgeStrategy: 'set',
smoothScrolling: true
});
$("body").css({height:"auto"});
}
outlinks();
$("img.linked")
.on("mouseover",function(e){
$(this).closest(".row").find("a.more").eq(0).addClass("hover");
})
.on("mouseout",function(e){
$(this).closest(".row").find("a.more").eq(0).removeClass("hover");
})
.on("click",function(){
location.href = $(this).closest(".row").find("a.more").eq(0).prop("href");
});
});
/*
(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();
e = (e) ? e : "body a";
$(e).each(function(){href = String($(this).attr("href")).toLowerCase(); if(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)");
}
}