$.extend(String.prototype,
{
IsEmpty: function () {
return /^s*$/.test(this);
},
Equals: function (str, ordinalIgnoreCase) {
ordinalIgnoreCase = ordinalIgnoreCase || false;
if (ordinalIgnoreCase) return $.trim(this.toLowerCase()) === $.trim(str.toLowerCase());
return $.trim(this) === $.trim(str);
},
RealSn: function () {
var sn = $.trim(this.toUpperCase());
if (request("CC").Equals("Lenovo", true)) { //CUSTOMER_CODE
var tmp = sn.substr(0, 2);
if (tmp.Equals("YL", true)) {
return sn.substr(0, 8);
}
tmp = sn.substr(sn.length - 8, 2);
if (tmp.Equals("YL", true)) {
return sn.substr(sn.length - 8, 8);
}
}
return sn;
}
});