// ACTIVITY INDICATOR
var imageLightBoxItems = {
count: 0,
byIndex: {},
byHref: {},
};
var map;
var activityIndicatorOn = function(){ $('
').appendTo('body'); },
activityIndicatorOff = function(){ $('#imagelightbox-loading').remove(); },
// OVERLAY
overlayOn = function(){ $('').appendTo('body'); },
overlayOff = function(){ $('#imagelightbox-overlay').remove(); },
// CLOSE BUTTON
closeButtonOn = function(instance){ $('').appendTo('body').on('click touchend', function() { $(this).remove(); instance.quitImageLightbox(); return false; }); },
closeButtonOff = function(){ $('#imagelightbox-close').remove(); },
// CAPTION
captionOn = function(){ var description = $('a[href="' + $('#imagelightbox').attr('src') + '"] img').attr('alt'); if (description != '' && description != undefined) $('' + description + '
').appendTo('body'); },
captionOff = function(){ $('#imagelightbox-caption').remove(); },
// NAVIGATION
navigationOn = function(instance, selector){ var images = $(selector); if (images.length) { var nav = $(''); for (var i = 0; i < images.length; i++) nav.append(''); nav.appendTo('body'); nav.on('click touchend', function() { return false; }); var navItems = nav.find('button'); navItems.on('click touchend', function() { var $this = $(this); if (images.eq($this.index()).attr('href') != $('#imagelightbox').attr('src')) instance.switchImageLightbox($this.index()); navItems.removeClass('active'); navItems.eq($this.index()).addClass('active'); return false; }) .on('touchend', function() { return false; }); } },
navigationUpdate = function(selector) { var items = $('#imagelightbox-nav button'); items.removeClass('active'); items.eq($(selector).filter('[href="' + $('#imagelightbox').attr('src') + '"]').index(selector)).addClass('active'); },
navigationOff = function(){ $('#imagelightbox-nav').remove(); },
// ARROWS
arrowsOn = function (instance, selector) { var $arrows = $(''); $arrows.appendTo('body'); $arrows.on('click touchend', function (e) { var $this = $(this); var index = imageLightBoxItems.byHref[$('#imagelightbox').attr('src')]; e.preventDefault(); if (typeof index === 'undefined') { return false; } if ($this.hasClass('imagelightbox-arrow-left')) { index = index - 1; if (typeof imageLightBoxItems.byIndex[index] === 'undefined') { index = imageLightBoxItems.count - 1; } } else { index = index + 1; if (typeof imageLightBoxItems.byIndex[index] === 'undefined') { index = 0; } } instance.switchImageLightbox(index); return false; }); },
arrowsOff = function() { $('.imagelightbox-arrow').remove(); };
var imageLighBoxSelector = 'a.fancybox',
imageLightboxInstance = $(imageLighBoxSelector).imageLightbox({
onStart: function() { overlayOn(); closeButtonOn( imageLightboxInstance ); arrowsOn( imageLightboxInstance, imageLighBoxSelector ); },
onEnd: function() { overlayOff(); captionOff(); closeButtonOff(); arrowsOff(); activityIndicatorOff(); },
onLoadStart: function() { captionOff(); activityIndicatorOn(); },
onLoadEnd: function() { captionOn(); activityIndicatorOff(); $( '.imagelightbox-arrow' ).css( 'display', 'block' ); }
});
$(imageLighBoxSelector).each(function (index) {
imageLightBoxItems.byHref[$(this).attr('href')] = index;
imageLightBoxItems.byIndex[index] = $(this).attr('href');
imageLightBoxItems.count += 1;
});
$(document).ready(function(){
$('#contactFormSend').on('submit', function(evt){
evt.preventDefault();
var k = [ 'name', 'question' ],
good = true;
$(this).find('[name]').removeClass('error');
$(this).find('p.ajaxInfo').hide();
if ( /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test( $(this).find('[name="mail"]').val() ) == false ){
$(this).find('[name="mail"]').addClass('error');
good = false;
}
if ( $(this).find('[name="phone"]').val().replace(/[^\d]/, '').length < 9 ){
$(this).find('[name="phone"]').addClass('error');
good = false;
}
for ( var i = 0; i < k.length; i++ ){
var obj = $(this).find('[name="'+ k[i] +'"]');
if ( obj.val().length <= 1 ){
good = false;
obj.addClass('error');
}
}
if ( good ){
$.post( $(this).attr('action'), $(this).serialize(), (function(response){
if (response.indexOf('false') === -1) {
$(this).find('input, textarea').val('');
$(this).find('p.ajaxInfo.ok').show();
} else {
$(this).find('p.ajaxInfo.error_send').show();
}
}).bind(this));
} else {
$(this).find('p.ajaxInfo.error').show();
}
});
// Zabiegaj linkom #
$('a[href=#]').click(function(e){
e.preventDefault();
});
});
$('.section-slider .slide-down').click(function(e){
e.preventDefault();
$('html, body').animate({
scrollTop: $('#about').offset().top
}, 1200);
});
$(window).load(function(){
var mainSlider = $('#slider');
if( mainSlider.length > 0 )
mainSlider.owlCarousel({
items: 1,
autoplay: true,
autoplayTimeout: 2000,
autoplaySpeed: 1000,
nav: true,
dots: true,
loop: true,
navText: ['<', '›'],
navContainer: ".text",
responsive: {
0: {
nav: false
},
720: {
nav: true
}
}
// mouseDrag:false,
// touchDrag:false,
// animateOut: 'fadeOut'
});
$('.show-categories').on('click', function(){
$('.categories-menu').slideToggle();
});
$('.show-galleries').on('click', function(){
$('.menu-category-list').slideToggle();
});
/*$('#preload').fadeOut(500);*/
var explode = function(){
$('.preload-collapse').addClass('active').delay(600).queue(function(next){
$('#preload').fadeOut(400);
});
};
setTimeout(explode, 500);
function initialize() {
var myOptions = {
zoom: 14,
center: new google.maps.LatLng(52.3186344606737,16.10937244853515),
navigationControl: true,
panControl: true,
zoomControl: true,
rotateControl: true,
overviewMapControl: true,
scrollwheel: false,
zoomControl: true,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.DEFAULT
},
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DEFAULT
},
mapTypeId: google.maps.MapTypeId.ROADMAP,
styles: [{"featureType":"water","elementType":"geometry.fill","stylers":[{"color":"#d3d3d3"}]},{"featureType":"transit","stylers":[{"color":"#808080"},{"visibility":"off"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"visibility":"on"},{"color":"#b3b3b3"}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"road.local","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#ffffff"},{"weight":1.8}]},{"featureType":"road.local","elementType":"geometry.stroke","stylers":[{"color":"#d7d7d7"}]},{"featureType":"poi","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#ebebeb"}]},{"featureType":"administrative","elementType":"geometry","stylers":[{"color":"#a7a7a7"}]},{"featureType":"road.arterial","elementType":"geometry.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"road.arterial","elementType":"geometry.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"landscape","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#efefef"}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"color":"#696969"}]},{"featureType":"administrative","elementType":"labels.text.fill","stylers":[{"visibility":"on"},{"color":"#737373"}]},{"featureType":"poi","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"road.arterial","elementType":"geometry.stroke","stylers":[{"color":"#d6d6d6"}]},{"featureType":"road","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{},{"featureType":"poi","elementType":"geometry.fill","stylers":[{"color":"#dadada"}]}]
}
var map = new google.maps.Map(document.getElementById("map"), myOptions);
var marker = new google.maps.Marker({
position: new google.maps.LatLng(52.3186344606737,16.10937244853515),
map: map
});
}
initialize();
});