// JavaScript Document




function changeTab(myValue)
{
	//alert(myValue);
	if (myValue == "tabOne")
	{
		//alert("");
		$('tabOne').className = 'btnOneSelected';
		$('tabOneBack').className = 'tabBackHightOp';
		$('tabContentOne').style.display = 'block';
		mySlide.slideIn();
				
		
		$('tabTwo').className = 'btnTwo';
		$('tabTwoBack').className = 'tabBackLowOp';
		$('tabContentTwo').style.display = 'none';
		mySlide2.slideOut();
		

	}
	else
	{
		$('tabOne').className = 'btnOne'; 
		$('tabOneBack').className = 'tabBackLowOp';
		$('tabContentOne').style.display = 'none';		
		mySlide2.slideIn();
		
		$('tabTwo').className = 'btnTwoSelected';
		$('tabTwoBack').className = 'tabBackHightOp';		
		$('tabContentTwo').style.display = 'block';	
		mySlide.slideOut();
		
	}

		
		//alert("TEST");
		//alert($('test').innerHTML);
	
}

var sLastSeleced = "tabTow";
var bIsInterval = true;
function timer() {

	//alert(bIsInterval + ' | ' + sLastSeleced);
	if (bIsInterval == true)
	{
		if (sLastSeleced == 'tabOne') 
		{
			changeTabV2('tabTwo');
		}
		else
		{
			changeTabV2('tabOne');
		}
	}		  
	setTimeout("timer()",5000);
}

function changeTabV2(myValue) {
	
	if (myValue == "tabOne")
	{
		$('tabOne').className = 'btnOneSelected';
		$('tabOneBack').className = 'tabBackHightOp';		
		$('tabTwo').className = 'btnTwo';
		$('tabTwoBack').className = 'tabBackLowOp';	
		mySlide2.slideOut();
		$('tabContentTwoSlide').style.display = 'none';		
		$('tabContentOneSlide').style.display = 'block';
		mySlide.slideIn();
		sLastSeleced = 'tabOne';
	}
	else
	{
		$('tabOne').className = 'btnOne'; 
		$('tabOneBack').className = 'tabBackLowOp';		
		$('tabTwo').className = 'btnTwoSelected';
		$('tabTwoBack').className = 'tabBackHightOp';		
		mySlide.slideOut();
		$('tabContentOneSlide').style.display = 'none';
		$('tabContentTwoSlide').style.display = 'block';
		mySlide2.slideIn();
		sLastSeleced = 'tabTwo';		
	}

}

function stopInterval() {
	bIsInterval = false;
}

function startInterval() {
	bIsInterval = true;
}

function mySlideOut() 
{

	mySlide.slideOut();

}


var sLastemployeeDesc = "-1";
function showDescription (myValue)
{
	//alert(myValue);
	if (sLastemployeeDesc != myValue)
	{
		//alert("Test");

		$(myValue).style.display = 'block';
		//var myInnerDiv = $(myValue).getElement('div');
		
		//var myNewString = myValue.replace('employeeDesc', 'employeeDescInner');
		//alert(myNewString);

		//alert($(myNewString));
		//var size = myInnerDiv.getScrollSize();
		//alert("The element is "+size.x+" pixels wide and "+size.y+"pixels high.");

		
		//alert($(myNewString).style.height + 'px');
		//$(myValue).style.height = '170px';	
		//$(myValue).style.top = '0px';	
		//$(myValue).style.verticalAlign = 'bottom';		
		//$(myValue).style.display = 'table-cell';	
		//$(myValue).style.position = 'relative';	
		
		
		//display: table-cell; vertical-align:bottom;
		
		//$(myValue).style.zIndex = '20';	
		sLastemployeeDesc = myValue; 
		//$('employeeDesc1').className = 'employeeDesc';
	}
}

function hideDescription()
{
	
	$$('.employeeDesc').setStyle('display', 'none');

	//alert(myValue);
	if (sLastemployeeDesc != "-1")
	{
		$(sLastemployeeDesc).style.display = 'none';		
		sLastemployeeDesc = "-1"; 
		//$('employeeDesc1').className = 'employeeDesc';
	}
}

function test() {
	
		//$$('div[class=employeeDesc]').setStyle('none');
	//$('employeeArea').getElement('.employeeDesc').setStyle('display', 'none');	
	$$('.employeeDesc').setStyle('display', 'none');
	
}

var sLastHighlight = "link1";
function setActiveAfter(myValue)
{	
	//alert("sdf dfg");
	//$$('a[class^=link]').className = 'normalOnly';
	if (sLastHighlight != "-1")
	{
		$(sLastHighlight).className = 'normalOnly';
	}
	
	
	$(myValue).className = 'activeOnly';
	sLastHighlight	= myValue;
}

var iMaxZoom = 3;
var iMinZoom = 1;
var iActZoom = 2;
function setZoom(myZoom)
{
	if (myZoom == 'ZOOM_OUT')
	{
		iActZoom--;
		if (iActZoom <= 0)
		{
			iActZoom = iMinZoom;
		}
	}
	if (myZoom == 'ZOOM_IN')
	{
		iActZoom++;
		if (iActZoom > iMaxZoom)
		{
			iActZoom = iMaxZoom;
		}
	}
	
	resetZoomImg();
	
	if (iActZoom == 1) {
		$('skizzeKlein').style.display = 'block';
	}
	else if (iActZoom == 2) {
		$('skizzeMittel').style.display = 'block';
	}
	else if (iActZoom == 3) {
		$('skizzeGross').style.display = 'block';	
	}
	else {
		$('skizzeGross').style.display = 'block';
	}
	
	
	//alert(iActZoom);
}

function resetZoomImg ()
{
	//alert('reset');
	$('skizzeKlein').style.display = 'none';	
	$('skizzeMittel').style.display = 'none';	
	$('skizzeGross').style.display = 'none';	
}
