function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]); return null;
};
String.prototype.trimEnd = function (chars) {
if (chars == null) {
chars = FRL.strings.whiteSpaceChars;
}
if (this == null || this == "") {
return "";
}
var i;
var l = this.length;
for (i = this.length - 1; (i >= 0) && (chars.indexOf(this.charAt(i)) > -1); i--) {
}
return this.substring(0, i + 1);
};
String.prototype.trimStart = function (chars) {
if (chars == null) {
chars = FRL.strings.whiteSpaceChars;
}
if (this == null || this == "") {
return "";
}
var i;
var l= this.length;
for (i = 0; (i < l) && (chars.indexOf(this.charAt(i)) > -1); i++) {
}
return this.substring(i);
};
String.prototype.trim = function (chars) {
if (chars == null) {
chars = FRL.strings.whiteSpaceChars;
}
var source = this;
if (source == null || source == "") {
return "";
}
var i;
var l;
l = source.length;
for (i = 0; (i < l) && (chars.indexOf(source.charAt(i)) > - 1); i++) {
}
source = source.substring(i);
l = source.length;
for (i = source.length - 1; (i >= 0) && (chars.indexOf(source.charAt(i)) > - 1); i--) {
}
source = source.substring(0, i + 1);
return source;
};