$(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.6355334,10.599344, '
Basilica di S. Andrea
Piazza Maderno,
25088 Toscolano Maderno (Bs)
'], [45.6353035,10.5994213, '
Colonna con Leone S. Marco
Piazza S. Marco,
25088 Toscolano Maderno (Bs)
'], [45.6353035,10.5994213, '
Monumento Bella Italia
P.zza San Marco,
25088 Toscolano Maderno (Bs)
'], [45.644119,10.617125, '
Chiesa Parrocchiale SS. Pietro e Paolo
Piazzale S. Maria del Benaco,
25088 Toscolano Maderno (Bs)
'], [45.635254 ,10.599773, '
Chiesa Parrocchiale S. Andrea
P.zza San Marco,
25088 Toscolano Maderno (Bs)
'], [45.6353035,10.5994213, '
Statua di S. Ercolano
Via Roma,
25088 Toscolano Maderno (BS)
'], [45.634602,10.600162, '
Il castello di Maderno
Via Lungolago Zanardelli,
25088 Toscolano Maderno ()
'], [45.635491,10.599464, '
Palazzo Gonzaga
Via Benamati, 20
()
'], [45.644339,10.617242, '
Santuario di Santa Maria del Benaco
P.zza Caduti,
25088 Toscolano Maderno (Bs)
'], [45.643529,10.617725, '
Villa romana dei Nonii Arrii
Piazzale S. Maria del Benaco,
25088 Toscolano Maderno (Bs)
'], [45.669432,10.635053, '
Santuario della Madonna di Supina
Via Supina,
25088 Toscolano Maderno (BS)
'], [45.6494198,10.6041777, '
Museo della Carta
Via Valle delle Cartiere,
25088 Toscolano Maderno (BS)
tel.: 0365 641050
e-mail: museo@valledellecartiere.it
'], [45.6397492,10.608380, '
Orto Botanico Ghirardi
Via Religione, 25
25088 Toscolano Maderno (BS)
'], [45.634511,10.6003327, '
Ancora della Flottiglia dei M.A.S.
Via Lungolago Zanardelli,
25088 Toscolano Maderno (BS)
'], [45.636621993973876,10.605728030204773, '
Ai caduti della Grande Guerra
Viale Ugo Foscolo,
25088 Toscolano Maderno (BS)
'], [45.6686149894396,10.648916959762573, '
Chiesa di S. Giorgio
Via S. Giorgio,
25088 Toscolano Maderno (BS)
'], [45.635672,10.599156, '
Chiesa Immacolata
Piazza S. Marco, 16
25088 Toscolano Maderno (BS)
'], [45.627192,10.586127, '
Villa Zanardelli
Via Roma, 61
25088 Toscolano Maderno (BS)
'], [45.6327825,10.596015, '
Palazzo Bulgheroni
Via Benamati,
()
'], [45.6452225,10.618414, '
Porto di Toscolano e le limonaie
Via Porto,
25088 Toscolano Maderno (Bs)
'], [45.671753,10.612793, '
Mulino di Camerate
Via Valle delle Camerate,
25088 Toscolano Maderno (BS)
'], [45.6353035,10.5994213, '
Piazza di Maderno
P.zza San Marco,
25088 Toscolano Maderno (BS)
'], [45.6494198,10.6041777, '
Valle delle Cartiere
Via Valle delle Cartiere,
25088 Toscolano Maderno (BS)
'], [45.6357296,10.597577, '
Hotel Golfo, ex Villa Bianchi
Via Roma, 1
25088 Toscolano Maderno (BS)
'], [45.638584,10.600285, '
Villa Caprera
Via S. Pietro,
25088 Toscolano Maderno (BS)
'], [45.631007,10.607489, '
Ex Villa Cavallero
Via Lungolago Zanardelli,
25088 Toscolano Maderno (BS)
'], [45.631596,10.605171, '
Hotel Bristol, Lungolago Maderno
Via Lungolago Zanardelli,
25088 Toscolano Maderno (BS)
'], [45.6384708,10.6028754, '
Scuole Elementari
Via Tito Speri, 3
25088 Toscolano Maderno (BS)
'], [45.633898,10.592784, '
Villa Gemma
Via Roma,
25088 Toscolano Maderno (BS)
'], [45.626777,10.585197, '
Ex Villa Bassetti
Via Roma,
25088 Toscolano Maderno (BS)
'], [45.625808,10.584289, '
Villa Mimosa
via Roma,
25088 Toscolano Maderno (BS)
'], [45.6364951,10.5988112, '
Villa Serenella
Via Aquilani, 52
25088 Toscolano Maderno (BS)
'], [45.633022,10.612357, '
Casa Bonaspetti
Via Promontorio,
25088 Toscolano Maderno (BS)
'], [45.6366058,10.6164009, '
Campeggio Toscolano
Via Religione,
25088 Toscolano Maderno (BS)
'], [45.639976,10.608698, '
Terreno Agricolo Andreoli
Via Bellini,
25088 Toscolano Maderno (BS)
'], [45.6420067,10.6127078, '
Parco Bernini
via Statale Toscolano,
25088 Toscolano Maderno (BS)
'], [45.6368428,10.5992588, '
Parco del Serraglio
Via Montana,
25088 Toscolano Maderno (BS)
'], [45.634511,10.6003327, '
Lungolago Zanardelli
Via Lungolago Zanardelli,
25088 Toscolano Maderno (BS)
'] ); var markers = new Array(); var mapOptions = { center: new google.maps.LatLng(45.63936321009, 10.605053291841), 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); }