function setField()
	{
		form = document.getElementById("status-t");
		form.style.display = "block";
		act = document.getElementById("status-a");
		act.style.display = "none";				
		field = document.getElementById("status-f");
		field.focus();
		field.select();
	}
function remField()
	{
		act = document.getElementById("status-a");
		act.style.display = "block";
		form = document.getElementById("status-t");
		form.style.display = "none";		
	}	
function setStatus()
	{
		field = document.getElementById("status-t");
		field.readonly = true;
		var params="arguments="+arguments[0];
		var arg=arguments;	
		xmlHttp.open("POST","/js_ajax/change_status.php",true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded, charset=windows-1251");
		xmlHttp.onreadystatechange = function done () 
		{
			if(xmlHttp.readyState==4 && xmlHttp.status==200) 
				{
					act = document.getElementById("status-a");
					act.style.display = "block";
					act.innerHTML = "<a href='javascript:setField()' class='pr-bottom'>Изменить статус</a> | <a href='javascript:remStatus()' class='pr-bottom'>Удалить статус</a>";				
					form = document.getElementById("status-t");
					form.style.display = "none";				
					value = document.getElementById("status-p");
					value.innerHTML = "<span class='pr-closed'> &larr; </span> <span class='money'>"+xmlHttp.responseText+"</span>";						
					if(xmlHttp.responseText.length<1)
					{	remStatus();	}			
				}		
		} 
				xmlHttp.send(params);												
	}
function remStatus()
	{
		field = document.getElementById("status-t");
		field.readonly = true;
		var params="arguments="+arguments[0];
		var arg=arguments;	
		xmlHttp.open("POST","/js_ajax/remove_status.php",true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded, charset=windows-1251");
		xmlHttp.onreadystatechange = function done () 
		{
			if(xmlHttp.readyState==4 && xmlHttp.status==200) 
				{
					value = document.getElementById("status-p");
					value.innerHTML = "";
					act = document.getElementById("status-a");
					act.innerHTML = "<a href='javascript:setField()' class='pr-bottom'>Изменить статус</a>";					
					field = document.getElementById("status-f");
					field.value = "";
				}		
		} 
		xmlHttp.send(params);								
	}				
