// JavaScript Document

function status_change(id,lang)
{
  var select = document.getElementById('status_'+id);
  var new_status = select.options[select.selectedIndex].value;
  var status;
  
  if (new_status == 'student') status = 'student';
  else if (new_status == 'teacher') status = 'teacher';
  else status = 'student';
    
  var url = "ajax/user_status_ajax.php?id="+id+"&status="+status+"&lang="+lang;
  sendRequest_status(url);
}

function stateChanged_status() 
{ 
  if (xmlHttp.readyState==4)
  { 
    document.getElementById('status_change').innerHTML=xmlHttp.responseText;
  }
}

function sendRequest_status(url)
{
	xmlHttp = createXMLHttpRequest();

	if (xmlHttp)
	{
	  xmlHttp.onreadystatechange=stateChanged_status;
		xmlHttp.open("GET", url, true);
		xmlHttp.send("");
		//return xmlhttp.responseText;
	}
}