
function show_select_event_window(url)
{
	var strWindowFeatures = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes";
	window.open(url, "select_event_window", strWindowFeatures);
}


var hideTimeout = [];

function show_menu(element, duration)
{
	var nm = '#'+element;
	if (!jQuery(nm).is(':visible'))
	{
		jQuery(nm).slideDown(500);
	}
	else
	{
		keep_menu_showing(element);
	}
}

function keep_menu_showing(element)
{
	if (hideTimeout[element])
	{
		clearTimeout(hideTimeout[element]);
		hideTimeout[element] = null;
	}
}

function hide_menu(element)
{
	if (!hideTimeout[element])
	{
		hideTimeout[element] = window.setTimeout(function(){
			hideTimeout[element] = null;
			jQuery('#'+element).slideUp(500);
		}, 1000);
	}
}

function remove_notification(url, element, id)
{
	jQuery.post(url, { id: id }, function(data)
	{
		jQuery('#'+element).fadeOut(500);
	});
	return false;
}

var urls = {};

function refresh_banner(url)
{
	jQuery('#banner-container').load(url);
}

function switch_lang(culture)
{
	var href=window.location.href;

	while (href.match(/lang=[A-z]+/))
	{
		href = href.replace(/(\?|&)lang=[A-z]+/, '');
	}

	if (href.indexOf('?') === -1)
	{
		href += '?lang='+culture;
	}
	else
	{
		href += '&lang='+culture;
	}
	window.location.href = href;
	return false;
}


