function QueryString (name) {
if (name == null || name == "") return "";
var result = "";
var href = window.location.href;
if (href.indexOf("?") != -1) {
var query = href.substr(href.indexOf("?"));
var queryParam = query.split("&");
for (var n = 0; n < queryParam.length; n++)
if (queryParam[n].toLowerCase().indexOf(name.toLowerCase() + "=") != -1) {
result = queryParam[n].split("=")[1];
break;
}
}
return unescape(result);
}