    //<![CDATA[

    var locations = {};

    function load() {
      var map = new GMap2(document.getElementById("map"));
      map.setCenter(new GLatLng(59.954004, 30.316770), 11);
	  map.addControl(new TextualZoomControl());	
	  var geocoder = new GClientGeocoder();
        for (var i=1;i<=document.getElementById("maxmarker").value;i++) {
          var address = document.getElementById("address_sauna"+i).value;
		function showAddress(address,id) {
          geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              //document.getElementById("map").style.display = 'none';
			  //alert(address+" не найден");
            } else {
		 	  var blueIcon = new GIcon(G_DEFAULT_ICON);
			  var title = address;
			  blueIcon.image = "/img/map_icon.png";
			  blueIcon.iconSize = new GSize(15, 15);
			  blueIcon.iconAnchor = new GPoint(0, 15);
			  blueIcon.shadow =null;
			  markerOptions = {icon:blueIcon,title:title};
              var marker = new GMarker(point, markerOptions);
				GEvent.addListener(marker, 'click', function() {
				if (!navigator.userAgent.match(/opera/i))
				{
				marker.openExtInfoWindow(
				map, 
				"extInfoWindow_coolBlues",
				"<div class='info'>"+
				"<p class=name><a href='http://sauna360.ru/sauna/"+document.getElementById("id_sauna"+id).value+"'>"+document.getElementById("name_sauna"+id).value+"</a></p>"+
				"<p class=ttt>Телефон:</p><p class=phone>"+document.getElementById("phone_sauna"+id).value+"</p>"+
				"<p class=desc><span class=ttt>Вместимость: </span>"+document.getElementById("capacity_sauna"+id).value+"<br>"+
				"<span class=ttt>Цена: </span>1 час - "+document.getElementById("price_sauna"+id).value+" р.<br>"+
				"<span class=ttt>Парные: </span>"+document.getElementById("type_sauna"+id).value+
				"</p></div>",
				{beakOffset: 3}
				); 
				}
				else
				{	
					var text="<a href='http://sauna360.ru/sauna/"+document.getElementById("id_sauna"+id).value+"'>"+document.getElementById("name_sauna"+id).value+"</a><br/> Телефон: "+document.getElementById("phone_sauna"+id).value+"<br/>Вместимость: "+document.getElementById("capacity_sauna"+id).value+"<br/> Цена: 1час - "+document.getElementById("price_sauna"+id).value+" р.<br/>Парные: "+document.getElementById("type_sauna"+id).value;
					marker.openInfoWindow(text);
				}
				});
			  
              map.addOverlay(marker);
            }
          }
          );
        }
        showAddress(address,i);
        }
    }
    function load_sauna() {
      var map = new GMap2(document.getElementById("map"));
     // map.setCenter(new GLatLng(59.954004, 30.316770), 11);
	  map.addControl(new TextualZoomControl());	
	  var geocoder = new GClientGeocoder();
	  var i=1;
	  var address = document.getElementById("address_sauna"+i).value;
		function showAddress(address,id) {
          geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              //document.getElementById("map").style.display = 'none';
			  //alert(address+" не найден");
            } else {
		 	  var blueIcon = new GIcon(G_DEFAULT_ICON);
			  var title = address;
			  blueIcon.image = "/img/map_icon.png";
			  blueIcon.iconSize = new GSize(15, 15);
			  blueIcon.iconAnchor = new GPoint(0, 15);
			  blueIcon.shadow =null;
			  map.setCenter(point, 15);
			  markerOptions = {icon:blueIcon,title:title};
              var marker = new GMarker(point, markerOptions);
				GEvent.addListener(marker, 'click', function() {
				if (!navigator.userAgent.match(/opera/i))
				{
				marker.openExtInfoWindow(
				map, 
				"extInfoWindow_coolBlues",
				"<div class='info'>"+
				"<p class=name><a href='http://sauna360.ru/sauna/"+document.getElementById("id_sauna"+id).value+"'>"+document.getElementById("name_sauna"+id).value+"</a></p>"+
				"<p class=ttt>Телефон:</p><p class=phone>"+document.getElementById("phone_sauna"+id).value+"</p>"+
				"<p class=desc><span class=ttt>Вместимость: </span>"+document.getElementById("capacity_sauna"+id).value+"<br>"+
				"<span class=ttt>Цена: </span>1 час - "+document.getElementById("price_sauna"+id).value+" р.<br>"+
				"<span class=ttt>Парные: </span>"+document.getElementById("type_sauna"+id).value+
				"</p></div>",
				{beakOffset: 3}
				); 
				}
				else
				{	
					var text="<a href='http://sauna360.ru/sauna/"+document.getElementById("id_sauna"+id).value+"'>"+document.getElementById("name_sauna"+id).value+"</a><br/> Телефон: "+document.getElementById("phone_sauna"+id).value+"<br/>Вместимость: "+document.getElementById("capacity_sauna"+id).value+"<br/> Цена: 1час - "+document.getElementById("price_sauna"+id).value+" р.<br/>Парные: "+document.getElementById("type_sauna"+id).value;
					marker.openInfoWindow(text);
				}
				});
			 
              map.addOverlay(marker);
				if (!navigator.userAgent.match(/opera/i))
				{
				marker.openExtInfoWindow(
				map, 
				"extInfoWindow_coolBlues",
				"<div class='info'>"+
				"<p class=name><a href='http://sauna360.ru/sauna/"+document.getElementById("id_sauna"+id).value+"'>"+document.getElementById("name_sauna"+id).value+"</a></p>"+
				"<p class=ttt>Телефон:</p><p class=phone>"+document.getElementById("phone_sauna"+id).value+"</p>"+
				"<p class=desc><span class=ttt>Вместимость: </span>"+document.getElementById("capacity_sauna"+id).value+"<br>"+
				"<span class=ttt>Цена: </span>1 час - "+document.getElementById("price_sauna"+id).value+" р.<br>"+
				"<span class=ttt>Парные: </span>"+document.getElementById("type_sauna"+id).value+
				"</p></div>",
				{beakOffset: 3}
				); 
				}
				else
				{	
					var text="<a href='http://sauna360.ru/sauna/"+document.getElementById("id_sauna"+id).value+"'>"+document.getElementById("name_sauna"+id).value+"</a><br/> Телефон: "+document.getElementById("phone_sauna"+id).value+"<br/>Вместимость: "+document.getElementById("capacity_sauna"+id).value+"<br/> Цена: 1час - "+document.getElementById("price_sauna"+id).value+" р.<br/>Парные: "+document.getElementById("type_sauna"+id).value;
					marker.openInfoWindow(text);
				}				
			}
          }
          );
        }
        showAddress(address,i);
    }
   function TextualZoomControl() {
    }
    TextualZoomControl.prototype = new GControl();

    // Creates a one DIV for each of the buttons and places them in a container
    // DIV which is returned as our control element. We add the control to
    // to the map container and return the element for the map class to
    // position properly.
    TextualZoomControl.prototype.initialize = function(map) {
      var container = document.createElement("div");

      var zoomInDiv = document.createElement("div");
      this.setButtonStyle1_(zoomInDiv);
      container.appendChild(zoomInDiv);
      zoomInDiv.appendChild(document.createTextNode(""));
      GEvent.addDomListener(zoomInDiv, "click", function() {
        map.zoomIn();
      });
      GEvent.addDomListener(zoomInDiv, "mouseover", function() {
        zoomInDiv.style.background= "url(/img/map_plus_hover.png) no-repeat";
      });
      GEvent.addDomListener(zoomInDiv, "mouseout", function() {
        zoomInDiv.style.background= "url(/img/map_plus.png) no-repeat";
      });
	  
      var zoomOutDiv = document.createElement("div");
      this.setButtonStyle2_(zoomOutDiv);
      container.appendChild(zoomOutDiv);
      zoomOutDiv.appendChild(document.createTextNode(""));
      GEvent.addDomListener(zoomOutDiv, "click", function() {
        map.zoomOut();
      });
      GEvent.addDomListener(zoomOutDiv, "mouseover", function() {
        zoomOutDiv.style.background= "url(/img/map_minus_hover.png) no-repeat";
      });
      GEvent.addDomListener(zoomOutDiv, "mouseout", function() {
        zoomOutDiv.style.background= "url(/img/map_minus.png) no-repeat";
      });
      map.getContainer().appendChild(container);
      return container;
    }

    // By default, the control will appear in the top left corner of the
    // map with 7 pixels of padding.
    TextualZoomControl.prototype.getDefaultPosition = function() {
      return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7, 7));
    }

    // Sets the proper CSS for the given button element.
    TextualZoomControl.prototype.setButtonStyle1_ = function(button) {
      button.style.background = "url(/img/map_plus.png) no-repeat";
      button.style.width = "38px";
      button.style.height = "38px";
      button.style.cursor = "pointer";
      button.style.margin = "2px";
    }
    // Sets the proper CSS for the given button element.
    TextualZoomControl.prototype.setButtonStyle2_ = function(button) {
      button.style.background = "url(/img/map_minus.png) no-repeat";
      button.style.width = "38px";
      button.style.height = "38px";
      button.style.cursor = "pointer";
      button.style.margin = "2px";}	
    //]]>
	
