var Loaded = new Array();

function Show(id)
{
	$('.card').hide();
	$('#content' + id).show();
	
	if(Loaded[id] != true)
	{
		LoadPieces(id, 1);
		Loaded[id] = true;
	}
}

function LoadPieces(pl, id)
{
	var el = '#pl' + pl;
	
	$(el).html('<div class="workloading"><img src="/script/thickbox/loadingAnimation.gif" alt="" /></div>');
	
	$(el).load(
		'workpieces.php?q=' + pl + '-' + id,
		function()
		{
			$(el + ' .workitems a[@show]').click(function()
			{
				$(el + ' .piece').hide();
				$('#' + $(this).attr('show')).show();
			
				$(this).siblings().removeClass('active');
				$(this).addClass('active');
			}
			);
			
			tb_init(el + ' .thickbox');
		}
	);
	
}


// event handling

$(function()
{
	$('ul.selectlinks li a').click(function()
	{
		$(this).parent().siblings().find('a').removeClass('active');
		$(this).addClass('active');
	}
	);

});

function n() { }



