function ValidateEmail(strEmail) {
	var a = false;
 	var res = false;
 	if(typeof(RegExp) == 'function') {
  		var b = new RegExp('abc');
  		if(b.test('abc') == true){a = true;}
  	}

 	if(a == true) {
  		reg = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)'+
						'(\\@)([a-zA-Z0-9\\-\\.]+)'+
						'(\\.)([a-zA-Z]{2,4})$');
  		res = (reg.test(strEmail));
 	} else {
  		res = (strEmail.search('@') >= 1 &&
        	   strEmail.lastIndexOf('.') > strEmail.search('@') &&
         	   strEmail.lastIndexOf('.') >= strEmail.length-5)
 	}
 	return(res);
}
