var lang = ""; var controller = "kontakt"; var action = "manazerbsq"; var searchString = ""+"…"; $(document).ready(function(){ $("a[rel^='prettyPhoto']").prettyPhoto({theme:'light_square',social_tools:false, deeplinking: false, overlay_gallery: true}); // kraceni pro jednotlive stranky $('.short').ellipsis(); // image lazy loading $("img.lazyload").lazyload(); var top = 275; $(window).scroll(function (event) { // what the y position of the scroll is var y = $(this).scrollTop(); var iw = $('body').innerWidth(); // whether that's below the form if (y >= top) { // && (iw > 767) $( "#menu" ).addClass( "over", function() { // Animation complete $( "#header-2" ).css( "top","0px"); $( "#header-2" ).css( "position","fixed"); $( "#box" ).css( "margin-top","65px"); }); // alert(y); } else { $( "#menu" ).removeClass( "over", function() { // Animation complete $( "#header-2" ).css( "top",""); $( "#header-2" ).css( "position","relative"); $( "#box" ).css( "margin-top",""); }); } }); var animstart = $.cookies.get('animstart'); // alert(animstart); if(controller == "index" && action != 'detail' && animstart != 1){ // set cookie $.cookies.set('animstart', 1); setTimeout (function () { // $("#bg-top-main-start-1").show(); $("#bg-top-main-start-1").fadeIn(1000, function() { setTimeout (function () { $("#bg-top-main-img-1").fadeIn(1000, function() { setTimeout (function () { $("#bg-top-main-img-2").fadeIn(1000, function() { setTimeout (function () { $("#bg-top-main-img-3").fadeIn(1000, function() { setTimeout (function () { $("#bg-top-main-img-4").fadeIn(1000, function() { setTimeout (function () { $("#bg-top-main-start-2").fadeIn(1000, function() { setTimeout (function () { $("#bg-top-main-start-3").fadeIn(1000, function() { $("#bg-top-main-start-2").hide(); // alert('Sliding!'); setTimeout (function () { $("#menu-slide-2").fadeIn(1000, function() { $("#menu-slide-1").hide(); $('#slides').slidesjs({ width: 760, height: 270, start: 1, preload: true, navigation: { effect: "fade" }, pagination: { effect: "fade" }, effect: { fade: { speed: 4000 } }, callback: { complete: function(number) { // Use your browser console to view log // console.log('SlidesJS: Loaded with slide #' + number); $.cookies.set('animstartslide', number); } }, play: { active: false, // [boolean] Generate the play and stop buttons. // You cannot use your own buttons. Sorry. effect: "fade", // [string] Can be either "slide" or "fade". interval: 4000, // [number] Time spent on each slide in milliseconds. auto: true, // [boolean] Start playing the slideshow on load. swap: true, // [boolean] show/hide stop and play buttons pauseOnHover: true, // [boolean] pause a playing slideshow on hover restartDelay: 2000 // [number] restart delay on inactive slideshow } }); }); }, 700); }); }, 500); $("#bg-top-main-start-1").hide(); }); }, 200); }); }, 200); }); }, 200); }); }, 200); }); }, 200); }); }, 1000); }else{ $("#menu-slide-2").fadeIn(50); $("#menu-slide-1").hide(); // var startslide = Math.floor((Math.random() * 34) + 1); // alert('start: ' + startslide); // $.cookies.set('animstartslide', 5); var startslide = $.cookies.get('animstartslide'); if(!(startslide > 0)){ startslide = 1; } $('#slides').slidesjs({ width: 760, height: 270, start: startslide, preload: true, navigation: { effect: "fade" }, pagination: { effect: "fade" }, effect: { fade: { speed: 3000 } }, callback: { complete: function(number) { // Use your browser console to view log // console.log('SlidesJS: Loaded with slide #' + number); $.cookies.set('animstartslide', number); } }, play: { active: false, // [boolean] Generate the play and stop buttons. // You cannot use your own buttons. Sorry. effect: "fade", // [string] Can be either "slide" or "fade". interval: 5000, // [number] Time spent on each slide in milliseconds. auto: true, // [boolean] Start playing the slideshow on load. swap: true, // [boolean] show/hide stop and play buttons pauseOnHover: true, // [boolean] pause a playing slideshow on hover restartDelay: 2000 // [number] restart delay on inactive slideshow } }); } $("a#menu-b-hledat").unbind("click").click(function(){ if ($("#box-hledat").is(":hidden")){ $("#box-hledat").slideDown("fast"); } else{ $("#box-hledat").slideUp("fast"); } }); $("input#hledat").click(function(){ var hledat = $("input#hledat").val(); if(hledat == "hledat"){ $("input#hledat").val(''); $("input#hledat").css("color","#ffffff"); }else{ this.select(); } }); $("input#hledat").blur(function(){ var hledat = $("input#hledat").val(); if(hledat == ""){ $("input#hledat").val('hledat'); $("input#hledat").css("color","#7777777"); } $("#box-hledat").slideUp("fast"); }); $("a#b-hledat").click(function(){ var hledat = $("input#hledat").val(); //alert('hooolaaaa'); if(hledat != "" && hledat != "hledat"){ $('#search').submit(); }else{ alert('Zadejte prosím výraz, který chcete vyhledat.'); } // location.href = "/cs/clanky/index/hledat/" + $.URLEncode(hledat); //console.log(location.href);exit; //location.href = "/cs/clanky/index/hledat/" + encodeURIComponent(hledat); }); });