function formdx()
{

return true;
}

  $(function() {
    $('#nav').droppy();
  });

function initialize() {
var myOptions = {zoom: 8, center: new google.maps.LatLng(42.9401497, 10.7143165), mapTypeId: google.maps.MapTypeId.ROADMAP}
var map = new google.maps.Map(document.getElementById("mappa"), myOptions);


var image = '/struttura/blu.png';
var myLatLng = new google.maps.LatLng(42.9401497, 10.7143165);
var contentString = '<a href="/">HOTEL IL BOSCHETTO</a><br><font size=1>Viale Italia 309 - Follonica</font>';
var infowindow = new google.maps.InfoWindow({content: contentString, maxWidth: 100});
var beachMarker = new google.maps.Marker({position: myLatLng, map: map, icon: image, title: 'HOTEL IL BOSCHETTO'});
google.maps.event.addListener(beachMarker, 'click', function() {infowindow.open(map,beachMarker);});

var image2 = '/struttura/verde.png';
var myLatLng2 = new google.maps.LatLng(42.9258510,10.5254320);
var contentString2 = '<a href="hotel-piombino.asp">PIOMBINO</a><br><font size=1>Distanza: 32Km (30min)</font>';
var infowindow2 = new google.maps.InfoWindow({content: contentString2, maxWidth: 100});
var beachMarker2 = new google.maps.Marker({position: myLatLng2, map: map, icon: image2, title: 'PIOMBINO'});
google.maps.event.addListener(beachMarker2, 'click', function() {infowindow2.open(map,beachMarker2);});

var image3 = '/struttura/verde.png';
var myLatLng3 = new google.maps.LatLng(43.0782962,10.6792407);
var contentString3 = '<a href="hotel-suvereto.asp">SUVERETO</a><br><font size=1>Distanza: 27Km (35min)</font>';
var infowindow3 = new google.maps.InfoWindow({content: contentString3, maxWidth: 100});
var beachMarker3 = new google.maps.Marker({position: myLatLng3, map: map, icon: image3, title: 'SUVERETO'});
google.maps.event.addListener(beachMarker3, 'click', function() {infowindow3.open(map,beachMarker3);});

var image4 = '/struttura/verde.png';
var myLatLng4 = new google.maps.LatLng(43.0500000,10.8939259);
var contentString4 = '<a href="hotel-massa-marittima.asp">MASSA MARITTIMA</a><br><font size=1>Distanza: 21Km (25min)</font>';
var infowindow4 = new google.maps.InfoWindow({content: contentString4, maxWidth: 100});
var beachMarker4 = new google.maps.Marker({position: myLatLng4, map: map, icon: image4, title: 'MASSA MARITTIMA'});
google.maps.event.addListener(beachMarker4, 'click', function() {infowindow4.open(map,beachMarker4);});

var image5 = '/struttura/verde.png';
var myLatLng5 = new google.maps.LatLng(42.8030746,10.7538236);
var contentString5 = '<a href="hotel-punta-ala.asp">PUNTA ALA</a><br><font size=1>Distanza: 18Km (21min)</font>';
var infowindow5 = new google.maps.InfoWindow({content: contentString5, maxWidth: 100});
var beachMarker5 = new google.maps.Marker({position: myLatLng5, map: map, icon: image5, title: 'PUNTA ALA'});
google.maps.event.addListener(beachMarker5, 'click', function() {infowindow5.open(map,beachMarker5);});

var image6 = '/struttura/verde.png';
var myLatLng6 = new google.maps.LatLng(42.7658642,10.8823578);
var contentString6 = '<a href="hotel-castiglione-della-pescaia.asp">CASTIGLIONE DELLA PESCAIA</a><br><font size=1>Distanza: 22Km (24min)</font>';
var infowindow6 = new google.maps.InfoWindow({content: contentString6, maxWidth: 100});
var beachMarker6 = new google.maps.Marker({position: myLatLng6, map: map, icon: image6, title: 'CASTIGLIONE DELLA PESCAIA'});
google.maps.event.addListener(beachMarker6, 'click', function() {infowindow6.open(map,beachMarker6);});

}

$(window).load(function() {$('#slider').nivoSlider({controlNavThumbs:false, controlNavThumbsFromRel:false});});
$(function(){
$("ul.dropdown li").hover(function(){  
$(this).addClass("hover");
$('ul:first',this).css('visibility', 'visible'); }, function(){$(this).removeClass("hover"); $('ul:first',this).css('visibility', 'hidden'); });
$("ul.dropdown li ul li:has(ul)").find("a:first").append(" &raquo; ");
});

$(function(){
$('a.fancyzoom').fancyzoom();
});

var slideshowSpeed = 6000;
var photos = [ 
{"image" : "1.jpg"}, 
{"image" : "2.jpg"},
{"image" : "3.jpg"},
{"image" : "4.jpg"},
{"image" : "5.jpg"}
];
$(document).ready(function() {
var interval;
$("#control").toggle(function(){
stopAnimation();
}, function() {
$(this).css({ "background-image" : "url(/struttura/btn_pause.png)" });
navigate("next");
interval = setInterval(function() {navigate("next");}, slideshowSpeed);
});
	
	
var activeContainer = 1;	
var currentImg = 0;
var animating = false;
var navigate = function(direction) {
if(animating) {
return;
}
		
if(direction == "next") {
currentImg++;
if(currentImg == photos.length + 1) {
currentImg = 1;
}
} else {
currentImg--;
if(currentImg == 0) {
currentImg = photos.length;
}
}
		
var currentContainer = activeContainer;
if(activeContainer == 1) {
activeContainer = 2;
} else {
activeContainer = 1;
}
showImage(photos[currentImg - 1], currentContainer, activeContainer);
};
	
var currentZindex = -1;
var showImage = function(photoObject, currentContainer, activeContainer) {
animating = true;
currentZindex--;

// Set the background image of the new active container
$("#headerimg" + activeContainer).css({
"background-image" : "url(/struttura/" + photoObject.image + ")",
			"display" : "block",
			"z-index" : currentZindex
		});
		

		
		
		// Fade out the current container
		// and display the header text when animation is complete
		$("#headerimg" + currentContainer).fadeOut(function() {
			setTimeout(function() {
				$("#headertxt").css({"display" : "block"});
				animating = false;
			}, 500);
		});
	};
	

	
	// We should statically set the first image
	navigate("next");
	
	// Start playing the animation
	interval = setInterval(function() {
		navigate("next");
	}, slideshowSpeed);
	
});

$(function() {
	$(".scorrimnento").jCarouselLite({
		vertical: true,
		hoverPause:true,
		visible: 1,
		auto:1500,
		speed:2000
	});
});

