function PageQuery(strQuery){
	if(strQuery.length > 1){
		this.Query = strQuery.substring(1, strQuery.length)	
	}else{
		this.Query = null;
	}
	this.KeyValuePairs = new Array();
	if(strQuery){
		for(var i = 0; i < this.Query.split("&").length; i++){
			this.KeyValuePairs[i] = this.Query.split("&")[i];
		}
	}
	this.GetKeyValuePairs = function() {return this.KeyValuePairs;}
	this.GetValue = function(strKey) {
		for(var j = 0; j < this.KeyValuePairs.length; j++){
			if(this.KeyValuePairs[j].split("=")[0] == strKey){
				return this.KeyValuePairs[j].split("=")[1];
			}
		}
		return false;
	}
	this.GetParameters = function(){
		var arrParams = new Array(this.GetLength());
		for(var j = 0; j < this.KeyValuePairs.length; j++){
			arrParams[j] = this.KeyValuePairs[j].split("=")[0];	
		}
		return arrParams;
	}
	this.GetLength = function(){return this.KeyValuePairs.length;}
}

function QueryString(strKey){
	var strQueryString = new PageQuery(window.location.search);
	return unescape(strQueryString.GetValue(strKey));
}

function GetQueryStringAsInteger(strKey){
	if(QueryString(strKey) == "false" || isNaN(QueryString(strKey))){
		return 0;
	}else{
		return QueryString(strKey);
	}
}

