
// Opens a secondary window if not already open, otherwise brings secondary window into focus.
// (c) Craig Housley. Updated 07-Jan-2005

	function openWindow(url){
		if (typeof(myWindow) == "undefined" || myWindow.closed) { // second condition is a workaround for a problem in Mozilla
			myWindow=window.open(url,'fact','scrollbars=yes, toolbar=no,status=yes,location=yes,menubar=no,resizable=no,top=30,left=30,width=520,height=550');
		}
		else {
			myWindow.location=url
		}
		myWindow.focus();
	}
	
	function showflash(filelocation, mywidth, myheight) {
		showPopup('flash_popup.html', (mywidth/1 + 55), (myheight/1 + 110), new Array('filelocation', 'width', 'height'), new Array(filelocation, mywidth, myheight));
	}
	
	function showPopup(myLocation, w, h, attribKeys, attribValues) {
		var attribString = (attribKeys.length > 0)? "?" : "";
		var i;
		for (i = 0; i < attribKeys.length; i++) {
			attribString += attribKeys[i] + "=" + attribValues[i] + "&";
		}
		attribString = attribString.replace(/&$/g, '');
		if (typeof(myWindow) == "undefined" || myWindow.closed) { // second condition is a workaround for a problem in Mozilla
			myWindow = window.open(myLocation + attribString, null,'scrollbars=yes,toolbar=no,status=no,location=no,menubar=yes,resizable=yes,top=130,left=130,width=' + w + ',height=' + h + '');
		}
		myWindow.location = myLocation + attribString;
		myWindow.focus();
	}
