//<![CDATA[


    var bubbleBlue = new GIcon(); 

    bubbleBlue.image = 'http://www.oselene.com/web/carte/bubble_blue.png';

    bubbleBlue.shadow = 'http://www.oselene.com/web/carte/bubble_shadow.png';

    bubbleBlue.iconSize = new GSize(12, 20);

    bubbleBlue.shadowSize = new GSize(22, 20);

    bubbleBlue.iconAnchor = new GPoint(6, 20);

    bubbleBlue.infoWindowAnchor = new GPoint(5, 1);



    var bubbleRed = new GIcon(); 

    bubbleRed.image = 'http://www.oselene.com/web/carte/bubble_red.png';

    bubbleRed.shadow = 'http://www.oselene.com/web/carte/bubble_shadow.png';

    bubbleRed.iconSize = new GSize(12, 20);

    bubbleRed.shadowSize = new GSize(22, 20);

    bubbleRed.iconAnchor = new GPoint(6, 20);

    bubbleRed.infoWindowAnchor = new GPoint(5, 1);

    var bubbleOrange = new GIcon(); 

    bubbleOrange.image = 'http://www.oselene.com/web/carte/bubble_orange.png';

    bubbleOrange.shadow = 'http://www.oselene.com/web/carte/bubble_shadow.png';

    bubbleOrange.iconSize = new GSize(12, 20);

    bubbleOrange.shadowSize = new GSize(22, 20);

    bubbleOrange.iconAnchor = new GPoint(6, 20);

    bubbleOrange.infoWindowAnchor = new GPoint(5, 1);


    var bubblePink = new GIcon(); 

    bubblePink.image = 'http://www.oselene.com/web/carte/bubble_pink.png';

    bubblePink.shadow = 'http://www.oselene.com/web/carte/bubble_shadow.png';

    bubblePink.iconSize = new GSize(12, 20);

    bubblePink.shadowSize = new GSize(22, 20);

    bubblePink.iconAnchor = new GPoint(6, 20);

    bubblePink.infoWindowAnchor = new GPoint(5, 1);

    var bubbleYellow = new GIcon(); 

    bubbleYellow.image = 'http://www.oselene.com/web/carte/bubble_yellow.png';

    bubbleYellow.shadow = 'http://www.oselene.com/web/carte/bubble_shadow.png';

    bubbleYellow.iconSize = new GSize(12, 20);

    bubbleYellow.shadowSize = new GSize(22, 20);

    bubbleYellow.iconAnchor = new GPoint(6, 20);

    bubbleYellow.infoWindowAnchor = new GPoint(5, 1);

    var bubbleBlack = new GIcon(); 

    bubbleBlack.image = 'http://www.oselene.com/web/carte/bubble_black.png';

    bubbleBlack.shadow = 'http://www.oselene.com/web/carte/bubble_shadow.png';

    bubbleBlack.iconSize = new GSize(12, 20);

    bubbleBlack.shadowSize = new GSize(22, 20);

    bubbleBlack.iconAnchor = new GPoint(6, 20);

    bubbleBlack.infoWindowAnchor = new GPoint(5, 1);


    var bubbleGreen = new GIcon(); 

    bubbleGreen.image = 'http://www.oselene.com/web/carte/bubble_green.png';

    bubbleGreen.shadow = 'http://www.oselene.com/web/carte/bubble_shadow.png';

    bubbleGreen.iconSize = new GSize(12, 20);

    bubbleGreen.shadowSize = new GSize(22, 20);

    bubbleGreen.iconAnchor = new GPoint(6, 20);

    bubbleGreen.infoWindowAnchor = new GPoint(5, 1);


    var bubbleWhite = new GIcon(); 

    bubbleWhite.image = 'http://www.oselene.com/web/carte/bubble_white.png';

    bubbleWhite.shadow = 'http://www.oselene.com/web/carte/bubble_shadow.png';

    bubbleWhite.iconSize = new GSize(12, 20);

    bubbleWhite.shadowSize = new GSize(22, 20);

    bubbleWhite.iconAnchor = new GPoint(6, 20);

    bubbleWhite.infoWindowAnchor = new GPoint(5, 1);



