String.prototype.trim = function()
{
	return this.replace(/(^\s*)|(\s*$)/g, "");
}

function val_longitud(cadena,longMin,longMax)
{	var str=new String(cadena).trim();
	var long_str=str.length;
	if(!((long_str>=longMin)&&(long_str<=longMax)))
	{
		return false;
	}
	else{
		return true;
	}
}

function val_vacio(cadena){
	var objStr=new String(cadena).trim();
	if((objStr.value=='')||(objStr.length==0)){
		return false;
	}else{
		return true;
	}
}

function validarSiNumero(numero){
  if (!/^([0-9])*$/.test(numero)){
    //alert("El valor " + numero + " no es un número");
    return false;
  }else{
    return true;
  }
}

function checkEmail(c){
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(c)){
		return true;
	}
	//alert("¡Favor de escribir una dirección de correo válida!")
	//document.frm_reg.correo.focus();
	return false;
}
