/* ************************************************************************** **
// JavaScript
// Funções úteis...
// Marco Pinheiro 2009
/* ************************************************************************** **
*/

function abreJanela(destino, w, h)
 {
	 
	 
	 var destino, w, h;
	

	if(screen.width)
	{
		var winl = (screen.width-w)/2;
		var wint = (screen.height-h)/2;
	}
	else
	{
		winl = 0;wint =0;
	}
	if (winl < 0) winl = 0;
	if (wint < 0) wint = 0;

	var settings = 'height=' + h + ',';
	settings += 'width=' + w + ',';
	settings += 'top=' + wint + ',';
	settings += 'left=' + winl;
	settings += 'resizable=0,toolbar=0,directories=0,status=0,location=no,scrollbars=no';
	
	win = window.open(destino,'admin',settings);
	//alert (destino);
	win.window.focus();
	
	 
 }
 
 
 
 function averigua_contacto() {


		var nome = document.getElementById('nome').value;
		var email = document.getElementById('email').value;
		var mensagem = document.getElementById('mensagem').value;
	

		
		if (nome==""||email==""||mensagem=="") 
		
		{
			alert("Atenção ao preenchimento dos campos obrigatórios!");
		} 
		
		else 
		
		{
		
			if (confirm('Confirma que deseja mesmo fazer este contacto?')) 
			{
				document.contacto.submit();
			}
			
		}
		
	}
	
	


function abreMapa()
{
	//alert ("abre mapa!");
	
	var w, h;

	w = 650;
	h = 290;

	if(screen.width)
	{
		var winl = (screen.width-w)/2;
		var wint = (screen.height-h)/2;
	}
	else
	{
		winl = 0;
		wint = 0;
	}
	if (winl < 0) winl = 0;
	if (wint < 0) wint = 0;

	var settings = 'height=' + h + ',';
	settings += 'width=' + w + ',';
	settings += 'top=' + wint + ',';
	settings += 'left=' + winl;
	settings += 'resizable=0,toolbar=0,directories=0,status=0,location=no,scrollbars=no';

	
	win = window.open("gmaps/mapa.html","Mapa",settings);
	win.window.focus();
	
	

}
		 
