var win = null;

function popdown() {
  if (win && !win.closed) win.close();
}



function showpdf(formtext)
{ 
attr = "scrollbars=yes, width=500, height=700, resizable=yes, left="+(screen.availWidth/2-250)+", top="+(screen.availHeight/2-350);
win = window.open(formtext,"PDFDatei",attr);

if (win) return false;
  else return true;
}

function showurl(formtext)
{ 
attr = "location=yes,menubar=yes,toolbar=yes,status=yes,scrollbars=yes, width=700, height=500, resizable=yes, left="+(screen.availWidth/2-250)+", top="+(screen.availHeight/2-350);
win = window.open(formtext,"URL",attr);

if (win) return false;
  else return true;
}

window.onunload = popdown;
window.onfocus = popdown;


// Script für das Leistungsspektrum
wmtt = null;

//document.onmousemove = updateWMTT; // auskommentiert, damit der Text nicht am Mauszeiger klebt sondern an einen fixen Platz wandert.

function updateWMTT(e) {
	x = (document.all) ? window.event.x + document.body.scrollLeft + 320 : e.pageX; //erster Wert für IE, zweiter für FF
	y = (document.all) ? window.event.y + document.body.scrollTop - 160 : e.pageY;

	if (wmtt != null) {
		wmtt.style.left = (x - 300) + "px"; //eigentlich x + 20, aber man muss die halbe Breite bei zentrierter Darstellung abziehen.
		wmtt.style.top 	= (y - 350) + "px"; //eigentlich y - 100
	}
}

function showWMTT(id) {
	wmtt = document.getElementById(id);
	wmtt.style.display = "block";
	document.getElementById("0").style.display = "none";
}

function hideWMTT() {
	wmtt.style.display = "none";
	document.getElementById("0").style.display = "";
}

// Script für die Grundsätze

function swap_content( div ) { 
    displayType = ( document.getElementById( div ).style.display == 'none' ) ? 'block' : 'none'; 
    document.getElementById( div ).style.display = displayType; 
} 
function swap_content1( span ) { 
    displayType = ( document.getElementById( span ).style.display == 'block' ) ? 'none' : 'block'; 
    document.getElementById( span ).style.display = displayType; 
}

