
function PageQuery () {
	queryString = window.location.search;
	if (queryString.length > 1) {
		this.queryString = queryString.substring(1, queryString.length);
	}
	else  {
		this.queryString = null;
	}
	this.keyValuePairs = new Array();
	if (queryString) {
		for (var i=0; i < this.queryString.split("&").length; i++) {
			this.keyValuePairs[i] = this.queryString.split("&")[i];
		}
	}
}


PageQuery.prototype.getKeyValuePairs = function() {
	return this.keyValuePairs;
}

PageQuery.prototype.getValue = function(keyWord) {
	for(var j=0; j < this.keyValuePairs.length; j++) {
		if(this.keyValuePairs[j].split("=")[0] == keyWord)
			return this.keyValuePairs[j].split("=")[1];
		}
	return false;
}

PageQuery.prototype.getParameters = function() {
	var a = new Array(this.getLength());
	for(var j=0; j < this.keyValuePairs.length; j++) {
		a[j] = this.keyValuePairs[j].split("=")[0];
	}
	return a;
}

PageQuery.prototype.getLength = function() {
	return this.keyValuePairs.length;
}