function winOpen(url, breite, hoehe) {
      winX = (screen.width-breite)/2;
      winY = (screen.height-hoehe)/2;
      fenster = window.open(url, "fenster1", "width="+breite+",height="+hoehe+",menubar=no,toolbar=no,location=0,status=no,scrollbars=yes,resizable=no");
	  fenster.moveTo(winX,winY);
	  fenster.focus();

} 
   
var smokeEnabled = false;

function showDiv(url, breite, hoehe) {	
	winOpen(url, breite, hoehe);
	//unsichtbares div, in das transp.png geladen wird
	var smokePane = document.createElement("div");
	smokePane.id = "smoke";
	smokePane.style.position = "absolute";
	smokePane.style.width = "100%";
	smokePane.style.height = "100%";
	smokePane.style.top = "0px";
	smokePane.style.left = "0px";
	smokePane.style.zIndex = 100;
	
	//halbtransparenter hintergrund
	var smokeImg = document.createElement("img");
	smokeImg.src = "pics/transp.png";
	//now a hack for IE which won't use the alpha channel of the png image properly
	smokeImg.style.filter = "alpha(opacity=70,style=0)";
	smokeImg.style.width = "100%";
	smokeImg.style.height = "100%";
	smokeImg.style.border = "none";

	var foreground = document.createElement("div");
	
	foreground.id = "foreground";
	foreground.style.position = "absolute";
	foreground.style.width = document.body.clientWidth + "px";
	foreground.style.height = document.body.clientHeight + "px";
	foreground.style.top = "0px";
	foreground.style.left = "0px";
	foreground.style.zIndex = 200;
		
	smokePane.appendChild(smokeImg);
	var bodyelement = document.getElementsByTagName("body")[0];
	bodyelement.appendChild(smokePane);
	bodyelement.appendChild(foreground);
	
	smokeEnabled = true;
}

function hideDiv() {
	if (!smokeEnabled) return;
	var smokePane, foreground;
	
	smokePane = document.getElementById("content").getElementById("smoke");
	foreground = document.getElementById("content").getElementById("foreground");
	
	foreground.parentNode.removeChild(foreground);
	smokePane.parentNode.removeChild(smokePane);
	
	smokeEnabled = false;
}
