  function ajax_send_request(handle, method, url, elem_id, input_id)
{
	if (window.ActiveXObject) { http_request = new ActiveXObject("Microsoft.XMLHTTP"); }
	else if (window.XMLHttpRequest) { http_request = new XMLHttpRequest(); }
	else { http_request = false; }
	
	if (!http_request) { return false; }
	
	http_request.open(method, url);

	http_request.onreadystatechange = function() { handle(http_request, elem_id, input_id); }
	
	http_request.send(false);
	
	return true;
}

function ajax_handle(http_request, elem_id, input_id)
{
	if (http_request.readyState == 4)
	{
		var ajax_obj = document.getElementById(elem_id);
		var input_obj = input_id;
		
		ajax_obj.innerHTML = http_request.responseText;
		
		    if ((input_obj == 'telo') || (input_obj == 'amesta')) {
		          ajax_process('ajPlansBox', this, 'mesta.html');
        }
        if (input_obj == 'aregiony') {
		          ajax_process('ajPlansBox', this, 'regiony.html');
		          
        }
         if (input_obj == 'asvet') {
		          ajax_process('ajPlansBox', this, 'svet.html');
        }
		
		
    if (http_request.responseText !== "")
		{
		//	ajax_obj.className = 'visible ajax_box';
			//input_obj.className = 'current';
		}
		else
		{
			//ajax_obj.className = '';
			//input_obj.className = 'current';
		}
		//alert ("\"" + http_request.responseText + "\"");*/
	}
	

	return;
}

function ajax_process(elem_id, input_id, url)
{
	if (!ajax_send_request(ajax_handle, 'GET', url, elem_id, input_id)) 
	{
		return false;
	}
	return true;
}