// URL Parameter processing // Get all url parameters as an associative array object. // Index 'paramNum' is set with the number of parameters. function getAllUrlParams() { var href=window.location.href; var paramArr = {}; var paramNum = 0; var paramIdx = 0; var split1 = href.split("?"); if (split1.length > 1) { var split2 = split1[1].split("&"); for(i = 0; i < split2.length; i++) { if (split2[i] != 'undefined') { var keyVal = split2[i].split("="); paramArr[keyVal[0]] = keyVal[1]; paramNum++; } } } paramArr['paramNum'] = paramNum; return paramArr; } // Get a url parameter by name 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]; }