// JavaScript Document

function swapArrow(toggle_box) { //Rollover
	
	arrow = document.getElementById(toggle_box);
	
	arrow.className = arrow.className+'_rollover';

}

function swapArrowBack(toggle_box) { //Rollover zurück
	
	arrow = document.getElementById(toggle_box);
	
	AClass = arrow.className;
	found = AClass.search(/arrowDown.+/);
	
	if(found != -1) {
		arrow.className = 'toggle_box_handle_arrowDown';
	} else {
		arrow.className = 'toggle_box_handle';
	}

}


/* get Tab var from URL -> define which tab is selected as default */
var currentSelectedTab = tab;
if(currentSelectedTab=="") {
	currentSelectedTab = FIRSTTAB;	
}

function switchToTab(tabNo) {
	
	//alert(tabNo+" "+currentSelectedTab)
	
	if(tabNo!=currentSelectedTab) {
	
	tabToSelect = document.getElementById('tab'+tabNo);
	tabToSelect.className = 'tab_selected';
	
	tabToDeselect = document.getElementById('tab'+currentSelectedTab);
	tabToDeselect.className = 'tab_unselected';
	
	/*Effect.Fade('tabContent_'+currentSelectedTab, { duration: 0.5 });
	Effect.Appear('tabContent_'+tabNo, { duration: 2.5 });*/
	
	/*show or hide content container*/
	tabContentToSelect = document.getElementById('tabContent_'+tabNo);
	tabContentToSelect.style.display = 'block';
	
	tabContentToDeselect = document.getElementById('tabContent_'+currentSelectedTab);
	tabContentToDeselect.style.display = 'none';
	
	}
	
	currentSelectedTab = tabNo;

}

function swapArrowUpOrDown(tbName) {

	tbNameHandle = tbName+'_handle';
	arrow = document.getElementById(tbNameHandle);
	
	AClass = arrow.className;
	found = AClass.search(/arrowDown.+/);
	
	if(found != -1) {
		arrow.className = 'toggle_box_handle_rollover';
	} else {
		arrow.className = 'toggle_box_handle_arrowDown_rollover';
	}
	

}

function showTBcontent(tbName) {
	
	tbNameContent = tbName+'_content';
	swapArrowUpOrDown(tbName);
	Effect.toggle(tbNameContent, 'Blind', { duration: 0.5 });
	
}