// validarEmail(cadena) 
// ------------------------------------------------------------------------------------------------
function validarEmail( valor )
{
	var a = valor;
	var filter=/^[A-Za-z][A-Za-z0-9_.]*@[A-Za-z0-9_]+.[A-Za-z0-9_.]+[A-za-z]$/;

	if (a.length == 0 ) { return 0; }

	if (filter.test(a)) {
		return 0;
	}
	else
	{
		return 1;
	}
}

// contieneArroba( valor )
// ------------------------------------------------------------------------------------------------
function contieneArroba( valor ) {
	var str = new String( valor );
	if ( str.indexOf("@") > -1 ) {
		return true;
	} else {
		return false;
	}
}

// ------------------------------------------------------------------------------------------------
function clearNoCharNoNumbers( valor ) {
	var str = new String( valor ).toUpperCase();
	var res = "";
	// 48 = 0, 57 = 9 // 65 = A, 90 = Z // 97 = a, 122 = 
	
	for ( n = 0; n < str.length; n++ ) {
		if ( ( str.charCodeAt( n ) > 47 && str.charCodeAt( n ) < 58 ) || ( str.charCodeAt( n ) > 64 && str.charCodeAt( n ) < 91 ) ) {
			res += str.charAt( n );
		}
	}

	return res;
}

// ------------------------------------------------------------------------------------------------
function clearNoChar( valor ) {
	var str = new String( valor ).toUpperCase();
	var res = "";
	// 48 = 0, 57 = 9 // 65 = A, 90 = Z // 97 = a, 122 = 
	
	for ( n = 0; n < str.length; n++ ) {
		if ( ( str.charCodeAt( n ) > 96 && str.charCodeAt( n ) < 123 ) || ( str.charCodeAt( n ) > 64 && str.charCodeAt( n ) < 91 ) ) {
			res += str.charAt( n );
		}
	}

	return res;
}