var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;



function atlas_DoFSCommand(command, args)
{
	//var myFlashObj = InternetExplorer ? atlas : document.body.atlas;
	
	//alert(window.frames['engine_if'].frames['engine_if-bilety'].document.getElementById('miasto_z'));
	
	var destinationString = window.frames['engine_if'].frames['engine_if-hotele'].document.getElementById('destinationString');
	var miasto_z = window.frames['engine_if'].frames['engine_if-bilety'].document.getElementById('miasto_z');
	var miasto_d = window.frames['engine_if'].frames['engine_if-bilety'].document.getElementById('miasto_d');
	var kod_z = window.frames['engine_if'].frames['engine_if-bilety'].document.getElementById('w_kod_z');
	var kod_d = window.frames['engine_if'].frames['engine_if-bilety'].document.getElementById('w_kod_d');
	var way = document.getElementById('AtlasJurneyWay').value;
	
	if (command == 'city_id')
	{
		if(way == "from")
			kod_z.value = args;
			
		if(way == "to")
			kod_d.value = args;
			
		if(way == "destinationString"){
			var destinationStringPattern = /\(.*\)/;
			destinationString.value = args.replace(destinationStringPattern,"");
		}
			
	}
	else if (command == 'city_name')
	{
		
		if(way == "from")
			miasto_z.value = args;
		if(way == "to")
			miasto_d.value = args;
		if(way == "destinationString"){
			var destinationStringPattern = /\(.*\)/;
			destinationString.value = args.replace(destinationStringPattern,"");
		}
			
		
		document.getElementById('atlas').style.display = "none";
		document.getElementById('ShoutBoxAtlas').style.display = "none";
	} else if (command == 'close')
	{
		document.getElementById('atlas').style.display = "none";
		document.getElementById('ShoutBoxAtlas').style.display = "none";
	}
}

function otworz(p, path, f)
{
	document.p = p;
	document.f = f;
	noweOkno = window.open(path+'atlas.html'+'?p='+p+'&f='+f, 'win', 'menubar=no, toolbar=no, location=no, scrollbars=no, resizable=no, status=no, width=650, height=390',p);
}
