$(document).ready(function() { InitCarousel(); InitPropertyCarousel(); InitOffCanvasNavigation(); InitMap(); InitChosen(); InitEzmark(); InitPriceSlider(); InitImageSlider(); InitAccordion(); InitTabs(); InitPalette(); }); function InitPalette() { if ($.cookie('palette') == 'true') { $('.palette').addClass('open'); } $('.palette .toggle a').on({ click: function(e) { e.preventDefault(); var palette = $(this).closest('.palette'); if (palette.hasClass('open')) { palette.animate({'left': '-195'}, 500, function() { palette.removeClass('open'); }); $.cookie('palette', false) } else { palette.animate({'left': '0'}, 500, function() { palette.addClass('open'); $.cookie('palette', true); }); } } }); if ($.cookie('color-variant')) { var link = $('.palette').find('a.'+ $.cookie('color-variant')); var file = link.attr('href'); var klass = link.attr('class'); $('#color-variant').attr('href', file); $('body').addClass(klass); } if ($.cookie('pattern')) { $('body').addClass($.cookie('pattern')); } if ($.cookie('header')) { $('body').addClass($.cookie('header')); } $('.palette a').on({ click: function(e) { e.preventDefault(); // Colors if ($(this).closest('div').hasClass('colors')) { var file = $(this).attr('href'); var klass = $(this).attr('class'); $('#color-variant').attr('href', file); if (!$('body').hasClass(klass)) { $('body').removeClass($.cookie('color-variant')); $('body').addClass(klass); } $.cookie('color-variant', klass) } // Patterns else if ($(this).closest('div').hasClass('patterns')) { var klass = $(this).attr('class'); if (!$('body').hasClass(klass)) { $('body').removeClass($.cookie('pattern')); $('body').addClass(klass); $.cookie('pattern', klass); } } // Headers else if ($(this).closest('div').hasClass('headers')) { var klass = $(this).attr('class'); if (!$('body').hasClass(klass)) { $('body').removeClass($.cookie('header')); $('body').addClass(klass); $.cookie('header', klass); } } } }); $('.palette .reset').on({ click: function() { $('body').removeClass($.cookie('color-variant')); $('#color-variant').attr('href', null); $.removeCookie('color-variant'); $('body').removeClass($.cookie('pattern')); $.removeCookie('pattern'); $('body').removeClass($.cookie('header')); $.removeCookie('header'); } }) } function InitPropertyCarousel() { $('.carousel.property .content li img').on({ click: function(e) { var src = $(this).attr('src'); var img = $(this).closest('.carousel.property').find('.preview img'); img.attr('src', src); $('.carousel.property .content li').each(function() { $(this).removeClass('active'); }); $(this).closest('li').addClass('active'); } }) } function InitTabs() { $('.tabs a').click(function (e) { e.preventDefault(); $(this).tab('show'); }); } function InitImageSlider() { $('.iosSlider').iosSlider({ desktopClickDrag: true, snapToChildren: true, infiniteSlider: true, navSlideSelector: '.slider .navigation li', onSlideComplete: function(args) { if(!args.slideChanged) return false; $(args.sliderObject).find('.slider-info').attr('style', ''); $(args.currentSlideObject).find('.slider-info').animate({ left: '15px', opacity: '.9' }, 'easeOutQuint'); }, onSliderLoaded: function(args) { $(args.sliderObject).find('.slider-info').attr('style', ''); $(args.currentSlideObject).find('.slider-info').animate({ left: '15px', opacity: '.9' }, 'easeOutQuint'); }, onSlideChange: function(args) { $('.slider .navigation li').removeClass('active'); $('.slider .navigation li:eq(' + (args.currentSlideNumber - 1) + ')').addClass('active'); }, autoSlide: true, scrollbar: true, scrollbarContainer: '.sliderContainer .scrollbarContainer', scrollbarMargin: '0', scrollbarBorderRadius: '0', keyboardControls: true }); } function InitAccordion() { $('.accordion').on('show', function (e) { $(e.target).prev('.accordion-heading').find('.accordion-toggle').addClass('active'); }); $('.accordion').on('hide', function (e) { $(this).find('.accordion-toggle').not($(e.target)).removeClass('active'); }); } function InitPriceSlider() { jQuery('.price-value .from').text(100); jQuery('.price-value .from').currency({ region: 'EUR', thousands: ' ', decimal: ',', decimals: 0 }); jQuery('.price-value .to').text(1000000); jQuery('.price-value .to').currency({ region: 'EUR', thousands: ' ', decimal: ',', decimals: 0 }); $('.property-filter .price-slider').slider({ range: true, min: 100, max: 1000000, values: [100, 1000000], slide: function(event, ui) { jQuery('.property-filter .price-from input').attr('value', ui.values[0]); jQuery('.property-filter .price-to input').attr('value', ui.values[1]); jQuery('.price-value .from').text(ui.values[0]); jQuery('.price-value .from').currency({ region: 'EUR', thousands: ' ', decimal: ',', decimals: 0 }); jQuery('.price-value .to').text(ui.values[1]); jQuery('.price-value .to').currency({ region: 'EUR', thousands: ' ', decimal: ',', decimals: 0 }); } }); } function InitEzmark() { $('input[type="checkbox"]').ezMark(); $('input[type="radio"]').ezMark(); } function InitChosen() { $('select').chosen({ disable_search_threshold: 10 }); } function InitOffCanvasNavigation() { $('#btn-nav').on({ click: function() { $('body').toggleClass('nav-open'); } }) } function InitCarousel() { $('#main .carousel .content ul').carouFredSel({ scroll: { items: 1 }, auto: false, next: { button: '#main .carousel-next', key: 'right' }, prev: { button: '#main .carousel-prev', key: 'left' } }); $('.carousel-wrapper .content ul').carouFredSel({ scroll: { items: 1 }, auto: false, next: { button: '.carousel-wrapper .carousel-next', key: 'right' }, prev: { button: '.carousel-wrapper .carousel-prev', key: 'left' } }); } function LoadMapProperty() { var locations = new Array( [45.6366534,10.6084597] ); var markers = new Array(); var mapOptions = { center: new google.maps.LatLng(45.6366534,10.6084597), zoom: 17, mapTypeId: google.maps.MapTypeId.ROADMAP, scrollwheel: false }; var map = new google.maps.Map(document.getElementById('property-map'), mapOptions); $.each(locations, function(index, location) { var marker = new google.maps.Marker({ position: new google.maps.LatLng(location[0], location[1]), map: map, icon: 'http://www.comune.toscolanomaderno.bs.it/personalizzazione/tpl/img/marker-transparent.png' }); var myOptions = { content: '', disableAutoPan: false, maxWidth: 0, pixelOffset: new google.maps.Size(-146, -190), zIndex: null, closeBoxURL: "", infoBoxClearance: new google.maps.Size(1, 1), position: new google.maps.LatLng(location[0], location[1]), isHidden: false, pane: "floatPane", enableEventPropagation: false }; marker.infobox = new InfoBox(myOptions); marker.infobox.isOpen = false; var myOptions = { draggable: true, content: '
', disableAutoPan: true, pixelOffset: new google.maps.Size(-21, -58), position: new google.maps.LatLng(location[0], location[1]), closeBoxURL: "", isHidden: false, // pane: "mapPane", enableEventPropagation: true }; marker.marker = new InfoBox(myOptions); marker.marker.open(map, marker); markers.push(marker); google.maps.event.addListener(marker, "click", function (e) { var curMarker = this; $.each(markers, function (index, marker) { // if marker is not the clicked marker, close the marker if (marker !== curMarker) { marker.infobox.close(); marker.infobox.isOpen = false; } }); if(curMarker.infobox.isOpen === false) { curMarker.infobox.open(map, this); curMarker.infobox.isOpen = true; map.panTo(curMarker.getPosition()); } else { curMarker.infobox.close(); curMarker.infobox.isOpen = false; } }); }); } function LoadMap() { var locations = new Array( [45.6616015,10.6317321, '
Ai Capperi
Via Sassello, 11
25088 CECINA (BS)
tel.: 349-4749813
e-mail: rednaa@vodafone.it
'], [45.63906,10.60388, '
All'Orologio
Via Mazzini, 24
25088 Toscolano Maderno (BS)
tel.: 0365-641951
e-mail: info@bborologio.com
web: www.bborologio.com
'], [45.6589457,10.6227117, '
Cà dei Casai
Via Folino Cabiana, 74-82
25088 GAINO (BS)
tel.: 0365-541360
e-mail: info@cadeicasai.it
web: www.cadeicasai.it
'], [45.6485848,10.611832, '
Camister
Via Donatello, 102
25088 GAINO (BS)
tel.: 338-3887566
e-mail: camister.garda@gmail.com
web: http://tinyurl.com/camister
'], [45.64818,10.61688, '
Casa del Tempo ritrovato
Via Firenze, 10
25088 GAINO (BS)
tel.: 349-0778349
e-mail: info@casadeltemporitrovato.com
web: www.casadeltemporitrovato.com
'], [45.6515437,10.612811, '
Ca' dell'Artista
Via Donatello, 47
25088 Gaino (BS)
tel.: 347-2112497
e-mail: pistricio@libero.it
'], [45.649169,10.6168669, '
Giardini di Corte
Via Pulciano-Gaino, 67
25088 gaino (BS)
tel.: 333-3264764
e-mail: info@giardinidicorte.it
web: http://www.giardinidicorte.it/
'], [45.664518,10.639869, '
Le Brede
Via Golf, 23
25088 Toscolano Maderno (BS)
tel.: 0365-548516
e-mail: info@lebrede.com
web: www.lebrede.com
'], [45.6481548,10.5931496, '
Locanda Alpina
via Sanico, 53
25088 Toscolano Maderno (BS)
tel.: 0365-540724
e-mail: locanda.alpina@hotmail.it
'], [45.64268,10.60517, '
Villa Susina
Via S. Ambrogio, 10
25088 Toscolano Maderno (BS)
tel.: 347-2734049
e-mail: villasusina@gmail.com
'], [45.635055,10.601784, '
La piccola corte
Via Statale, 14
25088 Toscolano Maderno (BS)
tel.: 0365/541673
e-mail: lapiccolacorte@gmail.com
web: www.lapiccolacorte.eu
'], [45.6366534,10.6084597, '
Filippin Guerrino
Piazzetta Bornico, 1
25088 Toscolano Maderno (Bs)
e-mail: filippinguerrino@legalmail.it
'], [45.654048,10.612919, '
Casa dei Suoni
Via Giotto, 19
25088 Toscolano Maderno (bs)
tel.: 0365/541550
e-mail: casadeisuoni@gmail.com
web: www.casadeisuoni.it
'], [45.6430401,10.6136462, '
Il Nido dei Gufi
Via Trento, 91
25088 Toscolano Maderno (Bs)
tel.: 0365/641519 - 320/0267962
e-mail: info@ilnidodeigufi.it
web: www.ilnidodeigufi.it
'], [45.636922,10.600674, '
Sergio il Gufo
Via Benamati, 73
25088 Toscolano Maderno (Bs)
tel.: +39 3405558302 - 0365690440
e-mail: info@sergioilgufo.com
web: www.sergioilgufo.com
'], [45.63785,10.59167, '
Aralba
Via Grotten Stina, 38
25088 Toscolano Maderno (BS)
tel.: 348-8138916
e-mail: angelobo@live.it
'], [45.6388732,10.6033035, '
Casa Mirabella 1790
Via Beltrami, 11
25088 Toscolano Maderno (Bs)
tel.: 0365-541428
e-mail: serena.andreoli1969@gmail.com
web: www.ilariahomes.com
'], [45.659267,10.622612, '
Il tempo delle farfalle
Via Folino-Cabiana, 85
25088 Toscolano Maderno (Bs)
tel.: 348-0301632
e-mail: info@iltempodellefarfalle.com
web: www.iltempodellefarfalle.com
'], [45.627217,10.583123, '
B&B L'Angolino
Via Resola, 26
25088 Toscolano Maderno (bs)
tel.: 3283028945
e-mail: mauriliagozza@gmail.com
web: www.angolinogardalake.it
'], [45.63695,10.60026, '
Atlante
Via Garibaldi, 76
25088 Toscolano Maderno (bs)
tel.: 3281236326
e-mail: atlanteretreats@gmail.com
'], [45.6328881,10.5887973, '
Timberti Serenella Carolina
Via Oleandri, 12
25088 toscolano maderno (bs)
tel.: 3396208947
'] ); var markers = new Array(); var mapOptions = { center: new google.maps.LatLng(45.6452953, 10.608673857143), zoom: 14, mapTypeId: google.maps.MapTypeId.ROADMAP, scrollwheel: false }; var map = new google.maps.Map(document.getElementById('map'), mapOptions); $.each(locations, function(index, location) { var marker = new google.maps.Marker({ position: new google.maps.LatLng(location[0], location[1]), map: map, icon: 'http://www.comune.toscolanomaderno.bs.it/personalizzazione/tpl/assets/img/marker-transparent.png' }); var myOptions = { content: location[2], disableAutoPan: false, maxWidth: 0, pixelOffset: new google.maps.Size(-146, -190), zIndex: null, closeBoxMargin: "0px -15px -15px 0px", closeBoxURL: "http://www.comune.toscolanomaderno.bs.it/personalizzazione/tpl/assets/img/close-button.png", infoBoxClearance: new google.maps.Size(1, 1), position: new google.maps.LatLng(location[0], location[1]), isHidden: false, pane: "floatPane", enableEventPropagation: false }; marker.infobox = new InfoBox(myOptions); marker.infobox.isOpen = false; var myOptions = { draggable: true, content: '
', disableAutoPan: true, pixelOffset: new google.maps.Size(-21, -58), position: new google.maps.LatLng(location[0], location[1]), closeBoxURL: "", isHidden: false, // pane: "mapPane", enableEventPropagation: true }; marker.marker = new InfoBox(myOptions); marker.marker.open(map, marker); markers.push(marker); google.maps.event.addListener(marker, "click", function (e) { var curMarker = this; $.each(markers, function (index, marker) { // if marker is not the clicked marker, close the marker if (marker !== curMarker) { marker.infobox.close(); marker.infobox.isOpen = false; } }); if(curMarker.infobox.isOpen === false) { curMarker.infobox.open(map, this); curMarker.infobox.isOpen = true; map.panTo(curMarker.getPosition()); } else { curMarker.infobox.close(); curMarker.infobox.isOpen = false; } }); }); } function InitMap() { google.maps.event.addDomListener(window, 'load', LoadMap); google.maps.event.addDomListener(window, 'load', LoadMapProperty); }