var initialLocation;
var map;
function showMapBox(plLat,plLong,idPlace) {
	//alert(plLat+","+plLong+","+idPlace);
	$("#mapBox").fadeIn("fast");
	getMap(plLat,plLong,idPlace);
	$("#butt_back3").fadeIn("fast");
	$.scrollTo('#slideshowAndTextBoxBlack',800);
}

function CloseselectMapBox()
{
	//var namePlace=document.getElementById("name_place_find").value="";
	//var regSelected=document.getElementById("region_select_find").selectedIndex = 0;
	//var catSelected=document.getElementById("categoria_select_find").selectedIndex = 0;
	$("#mapBox").fadeOut("fast");
	$("#butt_back3").fadeOut("fast");
	$("#map_canvas").html("");
	$("#infoPlace").html("");
}
function getMap(plLat,plLong,idPlace)
{
	var xmlhttp_4;
	//$("#loaderSearch").fadeIn("fast");
	if (window.XMLHttpRequest)
	  {
	  xmlhttp_4=new XMLHttpRequest();
	  }
	else
	  {
	  xmlhttp_4=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	xmlhttp_4.onreadystatechange=function()
	  {
	  if (xmlhttp_4.readyState==4 && xmlhttp_4.status==200)
	    {
			document.getElementById("mapBox").innerHTML=xmlhttp_4.responseText;
			fleXenv.fleXcrollMain("infoPlace");
			showMapCanvas(plLat,plLong,idPlace);
			//$("#loaderSearch").fadeOut("fast");
	    }
	  }
	xmlhttp_4.open("GET","includes/getMapC2PRidInfo.php?idplace="+idPlace,true);
	xmlhttp_4.send();
}

function showMapCanvas(plLat,plLong,idPlace)
{
	var myOptions = {
    zoom: 14,
    mapTypeId: google.maps.MapTypeId.ROADMAP
	};
	var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
	initialLocation = new google.maps.LatLng(plLat,plLong);
	var placeMarker = new google.maps.Marker({
											 position: initialLocation,
											 map: map,
											 
											 });
	
	map.setCenter(initialLocation);
}
