$(document).ready(function () {
	
	// Shadowbox
	Shadowbox.init({
		players: ["img", "iframe"]
	});
	
	// Header
	$('#slider').cycle({fx: 'fade'});
	
	// Only for newer browsers
	if (typeof document.body.style.maxHeight != "undefined") {
		
		// Menu
		$('ul#menu li').bind('mouseenter', function () {
			
			// Show & activate
			$('div', this).show();
			$('a', this).addClass('active');
			
		}).bind('mouseleave', function () {
			
			// Hide & deactivate
			$('div', this).hide();
			$('a', this).removeClass('active');
		});
	}
	
	// Datepicker
	$('input#startdate').datepicker({dateFormat: 'dd-mm-yy'});
});

function load_gmaps (longitude, latitude, description) {
	
	if (GBrowserIsCompatible()) {
		
		// Display the map, with some controls and set the initial location 
		var map = new GMap2(document.getElementById('map'));
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		map.setCenter(new GLatLng(latitude, longitude), 16);
		
		// Create pointer and marker
		var point = new GLatLng(latitude, longitude);
		var marker = new GMarker(point);
		
		// Cload info
		var infoTabs = [new GInfoWindowTab('Tab #1', description)];
		
		// Add cloud
		GEvent.addListener(marker, 'click', function() { marker.openInfoWindowTabsHtml(infoTabs); });
		
		// Oppen cload defeault
		marker.openInfoWindowTabsHtml(infoTabs);
		
		// Add to maps
		map.addOverlay(marker);
	}
}

