/* jQuery code */

$(document).ready(function() {

	// analytics
	try {
		var pageTracker = _gat._getTracker('UA-2723570-9');
		pageTracker._trackPageview();
	} catch (err) {}
	
	$('a.new-window').click(function() {
		window.open(this.href);
		return false;
	});

	$("#showmap").click(function() {
		$("#themap").animate( { top: '5' } , 800 );
		$("#drawer").animate( { top: '504' } , 1500 );
		return false;
	});

	$("#hidemap").click(function() {
		$("#themap").animate( { top: '-800px' } , 1500 );
		$("#drawer").animate( { top: '-800px' } , 800 );
		return false;
	});

});

function load() {
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("themap"));
		map.addControl(new GSmallMapControl());
		map.addControl(new GScaleControl());
		map.addControl(new GMapTypeControl());
		map.setCenter(new GLatLng(44.928835, 0.666046), 11);
		map.addOverlay(new GMarker(new GLatLng(44.942597, 0.801529))); // moulin latour
		map.addOverlay(new GMarker(new GLatLng(44.852948, 0.506744))); // airport
		/*
		directionsPanel = document.getElementById("route");
		directions = new GDirections(map, directionsPanel);
		directions.load("Bergerac to 44.942597, 0.801529");
		*/
	}
}
