

function assocArrayElement()
{
	this.key = 0;
	this.value = 0;
}

function urlTools()
{
	this.m_paramCount = 0;
	this.m_params = new Array();

	this.SetParam = urlTools_SetParam;
	this.DelParam = urlTools_DelParam;
	this.MakeUrl  = urlTools_MakeUrl;
}

function urlTools_SetParam(key, value)
{
	var found = false;
	var count = this.m_paramCount;

	for (i = 0; i < count; i ++)
	{
		if (this.m_params[i].key == key)
		{
			this.m_params[i].value = value;
			found = true;
		}
	}

	if (found == false)
	{
		this.m_params[count] = new assocArrayElement;
		this.m_params[count].key = key;
		this.m_params[count].value = value;

		this.m_paramCount ++;
	}
	return true;
}

function urlTools_DelParam(key)
{
	for (i = 0; i < this.m_paramCount; i ++)
	{
		if (this.m_params[i].key == key)
		{
			this.m_params[i].key = 0;
			this.m_params[i].value = 0;
		}
	}

	return true;
}

function urlTools_MakeUrl(file)
{	
	url = file + '?';

	for (i = 0; i < this.m_paramCount; i ++)
	{
		if (this.m_params[i].key != 0)
		{
			url = url + this.m_params[i].key + '=' + this.m_params[i].value + '&';
		}
	}

	return url;
}


