// JavaScript Document

/*** 
    Simple jQuery Slideshow Script
    Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc.  Please link out to me if you like it :)
***/

function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
});


// END Simple jQuery Slideshow Script

// image ready function sezione zoom
	$(document).ready(function(){
		
		$('#photos').galleryView({
		 	transition_interval: 0,
			border: 'none',					 
			panel_width: 974,
			panel_height: 411,
			frame_width: 140,
			frame_height: 100
		});
		$('#photos_geniusuno').galleryView({
		 	transition_interval: 0,
			border: 'none',					 
			panel_width: 974,
			panel_height: 411,
			frame_width: 100,
			frame_height: 80
		});
		$('#photos_geniusdue').galleryView({
		 	transition_interval: 0,
			border: 'none',					 
			panel_width: 974,
			panel_height: 411,
			frame_width: 100,
			frame_height: 80
		});
		$('#photos_retro').galleryView({
		 	transition_interval: 0,
			border: 'none',					 
			panel_width: 974,
			panel_height: 411,
			frame_width: 100,
			frame_height: 80
		});
		$('#photos_acquario').galleryView({
		 	transition_interval: 0,
			border: 'none',					 
			panel_width: 974,
			panel_height: 411,
			frame_width: 100,
			frame_height: 80
		});
		$('#photos_deco').galleryView({
		 	transition_interval: 0,
			border: 'none',					 
			panel_width: 974,
			panel_height: 411,
			frame_width: 100,
			frame_height: 67
		});
		$('#photos_smeraldo').galleryView({
		 	transition_interval: 0,
			border: 'none',					 
			panel_width: 974,
			panel_height: 411,
			frame_width: 100,
			frame_height: 91
		});
		$('#photos_bollicine').galleryView({
		 	transition_interval: 0,
			border: 'none',					 
			panel_width: 974,
			panel_height: 411,
			frame_width: 100,
			frame_height: 91
		});
		$('#photos_kuadro').galleryView({
		 	transition_interval: 0,
			border: 'none',					 
			panel_width: 974,
			panel_height: 411,
			frame_width: 100,
			frame_height: 91
		});
		$('#photos_perlage').galleryView({
		 	transition_interval: 0,
			border: 'none',					 
			panel_width: 974,
			panel_height: 411,
			frame_width: 100,
			frame_height: 91
		});
		$('#photos_mediterraneo').galleryView({
		 	transition_interval: 0,
			border: 'none',					 
			panel_width: 974,
			panel_height: 411,
			frame_width: 100,
			frame_height: 91
		});
		$('#photos_rondo').galleryView({
		 	transition_interval: 0,
			border: 'none',					 
			panel_width: 974,
			panel_height: 411,
			frame_width: 100,
			frame_height: 91
		});
		$('#photos_provenzale').galleryView({
		 	transition_interval: 0,
			border: 'none',					 
			panel_width: 974,
			panel_height: 411,
			frame_width: 100,
			frame_height: 91
		});
		$('#photos_country').galleryView({
		 	transition_interval: 0,
			border: 'none',					 
			panel_width: 974,
			panel_height: 411,
			frame_width: 100,
			frame_height: 80
		});
		$('#photos_vanity').galleryView({
		 	transition_interval: 0,
			border: 'none',					 
			panel_width: 974,
			panel_height: 411,
			frame_width: 100,
			frame_height: 80
		});
		$('#photos_narciso').galleryView({
		 	transition_interval: 0,
			border: 'none',					 
			panel_width: 974,
			panel_height: 411,
			frame_width: 100,
			frame_height: 80
		});
		$('#photos_novecento').galleryView({
		 	transition_interval: 0,
			border: 'none',					 
			panel_width: 974,
			panel_height: 411,
			frame_width: 100,
			frame_height: 80
		});
		$('#photos_vogue').galleryView({
		 	transition_interval: 0,
			border: 'none',					 
			panel_width: 974,
			panel_height: 411,
			frame_width: 100,
			frame_height: 80
		});
		
		
	});

// preload images function

function preload() {
  if (!document.images) return;
  var imgs = new Array();
  var arguments = preload.arguments;
  for (var i = 0; i < arguments.length; i++) {
    imgs[i] = new Image();
    imgs[i].src = arguments[i];
  }
}


// shadowbox inizializzazione
					
window.onload = function(){
		Shadowbox.init({    
    showOverlay:         true
		});

		};
		
// illumina box di sotto

function change(cosa){
document.getElementById(cosa).style.borderColor = "#ffffff";
}

function change_back(cosa){
document.getElementById(cosa).style.borderColor = "#333333";
}

function swapImage(quale) {
   document.imgcontatti.src = quale;
}
		
					

