	var mapka=false;
	var geocoder=false;

	function showPoint(point, newik)
	{
		if(newik)
			mapka.setCenter(point, 17);

		mapka.clearOverlays();
		var marker = new GMarker(point, {draggable: true});

		GEvent.addListener(mapka, 'zoomend', function(){
			npoint=marker.getPoint();
			if(mapka.getZoom()<15)
				info='<div class="gin" style="width: 400px;height: 100px">In order to indicate the location of your company, you need to zoom in.<br /></div>';
			else
				info='<div class="gin" style="width: 400px;height: 100px">If this is the location of your company, click "OK".<br />Otherwise, continue to drag the point.<br /><input type="submit" value="OK" /><br /></div>';
			marker.openInfoWindowHtml(info);
			GEvent.addListener(marker, 'click', function(){
				marker.openInfoWindowHtml(info);
			});
		});


		GEvent.addListener(marker, 'dragstart', function(){
			mapka.closeInfoWindow();
		});

		GEvent.addListener(marker, 'dragend', function(){
			npoint=marker.getPoint();
			if(mapka.getZoom()<15)
				info='<div class="gin" style="width: 400px;height: 100px">In order to indicate the location of your company, you need to zoom in.<br /></div>';
			else
				info='<div class="gin" style="width: 400px;height: 100px">If this is the location of your company, click "OK".<br />Otherwise, continue to drag the point.<br /><input type="submit" value="OK" /><br /></div>';
			marker.openInfoWindowHtml(info);
			GEvent.addListener(marker, 'click', function(){
				marker.openInfoWindowHtml(info);
			});
			document.getElementById('xek').value=npoint.x;
			document.getElementById('yek').value=npoint.y;
			mapka.setCenter(npoint);
		});

		mapka.addOverlay(marker);
		if(newik)
		{
			if(mapka.getZoom()<15)
				info='<div class="gin" style="width: 400px;height: 120px">This is an earlier added point of your company’s location.<br />In order to indicate the location of your company, you need to zoom in. Next, drag this point onto the exact location of your company (by holding down the left mouse button, drag the point to the relevant location).<br /></div>';
			else
				info='<div class="gin" style="width: 400px;height: 120px">This is an earlier added point of your company’s location.<br />If the point is not precise or has moved, move the point to the exact place where your company is located (by holding down the left mouse button, move the point to the relevant location).<br />If the point is located on the relevant position, click "OK".<br /><input type="submit" value="OK" /><br /></div>';
		}
		else
		{
			if(mapka.getZoom()<15)
				info='<div class="gin" style="width: 400px;height: 120px">A location has been found:<br /><strong>'+arr.join(' &raquo; ')+'</strong><br />n order to indicate the location of your company, you need to zoom in. Next, drag this point onto the exact location of your company (by holding down the left mouse button, drag the point to the relevant location).<br /></div>';
			else
				info='<div class="gin" style="width: 400px;height: 120px">A location has been found:<br /><strong>'+arr.join(' &raquo; ')+'</strong><br />If the location is incorrect, you may correct it, to do so:<br />- zoom in<br />- by holding down the left mouse button, frag the point to the relevant location of your company.<br />If the point is located on the relevant position, click "OK".<br /><input type="submit" value="OK" /><br /></div>';
		}
		marker.openInfoWindowHtml(info);
		GEvent.addListener(marker, 'click', function(){
			marker.openInfoWindowHtml(info);
		});
		document.getElementById('xek').value=point.x;
		document.getElementById('yek').value=point.y;
	}


	function showAddress(address, callback)
	{
		if(address)
			arr=address.split(';')
		else
			arr=new Array();
		address=(arr.join(','));
		if(geocoder)
		{
			geocoder.getLatLng(
				address,
				function(point)
				{
					if (!point)
					{
						newarr=new Array();
						for(i=0;i<arr.length-1;i++)
							newarr[i]=arr[i];
						showAddress(newarr.join(';'), callback);
					}
					else
					{
						if(arr.length>=4) mapka.setCenter(point, 17);
						else if(arr.length==3) mapka.setCenter(point, 13);
						else if(arr.length==2) mapka.setCenter(point, 10);
						else if(arr.length==1) mapka.setCenter(point, 8);
						else mapka.setCenter(point, 6);
						if(callback)
							eval(callback+'(point)');
					}
				}
			);
		}
	}


	function load_mapka()
	{
		if(GBrowserIsCompatible())
		{
			mapka=new GMap2(document.getElementById('m'));
			geocoder=new GClientGeocoder();
			mapka.enableDoubleClickZoom();
			mapka.enableContinuousZoom();
			mapka.addControl(new GOverviewMapControl());
			mapka.addControl(new GLargeMapControl());
			mapka.addControl(new GMapTypeControl());
			mapka.addControl(new GScaleControl());
			GEvent.addListener(mapka, 'mouseover', function(){
					mapka.showControls();
				}
			);
			GEvent.addListener(mapka, 'mouseout', function(){
					mapka.hideControls();
				}
			);
		}
	}
