<script src="http://api-maps.yandex.ru/1.1/index.xml?key=AG-QX04BAAAAQEqIJQIAF5eABVbf0V8pbxHqiVgqOawY_YUAAAAAAAAAAABGgyTZj04fGokZ78qnufN9KldHoA==" type="text/javascript"></script>
<script type="text/javascript">
var lat1 = 0;
var lon1 = 0;
var Datetime;// "01.01.0001 00:00"
var Speed = 0;
var ClearFlag = 0;
var MapNeedMove = 1;
var TrackNeedDraw = 0;
var start = false;
var line = false;
var Alias;

var old_lat = 0;
var old_lon = 0;

window.onload = function () {
      	map = new YMaps.Map(document.getElementById("YMapsID"));
	map.addControl(new YMaps.Zoom());
	map.addControl(new YMaps.TypeControl());

	setInterval(movePlacemark, 500);
}

function movePlacemark()
{
	if(lat1)
	{
		if(!start)
		{
	        	map.setCenter(new YMaps.GeoPoint(lon1, lat1), 13);
			placemark=new YMaps.Placemark(new YMaps.GeoPoint(lon1, lat1));
//			placemark.name = Datetime;
			placemark.description = '<B>' + Alias + '</B>' + '<BR>' + Datetime + '<BR>' + Speed + 'êì/÷';
			map.addOverlay(placemark);
			placemark.setIconContent(Speed + 'êì/÷');
			var s = new YMaps.Style();
			s.lineStyle = new YMaps.LineStyle();
			s.lineStyle.strokeWidth = '4';
			YMaps.Styles.add("example#CustomLine", s);
			start = true;
		}
		if(lat1 != old_lat || lon1 != old_lon)
		{
			pt=placemark.getGeoPoint();
			pt.setLng(lon1);
			pt.setLat(lat1);
			placemark.setGeoPoint(pt);
			placemark.setIconContent(Speed + 'êì/÷');
			placemark.setBalloonContent('<B>' + Alias + '</B>' + '<BR>' + Datetime + '<BR>' + Speed + 'êì/÷');
			if(TrackNeedDraw == 1)
			{
				if(!line)
				{
					line = new YMaps.Polyline([new YMaps.GeoPoint(lon1, lat1)],  {geodesic: true});
					line.setStyle("example#CustomLine");
				 	map.addOverlay(line);
				}
				else
				{
					if(ClearFlag == 1)
					{
						map.removeOverlay(line);
						line = new YMaps.Polyline([new YMaps.GeoPoint(lon1, lat1)],  {geodesic: true});
						line.setStyle("example#CustomLine");
					 	map.addOverlay(line);

						ClearFlag = 0;
					}		

				}
				line.addPoint(pt);
        			line.update();
			}
			if(MapNeedMove == 1)
			{       	
				map.panTo(pt);
			}
			old_lat = lat1;
			old_lon = lon1;
		}
	}
}
</script>

<BODY>
    <div id="YMapsID" style="width:100%;height:100%"></div>
</BODY>