function AddCategory(uri,response_div_id,catname_input_id,catmenu_input_id)
{
	this.uri = uri;
	this.response_div_id = response_div_id;
	this.catname_input_id = catname_input_id;
	this.catmenu_input_id = catmenu_input_id;
	this.catname;
}

AddCategory.prototype.DoRequest = function()
{
	this.catname = document.getElementById(this.catname_input_id).value;

	if (this.catname.length > 1)
	{
		SimpleResponse(this.response_div_id,MessageLoading('Saving...'));

		parentObj = this;

		LoadDoc(this,this.uri+escape(this.catname),this.ParseResponse,true);
	}
	else
	{
		document.getElementById(this.response_div_id).style.display = 'block';
		document.getElementById(this.response_div_id).innerHTML = MessageError('Name was too short or blank!');
	}
}

AddCategory.prototype.ParseResponse = function(parentObj,resultText)
{
	// split into init and exec
	resultArr = resultText.split(DELIMITER_1);

	// check if an init messages exist
	if (resultArr[0].length > 0)
	{
		// replace loading message with message
		SimpleResponse(parentObj.response_div_id,resultArr[0]);
	}
	else
	{
		// replace loading message with nothing
		SimpleResponse(parentObj.response_div_id,'');
	}

	if (resultArr[1].length > 0)
	{
		// if exec body contains data it must be the category's new ID number
		document.getElementById(parentObj.catmenu_input_id).options[document.getElementById(parentObj.catmenu_input_id).length] = new Option(parentObj.catname,resultArr[1],true,true);
	}
}