function SelectCruiseLine(element, show_all)
{
	$("#ship").removeOption(/./);
	if(show_all)
	{
		$('#ship').addOption('', 'Any Ship');
	}
	$.getJSON("/ajax/lines.php?line_id=" + $(element).val(), function(json){
		for(var key in json)
		{
			$('#ship').addOption(json[key].ship_id, json[key].name);
		}
		if(!show_all)
		{
			$("#ship").val(json[0].ship_id);
		}
		else
		{
			$("#ship").val('');
		}
	});
}

$(document).ready(function(){
	$(document).pngFix();
	window.setTimeout('GenerateSidebar();', 250);
});

function GenerateSidebar()
{
	$('#sidebar').load('/ajax/sidebar.php?height=' + $('#page_content').height() + '&page=' + $('meta[name="page_rel"]').attr('content'), function(){
		$('#sidebar').height($('#page_content').height() + 'px');
		
		$('#sidebar .block').each(function(){
			//alert($(this).offset().top + $(this).height() + ' - ' + $('#page_content').height() + $('#page_content').offset().top);
			if($(this).offset().top + $(this).height() > $('#page_content').height() + $('#page_content').offset().top)
			{
				$(this).remove();
			}
		});
	});
}