function ShowPlaceonMap()
{
	document.getElementById("slideshow").value=0;
	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();
	var obj=document.getElementById("googlemapabsolute");
	if (obj) {
		obj.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 350) / 2) + 'px');
		obj.style.left = (((arrayPageSize[0] - 20 - 740) / 2) + 'px');
		obj.style.display = 'block';		
		obj.style.visibility = 'visible';		
	}	
	var bgobj=document.getElementById("bggooglemap");
	if (bgobj) {
		bgobj.style.top = "0px";
		bgobj.style.width = (arrayPageSize[2]  + 'px');
		bgobj.style.left = "0px";
		bgobj.style.height = (arrayPageSize[0] + 'px');
		bgobj.style.display = 'block';		
		bgobj.style.visibility = 'visible';		
		document.body.style.overflowX='hidden';
	}
	else alert('no');
	load_sauna();
}
function HidePlaceonMap()
{

	var obj=document.getElementById("googlemapabsolute");
	if (obj) {
		obj.style.top = "-400px";
		obj.style.visibility = 'hidden';		
	}		
	var bgobj=document.getElementById("bggooglemap");
	if (bgobj) {
		bgobj.style.top = "-400px";
		bgobj.style.width = "1px";
		bgobj.style.height = "1px";
		bgobj.style.visibility = 'hidden';		
	}	
	document.body.style.overflowX='auto';
}

    function simplemap() {
      if (GBrowserIsCompatible()) {
		var adress=document.getElementById("adressmap").value;
        var map = new GMap2(document.getElementById("map"));
		var geocoder = new GClientGeocoder();
        function showAddress(address) {
          geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              //alert(address + " not found");
              document.getElementById("map").style.display = 'none';
            } else {
			        // Create our "tiny" marker icon
			 var blueIcon = new GIcon(G_DEFAULT_ICON);
			 blueIcon.image = "http://gmaps-samples.googlecode.com/svn/trunk/markers/blue/blank.png";
		     
			 // Set up our GMarkerOptions object
			  markerOptions = { icon:blueIcon };
              map.setCenter(point, 12);
			  var marker = new GMarker(point, markerOptions);
              
		    GEvent.addListener(marker, "click", function() {
			var adr=document.getElementById("adressmap").value;
            marker.openInfoWindowHtml(adr);
          });
		  map.addOverlay(marker);marker.openInfoWindowHtml(adress);
            }
          }
          );

        } 

		showAddress(adress);
      }
    }
