var mapSlider = 30;
var jump=false;
var transp = 100;
var mapInterval;
var gotoLocation='/mica-publicitate/toate-anunturile/';
var gotoNorm='';
//store browser name in 

function showMap()
{	
	//if ($("blocker").style.display == 'block')
	//	closeMap();

	//$("blocker").style.display = 'block';
	$("map_container").style.display = 'block';


	//change ARATA HARTA button
	
	mapInterval = setInterval("decTransp()", 6)
}


function closeMap()
{
	$("blocker").style.display = 'none';
	$("map_container").style.display = 'none';
	$("map_canvas").style.display = 'none';
	if (_BR == 'Firefox' || _BR == 'Chrome' || _BR == 'Safari')
	{
		$("map_container").style.opacity = "0.01";
	}
	else
		$("map_container").style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=1)";
}


function switchMap()
{
	$("map_canvas").style.display = 'block';
	initialize();
}


function decTransp()
{
	transp -= 10;
	setObjTransp();
	if (transp == 0)
	{
		clearInterval(mapInterval);
		transp = 100;
	}	
}

function setObjTransp()
{
	if (_BR == 'Firefox' || _BR == 'Chrome' || _BR == 'Safari')
	{
		if (transp == 0)
			$("map_container").style.opacity = "1";
		else
			$("map_container").style.opacity = "0."+(100-transp);
	}
	else
	{
		$("map_container").style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity="+transp+")";
	}
}


function loadCoords(countryNorm)
{
	gotoLocation='/mica-publicitate/'+countryNorm+'/';
	gotoNorm = countryNorm;
	jump = true;

	var attr= "getCountry="+countryNorm;
		attr += "&city="+cityHolder; //add current tag here
	var myAjax = new Ajax.Request(
                    '/proj/PHP/ajax/dispatch.maps.php',
                    {
                        method: 'post',
                        parameters: attr,
                        asynchronous: true,
                        onComplete: showResponse,
                        contentType:'application/x-www-form-urlencoded',
                        encoding: 'UTF-8'
                    });

        function showResponse(originalRequest)
        { 
		var result = originalRequest.responseText;
		$("gmap_coords").value = result;
		switchMap();
        }
}

