function printWindow () {
   bV = parseInt(navigator.appVersion)
   if (bV >= 4) window.print()
} // end function printWindow

function openWindow ( url, width, height, options, name ) {
  if ( ! width ) width = 640;
  if ( ! height ) height = 420;
  if ( ! options ) options = "scrollbars=yes,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes";
  if ( ! name ) name = "outsideSiteWindow";
  var newWin = window.open( url, name, "width=" + width + ",height=" + height + "," + options );
} // end function openWindow

function jumpMenu (targ,selObj,restore) { //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
} // end function jumpMenu

/* Get X-coordinate of an object */
function getPageOffsetLeft (el) {
  var ol=el.offsetLeft;
  while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
  return ol;
} // end function getPageOffsetLeft

/* Get Y-coordinate of an object */
function getPageOffsetTop (el) {
  var ot=el.offsetTop;
  while((el=el.offsetParent) != null) { ot += el.offsetTop; }
  return ot;
} // end function getPageOffsetTop

/*Functions for TopNav Hovering*/
function topNavHover(topnav) {
	topnav = document.getElementById(topnav);
	topnav.style.backgroundColor = "#E3E7F7" ;
}

function topNavHoverOff(topnav) {
	topnav = document.getElementById(topnav);
	topnav.style.backgroundColor = "" ;
}



function compMatch() {

    // not all documents have the response form
    var responseForm = document.getElementById("contact");
    if (responseForm == null) {
        return true;
    } // end if

    // not all response forms have the Company_or_University field
    if (responseForm.Company_or_University == null) {
        return true;
    } // end if
    var compValue = responseForm.Company_or_University.value;

    // not all response forms have the nr_Department field
    if (responseForm.nr_Department != null) {
        if (responseForm.nr_Department.value == "") {
            var subjects = ["college" , "univ" ];
            for (var i in subjects) {
                var pattern = new RegExp(subjects[i], "i");
                if (pattern.test(compValue)) {
                    // not translated?
                    if (confirm (
                        "Please provide your department name. "+
                        "You have submitted a company/university address that typically requires "+
                        "a department name in order for the post office and your organization's mail room "+
                        "to deliver the materials you are requesting. "+
                        "Click 'OK' to go back and specify a department or "+
                        "click 'cancel' to submit the form without a department.")) {
                        responseForm.nr_Department.focus();
                        return false;
                    } // end if
                } // end if
            } // end for
        } // end if
    } // end if

    // not all response forms have the nr_Mail_Stop field
    if (responseForm.nr_Mail_Stop != null) {
        if (responseForm.nr_Mail_Stop.value == "") {
            var subjects = ["air force", "bae", "boeing", "ford", "general motors", "gm", "honeywell",
                "lockheed", "nasa", "navair", "naval air", "raytheon"];
            for (var i in subjects) {
                var pattern = new RegExp(subjects[i], "i");
                if (pattern.test(compValue)) {
                    // not translated?
                    if (confirm (
                        "Please provide your mail stop. "+
                        "You have submitted an address for a company that typically requires "+
                        "a mail stop in order for the post office and your organization's mail room "+
                        "to deliver the materials you are requesting. "+
                        "Click 'OK' to go back and specify a mail stop or "+
                        "click 'Cancel' to submit the form without a mail stop.")){
                        responseForm.nr_Mail_Stop.focus();
                        return false;
                    } // end if
                } // end if
            } // end for
        } // end if
    } // end if

    return true;
} // end function compMatch

function sizeTables () {
  var bodyTables = document.getElementById("mainbody").getElementsByTagName("table");
  var rightCol = document.getElementById("rightcol");
  var rightColHeight = rightCol.offsetHeight;
  var rcolY = getPageOffsetTop(rightCol);
  var rcolTotal = (rcolY + rightColHeight);
  for (i=0; i<bodyTables.length; i++) {
    if (bodyTables[i].offsetWidth > 420 && getPageOffsetTop(bodyTables[i]) < rcolTotal && document.getElementById("leftnavcol")) {
      bodyTables[i].width = 420 ;
    }// end if
  } // end for
} // end function sizeTables

/* OnLoad Firing */
onload = function () {
  if (navigator.appName == "Microsoft Internet Explorer") {
    if ( document.getElementById("mainbody") && document.getElementById("rightcol") ) {
      sizeTables();
    } // end if
  } // end if
} // end anonymous function