// JScript source code
//<![CDATA[
    
    // this variable will collect the html which will eventually be placed in the side_bar
      
    
      // arrays to hold copies of the markers and html used by the side_bar
      // because the function closure trick doesnt work there
      var gmarkers = [];
      var i = 0;

     // A function to create the marker and set up the event window
      function createMarker(point,html) {
        var marker = new GMarker(point);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        // save the info we need to use later for the side_bar
        gmarkers[i] = marker;             
        i++;
        return marker;
      }   
    
    // This function picks up the click and opens the corresponding info window
      function myclick(i) {
        GEvent.trigger(gmarkers[i], "click");
      }
      
      
    
    
    function load() {
		startTime();
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());  
		map.setCenter(new GLatLng(35.7333333, 10.5833333), 11); // the second parameter is the zoom
		map.setMapType(G_HYBRID_MAP);
		
		//add the points 
		//msaken     
        var point = new GLatLng(35.7333333, 10.5833333); // longitude/latitude of your location
        var marker = createMarker(point,"Msaken, Tunisia");
		map.addOverlay(marker);   
           
           
        //add the points 
		//Kairouan    
        var point = new GLatLng(35.67929722, 10.09623333); // longitude/latitude of your location
        var marker = createMarker(point,"Kairouan, Tunisia");
		map.addOverlay(marker);  
		
		
		//add the points 
		//Tiaret    
        var point = new GLatLng(35.37918056, 1.324752778); // longitude/latitude of your location
        var marker = createMarker(point,"Tiaret, Algeria");
		map.addOverlay(marker);     
		
		
		
		//add the points 
		//Baghdad    
        var point = new GLatLng(33.33251389, 44.41856667); // longitude/latitude of your location
        var marker = createMarker(point,"Baghdad, Iraq");
		map.addOverlay(marker);       
		                 
      // put the assembled side_bar_html contents into the side_bar div
          
      
        
        //var marker = new GMarker(point);
		//map.addOverlay(marker);		
		//GEvent.addListener(marker, "click", function() {
        //marker.openInfoWindowHtml("Msaken, Tunisia");});

        
        /*G_NORMAL_MAP- the default view 
		G_SATELLITE_MAP - showing Google Earth satellite images 
		G_HYBRID_MAP - showing a mixture of normal and satellite views 
		G_DEFAULT_MAP_TYPES - an array of these three types, useful for iterative processing 
		*/     
        
      }
    }
    //]]>
				