﻿function showOrHide(eId, thisImg, state) {
  if (e = document.getElementById(eId)) {
      if (state == null) {
	      state = e.style.display == 'none';
	      e.style.display = (state ? '' : 'none');
      }

      var myItm = document.getElementById('li_' + eId);
      if (myItm != null){
	        myItm.className = 'current';      
      }
      
      //...except for this, probably a better way of doing this, but it works at any rate...
      var myImg = document.getElementById(thisImg);
      if (myImg != null){
          if (state == true){				
	          myImg.src="../images/collapse.jpg";
          }
          if (state == false){
	          myImg.src="../images/expand.jpg";
          }
      }
   
      
  }
}

//opens a window and centers it
function openWin(sPage,w,h,scrollbars,status,resize){
       var winL = (screen.width - w) / 2;
       var winT = (screen.height - h) / 2;

       var myWin = window.open(sPage,'','height=' + h + ',width=' + w + ',left=' + winL + ',top=' + winT + ',status=' + status + ',scrollbars=' + scrollbars + ',resizable=' + resize);

       return myWin;
}

function setFocus2(ctl_name){
    var o = getElementById(ctl_name);
    if (o != null){
        o.focus();
    }
    
}
