/*
openWindow.js
This file will be inserted server side if a non-fool link is on the page. 
See bug 25782 for details.
Note that there are separate versions of this file for UK and US so any
change may need to be made to both.
May be replaced after Evolution project is complete, possibly by inclusion
in fool.js.
*/

var alreadyOpen = false;
var brow_alreadyOpen = false;
var popupWin;
function openWindow(url,name,w,h){
	if (parseInt(navigator.appVersion) > 2) {
		if (alreadyOpen){
			if (popupWin.closed) {
				popupWin = window.open(url,name,'scrollbars,resizable,width='+w+',height='+h);
			} else {
				popupWin.location = url;
				popupWin.focus()
			}
		} else {
			popupWin = window.open(url,name,'scrollbars,resizable,width='+w+',height='+h);
			alreadyOpen = true;
		}
	}
}

function openBrowser(url){
	if (parseInt(navigator.appVersion) > 2) {
		if (brow_alreadyOpen){
			if (popupWin.closed) {
				popupWin = window.open(url);
			} else {
				popupWin.location = url;
				popupWin.focus()
			}
		} else {
			popupWin = window.open(url);
			brow_alreadyOpen = true;
		}
	}
}
