/*
  es_common.js
	------------
	This JavaScript file contains common functions for the
	Northrop Grumman Internet site.
	------------
	Copyright (c) 2008 Northrop Grumman.  All Rights Reserved.
*/


function HideContent(d) {
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
document.getElementById(d).style.display = "block";
}
function ReverseDisplay(d) {
if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
else { document.getElementById(d).style.display = "none"; }
}


function init() {
	/* Place any function calls or other code that need to occur
	   on page load here. */
	doIE6Hovers();
}


function getCurrentYear () {
  var now  = new Date();
	var year = now.getYear();
	
  if(now.getYear() < 1900) {
    //Adjust for Firefox
    year += 1900;
  }//if

  return year;
}//getCurrentYear



/*  
    IE 6 doesn't allow the li element to use the hover pseudo class,
    so we have to mimic the behavior of li:hover with some JavaScript 
*/
function doIE6Hovers () {
	var navDivs  = new Array('top_nav','bottom_nav');
	var navNodes = new Array();
	if(document.all && document.getElementById) {
    for(i = 0; i < navDivs.length; i++) {
			navRoot = document.getElementById(navDivs[i]);
			for (j=0; j < navRoot.childNodes.length; j++) {
        node = navRoot.childNodes[j];
				if(node.nodeName == "UL") {
					navNodes[i] = node;
				}//if
      }//for
		}//for
		for(i = 0; i < navNodes.length; i++) {
			for(j=0; j < navNodes[i].childNodes.length; j++) {
				node = navNodes[i].childNodes[j];
				if(node.nodeName == "LI") {
					node.onmouseover = function() { this.className += 'over'; };
					node.onmouseout  = function() { this.className = this.className.replace('over',''); }
				}//if
			}//for
		}//for
  }//if
}


function openWin(){
   newWin = eval("window.open('', 'newWin', 'width=500,height=400,left="+((screen.width-650)/2)+",top="+((screen.height-500)/2)+",directory=1,toolbar=1,menubar=0,status=0,location=1,scrollbars=0,resizable=1')"); 
   newWin.focus();
}
