
// declare global variable name
var newWindow = null
var newWin=null
var browserVer = parseInt(navigator.appVersion);

function makeNewWindow(strUrl, features) {
	// check if window already exists
	if (!newWindow || newWindow.closed) {
		// store new window object in global variable
		newWindow = window.open(strUrl,"subwindow",features)
		newWindow.opener.name = "opener"
		newWindow.focus()
	} 
	else {
	// window already exists, so bring it forward
	newWindow.open(strUrl,"subwindow",features)
	newWindow.focus()
	}
}

var checked=false;
function checkedAll (frm1) {
	var aa= document.getElementById('frm1');
	 if (checked == false)
          {
           checked = true
          }
        else
          {
          checked = false
          }
	for (var i =0; i < aa.elements.length; i++) 
	{
	 aa.elements[i].checked = checked;
	}
      }

// set flag to help out with special handling for window closing
var isIE3 = (navigator.appVersion.indexOf("MSIE 3") != -1) ? true : false
	
// close subwindow, including ugly workaround for IE3
function closeWindow() {
	if (newWindow && !newWindow.closed) {
		newWindow.close()
		window.opener.open("http://chiefs/main.asp")
	}
}
	
function winOpen(theURL, features) {
	window.open(theURL,"subwindow",features);
}

function popClose() {
  if (navigator.appVersion.indexOf("AOL") == -1) {
    if ((navigator.appName == "Netscape") || (browserVer >= 4 && navigator.appName.indexOf("Microsoft") != -1)) {
		if (newWin==null)
			return;
		else {
			if (newWin.closed) {
			  return;
			}
			else {
			  newWin.close();
			}
		}
    }
  }
}

function isEmpty(inputStr)
{
   if (inputStr == null || inputStr == "") {
      return true
   }
   return false
}

function isNum(inputVar) {
   inputStr = inputVar.toString();
   for (var i=0; i<inputStr.length; i++) {
      var oneChar = inputStr.charAt(i)
      if (oneChar < "0" || oneChar > "9") {
         return false
      }
   }
   return true
}
