
	// (c) copyright 2003 DAVstudio, Fenna Westerdiep (BNO)
	// Author: Bas van Gaalen

	// Opens a popup window width provided width and height or
	// fullscreen if no dimensions are provided.
	// Also optionally adds the menu and toolbars
	function openWin(url, width, height, menus) {
		var awidth = screen.availWidth;
		var aheight = screen.availHeight;
		var scrwidth, scrheight, features;
		if (width != null && height != null) {
			var scrleft = (awidth > width)?((awidth-width)/2):0;
			var scrtop = (aheight > height)?((aheight-height)/2):0;
			scrwidth = (awidth > width)?width:awidth;
			scrheight = (aheight > height)?height:aheight;
			features = 'width='+scrwidth+',height='+scrheight+',resize=no,top='+scrtop+',left='+scrleft;
		} else {
//			if (navigator.userAgent.match(/msie/i)) {
//				features = 'fullscreen';
//			} else {
				scrwidth = awidth;
				scrheight = aheight;
				features = 'width='+scrwidth+',height='+scrheight+',resize=no,top='+screen.availTop+',left='+screen.availLeft;
//			}
		}
		var strmenu = menus?",menubar=1,toolbar=1":"";
		window.open(url,'newwin'+Math.round(Math.random()*100),features+',scrollbars=1'+strmenu);
	}
