﻿function GeneralUtilsClass() {
}
GeneralUtilsClass.prototype.EmptyGuid = function() {
    return "00000000-0000-0000-0000-000000000000";
}
GeneralUtilsClass.prototype.trimString = function(value) {
    return value.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}
GeneralUtilsClass.prototype.isDouble = function(value) {
    var regex = new RegExp("^[0-9]{1,20}(\.([0-9]{1,20}))?$");
    return regex.exec(value) != null;
}
GeneralUtilsClass.prototype.isUrl = function(value) {
    var regex = new RegExp("^(http|https|ftp)\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a-zA-Z0-9\-\._\?\,\'/\\\+&amp;%\$#\=~])*$");
    return regex.exec(value) != null;
}
GeneralUtilsClass.prototype.isNumberKey = function(evt) {    
    var charCode = (evt.which) ? evt.which : evt.keyCode;    
    if ((charCode > 31 && (charCode < 48 || charCode > 57))) {
        if (!(charCode == 46 || charCode == 35 || charCode == 36 || charCode == 37 || 
              charCode == 38 || charCode == 39 || charCode == 40 || charCode ==  190)) {
            if (charCode < 96 || charCode > 105) {
                return false;
            }
        }
    }
    return true;
}
