// JavaScript Document
var currentcaption;
var anzahl = 6;
var first = 0;
var timeout;

function change(act) {
	if(first != 1){
		currentcaption = document.caption.src;
		first = 1;
	}	
   temp = act.href;
	temp = temp.substr(temp.indexOf("?id=")+4,temp.length-temp.indexOf("?id=")-4);
	window.clearTimeout(timeout);
   if (temp == "32"){
		for (var i=0;i<anzahl;i++) {
      	document.getElementById("div" + i).style.visibility = "hidden";
		}
		document.caption.src = "fileadmin/template/main/menu/elim_chemnitz.gif";
      document.getElementById("div1").style.visibility = "visible";
	}
	if (temp == "25"){
		for (var i=0;i<anzahl;i++) {
      	document.getElementById("div" + i).style.visibility = "hidden";
		}
		document.caption.src = "fileadmin/template/main/menu/youth_alive.gif";
      document.getElementById("div2").style.visibility = "visible";
	}
	if (temp == "19"){
		for (var i=0;i<anzahl;i++) {
      	document.getElementById("div" + i).style.visibility = "hidden";
		}
		document.caption.src = "fileadmin/template/main/menu/kids_alive.gif";
      document.getElementById("div3").style.visibility = "visible";
	}
	if (temp == "11"){
		for (var i=0;i<anzahl;i++) {
      	document.getElementById("div" + i).style.visibility = "hidden";
		}
		document.caption.src = "fileadmin/template/main/menu/arbeitskreise.gif";
      document.getElementById("div4").style.visibility = "visible";
	}
	if (temp == "9"){
		for (var i=0;i<anzahl;i++) {
      	document.getElementById("div" + i).style.visibility = "hidden";
		}
		document.caption.src = "fileadmin/template/main/menu/alphaprojekt.gif";
      document.getElementById("div5").style.visibility = "visible";
	}
}

function setactivemenu()
{
	for (var i=0;i<anzahl;i++) {
     	document.getElementById("div" + i).style.visibility = "hidden";
	}
	document.caption.src = currentcaption;
   document.getElementById("div0").style.visibility = "visible";
}

function startTime()
{
	if(first != 1){
		currentcaption = document.caption.src;
		first = 1;
	}
	timeout = window.setTimeout('setactivemenu()', 1500);
}

function stopTime()
{
	if(first != 1){
		currentcaption = document.caption.src;
		first = 1;
	}
	window.clearTimeout(timeout);
}

function toggletoparrow(picture)
{
	if(picture == "")
	{
		document.toparrow.src = "fileadmin/template/main/menu/top_7x11.gif";
	}else{
		document.toparrow.src = picture;
	}
}