var map;
function simpleyandexmap () {
  map = new YMaps.Map( document.getElementById("map") );
  map.removeAllOverlays();  
  var place=document.getElementById("adressmap").value;
 var geocoder = new YMaps.Geocoder(place, {results: 1, boundedBy: map.getBounds()});
 YMaps.Events.observe(geocoder, geocoder.Events.Load, function () {
  
  if (this.length()) {
  var geoPoint=this.get(0).getGeoPoint();
  var s = new YMaps.Style();
    s.iconStyle = new YMaps.IconStyle();
    s.iconStyle.offset = new YMaps.Point(-31,-34);
    s.iconStyle.href = "http://oddo-arh.ru/img/img.png";
    s.iconStyle.size = new YMaps.Point(63, 34);
  
  map.setCenter(new YMaps.GeoPoint(geoPoint.getLng(),geoPoint.getLat() ), 15, YMaps.MapType.MAP);
 var placemark = new YMaps.Placemark(new YMaps.GeoPoint(geoPoint.getLng(),geoPoint.getLat() ),{style: s});
	placemark.name = place;
	//placemark.description = "Описание";
	map.addOverlay(placemark); 
 /* map.addControl(new YMaps.TypeControl());
  map.addControl(new YMaps.ToolBar());*/
  map.addControl(new YMaps.Zoom());
/*  map.addControl(new YMaps.MiniMap());
  map.addControl(new YMaps.ScaleLine());*/

  map.addOverlay(placemark);
  this.get(0).setBalloonContent(this.get(0).text);
 // this.get(0).openBalloon();

    } else {
    alert("Ничего не найдено")
      }
});
}

