function elm(obj){
	return document.getElementById(obj);
	}
function pesquisa(){
	var pesquisa = $("input[@name=txtpesquisa]").val();
	

	if(pesquisa==''){
		alert('Digite uma palavra para poder efectuar a pesquisa!');
		$("input[@name=txtpesquisa]").focus();
		return false;
	}

	return true;
}
function email(){
	var email = $("input[@name=txtemailnews]").val();
	

	if(email==''){
		alert('Digite o email para registo!');
		$("input[@name=txtemail]").focus();
		return false;
	}

	return true;
}

function contactos(){
		var msg='Tem de preencher este campo!';
		
		
		if(elm('txtnome').value==''){
			alert(msg);
			elm('txtnome').focus()
			return false;
		}
		
		if(elm('txtassunto').value==''){
			alert(msg);
			elm('txtassunto').focus()
			return false;
		}
		
		if(elm('txtmsg').value==''){
			alert(msg);
			elm('txtmsg').focus()
			return false;
		}
		
		return true;
}
function sonumeros(){
	var caract = new RegExp(/^[0-9]+$/i);
	var caract = caract.test(String.fromCharCode(event.keyCode));

	if(!caract){
		event.keyCode=0;
		return;
	}
}

function openW(file,wW,wH,scr){
	
	var posX = (screen.width-wW) / 2; 
	var posY = (screen.height-wH) / 2; 
	
	if(!myWin){
		var myWin = window.open(file, 'varW', 'Height='+ wH +'px, Width='+ wW +'px,resizable=no,top='+posY+',left='+posX+',scrollbars='+scr)
		myWin.focus();	
	}
}

