	var glob_date = new Date();
	date = glob_date.getDate();
var input_field='';
/*from main js*/
	//-----------------------
	function _gid(id)
	{
		return document.getElementById(id);
	}//	function _gid(id)
	//-----------------------
	function _gfrm(frmname)
	{
		return document.forms[frmname];
	}//	function _gid(id)
	function makeHeight(o)
	{
		var mama;
		mama=(o.parentElement)?o.parentElement : o.parentNode;
		o.style.height=parseInt(mama.offsetHeight)-18;
	}//	function makeHeight(o)


/*from main js*/

function Copy2fld(o,fld)
	{
		var val=o.options[o.selectedIndex].value;
		var mytext = o.options[o.selectedIndex].text;
		if (val!='')
		{
			var frm=_gfrm('symphony');
			frm.elements[fld].value=mytext+" ("+val+")";
		}
	}

function select_airports(country_code,letter,input_field)
{
	if(country_code!='')
	{
		requestFromServ('/symphony_new.xml.php',addParam('country_code',country_code)+"&"+addParam('letter',letter)+"&"+addParam('input_field',input_field)+"&"+addParam('mode','get_airports'),'handle_airports');
		//show_div(name);
	}
}

function select_countries(name,letter)
{	
	show_div(name);
	requestFromServ('/symphony_new.xml.php',addParam('country_code','')+"&"+addParam('letter',letter)+"&"+addParam('input_field',name)+"&"+addParam('mode','get_countries'),'handle_counries');	
}

function handle_airports() 
{
	//alert("asd");
	if (xmlHttpGetData.readyState == 4) // continue if the process is completed
	{
		if (xmlHttpGetData.status == 200) // continue only if HTTP status is "OK"
		{
			try // process the server's response
			//----------------------------------
			{ show_airports() }
			//----------------------------------
			catch(e) // display the error message
			{ displayError(e.toString()); }
		}
		else // display the error message
		{ displayError(xmlHttpGetData.statusText); }
	}
}//function handle_airports() 

function handle_counries() 
{
	//alert("asd");
	if (xmlHttpGetData.readyState == 4) // continue if the process is completed
	{
		if (xmlHttpGetData.status == 200) // continue only if HTTP status is "OK"
		{
			try // process the server's response
			//----------------------------------
			{ show_countries() }
			//----------------------------------
			catch(e) // display the error message
			{ displayError(e.toString()); }
		}
		else // display the error message
		{ displayError(xmlHttpGetData.statusText); }
	}
}//function handle_airports() 

function show_airports()
{  
	// retrieve the server's response 
	var response = xmlHttpGetData.responseText;
	// server error?
	if (response.indexOf("ERRNO") >= 0 
		|| response.indexOf("error:") >= 0
		|| response.length == 0)
		throw(response.length == 0 ? "Void server response." : response);
	// retrieve the document element
	response = xmlHttpGetData.responseXML.documentElement;
	//getdata
	result = response.getElementsByTagName("result");
	if(result.item(0).firstChild.data.toString()=='yes')
	{
		var char_div = response.getElementsByTagName("char_div");
		var airports = response.getElementsByTagName("airports");

		var cntr_countries = _gid('cntr_countries'); //prja4u
		cntr_countries.style.height = '0px';
		cntr_countries.style.display = 'none';

		_gid('airports_div').style.display = 'block';
		var airports_countries = _gid('airports_countries'); //pokazivaju
		airports_countries.style.height = '240px';
		airports_countries.style.display = 'block';


		_gid('airports_chars').innerHTML= char_div.item(0).firstChild.data.toString();
		_gid('airports_countries').innerHTML=airports.item(0).firstChild.data.toString();
	}else
	{
		alert('Не получилось найти аэропорты!');
	}
} //function color_div()

function show_countries()
{  
	// retrieve the server's response 
	var response = xmlHttpGetData.responseText;
	// server error?
	if (response.indexOf("ERRNO") >= 0 
		|| response.indexOf("error:") >= 0
		|| response.length == 0)
		throw(response.length == 0 ? "Void server response." : response);
	// retrieve the document element
	response = xmlHttpGetData.responseXML.documentElement;
	//getdata
	result = response.getElementsByTagName("result");
	if(result.item(0).firstChild.data.toString()=='yes')
	{
		var char_div = response.getElementsByTagName("char_div");
		var airports = response.getElementsByTagName("airports");

		_gid('airports_div').style.display = 'none';
		var airports_countries = _gid('airports_countries'); //prja4u content airoportov
		airports_countries.style.height = '0px';
		airports_countries.style.display = 'none';

		var cntr_countries = _gid('cntr_countries'); //pokazivaju
		cntr_countries.style.height = '240px';
		cntr_countries.style.display = 'block';
		
		_gid('cntr_chars').innerHTML = char_div.item(0).firstChild.data.toString();
		_gid('cntr_countries').innerHTML = airports.item(0).firstChild.data.toString();
	}else
	{
		alert('Не получилось найти аэропорты!');
	}
} //function color_div()
function go_to_airport()
{
	var div = _gid('div_airports');
	if(div!=null){	
	div.style.display = 'none';
	_gid('airports_div').style.height = '0px';
	_gid('country_div').style.height = '300px';
	}
	_gid('country_names').style.display = 'block';
}

function show_div(id)
{
	var div = _gid('airports');
	div.style.top = '280px';
	div.style.left = '1010px';
	div.style.display = 'block';
	//go_to_airport();
	input_field = id;
}
function Copy2fld2(text,myid)
{
	var frm=_gfrm('symphony');
	frm.elements[myid].value=text;
	_gid('airports').style.display = 'none';
	_gid('airports').style.height = '480px';
}
function close_div()
{
	_gid('airports').style.display = 'none';
}

