

// returns the value of the parameter in the GET queryString.
// if there is none, null is returned.
// if there is more than one, the values are seperated with '|'
function getParameter ( parameterName ) {
	var result = null;

	var queryString = document.location.search;
	
	// Add "=" to the parameter name (i.e. parameterName=value)
	var parameterName = parameterName + "=";

	var done = false;	
	do {
		if ( queryString.length > 0 ) {
			// Find the beginning of the string
			begin = queryString.indexOf ( parameterName );
			// If the parameter name is not found, skip it, otherwise return the value
			if ( begin != -1 ) {
				// Add the length (integer) to the beginning
				begin += parameterName.length;
				// Multiple parameters are separated by the "&" sign
				end = queryString.indexOf ( "&" , begin );
				if ( end == -1 ) {
					end = queryString.length
				}
				// Return the string
				if( result == null ) {
					result = unescape ( queryString.substring ( begin, end ) );
				} else {
					result = result + "|" + unescape ( queryString.substring ( begin, end ) ) ;
				}
				// remove parsed part of querystring
				queryString = queryString.substring( end, queryString.length );
			} else {
				done = true; // no instance found
			}
		} else {
			 done = true; // no length 
		}
	} while( done==false );

	return stripSymbol(result);
}

//Returns the source stripped from certain symbols
function stripSymbol(source) {
	//To replace the automatically placed + symbols in the searchstring.
	regExp = new RegExp("\\+", "gi");
	if (source!=null)
		result = source.replace(regExp," ");
	else
		result = source;

	return result;
}