/*
author: charleswoerner@hotmail.com
purpose: functions for controlling window content
*/

function noFrameset() {
	if (self != top) {top.location = location;}
}

function closeWin(win) {
    if (win) {
      if (typeof(win) == "object") {
		win.close();
		win = null;
      }
    }
}

function openWin(url, win) {
    closeWin(win);
	var width    = 700;
	var height   = screen.height -100;
	var nullStr  = (navigator.appName.indexOf("Microsoft") > -1) ? "viewWin" : "";
	var sizeScr  = (navigator.appName.indexOf("Microsoft") > -1) ? "resizable=yes, scrollbars=yes, " : "scrollbars=1, resizable=1, ";
	var left     = (navigator.appName.indexOf("Microsoft") > -1) ? (screen.width/2 - (.5 * width)) : "100";
	var features = sizeScr + "width=" + width + ", height=" + height + ", left=" + left;

		win = window.open(url, nullStr, features);
      	//mac and unix nav2 workaround; must be called twice
  		(parseInt(navigator.appVersion) == 2) && (navigator.appName == "Netscape") && (win = window.open(url,"",features));

		win.focus();
   		(win.opener == null) && (win.opener = self);
   		win.name = "viewWin";

}
