/* This function returns all the request parameters
 as a name - value array */
function parseGetVars() {
 // Array that will hold all the url parameters
 var urlParams = new Array();

 // Get the url part after the ?
 // substring(1) will return the part without the ?
 var qString = top.location.search.substring(1);

 // Split all the parameter=value parts
 var pairs = qString.split(/\&/);

 // split each parameter=value and put it in the array
 for (var i in pairs) {
 var nameVal = pairs[i].split(/\=/);
 urlParams[nameVal[0]] = nameVal[1];
 }

 // return the array
 return urlParams;
}

/* This function performs a default search.
 The parameter is the name of the field holding the
 string to search for. */
function doSearch(fieldname,divname) {
 var getParams = parseGetVars();
 search(getParams[fieldname],divname);
}

