function loadmap(tip, adres){
		adres=adres.toLowerCase();
		document.getElementById(tip).innerHTML="";
		coordinatax=47.256262;
		coordinatay=56.135755;
		for(var i=0;i<objectsmasive.length;i++){
			razdel=objectsmasive[i].split("|");
			temp=razdel[3].toLowerCase();
			if(temp.indexOf(adres)>-1 || adres==temp){
				coordinatax=razdel[0];
				coordinatay=razdel[1];
			}
		}
		   

        var map = new YMaps.Map(document.getElementById(tip));
        map.setCenter(new YMaps.GeoPoint(coordinatax,coordinatay), 12, YMaps.MapType.MAP);
        map.addControl(new YMaps.Zoom());
        map.addControl(new YMaps.ToolBar());
        map.addControl(new YMaps.TypeControl());
 	
		
		


        YMaps.Styles.add("constructor#pmwtmPlacemark", {
            iconStyle : {
                href : "http://api-maps.yandex.ru/i/0.3/placemarks/pmwtm.png",
                size : new YMaps.Point(28,29),
                offset: new YMaps.Point(-8,-27)
            }
        });


        YMaps.Styles.add("constructor#pmblmPlacemark", {
            iconStyle : {
                href : "http://api-maps.yandex.ru/i/0.3/placemarks/pmblm.png",
                size : new YMaps.Point(28,29),
                offset: new YMaps.Point(-8,-27)
            }
        });


        YMaps.Styles.add("constructor#pmgnmPlacemark", {
            iconStyle : {
                href : "http://api-maps.yandex.ru/i/0.3/placemarks/pmgnm.png",
                size : new YMaps.Point(28,29),
                offset: new YMaps.Point(-8,-27)
            }
        });
		
		

		for(var i=0;i<objectsmasive.length;i++){
			razdel=objectsmasive[i].split("|");
			temp=razdel[3].toLowerCase();
			if(temp.indexOf(adres)>-1 || adres==temp){
				img="";
				if(razdel[5].length>5){
				img="<img src='/p/image.html?path="+razdel[5]+"&w=75'/>";
				}
				templink="/construction/"+razdel[4];
				if(templink.indexOf("http")>-1){
					templink=razdel[4];
				}
				map.addOverlay(createObject("placemark", new YMaps.GeoPoint(razdel[0],razdel[1]), razdel[2], "<div class='mapinfo'><div>"+img+"</div><span>"+razdel[3]+"<a href='"+templink+"'>Перейти на объект</a></span></div>"));
			}
		}
		     
		
      						
}
function createObject (type, point, style, description) {
            var allowObjects = ["Placemark", "Polyline", "Polygon"],
                index = YMaps.jQuery.inArray( type, allowObjects),
                constructor = allowObjects[(index == -1) ? 0 : index];
                description = description || "";
            
            var object = new YMaps[constructor](point, {style: style, hasBalloon : !!description});
            object.description = description;	
            return object;
}
