	String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };
	
	function check_login_form(){
	  var ret = true;
	  var oEmail = document.getElementById('email');
	  var oPass = document.getElementById('pass');
	  
	  if (!oEmail.value.trim()) ret = false;
	  if (!oPass.value.trim()) ret = false;
	
	  return ret;
	}
	
	
	function check_email(value){
		var regex = /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i;
		return  regex.test(value);	
	}
	
	
	function hide_errors_onkeyup(){
	  var oErrorDialog = document.getElementById('error_dialog');
	  if ( oErrorDialog != null ) 
	    document.getElementById('error_dialog').style.display = 'none';
	}
    
    
    
    