var isGecko = (navigator.userAgent.indexOf("Gecko") != -1)?true:false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1)?true:false;
var wincount = 0;
var NewWindowRef;
function openPopup(url,winTitle) {
	var winWidth="370";
	var winHeight="570";
	var winName = "NewWindow";
	var features = "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=no,top=100";
	features += ",width=" + winWidth + ",height=" + winHeight;
	//features += ",top=" + (screen.width-winWidth)/2 + ",left=" + (screen.height-winHeight)/2;

	if (!eval(winName + 'Ref')) {
		eval(winName + 'Ref = window.open("' + url + '","' + winName + '","' + features + '")');
	}
	else {
		//Opera doesn't give access to the .closed property, but if window has been closed .location will be undefined
		if ((isOpera && !eval(winName + 'Ref').location) || eval(winName + 'Ref').closed) {
			eval(winName + 'Ref = window.open("' + url + '","' + winName + '","' + features + '")');
		}
		else {
			eval(winName + 'Ref').close();
			eval(winName + 'Ref = window.open("' + url + '","' + winName + wincount + '","' + features + '")');
			wincount++;
		}
	}
	eval(winName + 'Ref').document.title=winTitle;
}
