Query Parameter Parsing Using RegEx - http://www.netlobo.com/url_query_string_javascript.html
// Much faster than string splitting when you need to get a parameter
// http://jsperf.com/query-parameter-parsing
function gup(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.href);
if (results == null) {
return "";
}
else {
return results[1];
}
}