function changeCity(mesto) { $('#weatherWidgetInner').fadeOut(); $.get("https://www.bebuzz.co.uk/js/ajaxHandler.php", {op:'weatherWidget', mesto: mesto}, function(data) { $('#weatherWidgetInner').html(data); $('#weatherWidgetInner').fadeIn(); }); } // input len s cislom, clas numeric function initNumericInput() { $('input.numeric').keydown(function(event){ if ( event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 || (event.keyCode == 65 && event.ctrlKey === true) || (event.keyCode >= 35 && event.keyCode <= 39)) { return; } else { if ( event.shiftKey|| (event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105 ) ) { event.preventDefault(); } } }); } function openPopup(file,width,height) { var param = "width=" + width + ",height=" + height + ",statusbar=0,menubar=0"; newwin = window.open(file, "preview", param); newwin.moveTo(screen.width/2 - width/2, 200); return false; } function openprint(idecko, formPrint, formUserId) { var screenW = 640; if (parseInt(navigator.appVersion) > 3) { screenW = screen.width; } else if (navigator.appName == "Netscape" && parseInt(navigator.appVersion)==3 && navigator.javaEnabled() ) { var jToolkit = java.awt.Toolkit.getDefaultToolkit(); var jScreenSize = jToolkit.getScreenSize(); screenW = jScreenSize.width; } var param = "width=700,height=700,statusbar=0,menubar=0,scrollbars=1"; var file = ""; if(formPrint != 1) { file = "https://www.bebuzz.co.uk/print.php?id=" + idecko; } else { file = "https://www.bebuzz.co.uk/print.php?id=" + idecko + "&formPrint=1&formUserId=" + formUserId; } newwin = window.open(file, "print", param); newwin.moveTo(screenW.width/2 - screenW/2, 200); return false; } function uncheckAllRadios(whichForm, otazkaId) { var otazka = 'radio_answer_' + otazkaId; radios = document.getElementsByName(otazka); for (var i = 0; i < radios.length; i++) { radios[i].checked = false; } } function setSmile(add,where) { add = 'smile '; inst = tinyMCE.getInstanceById(where); inst.execCommand('mceInsertContent',false, add); } // custom in-content slide toogle function toogleContentById(byId) { var c = '#' + byId; $(c).slideToggle(400); return false; } // custom UI dialog function openViaDialog(dialogText, dialogTitle) { $('body').append(''); $('#inlineDialogHiddenContent').dialog( { modal: true, title: dialogTitle, buttons: { "close": function() { $(this).dialog("close"); } }, close: function(event, ui) { $('#inlineDialogHiddenContent').remove(); } }); return false; } function getUrlVars() { var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for(var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; } function validateEmail(email) { var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; if( !emailReg.test( email ) ) { return false; } else { return true; } } // ------------------------------------------------------------- $(document).ready(pageLoaded); function pageLoaded() { if (location.hash == '' ) { if ($('.sortKategorie').length > 0) { $('.sortKategorie').sortable({containment: "parent", axis: "y",items:".categoryBranch", update: sortEndCategories}); } } if ($('.parentSortCat').length > 0) { $(".parentSortCat").sortable({containment: "parent", axis: "y",items:".artSort", update: sortEndArticles }); } $('.condition img').click(function(){ window.open("http://pocasie.aktuality.sk/"); }); //animacia infoBox $(".infoBox").css('background-color', '#ff0000').animate({backgroundColor: "#fff"}, 1000); $("a[href*='http://docs.google.com/gview']").each(function() { var pdfFile = $(this).attr('href').replace("http://docs.google.com/gview?url=", "").replace("&embedded=true&iframe", "").replace("&iframe&embedded=true", "").replace("&embedded=true", ""); $(this).after(" (download file)") }); $('a[rel*="external"]').click( function() { window.open($(this).attr('href')); return false; }).addClass('ext');; $("a[rel='openLoginForm']").click( function() { var lstr = '
'; openViaDialog(lstr, 'Sign in'); return false; }); if($('#inputName').val()) { $('#inputNameLabel').css('display', 'none'); } if($('#inputPass').val()) { $('#inputPassLabel').css('display', 'none'); } if($(".calendar").length || $("#calendar").length) { jQuery(function($){ $.datepicker.regional['sk'] = { closeText: 'Zavrieť', prevText: 'Predchádzajúci', nextText: 'Nasledujúci', currentText: 'Dnes', monthNames: ['Január','Február','Marec','Apríl','Máj','Jún','Júl','August','September','Október','November','December'], monthNamesShort: ['Jan','Feb','Mar','Apr','Máj','Jún','Júl','Aug','Sep','Okt','Nov','Dec'], dayNames: ['Nedeľa','Pondelok','Utorok','Streda','Štvrtok','Piatok','Sobota'], dayNamesShort: ['Ned','Pon','Uto','Str','Štv','Pia','Sob'], dayNamesMin: ['Ne','Po','Ut','St','Št','Pi','So'], weekHeader: 'Ty', dateFormat: 'dd.mm.yy', firstDay: 1, isRTL: false, showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['sk']); }); $(".calendar").datepicker({ yearRange: "-90:+0", changeMonth: true, changeYear: true, showOtherMonths: true, showOn: 'both', buttonImage: 'https://www.bebuzz.co.uk/styles/Default_Style/design/icons/calendar.gif', buttonImageOnly: true }); $.ajax( { url: "https://www.bebuzz.co.uk/js/ajaxHandler.php?op=showdates", dataType: "json", success: function(calendarEvents) { $("#calendar").datepicker( { onSelect: function(dateText, inst) { if(calendarEvents.length == 1) { window.location = "https://www.bebuzz.co.uk/c-" + calendarEvents[0][4] + "/"; } else { window.location = "https://www.bebuzz.co.uk/?go=2&s=1&searchIn=all&pf=" + dateText + "&pt=" + dateText + "&c=on&sopn=on"; } }, changeMonth: true, changeYear: true, showCurrentAtPos: 0, beforeShowDay: function (date) { for (i = 0; i < calendarEvents.length; i++) { if (date.getMonth() == calendarEvents[i][0] - 1 && date.getDate() == calendarEvents[i][1] && date.getFullYear() == calendarEvents[i][2]) { return [true,"ui-state-active",calendarEvents[i][3]]; } } return [false, ""];//enable all other days } }); } }); } $('#scrollToTop').click(function() { $('html, body').animate({ scrollTop: $("#top").offset().top - 180 }, 500); }); /* set variables locally for increased performance */ var scroll_timer; var displayed = false; var $message = $('#scrollToTop'); var $window = $(window); var top = $(document.body).children(0).position().top; /* react to scroll event on window */ $window.scroll(function () { window.clearTimeout(scroll_timer); scroll_timer = window.setTimeout(function () { if($window.scrollTop() <= top) { displayed = false; $message.fadeOut(500); } else if(displayed == false) { displayed = true; $message.stop(true, true).fadeIn(500).click(function () { $message.fadeOut(500); }); } }, 50); }); //openSmoothPopup = fancybox() $('a[rel*="openSmoothPopup"]').each(function(){ $(this).attr('data-lightbox', 'openSmoothPopup'); }); //load custom data via ajax $('a[rel*="loadAjaxContent"]').click(loadAjaxContentCall); function loadAjaxContentCall(e) { var thisHref = $(this).attr('href'); var thisRel = $(this).attr("rel").split(','); if(thisRel.length > 1) { var targetId = '#' + thisRel[1]; } else { var targetId = '#contentWrapper'; } $(targetId + " > *").animate({opacity: 0}, function() { //ajax content loading $.ajax( { url: thisHref, data: "ajax=1", async: false, beforeSend : function(XMLHttpRequest) { //$.fancybox.showActivity(); }, complete: function(XMLHttpRequest, status) { $("#ajaxLoading").remove(); $(targetId + " > *").animate({opacity: 1}, function() { //$.fancybox.hideActivity(); pageLoaded(); } ); }, success: function(html, status) { $(targetId).html(html); } } ); } ); return false; } var activeCurrent = $("#navi li.active:first"); $("#navi li:not('ul li ul li')").hover( function(e) { $(this).addClass("activeMenu"); $(this).parent().children("li.active").removeClass("active"); }, function(e) { $(this).removeClass("activeMenu"); if(activeCurrent.length) { activeCurrent.addClass("active"); } }); } /* pageLoaded */ function openImageManager(fields) { moxman.browse({ extensions : 'jpg,png,gif', no_host: true, view: 'thumbs', fields: fields, title: 'Image Manager' }); }; function openFileManager(fields) { moxman.browse({ no_host: true, fields: fields, title: 'File Manager' }); }; var slideshowSpeed = 6000; var fadeSpeed = 2000; var interval; var activeContainer = 1; var currentImg = 1; var animating = false; var currentZindex = -1; $(window).load(function(){ if ($('#slides').length > 0 ) { $("#slidesImg1").fadeIn(fadeSpeed, function(){ $("#slidesImg2").show(); runSlides(); }); } $("#slide_prev").click(function() { navigate("back"); }); // Forward navigation $("#slide_next").click(function() { navigate("next"); }); }); var runSlides = function() { interval = setInterval(function() { navigate("next"); }, slideshowSpeed); }; var stopSlides = function() { clearInterval(interval); }; var navigate = function(direction) { if(animating) return; if(direction == "next") { currentImg++; if(currentImg == photos.length + 1) { currentImg = 1; } } else { currentImg--; if(currentImg == 0) { currentImg = photos.length; } } var currentContainer = activeContainer; if(activeContainer == 1) { activeContainer = 2; } else { activeContainer = 1; } showImage(photos[currentImg - 1], currentContainer, activeContainer); }; var showImage = function(photoObject, currentContainer, activeContainer) { animating = true; currentZindex--; $("#slidesImg" + activeContainer).css({ "background-image" : "url(" + photoObject.image + ")", "display" : "block", "z-index" : currentZindex }); $("#slidesImg" + activeContainer).fadeIn(fadeSpeed); $("#slidesImg" + currentContainer).fadeOut(fadeSpeed, function() { animating = false; }); }; $(document).ready( function() { $('img').each(function(){ if ($(this).width() > $('.articleWrapper ').width() ) { $(this).width($('.articleWrapper ').width()); $(this).height('auto'); } }); /* MENU */ $('#navi li:last-child').addClass("last"); $('#navi li:first-child').addClass("first"); if ($('.cookieBox').length > 0) { $('.cookieBox').show(1000); } $('#id_cookieOk').click(function(){ $('.cookieBox').hide(500, function(){ var currdate = new Date(); var expirationdate = new Date(currdate.getTime() + 8640000000); // 100 dni var cookie = "consent=true;expires=" + expirationdate.toGMTString()+";path=/"; document.cookie=cookie; window.location.reload(true); }); }); $('#policy_personalisation_on').click(function(){ var cookie = "disablechat=true;expires=" + new Date(0).toUTCString() +";path=/"; document.cookie=cookie; window.location.reload(true); }); $('#policy_personalisation_off').click(function(){ var currdate = new Date(); var expirationdate = new Date(currdate.getTime() + 8640000000); // 100 dni var cookie = "disablechat=true;expires=" + expirationdate.toGMTString()+";path=/"; document.cookie=cookie; var cookie = "lctpref=;expires=" + new Date(0).toUTCString() +";path=/"; document.cookie=cookie; window.location.reload(true); }); $('#news_name').hide(); //$('a.btnMore').html('MORE >'); }); $(document).scroll(function(e){ var scrollAmount = $(window).scrollTop(); var top = parseInt( scrollAmount/1.7); $('.slide').css('top',top+'px'); $('.slidesWrapper iframe').css('margin-top',top+'px'); $('.slidesImg').css('top',top+'px'); if (top > 250) { $('.slidesWrapper').css('opacity', 0); } else { $('.slidesWrapper').css('opacity', 1); } }); function checkSendFileForm(form) { ret = true; if ( $(form).find("input[name='name']").val() == '' ) { ret = false; } ret = ret && validateEmail( $(form).find("input[name='email']").val()); if (! ret) { alert('You must fill your name and email'); } else { alert('Thank You. We will contact you as soon as possible'); } return ret; } function newsblog() { if ( validateEmail( $('#news_mail').val() ) ) { $('


