// Code for rollover images on navbar

if (document.images) {
		  
		    // Preload top nav bar rollover images
			hm_nav_contacton = new Image();       hm_nav_contacton.src = "images/nav_contactus_on.gif";
			hm_nav_contactoff = new Image();      hm_nav_contactoff.src = "images/nav_contactus_off.gif";
			hm_nav_productson = new Image();       hm_nav_productson.src = "images/nav_products_on.gif";
			hm_nav_productsoff = new Image();      hm_nav_productsoff.src = "images/nav_products_off.gif";
			hm_nav_homeon = new Image();          hm_nav_homeon.src = "images/nav_home_on.gif";
			hm_nav_homeoff = new Image();         hm_nav_homeoff.src = "images/nav_home_off.gif";
			hm_nav_faqon = new Image();           hm_nav_faqon.src = "images/nav_faqs_on.gif";
			hm_nav_faqoff = new Image();          hm_nav_faqoff.src = "images/nav_faqs_off.gif";
			hm_nav_wpon = new Image();            hm_nav_wpon.src = "images/nav_whatpeople_on.gif";
			hm_nav_wpoff = new Image();           hm_nav_wpoff.src = "images/nav_whatpeople_off.gif";
			hm_nav_sfon = new Image();            hm_nav_sfon.src = "images/nav_solutionsfinder_on.gif";
			hm_nav_sfoff = new Image();           hm_nav_sfoff.src = "images/nav_solutionsfinder_off.gif";
			hm_nav_iaon = new Image();           hm_nav_iaon.src = "images/nav_inaction_on.gif";
			hm_nav_iaoff = new Image();          hm_nav_iaoff.src = "images/nav_inaction_off.gif";
        }
		
// on and off behaviors for rollover images             
               
          function imgOn(imgName) {
             if (document.images) {
                document[imgName].src = eval(imgName + "on.src");
             }
          }
          function imgOff(imgName) {
             if (document.images) {
                document[imgName].src = eval(imgName + "off.src");
             }
          }
		  		  
// A few window launching functions

function MM_openBrWindow(theURL,winName,features) { //v.2.0
var newWindow = window.open(theURL,winName,features);
newWindow.focus()
} 

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? parseInt((screen.width-w)/2) : 0;
TopPosition = (screen.height) ? parseInt((screen.height-h)/2) : 0;
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',screenX='+TopPosition+',screenY='+LeftPosition+',scrollbars='+scroll;
win = window.open(mypage,myname,settings);
if(win.window.focus){win.window.focus();}
}

function openWin(winName, url, w, h){
var popup;
  if (popup != null && !popup.closed) {
  	popup.close();
  }
  var width = 535;
  var height = 520;
  if (arguments.length > 2) { width = w; }
  if (arguments.length > 3) { height = h; }
  if (arguments.length == 1) { url = ''; }
  var left = (screen.availWidth / 2) - (width / 2);
  var top = (screen.availHeight / 2) - (height / 2);
  popup = window.open(url, winName,'toolbar=0,scrollbars=1,resizeable=0,width=' + width + ',height=' + height + ',top=' + top + ',left=' + left);
  popup.focus();
}

function openWin2(url, winName, w, h){
  var width = 410;
  var height = 250;
  if (arguments.length > 2) { width = w; }
  if (arguments.length > 3) { height = h; }
  var left = (screen.availWidth / 2) - (width / 2);
  var top = (screen.availHeight / 2) - (height / 2);
	window.open(url, winName,'toolbar=0,scrollbars=0,resizeable=0,width=' + width + ',height=' + height + ',top=' + top + ',left=' + left);
}

function openWin_vids(winName, url, w, h){
var popup;
  if (popup != null && !popup.closed) {
  	popup.close();
  }
  var width = 535;
  var height = 520;
  if (arguments.length > 2) { width = w; }
  if (arguments.length > 3) { height = h; }
  if (arguments.length == 1) { url = ''; }
  var left = (screen.availWidth / 2) - (width / 2);
  var top = (screen.availHeight / 2) - (height / 2);
  popup = window.open(url, winName,'toolbar=0,scrollbars=0,resizeable=1,width=' + width + ',height=' + height + ',top=' + top + ',left=' + left);
  popup.focus();
}

function showHide (id) {
  // var numArticles will change depending on how many articles are on a particular page.  Needs to be set in each page that will call this function.

  for (i=1;i<=numArticles;i++) {
	document.getElementById("article" + i).style.display = 'none';
  }
  
  document.getElementById("article" + id).style.display = '';
  
}

