﻿function GetURLParams() {
    var e,
        p = {},
        a = /\+/g,  // Regex for replacing addition symbol with a space
        r = /([^&=]+)=?([^&]*)/g,
        d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
        q = window.location.search.substring(1);

    while (e = r.exec(q))
        p[d(e[1])] = d(e[2]);

    return p;
}
