
var uriParameters = { };

uriParameters.getAll = function() 
{
	var uri = window.location.href;
	var pos = uri.indexOf("?");
	return pos >= 0 ? uri.substring(pos + 1).split("&") : new Array;
};

uriParameters.getValue = function(name, params)
{
	if (! params) params = uriParameters.getAll();
	for (var i = 0; i < params.length; i++)
	{
		var p = params[i].split("=");
		if (p[0] == name)
			return decodeURIComponent(p[1].split("+").join("%20"));
	}
	return "";
};

uriParameters.getNames = function(params) 
{
	if (! params) params = uriParameters.getAll();
	var ret = "";
	for (var i = 0; i < params.length; i++)
		ret += (i ? ";" : "") + params[i].split("=")[0];
	return ret.split(";");
};
