		function setQuerystringElement(element, value)
		{
			var url = location.href;
			var newUrl = 'search.aspx';url;
			var params = url.split('?');
			var param;
			var i;
			var found = false;

			//params will have either one or two entries, where
			//entry 0 if the base URL and entry 1 is the querystring
			if (params.length == 1)
			{
				//url has no querystring, so just append element
				return newUrl += '?' + element + '=' + escape(value);
			}
			else
			{
				//save the base url from up above
				//newUrl = params[0];

				//divide the querystring into name/value pairs
				params = params[1].split('&');
				for (i=0; i<params.length; i++)
				{
					//divide each pair into a name and value
					param = params[i].split('=');
					if (param[0].toLowerCase() == element.toLowerCase())
					{
						//update the value of the element
						param[1] = value;
						found = true;
					}
					//append the parameter to the URL
					newUrl += (i == 0) ? '?' : '&';
					newUrl += param[0] + '=' + escape(param[1]);
				}

				//if the element was not already in the URL, add it
				if (!found) newUrl += '&' + element + '=' + escape(value);
			}
			return (newUrl);
		}   
