var aOptionPairs = new Array() 
//***********************
    var ovmap =""
          //  ======== A function to adjust the positioning of the overview ========
      function positionOverview(x,y) {
        var omap=document.getElementById("map_overview");
        omap.style.left = x+"px";
        omap.style.top = y+"px";
        
        // == restyling ==
        omap.firstChild.style.border = "1px solid gray";

        omap.firstChild.firstChild.style.left="4px";
        omap.firstChild.firstChild.style.top="4px";
        omap.firstChild.firstChild.style.width="150px";
        omap.firstChild.firstChild.style.height="150px";
      }
//**********************

function makefill() {

jsrsExecute( 'select-map.asp', load, 'makelist', comune );
 function cbFillMake ( strMakes ){ 
alert(strMakes);
 aOptionPairs = strMakes.split('|');
alert(aOptionPairs[0]+'aaa');
  }
  }


function load(strMakes) {

 aOptionPairs = strMakes.split('|');



        if (GBrowserIsCompatible()) { 

    //var hotIcon = new GIcon();
      //hotIcon.image = "http://www.ideasalento.com/images/flag2.gif";
      //--hotIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
      //hotIcon.iconSize = new GSize(20, 34);
      //hotIcon.shadowSize = new GSize(37, 34);
      //hotIcon.iconAnchor = new GPoint(9, 34);
      //hotIcon.infoWindowAnchor = new GPoint(9, 2);
      //hotIcon.infoShadowAnchor = new GPoint(18, 25);



   
      function createMarker(point,html) {
	 
        //var marker = new GMarker(point,hotIcon);
        var marker = new GMarker(point);
		 GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        return marker;
      }    
    


      if (GBrowserIsCompatible()) {


        var map = new GMap2(document.getElementById("map"));
        //map.addControl(new GLargeMapControl());
        //map.addControl(new GMapTypeControl());
 
		map.addControl(new GOverviewMapControl());

        map.setCenter(new GLatLng(aOptionPairs[1], aOptionPairs[0]), 12);
     
      var point = new GLatLng(aOptionPairs[1],aOptionPairs[0]);
		var customUI=map.getDefaultUI();
	  customUI.controls.scalecontrol=false;
	  map.setUI(customUI); 

 //  ======== Add a map overview ==========
      //  ======== save a reference to the control =========
      //var ovcontrol = new GOverviewMapControl(new GSize(180,180)); 
      //map.addControl(ovcontrol);
  
         // ======== get a reference to the GMap2 ===========
      //ovmap = ovcontrol.getOverviewMap();
	  
	  
      
      //GEvent.addListener(ovmap,"click",function() {alert("you clicked the overview");} );
   
      //  ======== Cause the overview to be positioned AFTER IE sets its initial position ======== 
      //setTimeout("positionOverview(600,254)",1);
      //positionOverview(700,254);
      
      //  ======== change the overview map type AFTER the overview finisges initializing =====
      //setTimeout("ovmap.setMapType(G_SATELLITE_MAP);",1);           
     //ovmap.setMapType(G_SATELLITE_MAP);
     //ovmap.setMapType(_SATELLITE_TYPE);
var publisher_id = 'pub-4445939314592851';
var adPos = new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(50, 50)); // Set the anchor position and GSize offset to your desired values.
var adsManagerOptions = { 
  maxAdsOnMap : 4, 
  style: 'adunit', 
  // The channel field is optional - replace this field with a channel number  
  // for Google AdSense tracking 
  channel: '2931573408',
  position: adPos 
}; 
 
adsManager = new GAdsManager(map, publisher_id, adsManagerOptions); 
adsManager.enable();

//***********************************


//var marker = createMarker(point,'prova')
var marker = createMarker(point,aOptionPairs[2])
      map.addOverlay(marker);
      }
      
    }
    
    // display a warning if the browser was not compatible
    else {
      alert("Ci dispiace ma Google maps non è compatibile con questo Browser");
    }
          


    }


