function tabs(whichactive, which){
	totalTabs = $(whichactive+'-content > div').length;
	if(which == null || (which - 1) >= totalTabs){which = 0};
	if(whichactive != null){
		$('ul' + whichactive).find('li a').removeClass('active'); // reset anything active
		$(whichactive+'-content > div').removeClass('show'); // reset anything active
		$('ul' + whichactive +' li a').eq(which).addClass('active'); 
		$(whichactive+'-content > div').eq(which).addClass('show');
	}else{
		$('ul.tabs').each(function(){
			$(this).find('li a').removeClass('active');
			$(this).find('li a').eq(0).addClass('active');
			$(this).next().find('div.tabs > div').removeClass('show');	
			$(this).next().find('div.tabs > div').eq(0).addClass('show');	
		});
	}		
}

$(document).ready(function(){
	$('ul.tabs li a').click(function(){
		$(this).parent().parent().find('li a').each(function(){
			$(this).removeClass('active');
		});
		$(this).addClass('active');
		showTab = "#"+ $(this).parent().attr('id') + "-content";

		tabSet = $(this).parent().parent().next().find('div.tabs > div');

		$(tabSet).each(function(){
			$(this).removeClass('show');						
		});
		$(showTab).addClass('show');
		
		return false;
	});	
});