        <script type="text/javascript">
            
			<?
			echo "var region='".$name_region."';\n";
			?>
			
			var arr = new Array();
			var center = new Array();

            <?
			$i=0;
			while($row_Recordset1 = mysql_fetch_array($Recordset1))
				{
				$div='';
				$div='<table cellpadding="3" cellspacing="3" ><tr><td valign=top>';
				if($row_Recordset1['small'] && file_exists($base_path.$row_Recordset1['small']))
				$div .= '<img class="imground" src="'.$bp.$row_Recordset1['small'].'" border=0 width=70></td><td valign=top>';
				$div .= '<b><a target=_blank href="'.$bp.'items/'.$row_Recordset1['zag_url'].'_'.$row_Recordset1['id'].'">'.$row_Recordset1['zag'].'</a></b><br>';
				
				$op = explode("<hr>",$row_Recordset1['opis']);
				if($op[0])
					{
					$ops = explode("\n", trim($op[0]));
					unset($ops[0]);
					if($ops[1])
					$opp = implode("<br>",$ops);
					}
				if(!$opp && $op[1])
					{
					$opp = obrez($op[1], 100);
					}
				$div .= $opp;
				
				$div .= '</td></tr></table>';
				echo "arr[".$i."] = new Array(".$row_Recordset1['map_x'].", ".$row_Recordset1['map_y'].", '".$div."');\n";
				$i++;
				}
			echo "var j = ".$i.";\n";
			?>
			
			
			center[0] = arr[0][0]; 
			center[1] = arr[0][1];
			
			

ymaps.ready(init);

function init () {

var myMap = new ymaps.Map("yamap", {center: center, zoom: 11});

myMap.controls.add("zoomControl")
.add("typeSelector")
.add("mapTools");

myGeoObjects = [];

for (i = 0; i < j; i++) 
	{   
	myPlacemark = new ymaps.Placemark([arr[i][0], arr[i][1]], {
		balloonContentHeader: '<div>'+arr[i][2]+'</div>',
		}
	 );             
	myGeoObjects.push(myPlacemark);
	} //end for
	
	
clusterer = new ymaps.Clusterer();
clusterer.add(myGeoObjects);
myMap.geoObjects.add(clusterer);

} // emd function
			
        </script>	

<br><br><div id="yamap" style="width: 700px; height: 500px;"></div>