var heartBlue = new GIcon(); 

    heartBlue.image = 'http://www.oselene.com/web/carte/heart_blue.png';

    heartBlue.shadow = 'http://www.oselene.com/web/carte/heart_shadow.png';

    heartBlue.iconSize = new GSize(12, 12);

    heartBlue.shadowSize = new GSize(22, 20);

    heartBlue.iconAnchor = new GPoint(6, 20);

    heartBlue.infoWindowAnchor = new GPoint(5, 1);



    var heartRed = new GIcon(); 

    heartRed.image = 'http://www.oselene.com/web/carte/heart_red.png';

    heartRed.shadow = 'http://www.oselene.com/web/carte/heart_shadow.png';

    heartRed.iconSize = new GSize(12, 12);

    heartRed.shadowSize = new GSize(22, 20);

    heartRed.iconAnchor = new GPoint(6, 20);

    heartRed.infoWindowAnchor = new GPoint(5, 1);

    var heartOrange = new GIcon(); 

    heartOrange.image = 'http://www.oselene.com/web/carte/heart_orange.png';

    heartOrange.shadow = 'http://www.oselene.com/web/carte/heart_shadow.png';

    heartOrange.iconSize = new GSize(12, 12);

    heartOrange.shadowSize = new GSize(22, 20);

    heartOrange.iconAnchor = new GPoint(6, 20);

    heartOrange.infoWindowAnchor = new GPoint(5, 1);


    var heartPink = new GIcon(); 

    heartPink.image = 'http://www.oselene.com/web/carte/heart_pink.png';

    heartPink.shadow = 'http://www.oselene.com/web/carte/heart_shadow.png';

    heartPink.iconSize = new GSize(12, 12);

    heartPink.shadowSize = new GSize(22, 20);

    heartPink.iconAnchor = new GPoint(6, 20);

    heartPink.infoWindowAnchor = new GPoint(5, 1);

    var heartYellow = new GIcon(); 

    heartYellow.image = 'http://www.oselene.com/web/carte/heart_yellow.png';

    heartYellow.shadow = 'http://www.oselene.com/web/carte/heart_shadow.png';

    heartYellow.iconSize = new GSize(12, 12);

    heartYellow.shadowSize = new GSize(22, 20);

    heartYellow.iconAnchor = new GPoint(6, 20);

    heartYellow.infoWindowAnchor = new GPoint(5, 1);

    var heartBlack = new GIcon(); 

    heartBlack.image = 'http://www.oselene.com/web/carte/heart_black.png';

    heartBlack.shadow = 'http://www.oselene.com/web/carte/heart_shadow.png';

    heartBlack.iconSize = new GSize(12, 12);

    heartBlack.shadowSize = new GSize(22, 20);

    heartBlack.iconAnchor = new GPoint(6, 20);

    heartBlack.infoWindowAnchor = new GPoint(5, 1);


    var heartGreen = new GIcon(); 

    heartGreen.image = 'http://www.oselene.com/web/carte/heart_green.png';

    heartGreen.shadow = 'http://www.oselene.com/web/carte/heart_shadow.png';

    heartGreen.iconSize = new GSize(12, 12);

    heartGreen.shadowSize = new GSize(22, 20);

    heartGreen.iconAnchor = new GPoint(6, 20);

    heartGreen.infoWindowAnchor = new GPoint(5, 1);


    var heartWhite = new GIcon(); 

    heartWhite.image = 'http://www.oselene.com/web/carte/heart_white.png';

    heartWhite.shadow = 'http://www.oselene.com/web/carte/heart_shadow.png';

    heartWhite.iconSize = new GSize(12, 12);

    heartWhite.shadowSize = new GSize(22, 20);

    heartWhite.iconAnchor = new GPoint(6, 20);

    heartWhite.infoWindowAnchor = new GPoint(5, 1);


    var ballBlue = new GIcon(); 

    ballBlue.image = 'http://www.oselene.com/web/carte/ball_blue.png';

    ballBlue.shadow = 'http://www.oselene.com/web/carte/ball_shadow.png';

    ballBlue.iconSize = new GSize(12, 12);

    ballBlue.shadowSize = new GSize(22, 20);

    ballBlue.iconAnchor = new GPoint(6, 20);

    ballBlue.infoWindowAnchor = new GPoint(5, 1);



    var ballRed = new GIcon(); 

    ballRed.image = 'http://www.oselene.com/web/carte/ball_red.png';

    ballRed.shadow = 'http://www.oselene.com/web/carte/ball_shadow.png';

    ballRed.iconSize = new GSize(12, 12);

    ballRed.shadowSize = new GSize(22, 20);

    ballRed.iconAnchor = new GPoint(6, 20);

    ballRed.infoWindowAnchor = new GPoint(5, 1);

    var ballOrange = new GIcon(); 

    ballOrange.image = 'http://www.oselene.com/web/carte/ball_orange.png';

    ballOrange.shadow = 'http://www.oselene.com/web/carte/ball_shadow.png';

    ballOrange.iconSize = new GSize(12, 12);

    ballOrange.shadowSize = new GSize(22, 20);

    ballOrange.iconAnchor = new GPoint(6, 20);

    ballOrange.infoWindowAnchor = new GPoint(5, 1);


    var ballPink = new GIcon(); 

    ballPink.image = 'http://www.oselene.com/web/carte/ball_pink.png';

    ballPink.shadow = 'http://www.oselene.com/web/carte/ball_shadow.png';

    ballPink.iconSize = new GSize(12, 12);

    ballPink.shadowSize = new GSize(22, 20);

    ballPink.iconAnchor = new GPoint(6, 20);

    ballPink.infoWindowAnchor = new GPoint(5, 1);

    var ballYellow = new GIcon(); 

    ballYellow.image = 'http://www.oselene.com/web/carte/ball_yellow.png';

    ballYellow.shadow = 'http://www.oselene.com/web/carte/ball_shadow.png';

    ballYellow.iconSize = new GSize(12, 12);

    ballYellow.shadowSize = new GSize(22, 20);

    ballYellow.iconAnchor = new GPoint(6, 20);

    ballYellow.infoWindowAnchor = new GPoint(5, 1);

    var ballBlack = new GIcon(); 

    ballBlack.image = 'http://www.oselene.com/web/carte/ball_black.png';

    ballBlack.shadow = 'http://www.oselene.com/web/carte/ball_shadow.png';

    ballBlack.iconSize = new GSize(12, 12);

    ballBlack.shadowSize = new GSize(22, 20);

    ballBlack.iconAnchor = new GPoint(6, 20);

    ballBlack.infoWindowAnchor = new GPoint(5, 1);


    var ballGreen = new GIcon(); 

    ballGreen.image = 'http://www.oselene.com/web/carte/ball_green.png';

    ballGreen.shadow = 'http://www.oselene.com/web/carte/ball_shadow.png';

    ballGreen.iconSize = new GSize(12, 12);

    ballGreen.shadowSize = new GSize(22, 20);

    ballGreen.iconAnchor = new GPoint(6, 20);

    ballGreen.infoWindowAnchor = new GPoint(5, 1);


    var ballWhite = new GIcon(); 

    ballWhite.image = 'http://www.oselene.com/web/carte/ball_white.png';

    ballWhite.shadow = 'http://www.oselene.com/web/carte/ball_shadow.png';

    ballWhite.iconSize = new GSize(12, 12);

    ballWhite.shadowSize = new GSize(22, 20);

    ballWhite.iconAnchor = new GPoint(6, 20);

    ballWhite.infoWindowAnchor = new GPoint(5, 1);



    var starBlue = new GIcon(); 

    starBlue.image = 'http://www.oselene.com/web/carte/star_blue.png';

    starBlue.shadow = 'http://www.oselene.com/web/carte/star_shadow.png';

    starBlue.iconSize = new GSize(12, 12);

    starBlue.shadowSize = new GSize(22, 20);

    starBlue.iconAnchor = new GPoint(6, 20);

    starBlue.infoWindowAnchor = new GPoint(5, 1);



    var starRed = new GIcon(); 

    starRed.image = 'http://www.oselene.com/web/carte/star_red.png';

    starRed.shadow = 'http://www.oselene.com/web/carte/star_shadow.png';

    starRed.iconSize = new GSize(12, 12);

    starRed.shadowSize = new GSize(22, 20);

    starRed.iconAnchor = new GPoint(6, 20);

    starRed.infoWindowAnchor = new GPoint(5, 1);

    var starOrange = new GIcon(); 

    starOrange.image = 'http://www.oselene.com/web/carte/star_orange.png';

    starOrange.shadow = 'http://www.oselene.com/web/carte/star_shadow.png';

    starOrange.iconSize = new GSize(12, 12);

    starOrange.shadowSize = new GSize(22, 20);

    starOrange.iconAnchor = new GPoint(6, 20);

    starOrange.infoWindowAnchor = new GPoint(5, 1);


    var starPink = new GIcon(); 

    starPink.image = 'http://www.oselene.com/web/carte/star_pink.png';

    starPink.shadow = 'http://www.oselene.com/web/carte/star_shadow.png';

    starPink.iconSize = new GSize(12, 12);

    starPink.shadowSize = new GSize(22, 20);

    starPink.iconAnchor = new GPoint(6, 20);

    starPink.infoWindowAnchor = new GPoint(5, 1);

    var starYellow = new GIcon(); 

    starYellow.image = 'http://www.oselene.com/web/carte/star_yellow.png';

    starYellow.shadow = 'http://www.oselene.com/web/carte/star_shadow.png';

    starYellow.iconSize = new GSize(12, 12);

    starYellow.shadowSize = new GSize(22, 20);

    starYellow.iconAnchor = new GPoint(6, 20);

    starYellow.infoWindowAnchor = new GPoint(5, 1);

    var starBlack = new GIcon(); 

    starBlack.image = 'http://www.oselene.com/web/carte/star_black.png';

    starBlack.shadow = 'http://www.oselene.com/web/carte/star_shadow.png';

    starBlack.iconSize = new GSize(12, 12);

    starBlack.shadowSize = new GSize(22, 20);

    starBlack.iconAnchor = new GPoint(6, 20);

    starBlack.infoWindowAnchor = new GPoint(5, 1);


    var starGreen = new GIcon(); 

    starGreen.image = 'http://www.oselene.com/web/carte/star_green.png';

    starGreen.shadow = 'http://www.oselene.com/web/carte/star_shadow.png';

    starGreen.iconSize = new GSize(12, 12);

    starGreen.shadowSize = new GSize(22, 20);

    starGreen.iconAnchor = new GPoint(6, 20);

    starGreen.infoWindowAnchor = new GPoint(5, 1);


    var starWhite = new GIcon(); 

    starWhite.image = 'http://www.oselene.com/web/carte/star_white.png';

    starWhite.shadow = 'http://www.oselene.com/web/carte/star_shadow.png';

    starWhite.iconSize = new GSize(12, 12);

    starWhite.shadowSize = new GSize(22, 20);

    starWhite.iconAnchor = new GPoint(6, 20);

    starWhite.infoWindowAnchor = new GPoint(5, 1);

    var customIcons = [];

    customIcons["DA"] = heartBlue;
    customIcons["DB"] = heartRed;
    customIcons["DC"] = heartOrange;
    customIcons["DD"] = heartPink;
    customIcons["DE"] = heartYellow;
    customIcons["DF"] = heartBlack;
    customIcons["DG"] = heartGreen;
    customIcons["DH"] = heartWhite;

    customIcons["CA"] = starBlue;
    customIcons["CB"] = starRed;
    customIcons["CC"] = starOrange;
    customIcons["CD"] = starPink;
    customIcons["CE"] = starYellow;
    customIcons["CF"] = starBlack;
    customIcons["CG"] = starGreen;
    customIcons["CH"] = starWhite;

    customIcons["BA"] = ballBlue;
    customIcons["BB"] = ballRed;
    customIcons["BC"] = ballOrange;
    customIcons["BD"] = ballPink;
    customIcons["BE"] = ballYellow;
    customIcons["BF"] = ballBlack;
    customIcons["BG"] = ballGreen;
    customIcons["BH"] = ballWhite;

    customIcons["AA"] = bubbleBlue;
    customIcons["AB"] = bubbleRed;
    customIcons["AC"] = bubbleOrange;
    customIcons["AD"] = bubblePink;
    customIcons["AE"] = bubbleYellow;
    customIcons["AF"] = bubbleBlack;
    customIcons["AG"] = bubbleGreen;
    customIcons["AH"] = bubbleWhite;
	
    var map = null;
    var geocoder = null;
	var marker31 ;

    function load() {
      if (GBrowserIsCompatible()) {
            map = new GMap2(document.getElementById("map"));
			map.addControl(new GLargeMapControl());
			map.addControl(new GMapTypeControl());
			map.setCenter(new GLatLng(43.604830, 1.442860), 12);
			

	   	    geocoder = new GClientGeocoder();
	
		var icon = new GIcon();
			icon.image = "http://www.oselene.com/web/carte/bubble_red.png";
			icon.shadow =
			"http://www.oselene.com/web/carte/bubble_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);

			//var id = "36";
		var options = {
        	icon: icon,
        	draggable: true
     	 };
		 
		var point = new GLatLng(43.604830, 1.442860);
		marker31 = new GMarker(point, options);
		map.addOverlay(marker31); 

		GEvent.addListener(marker31, "dragstart", function() {
        map.closeInfoWindow();
    	  });
      
		GEvent.addListener(marker31, "dragend", function() {
         htm1 = '<br /> ' +  ' Latitude = ' + marker31.getPoint().lat();
         htm2 = htm1 + '<br /> ' +  ' Longitude = ' + marker31.getPoint().lng();
         marker31.openInfoWindowHtml(htm2);
     	 });

		GDownloadUrl("genxml_rtime.php", function(data) {
          var xml = GXml.parse(data);
          var markers = xml.documentElement.getElementsByTagName("marker");
          for (var i = 0; i < markers.length; i++) {
            var dateheure = markers[i].getAttribute("dateheure");
	    	var name = markers[i].getAttribute("name");
            var subname = markers[i].getAttribute("subname");
            var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")),
                                    parseFloat(markers[i].getAttribute("lng")));
            var altitude = markers[i].getAttribute("alt");
			var vitesse = markers[i].getAttribute("vit");
            var type = markers[i].getAttribute("type");
            var subtype= markers[i].getAttribute("subtype");
            var letext= markers[i].getAttribute("text");
            var marker = createMarker(point, dateheure, name, subname, altitude,  vitesse, type, subtype, letext);
            map.addOverlay(marker);}});
     	 }
    	}

    function createMarker(point, dateheure, name, subname, altitude, vitesse, type, subtype,letext) {
      var marker = new GMarker(point, customIcons[type]);
      var html = "<b>" + " Date:Hour " + dateheure + "</b> <br/>"+ "<b>" + " Name:" + name + "</b> <br/>" + "<b>" + " Subname:" + subname + "</b> <br/>" + " Speed: " + vitesse + " Altitude: " + altitude + "<br/>"  +" Text: " + letext;
      GEvent.addListener(marker, 'click', function() {
        marker.openInfoWindowHtml(html);
      });
      return marker;
    }
	
	function showAddress(address) {  
	   	geocoder.getLatLng(address,function(point) {      
	   	if (!point) {alert(address + " not found");} 
	   		else { map.setCenter(point, 13);        
	   		var marker = new GMarker(point);        
	   		map.addOverlay(marker);        
	   		marker.openInfoWindowHtml(address);}
			}  );
		}	
		
  	function movetolatlng () {
		var lati = document.getElementById('maplatitude') ;
		var lngi = document.getElementById('maplongitude') ;
		lat = (+lati.value);
	 	lng = (+lngi.value);
		alert ( lat + " " + lng);
		if ((lat > -90 ) && (lat < 90 ) && (lng > -180) && (lng < 180)) {
		map.panTo(new GLatLng(lat, lng));
		marker31.setLatLng(new GLatLng(lat, lng));
		marker31.closeInfoWindow()
	}

	}
	
	function gotolatlng ( lat, lng) {
	 lat = (+lat);
	 lng = (+lng);
	if ((lat > -90 ) && (lat < 90 ) && (lng > -180) && (lng < 180)) {
		//marker31.closeInfoWindow()
		map.panTo(new GLatLng(lat, lng));
		marker31.setLatLng(new GLatLng(lat.value, lng.value));
		//MyMapSetZoom (12);
		}
	}
	
	
	
 	function MyMapGoto(lat, lng) {
       map.panTo(new GLatLng(lat, lng));
    }
	
	function MyMapSetZoom(zoom) {	
		zoom = (+zoom);
		map.setZoom(zoom);
    }
	
	function MyMapRemoveMarker(marker) {
      map.removeOverlay(marker);
    }

    //]]>