﻿jQuery.fn.extend({ getUrlParam: function(d) {
    d = escape(unescape(d)); var c = [], b = null; if ($(this).attr("nodeName") == "#document") { if (window.location.search.search(d) > -1) b = window.location.search.substr(1, window.location.search.length).split("&") } else if ($(this).attr("src") != "undefined") { var a = $(this).attr("src"); if (a.indexOf("?") > -1) { b = a.substr(a.indexOf("?") + 1); b = b.split("&") } } else if ($(this).attr("href") != "undefined") { a = $(this).attr("href"); if (a.indexOf("?") > -1) { b = a.substr(a.indexOf("?") + 1); b = b.split("&") } } else return null;
    if (b === null) return null; for (a = 0; a < b.length; a++) escape(unescape(b[a].split("=")[0])) == d && c.push(b[a].split("=")[1]); return c.length === 0 ? null : c.length == 1 ? c[0] : c
} 
});
