// 2011 radek k @ inmca.com
function setupTabs()
{	/**
	* Items with a CLASS "tab" will correspond (in order) to
	* DIVs with ID sequence of "tabN", where N starts with 1,
	* and the DIVs must have a class of "tabcontent".
	*/
	$('.tabcontent').hide();
	$('#tab1').show();
	var tabsz = $('.tab').length;
	$('.tab').each( function(i,e){
		$(e).css('z-index', tabsz-i);
		var f = function(){
			$('.tab').each( function(ii,ee){$(ee).css('z-index', /*$(ee).css('z-index')-1*/ tabsz-ii).removeClass('selectedTab');if( tabsz==ii+1 )$(e).addClass('selectedTab');} );
			$(e).css('z-index', tabsz);
			$('.tabcontent').hide();
			$('#tab'+(i+1)).show();
		};
		$(e).click( f );
		if( i==0 )
			$(e).addClass('selectedTab');
	} );
}

