	function slideSwitch() {
		var $active = $('#slideshow img.active');
		if ( $active.length == 0 ) $active = $('#slideshow img:last');
			var $next =  $active.next().length ? $active.next()
			: $('#slideshow img:first');
	
		$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 );
	});

$(document).ready(function(){
	
//Set default open/close settings
$('.acc_container').hide(); //Hide/close all containers
$('.acc_trigger:first').addClass('active').next().show(); //Add "active" class to first trigger, then show/open the immediate next container

//On Click
$('.acc_trigger').click(function(){
	if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
		$('.acc_trigger').removeClass('active').next().slideUp(); //Remove all .acc_trigger classes and slide up the immediate next container
		$(this).toggleClass('active').next().slideDown(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
	}
	return false; //Prevent the browser jump to the link anchor
});

//Gallery Lightbox
$("a[rel=gallery_rel]").fancybox({
				'transitionIn'		: 'elastic',
				'transitionOut'		: 'elastic',
				'titlePosition' 	: 'inside'
			});

//Apartments Tabs
$(".tab_content").hide(); //Hide all content
$("ul.tabs li:first").addClass("active").show(); //Activate first tab
$(".tab_content:first").show(); //Show first tab content

//On Click Event
$("ul.tabs li").click(function() {

	$("ul.tabs li").removeClass("active"); //Remove any "active" class
	$(this).addClass("active"); //Add "active" class to selected tab
	$(".tab_content").hide(); //Hide all tab content

	var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
	$(activeTab).fadeIn(); //Fade in the active ID content
	return false;
});



});

//Google Map
function initialize() {
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("map_canvas"));
		map.setCenter(new GLatLng(45.839837,7.816577), 13);
		map.setUIToDefault();
		function createMarker(point, description) {
			var marker = new GMarker(point);
			GEvent.addListener(marker, "mouseover", function() {
				marker.openInfoWindowHtml(description);
			});
			return marker;
		}
		map.addOverlay(
			createMarker(new GLatLng(45.839837,7.816577), "<b>Residence dei Walser</b><br>Località Fohre,<br>11020 Gressoney la Trinitè, Aosta")
		);
						
	}
}