').dialog({ modal: true, buttons: { Ok: function() { email = $('#news_mail').val(); $.get("/js/ajaxHandler.php", {op: 'insertemail', email: email}, function(data){}); $( this ).dialog( "close" ); $( this ).remove(); } } }); } else { $('

Please, insert correct e-mail

').dialog({ modal: true, buttons: { Ok: function() { $( this ).dialog( "close" ); $( this ).remove(); } } }); } return false; } /** * Lightbox v2.7.1 * by Lokesh Dhakar - http://lokeshdhakar.com/projects/lightbox2/ * * @license http://creativecommons.org/licenses/by/2.5/ * - Free for use in both personal and commercial projects * - Attribution requires leaving author name, author link, and the license info intact */ (function(){var a=jQuery,b=function(){function a(){this.fadeDuration=500,this.fitImagesInViewport=!0,this.resizeDuration=700,this.positionFromTop=50,this.showImageNumberLabel=!0,this.alwaysShowNavOnTouchDevices=!1,this.wrapAround=!1}return a.prototype.albumLabel=function(a,b){return"Image "+a+" of "+b},a}(),c=function(){function b(a){this.options=a,this.album=[],this.currentImageIndex=void 0,this.init()}return b.prototype.init=function(){this.enable(),this.build()},b.prototype.enable=function(){var b=this;a("body").on("click","a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]",function(c){return b.start(a(c.currentTarget)),!1})},b.prototype.build=function(){var b=this;a("
").appendTo(a("body")),this.$lightbox=a("#lightbox"),this.$overlay=a("#lightboxOverlay"),this.$outerContainer=this.$lightbox.find(".lb-outerContainer"),this.$container=this.$lightbox.find(".lb-container"),this.containerTopPadding=parseInt(this.$container.css("padding-top"),10),this.containerRightPadding=parseInt(this.$container.css("padding-right"),10),this.containerBottomPadding=parseInt(this.$container.css("padding-bottom"),10),this.containerLeftPadding=parseInt(this.$container.css("padding-left"),10),this.$overlay.hide().on("click",function(){return b.end(),!1}),this.$lightbox.hide().on("click",function(c){return"lightbox"===a(c.target).attr("id")&&b.end(),!1}),this.$outerContainer.on("click",function(c){return"lightbox"===a(c.target).attr("id")&&b.end(),!1}),this.$lightbox.find(".lb-prev").on("click",function(){return b.changeImage(0===b.currentImageIndex?b.album.length-1:b.currentImageIndex-1),!1}),this.$lightbox.find(".lb-next").on("click",function(){return b.changeImage(b.currentImageIndex===b.album.length-1?0:b.currentImageIndex+1),!1}),this.$lightbox.find(".lb-loader, .lb-close").on("click",function(){return b.end(),!1})},b.prototype.start=function(b){function c(a){d.album.push({link:a.attr("href"),title:a.attr("data-title")||a.attr("title")})}var d=this,e=a(window);e.on("resize",a.proxy(this.sizeOverlay,this)),a("select, object, embed").css({visibility:"hidden"}),this.sizeOverlay(),this.album=[];var f,g=0,h=b.attr("data-lightbox");if(h){f=a(b.prop("tagName")+'[data-lightbox="'+h+'"]');for(var i=0;ij||e.height>i)&&(e.width/j>e.height/i?(h=j,g=parseInt(e.height/(e.width/h),10),d.width(h),d.height(g)):(g=i,h=parseInt(e.width/(e.height/g),10),d.width(h),d.height(g)))),c.sizeContainer(d.width(),d.height())},e.src=this.album[b].link,this.currentImageIndex=b},b.prototype.sizeOverlay=function(){this.$overlay.width(a(window).width()).height(a(document).height())},b.prototype.sizeContainer=function(a,b){function c(){d.$lightbox.find(".lb-dataContainer").width(g),d.$lightbox.find(".lb-prevLink").height(h),d.$lightbox.find(".lb-nextLink").height(h),d.showImage()}var d=this,e=this.$outerContainer.outerWidth(),f=this.$outerContainer.outerHeight(),g=a+this.containerLeftPadding+this.containerRightPadding,h=b+this.containerTopPadding+this.containerBottomPadding;e!==g||f!==h?this.$outerContainer.animate({width:g,height:h},this.options.resizeDuration,"swing",function(){c()}):c()},b.prototype.showImage=function(){this.$lightbox.find(".lb-loader").hide(),this.$lightbox.find(".lb-image").fadeIn("slow"),this.updateNav(),this.updateDetails(),this.preloadNeighboringImages(),this.enableKeyboardNav()},b.prototype.updateNav=function(){var a=!1;try{document.createEvent("TouchEvent"),a=this.options.alwaysShowNavOnTouchDevices?!0:!1}catch(b){}this.$lightbox.find(".lb-nav").show(),this.album.length>1&&(this.options.wrapAround?(a&&this.$lightbox.find(".lb-prev, .lb-next").css("opacity","1"),this.$lightbox.find(".lb-prev, .lb-next").show()):(this.currentImageIndex>0&&(this.$lightbox.find(".lb-prev").show(),a&&this.$lightbox.find(".lb-prev").css("opacity","1")),this.currentImageIndex1&&this.options.showImageNumberLabel?this.$lightbox.find(".lb-number").text(this.options.albumLabel(this.currentImageIndex+1,this.album.length)).fadeIn("fast"):this.$lightbox.find(".lb-number").hide(),this.$outerContainer.removeClass("animating"),this.$lightbox.find(".lb-dataContainer").fadeIn(this.options.resizeDuration,function(){return b.sizeOverlay()})},b.prototype.preloadNeighboringImages=function(){if(this.album.length>this.currentImageIndex+1){var a=new Image;a.src=this.album[this.currentImageIndex+1].link}if(this.currentImageIndex>0){var b=new Image;b.src=this.album[this.currentImageIndex-1].link}},b.prototype.enableKeyboardNav=function(){a(document).on("keyup.keyboard",a.proxy(this.keyboardAction,this))},b.prototype.disableKeyboardNav=function(){a(document).off(".keyboard")},b.prototype.keyboardAction=function(a){var b=27,c=37,d=39,e=a.keyCode,f=String.fromCharCode(e).toLowerCase();e===b||f.match(/x|o|c/)?this.end():"p"===f||e===c?0!==this.currentImageIndex?this.changeImage(this.currentImageIndex-1):this.options.wrapAround&&this.album.length>1&&this.changeImage(this.album.length-1):("n"===f||e===d)&&(this.currentImageIndex!==this.album.length-1?this.changeImage(this.currentImageIndex+1):this.options.wrapAround&&this.album.length>1&&this.changeImage(0))},b.prototype.end=function(){this.disableKeyboardNav(),a(window).off("resize",this.sizeOverlay),this.$lightbox.fadeOut(this.options.fadeDuration),this.$overlay.fadeOut(this.options.fadeDuration),a("select, object, embed").css({visibility:"visible"})},b}();a(function(){{var a=new b;new c(a)}})}).call(this); //# sourceMappingURL=lightbox.min.map