jQuery(document).ready(function() {
	$('#person1').mouseover(function() { $('#person1Talk').fadeIn(); });
	$('#person1').mouseout(function() { $('#person1Talk').fadeOut(); });

	$('#person2').mouseover(function() { $('#person2Talk').fadeIn(); });
	$('#person2').mouseout(function() { $('#person2Talk').fadeOut(); });

	$('#person3').mouseover(function() { $('#person3Talk').fadeIn(); });
	$('#person3').mouseout(function() { $('#person3Talk').fadeOut(); });

	$('#person4').mouseover(function() { $('#person4Talk').fadeIn(); });
	$('#person4').mouseout(function() { $('#person4Talk').fadeOut(); });


	jQuery('#slider').jcarousel(/*{ scroll:1,	}*/);
	
	$('#teaserInfos').hover(	
		function() { $('#infosBox').slideDown('slow'); },
		function() { /*$('#newsBox').slideToggle('slow'); */}	
		);
	$('#infosBox').hover(	
		function() { /*$('#newsBox').slideToggle('slow'); */},
		function() { $('#infosBox').slideUp('slow'); }	
		);
	
	
	$('#teaserNews').hover(	
		function() { $('#newsBox').slideDown('slow'); },
		function() { /*$('#newsBox').slideToggle('slow'); */}	
		);
	$('#newsBox').hover(	
		function() { /*$('#newsBox').slideToggle('slow'); */},
		function() { $('#newsBox').slideUp('slow'); }	
		);
		
	$('#teaserFragMicha').hover(	
		function() { $('#fragMichaBox').slideDown('slow'); },
		function() { /*$('#fragMichaBox').slideToggle('slow'); */}
		);
	$('#fragMichaBox').hover(	
		function() { /*$('#newsBox').slideToggle('slow'); */},
		function() { $('#fragMichaBox').slideUp('slow'); }	
		);
		
	$("a.download").fancybox({ 'hideOnContentClick': true }); 		
	$("a#grosselfingen").fancybox({
				'itemLoadCallback': getGroupItems
			});

	// Skiausfahrt
	$("#dialog").dialog({ height: 555, width:505 });

});


// Galerie für Fahrschule in Grosselfingen
var imageList = [
	{url: "/files/unterrichtsraum_grosselfingen1.jpg", title: "Unterrichtsraum in Grosselfingen"},
	{url: "/files/unterrichtsraum_grosselfingen2.jpg", title: "Fahrschule in Grosselfingen"},
	{url: "/files/unterrichtsraum_grosselfingen3.jpg", title: "Unterrichtsraum in Grosselfingen"}
];

function getGroupItems(opts) {
	jQuery.each(imageList, function(i, val) {
		opts.itemArray.push(val);
	});
}
function createMarker(point,html) 
{
	var marker = new GMarker(point);
	GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml(html);
	});
	return marker;
}
function load() 
{

	if (GBrowserIsCompatible()) 
	{	
		// Bechtoldsweiler
		var map = new GMap2(document.getElementById("map"));
		map.addControl(new GMapTypeControl());  	// Kartentypauswahl
		map.setCenter(new GLatLng(48.387186, 8.945048), 15);
		map.setMapType(G_NORMAL_MAP);
		
		var point = new GLatLng(48.385186, 8.945048);
		var marker = createMarker(point,'<div><strong>Micha\'s Fahrschule</strong><br/>Rathausstr. 17<br/>72379 HCH-Bechtoldsweiler</div>')
		map.addOverlay(marker);
		
		// Grosselfingen
		var map2 = new GMap2(document.getElementById("map2"));
		map2.addControl(new GMapTypeControl());  	// Kartentypauswahl
		map2.setCenter(new GLatLng(48.333031, 8.886362), 15);
		map2.setMapType(G_NORMAL_MAP);
		
		var point = new GLatLng(48.333031, 8.886362);
		var marker = createMarker(point,'<div><strong>Micha\'s Fahrschule</strong><br/>Rangendingerstr. 32<br/>72415 Grosselfingen</div>')
		map2.addOverlay(marker);

		// Jungingen
		var map3 = new GMap2(document.getElementById("map3"));
		map3.addControl(new GMapTypeControl());  	// Kartentypauswahl
		map3.setCenter(new GLatLng(48.328047, 9.039634), 15);
		map3.setMapType(G_NORMAL_MAP);
		
		var point = new GLatLng(48.328047, 9.039634);
		var marker = createMarker(point,'<div><strong>Micha\'s Fahrschule</strong><br/>Hauptstraße 18<br/>72417 Jungingen</div>')
		map3.addOverlay(marker);
		
	}
    else 
	{
      alert("Google Maps wird von Ihrem Browser leider nicht unterstützt.");
    }

}

