var centerLatitude = 48.5861358246929;
var centerLongitude = 7.76447474956512;
var startZoom = 13;


var map


function init()
{
    if (GBrowserIsCompatible()) {

      // Display the map

	  map = new GMap2(document.getElementById('map'));

	  //Center the map

	  var location = new GLatLng(centerLatitude, centerLongitude);

      map.setCenter(location, startZoom);

	  //Display the icon

	  var icon = new GIcon();

	  icon.image = '../img/mm_20_red.png';

	  icon.shadow = '../img/mm_20_shadow.png';

      icon.iconSize = new GSize(12, 20);

	  icon.shadowSize = new GSize(22, 20);

      icon.iconAnchor = new GPoint(6, 20);

      icon.infoWindowAnchor = new GPoint(5, 1);

	  //Display the marker

	  var marker = new GMarker(location, icon);

	  map.addOverlay(marker);

	  //Display the map options (zoom, view...)
      map.addControl(new GLargeMapControl());

      map.addControl(new GMapTypeControl());

	  //Delete the Normal view button

	  map.removeMapType(G_NORMAL_MAP);

	  //Add the Physical view button

      map.addMapType(G_PHYSICAL_MAP);

	  //Forced the Physical view

      map.setMapType(G_PHYSICAL_MAP);

	  //Display the windows

	  var tabs = new Array();

	  var tabAgence = new GInfoWindowTab ('AGENCE', '<div id="tabs"><ul><li><em class="tabgras">DISS IMMOBILIER S&agrave;rl</em></li><li><em class="tabadresse">5 Avenue de la For&ecirc;t Noire</em></li><li><em class="tabadresse">67000 STRASBOURG</em></li><li><em class="tabsouligner">T&eacute;l :</em><em class="tabtelephone"> 03 90 41 06 50</em></li><li><em class="tabsouligner">Fax :</em><em class="tabtelephone"> 03 90 41 06 51</em></li><li><em class="tabsouligner">M&eacute;l :</em> <a href="./contact.php#send_mail">Suivez ce lien</a></li></ul><img src="../php/agence.php" alt="Photographie de la fa&ccedil;ade d\'immeuble de l\'agence immobili&egrave;re DISS Michel sise 5 Avenue de la For&ecirc;t Noire &agrave; Strasbourg." /></div>'); 

	  var tabAnnonces = new GInfoWindowTab ('ANNONCES', '<div id="tabs"><ul><li><em class="tabgras">LES ANNONCES IMMOBILI&Egrave;RES :</em></li><li><a href="./annonces.php#vente"> - Les ventes immobili&egrave;res (appartements, maisons, combles, garages, locaux, terrains.)</a></li><li><a href="./annonces.php#location"> - Les locations immobili&egrave;res (appartements, maisons, garages, locaux.)</a></li></ul></div>'); 

	  tabs[0] = tabAgence;

      tabs[1] = tabAnnonces;

	  //Display the windows options

	  var options = {maxWidth : 270, selectedTab : 0};

	  map.openInfoWindowTabsHtml(location, tabs, options);

	  //Display the marker click

	  GEvent.addListener(marker, 'click', function() { map.openInfoWindowTabsHtml(location, tabs, options);});

	}

	else {alert("Votre navigateur Internet n'est pas compatible Javascript. La carte ne peut pas s'afficher.")}
}

window.onload = init;
window.onunload = GUnload;
