<!--
var childWindowArray = new Array();

//Add event that fires when page calls unload
addEvent(window, "unload", close_windows);

//Function closes all windows that the NewWindow
//function adds to the childWindowArray.
function close_windows(e) {
    for(i=0;i<childWindowArray.length;i++){
        childWindowArray[i].close();
    }
    childWindowArray.length = 0;
}


//Function adds events based on browser type
function addEvent(elm, evType, fn, useCapture){
    // addEvent and removeEvent
    // cross-browser event handling for IE5+,  NS6 and Mozilla
    // By Scott Andrew

    if (elm.addEventListener){
        elm.addEventListener(evType, fn, useCapture);
        return true;
    } else if (elm.attachEvent){
        var r = elm.attachEvent("on"+evType, fn);
        return r;
    } else {
       window.onunload = fn;
       return true;
    }
}

//Function pops up and centers a new child window
//and adds it to the child window array.
function NewWindow(mypage, myname, w, h, scroll) {
	//Original:  Eric King (eric_andrew_king@hotmail.com)
	//Modified to handle closing of children on page unload: Brent Pellinen
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=no'
	win = window.open(mypage, myname, winprops)
	childWindowArray[childWindowArray.length] = win;
	if (parseInt(navigator.appVersion) >= 4) { 
		win.window.focus(); 
	}
}
// -->
