
// Globale Variablen
var ie6		 = 0;

var akt_tab = 'komp';
var tabKlickbar = 1;

var tab_item_width = 606;
var my_firsttab_height;

// Hooks
onloadHooks.push(function(){
	tx_igkompbranchen_pi1_onload();
});

// Load-Funktionen
function tx_igkompbranchen_pi1_onload(){
	initKompBranchen();
}

function initKompBranchen(){
	
	// Höhe
	my_firsttab_height = $('.komp_content').height();
	$('.tab_content_outer').css('height', my_firsttab_height);
	
	
	$('.tab_reiter a').click(function() {
		if(!$(this).hasClass(akt_tab) && tabKlickbar == 1) {
			tabKlickbar = 0;
			akt_tab = $(this).attr('class');
			killOldAktiv();
			$(this).parent().addClass('aktiv');
			animateTab();			
		}				
	});
	
	
	
	
	
}

function killOldAktiv() {
	var my_lis = $('.tab_reiter li');
	$.each(my_lis, function(key, value) { 
		if($(this).hasClass('aktiv')) $(this).removeClass('aktiv');
	});
	
}

function animateTab() {
	
	var new_tab_left;
	var new_tab_height;
	
	if(akt_tab == 'bran') {
		new_tab_left = -606;
		new_tab_height = $('.bran_content').height();
	}else {
		new_tab_left = 0;
		new_tab_height = my_firsttab_height;
	}
	
	
	$('.tab_content_inner').animate( {
			left: new_tab_left
		}, {
			    duration: 350,
			    easing: 'jswing',
			    complete: function() {
			    	
			 	}		
		}
	);
	
	
	$('.tab_content_outer').animate( {
			height: new_tab_height
		}, {
			    duration: 600,
			    easing: 'jswing',
			    complete: function() {
			    	tabKlickbar = 1;
			 	}		
		}
	);
	
	
	
	
	
}
