var map;
var mojmarker;
var x;
var y;

function startmap(Lat,Lng){
	map = new GMap2(document.getElementById("mapa"));
	map.setCenter(new GLatLng(Lat,Lng), 4);
	map.addControl(new GScaleControl());
	map.addControl(new GSmallZoomControl());
	map.addControl(new GMapTypeControl());
}

function startmoj(u){
	mojmarker = new GMarker(new GLatLng(53.159947,17.95166), {draggable: true});
	GEvent.addListener(mojmarker,"click",function(){
		mojmarker.openInfoWindowHtml(u);
	});    
	GEvent.addListener(mojmarker, "dragend", function() {
        coord = mojmarker.getPoint();
		document.pozycja.Lng.value=coord.x;
		document.pozycja.Lat.value=coord.y;
      });
	map.addOverlay(mojmarker);
}

function add(u,a,Lat,Lng,icon){
		var marker = new GMarker(new GLatLng(Lat,Lng),{icon:icon});
		GEvent.addListener(marker,"click",function(){
		marker.openInfoWindowHtml("<img src=\""+a+"\" width=\"80\" height=\"80\"><br><a href=\"javascript:act('http://www.piszmy.pl/profil.php?loginr="+u+"')\">"+u+"</a>");
		});
		map.addOverlay(marker);	
}

function sendlnglat(){
	act("geografia.php?Lng="+x+"&Lat="+y);
}