function popup(theURL,winName,features) {
  window.open(theURL,winName,features);
}
function onlynumbers(){ //valida q la entrada sea solo numerica
if ((event.keyCode < 48) || (event.keyCode > 57)) event.returnValue = false;
}
//valida campo vacio
function campo_nulo(theform,thefield,thename) {
	var tmsg = "";
	cad = eval(theform + '.' + thefield + '.value');
	
	if (cad=='') {
		tmsg = "\n-" + thename + ", este campo es requerido";
	}
	return tmsg;
}
function campo_mail(theform,thefield,thename) {
  var tmsg = "";
  apos=eval(theform + '.' + thefield + '.value.indexOf("@")');
  dotpos=eval(theform + '.' + thefield + '.value.lastIndexOf(".")');
  lastpos=eval(theform + '.' + thefield + '.value.length-1');  

  if (apos < 1 || dotpos-apos < 2 || lastpos-dotpos > 3 || lastpos-dotpos < 2) { 
  tmsg = "\n-" + thename + ", no es una dirección de correo electrónico válida";
  }

return tmsg;
}
//este hace el refresh onchange del pulldown, lo uso en el formulario de auditoria
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


