﻿var Utility = {
    //
    GetCharKeyCode: function(e, obj) {    
        var characterCode;
        // NN4 specific code
        if(e && e.which) { characterCode = e.which; }
        // IE specific code
        else { characterCode = e.keyCode; }
        return characterCode;
    },
   
   Trim: function(str) {
        return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
   },
   
   IsEmailValid: function(email) {
       var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
       return reg.test(email);
   }

}


