var currentClicked="not-a-vehicle";
var currentOverlays = [];
var overlaysIndex=0;

currentRoute = null;

function loadGoogleMap() {
	if (GBrowserIsCompatible()) {

		window.map = new GMap2(document.getElementById("map"));
       	map.setCenter(new GLatLng(46.095250, -64.793372), 15);
		map.addControl(new GLargeMapControl());
       	map.addControl(new GMapTypeControl());

		routeMap = new RouteMap(".",false);
		setInterval("loadVehicles()", 5000);
   	}
   	loadVehicles();
}

function loadVehicles() {
	$.ajax({
		type: "GET",
	  	url: "actions.php",
		data: "action=getVehicles",
		success: function(xml) { routeMap.refreshVehicles(xml, "hide"); }
	});
}