var childWindow;

function open_childWindow(windowURL,x,y) {
	
	//  default window properties
	var windowWidth  = x;
	var windowHeight = y;
	var	windowName = 'childWindow';
	
	//  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;
		}
	}
	//set Location of window (centered) from screen dimensions
	var windowPosTop = (screenHeight - windowHeight) / 2;
	var windowPosLeft  = (screenWidth - windowWidth) / 2;
	
	if (!childWindow || childWindow.closed) {
		childWindow = window.open(windowURL,windowName,'width='+windowWidth+',height='+windowHeight+',top='+windowPosTop+',left='+windowPosLeft+',scrollbars=1,resizable=1,toolbar=0,location=0,directories=0,status=0,menubar=0,copyhistory=0');
		if (!childWindow.opener) {
			childWindow.opener = window;
		}
	}
	else {
		// window is already open; bring to front
		setTimeout('childWindow.focus();',250);
		childWindow.location = windowURL;
	}
}
