var idCurrentTimeout;

function hideAllTabLabel( menu_tabs_size ){
	
	for(var index = 0; index < menu_tabs_size; index++){

		var tabID = "home-tab-" + index;
		var tabElement = document.getElementById( tabID );
		
		tabElement.className = "";
		
		if( index == (menu_tabs_size-1) ){
			tabElement.className = "last-tab";
		}
		
		if( index == 0 ){
			tabElement.className = "first-tab";
		}

	}	
}

function showTabLabel(index, menu_tabs_size){
	
	hideAllTabLabel( menu_tabs_size );
	
	var currentTab = document.getElementById( "home-tab-" + index );
	currentTab.className = "active";
	
	if( index == 0 ){
		currentTab.className = "active-first-tab";
	}
	
	if( index == (menu_tabs_size-1) ){
		currentTab.className = "active-last-tab";
	}
		
	if( index > 0 ){
		var prevTab =  document.getElementById( "home-tab-" + (index-1) );
		prevTab.className = "active-previous-tab";
		if( index == 1 ){
			prevTab.className = "active-first-previous-tab";
		}
	}
	
	if( index < (menu_tabs_size-1) ){
		var nextTab =  document.getElementById( "home-tab-" + (index+1) );
		nextTab.className = "active-next-tab";
		if( index == (menu_tabs_size-2) ){
			nextTab.className = "active-next-last-tab";
		}
	}

}


function hideAllTabContent( menu_tabs_size ){
	
	for(var index = 0; index < menu_tabs_size; index++){
		
		var tabID = "tab-content-" + index;
		var tabContentElement = document.getElementById( tabID );
		
		tabContentElement.className = "columns";
	}
}

function showTabContent( index, menu_tabs_size ){
	
	hideAllTabContent( menu_tabs_size );
	
	var tabID = "tab-content-" + index;
	var tabContentElement = document.getElementById( tabID );
	
	tabContentElement.className = "columns active";
	
}


function showTab( index, menu_tabs_size ){
	
	showTabLabel( index, menu_tabs_size );
	showTabContent( index, menu_tabs_size );
	
}

function delayedShowTab( index, menu_tabs_size ){
	idCurrentTimeout = setTimeout( function(){showTab(index, menu_tabs_size)}, 500 );
}




