window.onload = function()
{   	
	/* SPEAKERS LINK erstellen*/
	
    var speakersButton = document.getElementById("speakersButton");
	var a = document.createElement("a");
	a.setAttribute("id","speakersLink");
	a.onclick = function()
	{
		showSpeakers();
	}
	a.setAttribute("href","javascript:void(0)");
	a.appendChild(document.createTextNode(" Redner einblenden"));
       	
	var button = document.getElementById("oldSpeakersButton");
	speakersButton.setAttribute("class", "inaktiv");
	speakersButton.removeChild(button);
	speakersButton.appendChild(a);
	
	/* SESSIONS LINK erstellen*/
	
	var sessionsButton = document.getElementById("sessionsButton");
	var a = document.createElement("a");
	a.setAttribute("id","sessionsLink");	
	a.onclick = function()
	{
		showSessions();
	}
	a.setAttribute("href","javascript:void(0)");
	a.appendChild(document.createTextNode(" Sitzungen einblenden"));
	
	var button = document.getElementById("oldSessionsButton");
	speakersButton.setAttribute("class", "inaktiv");
	sessionsButton.removeChild(button);
	sessionsButton.appendChild(a);
}




function showSpeakers(){
	var container = document.getElementById("speakersContainer"); 
	container.style.display = "block";		

        var speakersButton = document.getElementById("speakersButton");
	var oldLink = document.getElementById("speakersLink");
	speakersButton.setAttribute("class", "aktiv");
	speakersButton.removeChild(oldLink);

	var a = document.createElement("a");
	a.setAttribute("id","speakersLink");
	a.onclick = hideSpeakers;
	a.setAttribute("href","javascript:void(0)");
	a.appendChild(document.createTextNode(" Redner ausblenden"));       	
	speakersButton.appendChild(a);
}

function hideSpeakers(){	
	var container = document.getElementById("speakersContainer"); 
	container.style.display = "none";
	var oldLink = document.getElementById("speakersLink");
	
	var speakersButton = document.getElementById("speakersButton");
	speakersButton.setAttribute("class", "inaktive");
	speakersButton.removeChild(oldLink);	

	var a = document.createElement("a");
	a.setAttribute("id","speakersLink");
	a.onclick = showSpeakers;
	a.setAttribute("href","javascript:void(0)");
	a.appendChild(document.createTextNode(" Redner einblenden"));       	
	speakersButton.appendChild(a);
}

function showSessions(){		
	var container = document.getElementById("sessionsContainer"); 
	container.style.display = "block";		
	var oldLink = document.getElementById("sessionsLink");

	var sessionsButton = document.getElementById("sessionsButton");
	sessionsButton.setAttribute("class", "aktiv");
	sessionsButton.removeChild(oldLink);
	var a = document.createElement("a");
	a.setAttribute("id","sessionsLink");
	a.onclick = hideSessions;
	a.setAttribute("href","javascript:void(0)");
	a.appendChild(document.createTextNode(" Sitzungen ausblenden"));       	
	sessionsButton.appendChild(a);
}

function hideSessions(){	
	var container = document.getElementById("sessionsContainer");
	container.style.display = "none";
	var oldLink = document.getElementById("sessionsLink");

	var sessionsButton = document.getElementById("sessionsButton");
	sessionsButton.setAttribute("class", "inaktiv");
	sessionsButton.removeChild(oldLink);
	var a = document.createElement("a");
	a.setAttribute("id","sessionsLink");
	a.onclick = showSessions;
	a.setAttribute("href","javascript:void(0)");
	a.appendChild(document.createTextNode(" Sitzungen einblenden"));       	
	sessionsButton.appendChild(a);
}
