function openWindowCentered(url,name,width,height,scrollbars) {
	var y  = (screen.height-height)>>1;
	var x = (screen.width-width)>>1;
	
	if (scrollbars) scrollbars="auto"
	else scrollbars="no"

	window.open(url,name,'width='+width+',height='+height+',top='+y+',left='+x+',scrollbars='+scrollbars+',resizable=0,toolbar=0,location=0,directories=0,status=0,menubar=0,copyhistory=0');
}

function popupCentreWindow(winURL, winName, winX, winY) {
	//  default window size
	var windowWidth  = winX;
	var windowHeight = winY;
	//  get the size of the screen if we can
	if (window.screen) {
        if (window.screen.availWidth) {
			//  browser has the appropriate properties we need to centre the window
            var screenWidth  = window.screen.availWidth;
            var screenHeight = window.screen.availHeight;
        }
	}
	//  location of the window
	var left = (screenWidth - windowWidth) / 2;
	var top  = (screenHeight - windowHeight) / 2;

	while (true) {
		var i = winURL.indexOf('&amp;');
		if (i < 0) {
			break;
		}
		winURL = winURL.substring(0, i) + '&' + winURL.substring(i + 5, winURL.length);
	}
	
	//  open the window
	newwin = window.open(winURL,winName,'left='+left+',top='+top+',screenX='+left+',screenY='+top+',width='+windowWidth+',height='+windowHeight+',scrollbars=0,resizable=1,toolbar=0,location=0,directories=0,status=0,menubar=0,copyhistory=0');
	if(javascript_version > 1.0) {
 		setTimeout('newwin.focus();',250);
	}
}
