// JavaScript Document

function showBio (page) {
// popup window for faculty bio page, called from the brief bio sketch.

	location.href = page;
	window.moveTo (20, 20);
	window.resizeTo (window.screen.availWidth-40, window.screen.availHeight-40);
}


/* 
	Following is from Vladimir Kelman. posted 10/24/06 at
	http://pro-thoughts.blogspot.com/2006/10/incorrect-behavior-of-windowonblur.html 
	Works with FF2, IE6, IE7, Opera 9 (as of 5/12/07)


	In Internet Explorer 'onblur' event is implemented incorrectly (as opposed to Firefox/Mozilla browsers).
	It is wrongly fired when focus is switched between HTML elements *inside* a window. As a result, clicking
	on any element *inside* a popup window or trying to select something there will also close a popup.
	Below is a workaround.
	
	To use this, write the <body> tag as <body onload="initiateSelfClosing()">
*/

var active_element;
var bIsMSIE = false;

function initiateSelfClosing() {
	if (navigator.appName == "Microsoft Internet Explorer") {
		active_element = document.activeElement;
		document.onfocusout = closeWnd;
		bIsMSIE = true;
	} else { 
		window.onblur = closeWnd;
	}
}


function closeWnd() {
	if (window.opener != null) {
		if (bIsMSIE && (active_element != document.activeElement)) {
			active_element = document.activeElement;
		} else {
			window.close();
		}
	}
}
