function isUndefined(a) { return typeof a == 'undefined' }

function raw_popup(url, target, features)
{
	if (isUndefined(features))
	{
		features = 'location=0,statusbar=0,menubar=0,width=420,height=300';
	}
	if (isUndefined(target))
	{
		target = '_blank';
	}
	var theWindow = window.open(url, target, features);
	theWindow.focus();
	return theWindow;
}

function route_popup(link, features)
{
	return raw_popup(link.getAttribute('href'), link.getAttribute('target') || '_blank', 'location=0,statusbar=0,menubar=0,width=320,height=600,scrollbars=yes');
}

function route_drop_popup(url, target, features)
{
	if (url=="")
	{
		return true;
	}
	if (isUndefined(features))
	{
		features = 'location=0,statusbar=0,menubar=0,width=420,height=600,scrollbars=yes';
	}
	if (isUndefined(target))
	{
		target = '_blank';
	}
	return raw_popup(url, target, features);
}

var currentmap='all';

function switchmap(map_name)
{
	if (map_name==currentmap)
	{
		map_name='all';
	}
	var currentform=document.getElementById('flightselect_'+currentmap);
	currentform.style.display='none';
	var currentimage=document.getElementById('flightmap_'+currentmap);
	currentimage.style.display='none';
	var nextform=document.getElementById('flightselect_'+map_name);
	nextform.style.display='block';
	var nextimage=document.getElementById('flightmap_'+map_name);
	nextimage.style.display='block';
	currentmap=map_name;	
}


