function openWindow(myname,myurl, mywidth, myheight)
{
	focusWindow = window.open(myurl, myname, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=' + mywidth + ',height=' + myheight);
	focusWindow.focus();
}

function toggleToc(param) {
	//alert("Einsprung");
 	var toc = document.getElementById('toc'+param);
 	
 	var toggleLink = document.getElementById('togglelink' + param)
 	//var toc = document.getElementById('toc1');
 	//var toggleLink = document.getElementById('togglelink1')
 	

 	//alert(param);
 	//alert(toggleLink.src);
  	
 	if(toc && toggleLink && toc.style.display == 'none') {
 		//alert("sichtbar");
     		changePic(toggleLink, tocHideText);
     		
     		//changeText(toggleLink, tocHideText);
 		toc.style.display = 'block';
     		document.cookie = "hidetoc=0";
	} else {
		//alert("noch sichtbar");
    		changePic(toggleLink, tocShowText);
    		
    		//changeText(toggleLink, tocShowText);
		toc.style.display = 'none';
		document.cookie = "hidetoc=1";
	}
}

function changeText(el, newText) {
  // Safari work around
  if (el.innerText)
    el.innerText = newText;
  else if (el.firstChild && el.firstChild.nodeValue)
    el.firstChild.nodeValue = newText;
}
  

function changePic(el, newText) {
 //alert("dddd");
 // alert(el.src);
  el.src="../images/site-images/menu/"+ newText;
  
}

function showTocToggle() {
  if (document.createTextNode) {
    // Uses DOM calls to avoid document.write + XHTML issues

    var linkHolder = document.getElementById('toctitle')
    if (!linkHolder) return;

    var outerSpan = document.createElement('span');
    outerSpan.className = 'toctoggle';

    var toggleLink = document.createElement('a');
    toggleLink.id = 'togglelink';
    toggleLink.className = 'internal';
    toggleLink.href = 'javascript:toggleToc()';
    toggleLink.appendChild(document.createTextNode(tocHideText));

    outerSpan.appendChild(document.createTextNode('['));
    outerSpan.appendChild(toggleLink);
    outerSpan.appendChild(document.createTextNode(']'));

    linkHolder.appendChild(document.createTextNode(' '));
    linkHolder.appendChild(outerSpan);

    var cookiePos = document.cookie.indexOf("hidetoc=");
    if (cookiePos > -1 && document.cookie.charAt(cookiePos + 8) == 1)
     toggleToc();
  }
}

function over(LinkBoxID)
{
	var LinkBoxBody2 = "Body2-" + LinkBoxID
	var LinkBoxBody3 = "Body3-" + LinkBoxID
 	
 	document.getElementById(LinkBoxBody2).style.backgroundColor="#D3D7E0";
 	document.getElementById(LinkBoxBody3).style.backgroundColor="#D3D7E0";
}

function out(LinkBoxID)
{
 	var LinkBoxBody2 = "Body2-" + LinkBoxID
 	var LinkBoxBody3 = "Body3-" + LinkBoxID
 	
  	document.getElementById(LinkBoxBody2).style.backgroundColor="#EFEFEF";
  	document.getElementById(LinkBoxBody3).style.backgroundColor="#EFEFEF";
}

function nav_over(ID)
{
	var NavID = "Navigation-" + ID;
	
	document.getElementById(NavID).style.backgroundColor="#94BDDD";
	
}

function nav_out(ID)
{
	var NavID = "Navigation-" + ID;
	
	
	document.getElementById(NavID).style.backgroundColor="#607B90";
	
}

function menu_over(ID)
{
	var NavID = "Navigation-" + ID;
	
	document.getElementById(NavID).style.backgroundColor="#C6C6C6";
	
}

function menu_out(ID)
{
	var NavID = "Navigation-" + ID;
	
	
	document.getElementById(NavID).style.backgroundColor="#EFEFEF";
	
}