function report(status, text) { if (status) jQuery("
"+text+"
").appendTo("#infocontainer").delay(200).fadeIn().delay(3500).fadeOut(); else jQuery("
"+text+"
").appendTo("#infocontainer").delay(200).fadeIn().delay(3500).fadeOut(); } jQuery("#fbLike0").hover(function(){ jQuery("#fbLike0").stop(true, false).animate({left:"0"},"medium"); },function(){ jQuery("#fbLike0").stop(true, false).animate({left:"-306"},"medium"); },500); jQuery("#fbLike1").hover(function(){ jQuery("#fbLike1").stop(true, false).animate({right:"0"},"medium"); },function(){ jQuery("#fbLike1").stop(true, false).animate({right:"-306"},"medium"); },500); jQuery(document).on("submit", "form[class!=send]", function(){ var form = jQuery(this); jQuery(form).find(".button").hide(); jQuery(form).find(".loader").show(); jQuery(form).ajaxSubmit({ target:'#answerForm', success: function(){ jQuery(form).find(".button").show(); jQuery(form).find(".loader").hide(); } }); return false; }); jQuery("#showmenu").click(function(){ jQuery(this).toggleClass('bg'); jQuery("#menu ul.main").toggle().addClass('r'); return false; }); function resize() { if (jQuery(window).width()>=1220) { jQuery('#home_blank').css('height', jQuery(window).height()-jQuery('#top').height()); } else { jQuery('#home_blank').css('height', 'auto'); } jQuery('#content').css('min-height', jQuery(window).height()-jQuery('#slider').outerHeight()-jQuery('#menu').outerHeight()-jQuery('#header').outerHeight() -jQuery('#footer').outerHeight()-jQuery('#footer_icons').outerHeight()-100+'px'); } jQuery(window).on('resize', function(){ if (jQuery(window).width()>=1220) { jQuery("#menu ul.main").show().removeClass('r'); } else { jQuery("#menu ul.main").addClass('r'); } jQuery('#menu ul ul').removeClass('dmenu'); jQuery('.fa-angle-up').removeClass('fa-angle-up').addClass('fa-angle-down'); resize(); }); resize(); jQuery('.image-popup').magnificPopup({ delegate: 'a.mgallery-photo', type: 'image', closeOnContentClick: true, closeBtnInside: false, fixedContentPos: true, mainClass: 'mfp-no-margins mfp-with-zoom', // class to remove default margin from left and right side image: { verticalFit: true }, gallery: { enabled: true, navigateByImgClick: true, preload: [0,1] // Will preload 0 - before current, and 1 after the current image }, zoom: { enabled: true, duration: 300 // don't foget to change the duration also in CSS } }); jQuery('.popup-youtube').magnificPopup({ disableOn: 700, type: 'iframe', mainClass: 'mfp-fade', removalDelay: 160, preloader: false, fixedContentPos: false }); jQuery('.action_more').click(function(){ jQuery(this).parent().find('.action_content').slideToggle(); return false; }); jQuery('.btn_login').click(function(){ jQuery("#account_header").toggle(); return false; }); jQuery('.tabs .nav a').click(function(){ var tabs = jQuery(this).parent().parent(); tabs.find('a').removeClass('bg'); jQuery(this).addClass('bg'); tabs.find('.tab').slideUp(); tabs.find('.'+jQuery(this).attr('rel')).slideDown(); return false; }); jQuery('.btn_color').click(function(){ jQuery('.btn_color').removeClass('bg'); jQuery(this).addClass('bg'); jQuery('#price').text(jQuery(this).attr('rel')); jQuery('#color_id').val(jQuery(this).attr('data-id')); return false; }); jQuery(document).ready(function(){ jQuery('.btn_color:first-child').click(); }); jQuery('#product_slider .images a').click(function(){ jQuery('#current_image').val(jQuery(this).attr('data-id')); jQuery('#main_image img').attr('src', jQuery(this).attr('href')); jQuery('#main_image a').attr('href', jQuery(this).attr('href')); jQuery('#product_slider .images a').removeClass('bg'); jQuery(this).addClass('bg'); jQuery('.btn_arrow_right, .btn_arrow_left').removeClass('disabled'); if (jQuery(this).hasClass('last')) jQuery('.btn_arrow_right').addClass('disabled'); if (jQuery(this).hasClass('first')) jQuery('.btn_arrow_left').addClass('disabled'); return false; }); jQuery('#product_slider .images a:first-child').click(); jQuery('.btn_arrow_right').click(function(){ var currentone = jQuery("#image"+jQuery("#current_image").val()); var next = jQuery(currentone).next(); jQuery(next).click(); return false; }); jQuery('.btn_arrow_left').click(function(){ var currentone = jQuery("#image"+jQuery("#current_image").val()); var next = jQuery(currentone).prev(); jQuery(next).click(); return false; }); var owl = $(".offers_slider"); owl.owlCarousel({ items: 3, pagination:false, loop:false, nav:true, navText: [" Poprzednie"," Następne"], autoPlay:true, autoPlay:3000, margin:10, stopOnHover:true, responsive:{ 0:{ items:1 }, 800:{ items:2 }, 1240:{ items:3 }, } }); var owl3 = $(".photos_slider"); owl3.owlCarousel({ items: 5, pagination:false, loop:false, nav:true, navText: [" Poprzednie"," Następne"], autoPlay:true, autoPlay:3000, margin:0, stopOnHover:true, responsive:{ 0:{ items:1 }, 420:{ items:2 }, 550:{ items:3 }, 700:{ items:2 }, 750:{ items:3 }, 970:{ items:4 }, 1240:{ items:5 }, } }); var owl2 = $(".home_rooms_slider"); owl2.owlCarousel({ items: 1, pagination:false, loop:false, nav:true, navText: [" Poprzednie"," Następne"], autoPlay:true, autoPlay:3000, margin:0, stopOnHover:true, }); jQuery('.btn_input_amount').keyup(function(){ jQuery('#answerForm').load('https://owbaltyk.com/update-shop/'+jQuery(this).attr('data-id')+'/'+jQuery(this).attr('data-id2')+'/'+jQuery(this).val()); return false; }); jQuery(document).on('change', '#delivery_country', function(){ jQuery('#answerForm').load('https://owbaltyk.com/delivery/'+jQuery('#delivery_country').val()); return false; }); jQuery('.btn_delete_shop_item').click(function(){ var delivery = jQuery('form#delivery').find('input[name=delivery]:checked').val(); jQuery('#answerForm').load('https://owbaltyk.com/delete-shop/'+jQuery(this).attr('data-id')+'/'+jQuery(this).attr('data-id2')+'/'+jQuery(this).val()+'/'+delivery); return false; }); jQuery('.delivery_select').click(function(){ var delivery = jQuery('form#delivery').find('input[name=delivery]:checked').val(); jQuery('#answerForm').load('https://owbaltyk.com/delivery/'+delivery); }); jQuery('.btn_order').click(function(){ jQuery('#answerForm').load('https://owbaltyk.com/konto/order/'); return false; }); jQuery('.btn_show_order').click(function(){ $(this).toggleClass("clicked"); if ( $(this).hasClass("clicked") ) { $(this).html("Zwiń "); } else { $(this).html("Rozwiń "); } jQuery('.products'+jQuery(this).attr('href')).toggle(); return false; }); jQuery('.btn_search').click(function(){ jQuery('#search').toggle(); return false; }); jQuery("#sortForm select").change(function(){ var form = jQuery("#sortForm"); jQuery(form).ajaxSubmit({ target:'#answerForm' }); return false; }); jQuery('.btn_close_h').click(function(){ jQuery('#search, #account_header').hide(); return false; }); jQuery(document).on("click", "#fade, .popup .close", function(){ jQuery("#fade, .popup").fadeOut(function(){ jQuery(this).remove(); }); return false; }); function popup() { jQuery(".popup").css('left', (jQuery(window).width()-jQuery('.popup').width())/2); jQuery(".popup").css("top", jQuery(window).scrollTop()+100); if ((jQuery("#fade").length == 0)){ jQuery("body").append("
"); } } jQuery('.tabs a').click(function(){ jQuery(this).parent().find('a').removeClass('bg'); jQuery(this).addClass('bg'); jQuery(this).parent().parent().find('.tab').slideUp(); jQuery(this).parent().parent().find('.'+jQuery(this).attr('href')).slideDown(); return false; }); jQuery(document).on({ mouseenter: function () { jQuery(this).find(".hover").removeClass("resize").addClass("enlarge"); jQuery(this).find(".price").removeClass("resize").addClass("enlarge"); }, mouseleave: function () { jQuery(this).find(".hover").removeClass("enlarge").addClass("resize"); jQuery(this).find(".price").removeClass("enlarge").addClass("resize"); } }, ".room"); jQuery('#menu ul li i').click(function(){ jQuery(this).toggleClass('fa-angle-down'); jQuery(this).toggleClass('fa-angle-up'); jQuery(this).parent().parent().find('ul').toggleClass('dmenu'); return false; }); var scrollState = 'top'; jQuery(window).scroll(function(){ var scrollPos = jQuery(window).scrollTop(); if (jQuery(window).width() >= 1240) { if( ( scrollPos >= 150 ) && ( scrollState === 'top' ) ) { scrollState = 'scrolled'; jQuery("#header").animate({height:60, "font-size":"14px"},500); jQuery("#logo").animate({height:60},500); jQuery("#header .left, #header .right").animate({"margin-top":"20px"},500); } else if( ( scrollPos < 150 ) && ( scrollState === 'scrolled' ) ) { scrollState = 'top'; jQuery("#header").animate({height:120, "font-size":"16px"},500); jQuery("#logo").animate({height:120},500); jQuery("#header .left, #header .right").animate({"margin-top":"45px"},500); } } }); jQuery('.btn_slide_to').click(function(){ var id = jQuery(this).attr('href'); jQuery('html, body').animate({ scrollTop: jQuery(id).offset().top-60 }, 500); return false; }); jQuery('.btn_photo').click(function(){ var image = jQuery(this).attr('href'); jQuery('#photoId').val(jQuery(this).attr('data-id')); jQuery(this).parent().parent().parent().parent().parent().parent().find('img.main').attr('src', image); return false; }); jQuery('.btn_offers').click(function(){ jQuery('.btn_offers').removeClass('bg'); jQuery(this).addClass('bg'); jQuery('#offers_loader').fadeIn(); jQuery('#offers').load(jQuery(this).attr('href')); return false; }); if (jQuery(window).width()>=1220) { jQuery(document).ready(function () { jQuery('#slider').css('width', jQuery(window).width() - 1); jQuery('#slider').css('width', jQuery(window).width()); jQuery('#slider').css('height', jQuery(window).height() - 1); jQuery('#slider').css('height', jQuery(window).height()); }); } jQuery("#setlang").change(function () { window.location = jQuery(this).parent().parent().attr("action")+jQuery(this).val(); }); jQuery(document).on("swiperight", ".room_mgallery", swiperightHandler ); // Callback function references the event target and adds the 'swiperight' class to it function swiperightHandler( event ){ jQuery( event.target ).find(".owl-prev").click(); } jQuery(document).on("swipeleft", ".room_mgallery", swipeleftHandler ); // Callback function references the event target and adds the 'swiperight' class to it function swipeleftHandler( event ){ jQuery( event.target ).find(".owl-next").click(); } var photos = []; jQuery('.photos_slider .photo a').each(function(){ photos.push(jQuery(this).attr('data-id')); }); var index; jQuery('.btn_prev_photo').click(function(){ var id = jQuery('#photoId').val(); photos.some(function(entry, i) { if (entry == id) { index = i; return true; } }); jQuery('#photo'+photos[index-1]).click(); return false; }); jQuery('.btn_next_photo').click(function(){ var id = jQuery('#photoId').val(); photos.some(function(entry, i) { if (entry == id) { index = i; return true; } }); jQuery('#photo'+photos[index+1]).click(); return false; }); jQuery(document).on({ mouseenter: function () { jQuery(this).find(".arrow").fadeIn(); }, mouseleave: function () { jQuery(this).find(".arrow").fadeOut(); } }, ".room_mgallery");