

var v=parseInt(navigator.appVersion);
isNetscape=navigator.appName.indexOf('Netscape')>=0;
isExplorer=navigator.appName.indexOf('Explorer')>=0;
if (v>=3) self.focus();



function yamapPrint(geo1, geo2, coord1, coord2, text, ww, wh, scr) {
alert(geo1 +' '+ geo2 +' '+ coord1 +' '+ coord2 +' '+ text +' '+ ww +' '+ wh +' '+ scr);

		goLocation = "";

		if (scr != 1){
			scr = 0;
		}else{
			ww = Number(ww) + 17;
		}
		positionCode='';

		if (v>=4) {
			sw=screen.width; sh=screen.height;
			wbx=Math.round((sw-ww)/2); wby=Math.round((sh-wh)/2)-25;
			if (isExplorer) positionCode='left='+wbx+',top='+wby+',';
			if (isNetscape) positionCode='screenX='+wbx+',screenY='+wby+',';
		}

		page = window.open(goLocation,'','width='+ww+',height='+wh+','+positionCode+'toolbar=0,'+'scrollbars='+scr+','+'resizable=0');
		page.document.open();
		pagecode = '<HEAD><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=windows-1251" /><TITLE>РОК — Карта проезда</TITLE></HEAD><BODY STYLE="margin: 0px; padding: 0px">';
		pagecode += '<script src="http://api-maps.yandex.ru/1.1/?key=AHy5rEsBAAAAMUksQgIAi5Tmynk-XcVsNzvI7cepfFsXb2EAAAAAAAAAAABOT4ebWtiNFtq0EuEE-0hbsOHgXQ==&wizard=constructor" type="text/javascript"></script>';
		pagecode += '<script type="text/javascript">';		
		pagecode += '		  YMaps.jQuery(function () {';
		pagecode += '		  var map = new YMaps.Map(YMaps.jQuery("#YMapsID-5145")[0]);';
		pagecode += '        map.setCenter(new YMaps.GeoPoint('+ geo1 +','+ geo2 +'), 16, YMaps.MapType.MAP);';
		pagecode += '        map.addControl(new YMaps.Zoom());';
		pagecode += '        map.addControl(new YMaps.ToolBar());';
		pagecode += '        map.addControl(new YMaps.TypeControl());';		
		pagecode += '        YMaps.Styles.add("constructor#pmblmPlacemark", {';
		pagecode += '            iconStyle : {';
		pagecode += '                href : "http://api-maps.yandex.ru/i/0.3/placemarks/pmblm.png",';
		pagecode += '                size : new YMaps.Point(28,29),';
		pagecode += '                offset: new YMaps.Point(-8,-27)';
		pagecode += '            }';		
		pagecode += '        });';
		pagecode += '        YMaps.Styles.add("constructor#FFEA00c85Polyline", {';
		pagecode += '            lineStyle : {';
		pagecode += '                strokeColor : "FFEA00c8",';
		pagecode += '                strokeWidth : 5';
		pagecode += '            }';		
		pagecode += '        });';
//       map.addOverlay(createObject("Placemark", new YMaps.GeoPoint(30.214093,59.867561), "constructor#pmblmPlacemark", "???-1, ??????? ????"));
		pagecode += '	   map.openBalloon(new YMaps.GeoPoint('+ coord1 +', '+ coord2 +'), "'+ text +'", {hasCloseButton:false, maxWidth:250})';
		pagecode += '      map.addOverlay(createObject("Polyline", [new YMaps.GeoPoint(30.216813,59.86496),new YMaps.GeoPoint(30.212414,59.865662),new YMaps.GeoPoint(30.210762,59.866028),new YMaps.GeoPoint(30.208874,59.866525),new YMaps.GeoPoint(30.210998,59.868402),new YMaps.GeoPoint(30.213573,59.867733),new YMaps.GeoPoint(30.213316,59.867528),new YMaps.GeoPoint(30.213874,59.86741)], "constructor#FFEA00c85Polyline", ""));';
		pagecode += '        function createObject (type, point, style, description) {';
		pagecode += '            var allowObjects = ["Placemark", "Polyline", "Polygon"],';
		pagecode += '            index = YMaps.jQuery.inArray( type, allowObjects),';		
		pagecode += '            constructor = allowObjects[(index == -1) ? 0 : index];';
		pagecode += '            description = description || "";';
		pagecode += '            var object = new YMaps[constructor](point, {style: style, hasBalloon : !!description});';
		pagecode += '            object.description = description;';
		pagecode += '            return object;';
		pagecode += '        }';
		pagecode += '    });';
		pagecode += '</script>';
		pagecode += '<div id="YMapsID-5145" style="width:600px;height:450px"></div>';
		pagecode += '</BODY>';		
		

		page.document.write(pagecode);
		page.document.close();
		if (isNetscape && v>=3) page.focus();
}

