fValidate.prototype.alnum = function( minLen, tCase, numbers, spaces, puncs )
{
    i18n = {'ru' : ['Да', 'Нет', 'Любой','Нет','ВЕРХНИЙ','нижний','С заглавной буквы'], 'en' : ['Yes', 'No', 'Any','None','UPPER','lower','Intial capital']};
    i18n = i18n[fvalidate.lang];

	if ( this.typeMismatch( 'text' ) ) return;

	tCase = this.setArg( tCase, "a" );

	//alert( [minLen,tCase,numbers,spaces,puncs] );

	numbers = ( numbers == "true" || numbers == "1" );
	spaces = ( spaces == "true" || spaces == "1" );

	//alert( [minLen,tCase,numbers,spaces,puncs] );

    var okChars = "",
        arrE	= [i18n[3],i18n[2],i18n[1],i18n[1],i18n[2]];

	if ( minLen != '*' )
	{
		minLen =  parseInt( minLen, 10 );
		arrE[0] = minLen;
	} else {
		minLen = 0;
	}

	switch( tCase.toUpperCase() )
	{
		case 'U':
			okChars += 'A-Z';
			arrE[1] =  i18n[4];
			break;
		case 'L':
			okChars += 'a-z';
			arrE[1] =  i18n[5];
			break;
		case 'C':
			okChars += 'A-Z][a-z';
			arrE[1] =  i18n[6];
			minLen--;
			break;
		default:
			okChars += 'a-zA-Z';
			break;
	}

	if ( numbers == true )
	{
		okChars += '0-9';
		arrE[2] =  i18n[0];
	}
	if ( spaces == true )
	{
		okChars += ' ';
		arrE[3] =  i18n[0];
	}
	if ( puncs == "any" )
	{
		arrE[4]  = i18n[2];
	}
	else if ( puncs == "none" )
	{
		arrE[4] = i18n[3];
	}
	else
	{
		puncs = puncs.replace( /pipe/g, "|" );
		okChars += puncs;
		arrE[4] =  puncs; //.toPattern().replace( /\\/g, "" );
	}
	var length = ( minLen != "*" )?
		"{" + minLen + ",}":
		"+";
	var regex = ( puncs == "any" ) ?
		new RegExp( "^([" + okChars + "]|[^a-zA-Z0-9\\s])" + length + "$" ):
		new RegExp( "^[" + okChars + "]" + length + "$" );

	if ( !regex.test( this.elem.value ) )
	{
		this.throwError( [this.elem.value, this.elem.fName, arrE[0], arrE[1], arrE[2], arrE[3], arrE[4]] );
	}
}

fValidate.prototype.equalto = function( oName )
{
	if ( this.typeMismatch( 'text' ) ) return;
	if ( typeof oName == 'undefined' )
	{
		this.paramError( 'oName' );
	}
	var otherElem = this.form.elements[oName];
	if ( this.elem.value != otherElem.value )
	{
		this.throwError( [this.elem.fName,otherElem.fName] );
	}
}

fValidate.prototype.email = function( level )
{
	if ( this.typeMismatch( 'text' ) ) return;
	if ( typeof level == 'undefined' ) level = 0;
	var emailPatterns = [
		/.+@.+\..+$/i,
		/^\w.+@\w.+\.[a-z]+$/i,
		/^\w[-_a-z~.]+@\w[-_a-z~.]+\.[a-z]{2}[a-z]*$/i,
		/^\w[\w\d]+(\.[\w\d]+)*@\w[\w\d]+(\.[\w\d]+)*\.[a-z]{2,7}$/i
		];
	if ( ! emailPatterns[level].test( this.elem.value ) )
	{
		this.throwError();
	}
}