function question( pergunta )
{
	if ( confirm( pergunta ) ) {
		return true;
	} else {
		return false;
	}
}

// Abre uma janela popup
function popup ( url, nome, largura, altura, posicao, resize, barras ) {
	if ( posicao == 0 ) {
		posleft = 20;
		postop  = ( screen.height ) ? ( screen.height - altura ) / 2 - 50 : 100;
	} else if ( posicao == 1 ) {
		posleft = ( screen.width ) ? ( screen.width - largura ) / 2 : 100;
		postop  = ( screen.height ) ? ( screen.height - altura ) / 2 - 50 : 100;
	} else if (posicao == 2 ) {
		posleft = ( screen.width ) ? ( screen.width - largura ) - 28 : 100;
		postop  = ( screen.height ) ? ( screen.height - altura ) / 2 - 50 : 100;
	}
	opBarras = ( barras ) ? "yes" : "no";
	opResize = ( resize ) ? "yes" : "no";

	settings = 'z-lock=yes, width=' + largura + ', height=' + altura + ', top=' + postop + ', left=' + posleft + ', scrollbars=' + opBarras + ', location=no, directories=no, status=no, menubar=no, toolbar=no, resizable=' + opResize;
	window.open( url, nome, settings );
}

function checkFormContact()
{
	var obj = document.f;
	var nome = obj.nome.value;
	var email = obj.email.value;
	var mensagem = obj.mensagem.value;
	
	if ( nome == "" || email == "" || mensagem == "" ) {
		alert("Todos os campos precisam ser preenchidos corretamente");
		return false;
	} else {
		if ( isValidEmail(email) ) {
			obj.submit();
		} else {
			alert('Email inválido');
			obj.email.focus();
			obj.email.select();
			
			return false;
		}
	}
}