
// PERMITE APENAS DIGITAR NUMEROS NO CAMPO TIPO TEXT
// deve ser chamado com o return e com a funcai nativa event 
// return SomenteNumero(event)
function SomenteNumero(even){
	
	if(document.all){
		tecla = event.keyCode;
	}else{
		tecla = even.which
	}

	
	if (tecla < 48 || tecla > 57 ){	
		alert("Só é permitido digitar numeros ");	
		return false;
	}
}

// VERIFICA SE FOI PRECIONADO ENTER E DA UM SUBMIT NO FORMULARIO CASO SIM
// deve ser enviado como parametro nome de formulerio e "event"  
function enterSubmit(formulario,even){
		form = document.getElemntById('formulario');
	if(document.all){
		tecla = event.keyCode;
	}else{
		tecla = even.which
	}

	
	if (tecla == 13){	
		form.submit();
	}
}

// ABRIR POP UP
function PopUp(url,largura,altura){
	window.open(url,'janela','width='+largura+',height='+altura+',menubar=no,scrollbars=no,toolbar=no,location=no,directories=no,resizable=no,top=5,left=5');
}

function pop(url){
		window.open(url,'janela','width=450,height=480,menubar=no,scrollbars=no,toolbar=no,location=no,directories=no,resizable=no,top=5,left=5');
	}
	
// ABRIR POP UP
function popUpCentro(url,largura,altura){
	var lado = (screen.width - largura) / 2;
	var topo = (screen.height - altura) / 2;
	window.open(url,'janela','width='+largura+',height='+altura+',menubar=no,scrollbars=no,toolbar=no,location=no,directories=no,resizable=no,top='+topo+',left='+lado);
}