function init(adress, name) {
		var map = new YMaps.Map(document.getElementById("YMapsID"));
		map.enableScrollZoom();
		if (document.getElementById("dash").innerHTML == "посмотреть на карте") {
			document.getElementById("dash").innerHTML = "убрать карту";
			document.getElementById("YMapsID").style.width = "450px";
			document.getElementById("YMapsID").style.height = "330px";					
			map.setCenter(new YMaps.GeoPoint(30.35, 59.92), 13);
			
			// Удаляем все оверлеи
			map.removeAllOverlays(); 
			// Запускаем процесс геокодирования
			var geocoder = new YMaps.Geocoder(adress, {results: 1, boundedBy: map.getBounds()});
			YMaps.Events.observe(geocoder, geocoder.Events.Load, function () {
			//Если поиск прошел без ошибок и найден хотя бы один результат
				if (this.length()) { 
					// Добавляем оверлей на карту
					map.addOverlay(this.get(0));
					this.get(0).setBalloonContent(this.get(0).text);
					// Открываем балун
					this.get(0).openBalloon('<strong>'+name+'</strong><br>'+adress); 
				} else {
					//alert("Ничего не найдено");
				}
			});
			// Если при геокодировании произошла ошибка, то сообщаем о ней
			//YMaps.Events.observe(geocoder, geocoder.Events.Fault,
			//function (error) {alert("Произошла ошибка: " + error.message)});
		} else {
		    document.getElementById("dash").innerHTML = "посмотреть на карте";
			map.destructor();
			document.getElementById("YMapsID").style.width = "0px";
			document.getElementById("YMapsID").style.height = "0px";				
		}
}


function doClear(theText) {
     if (theText.value == theText.defaultValue) {
         theText.value = "";
         theText.style.color = "#000000";
     }
}

function doWrite(theText) {
     if (theText.value == "") {
		theText.value = 'введите адрес или улицу..';
        theText.style.color = "#999999";
     }
}
