<!--
// @@@
// @@ Author: Bas van Dorst
// @@ Date: 2007-02-27
// @@ Last change: 2007-02-27
// @@ Version: 1
// @@ Revision: 0
// @@ Copyright: Ecommany B.V.
// @@ Description: JS: popup windows
// @@$

var bPopupWinOpen = false;
loadPopupWin=true;

function OpenPopUpWin(sUrl, w, h, yesNo) {
  winl = (screen.width-w)/2;
	wint = (screen.height-h)/2;
	winprops = 'height='+h+',width='+w+',left='+winl+',top='+wint+',scrollbars=1,resizable=';
	winprops+= (document.layers)?1:yesNo;
	winprops+= ',toolbar='+yesNo+',location='+yesNo+',directories='+yesNo+',status='+yesNo+',menubar='+yesNo+',fullscreen=0';
  if (bPopupWinOpen) 
    if (PopUpWin.closed) 
			PopUpWin=window.open(sUrl,'PopUpWin',winprops);
		else {
			PopUpWin.location.href=sUrl;
			PopUpWin.focus();
		}
  else {
		PopUpWin=window.open(sUrl,'PopUpWin',winprops);
		bPopupWinOpen = true;
  }
}

function ClosePopUpWin() {
	if (bPopupWinOpen) 
    if (!PopUpWin.closed) 
      PopUpWin.close();
}

onunload = ClosePopUpWin;
//-->