
/* Copyright © 2007 DIALNET All rights reserved. */
var imNotSleepJet = true;

function showGMapOne( mapAccuracy, mapW, mapL, showMarker, html, cSmallControl, cSmallZoom, cLargeControl, cScale, cType, cDragging )
{
    if( imNotSleepJet )
    {
	imNotSleepJet = false;
	setTimeout( "showGMapOne( "+mapAccuracy+", "+mapW+", "+mapL+", "+showMarker+", '"+html+"', "+cSmallControl+", "+cSmallZoom+", "+cLargeControl+", "+cScale+", "+cType+", "+cDragging+" )", 500 );
	return;
    }

    if(GBrowserIsCompatible()) 
    {
	var map = new GMap2( document.getElementById ? document.getElementById("mapDiv") : document.all.mapDiv );
	if( cSmallControl == true )						map.addControl(new GSmallMapControl());
	if( cLargeControl == true || (!cLargeControl && cLargeControl != false))map.addControl(new GLargeMapControl());
	if( cScale == true || (!cScale && cScale != false))			map.addControl(new GScaleControl());
	if( cType == true || (!cType && cType != false) )			map.addControl(new GMapTypeControl());
	if( cSmallZoom == true )						map.addControl(new GSmallZoomControl());
	if( cDragging != true || mapAccuracy == 1 )				map.disableDragging();

	if( html != '')
	{
	    html = "<div style='background-color:#fff; margin:0px; width:320px; height:80px '>"+html+"</div>";
	}

	var mapCenterPoint = new GLatLng( mapW, mapL);
	
	map.setCenter( mapCenterPoint, getZoomByAccuracy(mapAccuracy) );

	if( showMarker == true )
	{
	    marker = new GMarker( mapCenterPoint );
	    map.addOverlay(marker);
	    if( html != '' )
	    {
		GEvent.addListener(marker, "click", function()
		{
		    marker.openInfoWindowHtml( html );
		});
		marker.openInfoWindowHtml( html );
	    }
	}

	/* ograniczenia zoomowania */

	GEvent.addListener(map, "zoomend", function( oldLevel, newLevel )
	{
	    if( newLevel > 17 )
	    {
		map.setZoom(17);
		if( cDragging == true ) map.enableDragging();
	    }
	    else if( newLevel <= 6 )
	    {
		map.disableDragging();
		map.setZoom(6);
	    }
	    else
	    {
		if( cDragging == true ) map.enableDragging();
	    }
	});
    }
}
