/*
* Code from: http://dotnet.org.za/hendrik/archive/2004/03/02/571.aspx
*
* Sample usage
* var queryStringObject = new QueryStringObject(window.location);
* alert(queryStringObject.parameter1);
* alert(queryStringObject.parameter2);
*
*/



function QueryStringObject(querystring){
	//Create regular expression object to retrieve the qs part
	// Used regex 'cause the search property on the location object includes the bookmark stuff
	var qsReg = new RegExp("[?][^#]*","i");
	hRef = unescape(querystring);
	var qsMatch = hRef.match(qsReg);
	
	//removes the question mark from the url
	qsMatch = new String(qsMatch);
	qsMatch = qsMatch.substr(1, qsMatch.length -1);
	
	//split it up
	var rootArr = qsMatch.split("&");
	for(i=0;i<rootArr.length;i++){
		var tempArr = rootArr[i].split("=");
		if(tempArr.length ==2){
			tempArr[0] = unescape(tempArr[0]);
			tempArr[1] = unescape(tempArr[1]);
		
			this[tempArr[0]]= tempArr[1];
		}
	}
} 