// JavaScript Document


$(function(){




	function doRenderMap($x, $y, $nr, $adr){
		//$("#map").remove();
		//$(".continut","#harta").append('<div id="map">&nbsp;</div>');
		delete map, latlon, myMarker, myMarkerContent;
		var map = new YMap(document.getElementById('map'), YAHOO_MAP_REG, new YSize(449, 320));  
		map.addZoomLong();  
		map.addPanControl();  
		map.setMapType();
		var latlon = new YGeoPoint($x, $y);
		var myMarker = new YMarker(latlon, createCustomMarkerImage());
		var myMarkerContent = "<div style='padding:0 10px;width:160px;color:#2e4ca9;'><strong>Agentia de Credite si Burse de Studii</strong><p style='font-size:10px;color:#666;border-top:2px solid #2e4ca9'>" + $adr + "</p></div>";
		YEvent.Capture(myMarker, EventsList.MouseClick,
		function() {myMarker.openSmartWindow(myMarkerContent);});
		map.addOverlay(myMarker);
		
		map.drawZoomAndCenter(latlon, $nr);
		myMarker.addAutoExpand("<strong style='color:#2e4ca9; padding:0 10px;'>Agentia de Credite si Burse de Studii</strong>");
		//myMarker.openSmartWindow(myMarkerContent);
		//myMarker.setSmartWindowColor("ocre");

		function createCustomMarkerImage(){  
			var myImage = new YImage();  
			myImage.src = '../imagini/marker.png';  
			myImage.size = new YSize(30,33);  
			myImage.offsetSmartWindow = new YCoordPoint(0,0);  
			return myImage;   
		} 

	}
doRenderMap(44.466640, 26.047082, 3, "Str. Caransebes nr. 1, etaj 7, sector 1, Bucuresti, cod 012271");
});