$.extend({URLEncode:function(a) {
  var e = "", c = 0;
  a = a.toString();
  for(var f = /(^[a-zA-Z0-9_.]*)/;c < a.length;) {
    var d = f.exec(a.substr(c));
    if(d != null && d.length > 1 && d[1] != "") {
      e += d[1];
      c += d[1].length
    }else {
      if(a[c] == " ")e += "+";
      else {
        d = a.charCodeAt(c).toString(16);
        e += "%" + (d.length < 2 ? "0" : "") + d.toUpperCase()
      }c++
    }
  }return e
}, URLDecode:function(a) {
  a = a;
  for(var e, c = /(%[^%]{2})/;(m = c.exec(a)) != null && m.length > 1 && m[1] != "";) {
    b = parseInt(m[1].substr(1), 16);
    e = String.fromCharCode(b);
    a = a.replace(m[1], e)
  }return a
}});
