/* * * * * * * * * * * * * * * * * * * * * * * 
 *	File: NewWindow.js
 *	Functions: NewWindow(); IEopenWin();
 *	Instructions: Call NewWindow with address of document as a string,  
 *	height and width of window as numeric values
 *
 * * * * * * * * * * * * * * * * * * * * * * */

// declare popup variable
var popup;

// function for dealing with IE4 on the Mac
function IEopenWin(address,height,width) {
	if (height != null) {
	popup = window.open(address, 'sized_popup_window','statusbar,resizable,scrollbars,HEIGHT=' + height + ',WIDTH=' + width);
	} else {
	popup = window.open(address,scrollbars,'popup_window');
	}
}

// function for opening the pop-up window
// pass the address of the document, height of the window, and width of the window 
function NewWindow(address,height,width) {
	// workaround for ie4 on PC´s!
	if (navigator.appVersion.indexOf("MSIE") != -1 && navigator.appVersion.indexOf("Macintosh") == -1 ) {
		if (popup != null) {
			popup.close();
			}
			if (height != null) {
				setTimeout("IEopenWin(\'" + address + "\'," + height + "," + width + ")", 100);
			} else {
				setTimeout("IEopenWin(\'" + address + "\')", 100);
			}
	} else {
	if (height != null) {
		popup = window.open(address, 'sized_popup_window','statusbar,resizable,scrollbars,HEIGHT=' + height + ',WIDTH=' + width);
	} else {
		popup = window.open(address,scrollbars, 'popup_window');
	}
	popup.focus();
	}
}


