 if (window.addEventListener) {
	window.addEventListener("load", DrawDinovotionMap, false);
 } else if (document.addEventListener) {
	 document.addEventListener("load", DrawDinovotionMap, false);
 } else if (window.attachEvent) {
	 window.attachEvent("onload", DrawDinovotionMap);
 } else {
	 window.onload = DrawDinovotionMap; 
 }

 var map = null;

 var expocenterLocation = new VELatLong(49.244, 6.1304);

 var pinPoint = null;
 var pinPixel = null;
		  
 function DrawDinovotionMap()
 {
	map = new VEMap('amdMap');
	map.LoadMap(expocenterLocation, 10, VEMapStyle.Road, false, VEMapMode.Mode2D, true, 1);

	AddPin();
 }
 
 function AddPin()
 {
	// Add a new pushpin to the center of the map.
	var pinPoint = map.GetCenter();
	var shape = new VEShape(VEShapeType.Pushpin, pinPoint);
	shape.SetTitle("Dinovotion");
	//shape.SetDescription("<strong>Adresse</strong><p>ExpoCenter<br />Centre Thermal<br />F-57360 Amn&eacute;ville-les-thermes<br />France</p><strong>Coordonn&eacute;es GPS</strong><p>N 49&deg;14.640', E 6&deg;07.824'</p><strong>Nous contacter</strong><p>T&eacute;l&eacute;phone : +33.3.xx.xx.xx.xx<br />E-mail : contact@dinovotion.com<br /><a href='contact.html'>Formulaire de contact</a></p>");
	shape.SetDescription(document.getElementById("pushpin_info").innerHTML);
	map.AddShape(shape);
 }
 
 function ComingTo(destText) {
	if (destText != null && destText != "") {
		try {
			var routeOptions = new VERouteOptions();
			routeOptions.RouteCallback = routeLoaded;
			map.GetDirections([destText, expocenterLocation], routeOptions);
			
			$('addressAsk').popup.hide();
			$('loadingPopup').popup.show();
		} catch (e) {
			window.alert(e.message);	
		}
	}
 }
 
 function routeLoaded(route) {
	 $('loadingPopup').popup.hide();
 }