function val_login(){
	if(document.frm_log.username.value==""){
		alert("Preencher Username!");
	}
	else if(document.frm_log.password.value==""){
		alert("Preencher Password!");
	}
	else{
		document.frm_log.action="login/login.php?op=1";
		document.frm_log.submit();
	}
}

function action(x){
	document.location = x;
}

function val_logout(){
	document.frm_log.action="login/login.php?op=2";
	document.frm_log.submit();
}

function recoverPass(){
	var mail = prompt("Introduza o seu email! Recebera uma email com os seus dados!");
	document.location="novas/pass.php?mail="+mail;
}
function checkEnter(event){
  if (event && event.which == 13)
    val_login();
  else
    return true;
}