function simpleyandexmap3 () {
  map = new YMaps.Map( document.getElementById("map") );
  map.removeAllOverlays();  
  var place=document.getElementById("adressmap").value;
  var place2=document.getElementById("adressmap33").value;
 var geocoder = new YMaps.Geocoder(place, {results: 1, boundedBy: map.getBounds()});
 YMaps.Events.observe(geocoder, geocoder.Events.Load, function () {
  
  if (this.length()) {
  var geoPoint=this.get(0).getGeoPoint();
  var s = new YMaps.Style();
    s.iconStyle = new YMaps.IconStyle();
    s.iconStyle.offset = new YMaps.Point(-31,-34);
    s.iconStyle.href = "http://oddo-arh.ru/img/img.png";
    s.iconStyle.size = new YMaps.Point(63, 34);
  
    map.setCenter(new YMaps.GeoPoint(geoPoint.getLng(),geoPoint.getLat() ), 9, YMaps.MapType.MAP);
    var placemark = new YMaps.Placemark(new YMaps.GeoPoint(geoPoint.getLng(),geoPoint.getLat() ),{style: s});
	placemark.name = place;
	map.addOverlay(placemark); 
    map.addControl(new YMaps.Zoom());
    map.addOverlay(placemark);
    this.get(0).setBalloonContent(this.get(0).text);

    } else {
    alert("Ничего не найдено")
      }
}); 
var geocoder2 = new YMaps.Geocoder(place2, {results: 1, boundedBy: map.getBounds()});
 YMaps.Events.observe(geocoder2, geocoder2.Events.Load, function () {
  
  if (this.length()) {
  var geoPoint=this.get(0).getGeoPoint();
  var s = new YMaps.Style();
    s.iconStyle = new YMaps.IconStyle();
    s.iconStyle.offset = new YMaps.Point(-31,-34);
    s.iconStyle.href = "http://oddo-arh.ru/img/img.png";
    s.iconStyle.size = new YMaps.Point(63, 34);
  
  //  map.setCenter(new YMaps.GeoPoint(geoPoint.getLng(),geoPoint.getLat() ), 7, YMaps.MapType.MAP);
    var placemark = new YMaps.Placemark(new YMaps.GeoPoint(geoPoint.getLng(),geoPoint.getLat() ),{style: s});
	placemark.name = place;
	map.addOverlay(placemark); 
    map.addControl(new YMaps.Zoom());
    map.addOverlay(placemark);
    this.get(0).setBalloonContent(this.get(0).text);

    } else {
    alert("Ничего не найдено")
      }
});
}	
function simpleyandexmap1 () {
  map = new YMaps.Map( document.getElementById("map1") );
  map.removeAllOverlays();  
  var place=document.getElementById("adressmap1").value;
 var geocoder = new YMaps.Geocoder(place, {results: 1, boundedBy: map.getBounds()});
 YMaps.Events.observe(geocoder, geocoder.Events.Load, function () {
  
  if (this.length()) {
  var geoPoint=this.get(0).getGeoPoint();
  var s = new YMaps.Style();
    s.iconStyle = new YMaps.IconStyle();
    s.iconStyle.offset = new YMaps.Point(-31,-34);
    s.iconStyle.href = "http://oddo-arh.ru/img/img.png";
    s.iconStyle.size = new YMaps.Point(63, 34);
  
  map.setCenter(new YMaps.GeoPoint(geoPoint.getLng(),geoPoint.getLat() ), 15, YMaps.MapType.MAP);
 var placemark = new YMaps.Placemark(new YMaps.GeoPoint(geoPoint.getLng(),geoPoint.getLat() ),{style: s});
	placemark.name = place;
	//placemark.description = "Описание";
	map.addOverlay(placemark); 
 /* map.addControl(new YMaps.TypeControl());
  map.addControl(new YMaps.ToolBar());*/
  map.addControl(new YMaps.Zoom());
/*  map.addControl(new YMaps.MiniMap());
  map.addControl(new YMaps.ScaleLine());*/

  map.addOverlay(placemark);
  this.get(0).setBalloonContent(this.get(0).text);
 // this.get(0).openBalloon();

    } else {
    alert("Ничего не найдено")
      }
});
}	
