function aumentaMenu(tamanho){
	$('menu').style.height = tamanho+'px';
	$('flashMenu').style.height  = tamanho+'px';
}

    var map;
    var gdir;
    var geocoder = null;
    var addressMarker;

    function initialize(endereco) {
      if (GBrowserIsCompatible()) { 
		map = new GMap2(document.getElementById("map_canvas"));
		map.setUIToDefault();
        gdir = new GDirections(map, document.getElementById("directions"));
        GEvent.addListener(gdir, "load", onGDirectionsLoad);
		geocoder = new GClientGeocoder();
        GEvent.addListener(gdir, "error", handleErrors);
		
      }
	  showAddress(endereco);
    }
	
    function handleErrors(){
	   if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
	     alert("Endereço Inválido. Por favor verique a ortografia e tente novamente." + gdir.getStatus().code);
	   else if (gdir.getStatus().code == G_GEO_SERVER_ERROR)
	     alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: " + gdir.getStatus().code);
	   
	   else if (gdir.getStatus().code == G_GEO_MISSING_QUERY)
	     alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: " + gdir.getStatus().code);

	//   else if (gdir.getStatus().code == G_UNAVAILABLE_ADDRESS)  <--- Doc bug... this is either not defined, or Doc is wrong
	//     alert("The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons.\n Error code: " + gdir.getStatus().code);
	     
	   else if (gdir.getStatus().code == G_GEO_BAD_KEY)
	     alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: " + gdir.getStatus().code);

	   else if (gdir.getStatus().code == G_GEO_BAD_REQUEST)
	     alert("A directions request could not be successfully parsed.\n Error code: " + gdir.getStatus().code);
	    
	   else alert("An unknown error occurred.");
	   
	}

	function onGDirectionsLoad(){ 

	}
    function showAddress(address){
		if (geocoder){
			geocoder.getLatLng(
				address,
				function(point){
					if (!point){
						alert(address + " não encontrado");
					}else{
						map.setCenter(point, 15);
						var tinyIcon = new GIcon();
						tinyIcon.image = "http://www.gwirealestate.com.br/_media/gwi.png";
						tinyIcon.shadow = "http://www.gwirealestate.com.br/_media/shadow-gwi.png";
						tinyIcon.iconSize = new GSize(30, 30);
						tinyIcon.shadowSize = new GSize(30, 30);
						tinyIcon.iconAnchor = new GPoint(6, 20);
						tinyIcon.infoWindowAnchor = new GPoint(5, 1);
        
				        markerOptions = { icon:tinyIcon };

						map.addOverlay(new GMarker(point, markerOptions));
					}
				}
			);
		}
	}


function validaContato(id_idioma){
	var msgP = "";
	var msgE = "";
	if($('nome').value == ""){
		msgP += "- Nome\n";	
		msgE += "- Name\n";	
	}
	if($('email').value == ""){
		msgP += "- E-mail\n";	
		msgE += "- E-mail\n";	
	}
	if($('area').value == "0"){
		msgP += "- Área\n";	
		msgE += "- Area\n";	
	}
	if($('mensagem').value == ""){
		msgP += "- Mensgem\n";	
		msgE += "- Message\n";	
	}
	
	if(msgP != ""){
		if(id_idioma == "1"){
			alert('Os seguintes campos são obrigatórios:\n'+msgP);	
		}else{
			alert('The follow fields are required:\n'+msgE);	
		}
		return false;
	}
	
}
