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(".btn").hide();
	jQuery(form).find(".loader").show();
	jQuery(form).ajaxSubmit({
		target:'#answerForm',
		success: function(){
			jQuery(form).find(".btn").show();
  			jQuery(form).find(".loader").hide();
		}
	});
	return false;
});
jQuery("#showmenu").click(function(){
	jQuery("#menu .main-menu").slideDown(300);
	return false;
});
jQuery("#close-menu").click(function() {
	jQuery("#menu .main-menu").slideUp(300);
	return false;
})
function resize() {
    if (jQuery(window).width() > 700) {
        jQuery('.apartment_left .room_mgallery_content').css('height', jQuery('.apartment_right .icons').height());
        jQuery('.apartment_left').css('height', jQuery('.apartment_right .icons').height()+80);
        jQuery('.apartment_left .room_mgallery_content').css('min-height', 430);
    } else {
        jQuery('.apartment_ .room_mgallery_content').css('height', 'auto');
        jQuery('.apartment_').css('height', 'auto');
    }
	jQuery('#content').css('min-height', jQuery(window).height()-jQuery('#header').outerHeight()-jQuery('#footer').outerHeight()-jQuery('#footer2').outerHeight()-jQuery('#title').outerHeight()
-60+'px');
}
	jQuery(window).on('resize', function(){
		if (jQuery(window).width()>=1000) {
			jQuery("#menu ul.main").show().removeClass('r');
		} else {
			jQuery("#menu ul.main").addClass('r');
		}
		resize();
	});
		resize();
jQuery('#menu ul li i').click(function(){
    jQuery(this).toggleClass('fa-chevron-down');
    jQuery(this).toggleClass('fa-chevron-up');
    jQuery(this).parent().parent().find('ul').toggleClass('dmenu');
});
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);
jQuery(this).parent().parent().parent().parent().parent().parent().find('a.mgallery-photo').attr('href', image);
jQuery(this).closest('.room_mgallery').css('background-image', "url("+image+")");
return false;
});
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 index = 0;
var photos = [];
jQuery('.photos_slider .photo a').each(function(){
photos.push(jQuery(this).attr('data-id'));
});
var owl3 = $(".photos_slider");
owl3.owlCarousel({
items: 4,
pagination:false,
loop:false,
nav:true,
navText: ["Poprzednie","Następne"],
autoPlay:true,
autoPlay:3000,
margin:0,
stopOnHover:true,
responsive:{
0:{
items:1
},
400:{
items:2
},
1000:{
items:3
},
1300:{
items:4
},
}
});
jQuery('.image-popup').magnificPopup({
delegate: 'a.mgallery-photo',
type: 'image',
closeBtnInside: true,
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
},
});
var nextMagnific = function(e) {
	e.stopPropagation();
	e.preventDefault();
	console.log('next');
}
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('.photos .photo a').click(function() {
	jQuery('.photos .photo a').removeClass('active')
	jQuery(this).addClass('active')
})
jQuery(document).on({
mouseenter: function () {
jQuery(this).find(".arrow").fadeIn();
},
mouseleave: function () {
jQuery(this).find(".arrow").fadeOut();
}
}, ".room_mgallery");
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");
}
}, ".apartment");
$(function() {
	$('.images.on-start .show').delay(500).fadeIn();
	$('.images.on-start .img a').hover(function() {
		$(this).find('span').fadeOut();
	}, function() {
		$(this).find('span').fadeIn();
	})
})