function UstawWylot(obj,focus)
{
	obj.checked = true;
	
	if( obj.value == 1 )
	{
		document.afpForm.fromcity1.disabled = false;
	
		if( focus )
			document.afpForm.fromcity2.focus();
	
		document.afpForm.fromcity2.disabled = true;
	}
	else
	{
		document.afpForm.fromcity2.disabled = false;
	
		if( focus )
			document.afpForm.fromcity2.focus();
	
		document.afpForm.fromcity1.disabled = true;
	}
}
		
function WybierzLotnisko(edit,obj_txt)
{
	if( edit.disabled )
	{
		UstawWylot(edit);
	}

	Okno(10,10,300,400,'http://www.esky.pl/lotniskap.php',true,'?ed='+obj_txt)
}

function Zamknij(kod, parametr)
{
	if( kod != null && kod != '' && kod != 'undefined' )
	{
		opener.parametr.value = kod;
	}
	window.close();
}

function switchDiv(target) {
	var divs = new Array("eskysamoloty", "eskyhotele", "eskysamochody");
	for (i=0; i<divs.length; i++) {
		if (divs[i] == target) {
			Element.show(divs[i]);
		}
		else {
			Element.hide(divs[i]);
		}
	}
	
}
