Index: trunk/client/header.php
===================================================================
--- trunk/client/header.php	(revision 209)
+++ trunk/client/header.php	(revision 210)
@@ -31,5 +31,5 @@
 	# rotazione per tema tour
 	if (isset($_SESSION['ruota'])){$csv=1; echo "<body onload=\"loadpage()\"";}
-	else echo "<body";
+	else echo "<body onload=\"initialize()\"";
 	if (!$csv) echo " style=\"background-image: url(temi/$tema/images/sfondo.jpg); background-repeat:repeat-x;\"";
 	echo " >\n";
Index: trunk/client/inc/javascript.php
===================================================================
--- trunk/client/inc/javascript.php	(revision 209)
+++ trunk/client/inc/javascript.php	(revision 210)
@@ -48,4 +48,5 @@
 #########################################################
 
+
 function googlemaps(){
 global $dbi,$prefix,$id_comune,$googlemaps,$op,$gkey,$lang;
@@ -56,70 +57,46 @@
     $sql = mysql_query("select indirizzo from ".$prefix."_ele_sede where id_sede='$id_sede'", $dbi);
     list($indirizzo)=mysql_fetch_row($sql);
-    $indirizzocomune="$indirizzo , $comune , $lang";
-# javascript per mappa
-$jsmaps ="
-    <div id=\"mapsearch\" style=\"margin:0 auto 0;\">
-    <span style=\"color:#676767;font-size:11px;margin:10px;padding:4px;\">Loading...</span>
-    </div>
+    $address="$indirizzo  $comune";
+	
+        $url = sprintf('http://maps.google.com/maps?output=js&q=%s',rawurlencode($address));
+	$result = false;
+	
+	if($result = file_get_contents($url)) {
+	    $coords = array();
+	
+		if(strpos($result,'errortips') > 1 || strpos($result,'Did you mean:') !== false) {
+			 return false;
+		}
+		
+		preg_match('!center:\s*{lat:\s*(-?\d+\.\d+),lng:\s*(-?\d+\.\d+)}!U', $result, $matches);
+		
+		$coords['lat'] = $matches[1];
+		$coords['long'] = $matches[2];
+	}
 
-  
-  <script src=\"http://maps.google.com/maps?file=api&amp;v=2&amp;key=$gkey\"
-    type=\"text/javascript\"></script>
-  <script src=\"http://www.google.com/uds/api?file=uds.js&v=1.0&source=uds-msw&key=$gkey\"
-    type=\"text/javascript\"></script>
-  <style type=\"text/css\">
-    @import url(\"http://www.google.com/uds/css/gsearch.css\");
-  </style>
-  <script type=\"text/javascript\">
-    window._uds_msw_donotrepair = true;
-  </script>
-  <script src=\"http://www.google.com/uds/solutions/mapsearch/gsmapsearch.js?mode=new\"
-    type=\"text/javascript\"></script>
-  <style type=\"text/css\">
-    @import url(\"http://www.google.com/uds/solutions/mapsearch/gsmapsearch.css\");
-  </style>
+echo '
+<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&language=it"></script>
+   <script type="text/javascript">
+      function initialize() {
+         var latlng = new google.maps.LatLng('.$coords['lat'].','.$coords['long'].'); // centro della mappa
+         var myLatlng = new google.maps.LatLng('.$coords['lat'].','.$coords['long'].'); // segnapunto
+         // definizione della mappa
+         var myOptions = {
+             zoom: 16,
+             center: latlng,
+            mapTypeId: google.maps.MapTypeId.ROADMAP,
+            mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR}
+         }
+         mymap = new google.maps.Map(document.getElementById("map"), myOptions);
+         // definizione segnapunto
+         var marker = new google.maps.Marker({
+            position: myLatlng,
+            map: mymap,
+            title:"'.$address.'"
+         });
 
-  <style type=\"text/css\">
-    .gsmsc-mapDiv {
-      height : 350px;
-    }
-
-    .gsmsc-idleMapDiv {
-      height : 350px;
-    }
-
-    #mapsearch {
-      width : 450px;
-      margin: 10px;
-      padding: 4px;
-    }
-  </style>
-  <script type=\"text/javascript\">
-    function LoadMapSearchControl() {
-
-      var options = {
-            zoomControl : GSmapSearchControl.ZOOM_CONTROL_ENABLE_ALL,
-            title : \"$indirizzo\",
-            url : \"http://www.eleonline.it\",
-            idleMapZoom : GSmapSearchControl.ACTIVE_MAP_ZOOM+1,
-            activeMapZoom : GSmapSearchControl.ACTIVE_MAP_ZOOM+1
-            }
-
-      new GSmapSearchControl(
-            document.getElementById(\"mapsearch\"),
-            \"$indirizzocomune\",
-            options
-            );
-
-    }
-    
-    GSearch.setOnLoadCallback(LoadMapSearchControl);
-  </script>
-
-        <center>";    
-
-return $jsmaps;
+      }
+   </script>
+';
 }
-
-
 ?>
Index: trunk/client/modules/Elezioni/index.php
===================================================================
--- trunk/client/modules/Elezioni/index.php	(revision 209)
+++ trunk/client/modules/Elezioni/index.php	(revision 210)
@@ -384,5 +384,9 @@
  echo "<br /><div><img src=\"modules.php?name=Elezioni&amp;file=foto&amp;id_sede=".$id_sede."\" alt=\"mappa\" /></div>";
  }elseif($id_sede!='0' && $googlemaps=='1'){
-    $mappa=googlemaps(); echo $mappa;
+    $mappa=googlemaps(); //echo $mappa;
+	echo "
+	<div id=\"map\" style=\"width: 400px; height: 400px; margin: 0 auto;   position: relative; top:0; overflow: hidden;\"></div>
+";
+   // echo '<div id="map"></div>';
  } 
 
