actual = 1;
function overTab(obj) {
		obj.className = "over";
}

function outTab(obj) {
	id = obj.id.substring(6,7);
	id = parseInt(id);
	//alert(obj.id);
	if(actual != id) {
		obj.className = "";
	}
}

// usage: switchTab('tab_', 5, 1);
function switchTab(tabPrefix, maxTabs, activeTab){
	actual = activeTab;
	if(document.getElementById('tab_saz'))
		document.getElementById('tab_saz').value = actual;
	for(i=1;i<maxTabs+1;i++) {
		tmpDivName = tabPrefix + i;
		tmpDiv = document.getElementById(tmpDivName);
		buttonDiv = document.getElementById("tabBut"+i);
		if(i != activeTab) {
			outTab(buttonDiv);
			//buttonDiv.className = "";
			tmpDiv.style.display = "none";
		}
		else {
			overTab(buttonDiv);
			tmpDiv.style.display = "block";
			//document.getElementById("tab_saz").value = activeTab;			
			tmpDiv.focus();
		}
			
	}
	
	return false;
	/*
	//var tmpDiv, tmpDivName, counter;
	
	tmpDivName = tabPrefix + activeTab;
	tmpDiv = document.getElementById(tmpDivName);
	tmpDiv.style.visibility="visible";
	tmpDiv.style.display = "inline";
	tmpDiv.focus();

	counter = 1;
	//while(counter < maxTabs) {
	for(i=1;i<maxTabs+1;i++) {
		
		if (counter != activeTab) {
			tmpDivName = tabPrefix + i;
			tmpDiv = document.getElementById(tmpDivName);
			tmpDiv.style.display = "none";
			tmpDiv.style.visibility="hidden";
		}
			//counter++;
	}*/
}
