/* 

Author:         Steve Bentley, Blue Water Images
Created: 		12 Dec 2006

Page Name:		windows.js
Page Type:		Javascript Window Fnctions

Function:

*/

	var newWindow;


/* Open New Centred Window: If already open  bring to front */

function openCentredWindow(windowURL, windowName, windowWidth, windowHeight) {
	
	if (!newWindow || newWindow.closed) {
		var left = parseInt((screen.availWidth/2) - (windowWidth/2));
		var top = parseInt((screen.availHeight/2) - (windowHeight/2));
		var windowFeatures = "width=" + windowWidth + ", height=" + windowHeight + ",status,left=" + left + ",top=" + top + ",screenX=" + left + ",screenY=" + top;
		newWindow = window.open(windowURL, windowName, windowFeatures);
	} else {
		// window is already open, bring to front
		newWindow.focus();
	}
}

/* Open New Window: If already open  bring to front */
function openWindow(windowURL, windowName) {
//alert('start');
	if (!newWindow || newWindow.closed) {
//alert('new');
		newWindow = window.open(windowURL, windowName);
	} else {
//alert('open');
		// window is already open, bring to front
		newWindow.focus();
	}
}