//**********************************************************************
	//Verificación de Campos que requieren ser llenados
	function IsVacio(n_form,n_campos,n_long,n_mensajes){
		var theform="document."+n_form+".";
		//alert(theform);
		var campos=n_campos.split(";");
		var longit=n_long.split(";");
		var mensaje=n_mensajes.split(";");
		for (var i=0; i<campos.length; i++){
			if (eval(theform+campos[i]+".value.length < "+longit[i])){
				alert(mensaje[i]);
				document.getElementById(campos[i]).style.backgroundColor="#FFFFCC";
				eval(theform+campos[i]+".focus()");
				return (false);
			} else document.getElementById(campos[i]).style.backgroundColor="#FFFFFF";
		}
		return (true);
	}
	
	//Verificación de Campos que requieren ser numéricos
	function IsNumeric(n_form,n_campos,n_check,n_mensajes){
		var theform="document."+n_form+".";	c_numericos=n_campos.split(";"); 
		var checkOK=n_check.split(";");	mensaje=n_mensajes.split(";");
		for (x=0; x<c_numericos.length; x++){ 
			var checkStr = eval(theform+c_numericos[x]+".value"); 
			for (i = 0;  i < checkStr.length; i++)	{
				ch = checkStr.charAt(i);
				for (j = 0;  j < checkOK[x].length;  j++){
					if (ch == checkOK[x].charAt(j))	break;
				}
				if (j == checkOK[x].length){
					alert(mensaje[x]);
					eval(theform+c_numericos[x]+".focus()");
					return (false);
				}
			}
		}
		return (true);
	}

	//Verificación de Campos List/Menu que requieren que no se escoja la primera opción
	function IsSelFirst(n_form,n_campos,n_mensajes){
		var theform="document."+n_form+".";	var campos=n_campos.split(";"); var mensaje=n_mensajes.split(";");
		for (var i=0; i<campos.length; i++){
			//if (eval(theform+campos[i]+".value.length < "+longit[i])){
			if (eval(theform+campos[i]+".selectedIndex == 0")){
				alert(mensaje[i]); eval(theform+campos[i]+".focus()"); return (false);
			}
		}
		return (true);
	}

	//Verificación de Radio Button que requieren ser escojidos
	function IsCheck(n_form,n_campos,n_mensajes){
		var theform="document."+n_form+".";	var campos=n_campos.split(";"); var mensaje=n_mensajes.split(";");
		for (var j=0; j<campos.length; j++){
			var radioSelected = false;
			for (var i=0;  i<eval(theform+campos[j]+".length"); i++){
				if (eval(theform+campos[j]+"["+i+"].checked")) radioSelected = true;
			}
			if (!radioSelected)	{
				alert(mensaje[j]);	return false;
			}
		}
		return true;
	}

	function IsEmail(n_form,emailstr,n_mensajes) {
		var theform="document."+n_form+".";	
		var email=eval(theform+emailstr+".value");
		var emailregexp = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i
		if (emailregexp.test(email)==false){
			alert(n_mensajes); eval(theform+emailstr+".focus()");
			document.getElementById(emailstr).style.backgroundColor="#FFFFCC";
			return false;
		}
		return true;
	}

	function OpenWindow(url, name, w, h){
		var config_line = "height="+h+",width="+w+",toolbar=0,menubar=0,scrollbars=1,resizable=0,location=0,status=0,directories=0";
		window.open(url, name, config_line);
	}
