// *****************************************************
// *****************************************************
// *****                                           *****
// ***** commonJavaScripts for kljb-bedifferent.de *****
// ***** coded by Lukas W. Bartsch /LukasDesignCGN *****
// ***** in January 2005 for kljb bzd.             *****
// *****                                           *****
// *****************************************************
// *****************************************************
//
// Popupfenster
//
function pupBox(url, xpand, ypand, additionals, popup){

  var winpopup = "win";
  var winadditionals = "";
  var x = 0;
  var y = 0;

  if(popup != '') winpopup = popup;

  if(winpopup == 'popup') { winpopup = winpopup + (new Date()).getTime(); }

  windowisopen = false;
  eval("if(window." + winpopup + " && window." + winpopup + ".closed==false) { windowisopen = true\; }");

  if(!windowisopen) {
    if(screen.width > 640) { 
      x = (screen.availWidth  - xpand) / 2;
      y = (screen.availHeight - ypand) / 2; 
    }
    winadditionals  = 'width=' + xpand + ',height=' + ypand + ',top=' + y + ',left='+ x;
    winadditionals += ',resizable,menubar,scrollbars';
  }
  

  eval("" + winpopup + " = window.open( url, winpopup, winadditionals)\;");
  eval("" + winpopup + ".focus()\;");
  eval("if (" + winpopup + ".opener == null) " + winpopup + ".opener = self\;");
}

// altes script, läuft aber... neues (momentan 'pUpbox') muss repariert werden...

function popBox (url, width, height)
	{
	var url;
	var width;
	var height;  
	var x = 0;
	var y = 0;
	var win = "";
	
	if(screen.width > 640)
	{
		x = (screen.availWidth  - width) / 2;
		y = (screen.availHeight - height) / 2;
	}
 	win=window.open(url,"popbox","width=350,height=500,top=' + y + ',left=' + x +',menubar=0,toolbar=0,directories=0, scrollbars=no");
	if(window.focus){ win.focus(); } 
	}
