String.prototype.trim = function() {
	return( this.replace( /^\s+|\s+$/, '' ) );
}
		
function switch_note( visible )
{
	var id  = 'email_login_note';
	var obj = document.getElementById( id );
		
	if( obj ) {
		obj.style.display = visible ? 'block' : 'none';
	}
}
	
function check_if_email( obj )
{
	var val = obj.value;
			
	if( val.trim() ) {
		if( val.indexOf( '@' ) != -1 ) {
			switch_note( true );
		} else {
			switch_note( false );
		}
	}
}
