/*
	AGI-WI Project : RE-SKIN
	Date 06.07.2006 version 1.0
	By C.McElwee E-tech Consultant
	Description: JavaScript file included on all 'reskinned' pages.
				 Currently handles dynamic left menu (ShowMenu) and 
				 managing main browser window and secondary window (openOnlyOneWindow)
				 to contain reskinned content (main site) and old content (eAccess)
*/


<!--
function ShowMenu(n){
 var menu, arrowImg
 menu = document.getElementById("d" + n);
 // Determine if the menu is currently showing.
 if (menu.style.display != 'none'){
  // If it is showing, hide the menu and update the twisty image.
  menu.style.display = 'none';
  //arrowImg = document.images["i" + n];
  //arrowImg.src = "#variables.imageSrc#";
 } else {
  // Hide all layers first.
 var divs = document.getElementsByTagName("div")
 for (i = 0; i < divs.length; i++)
  if (divs[i].id.indexOf('d0') >= 0)
    	divs[i].style.display = 'none'
  // Show the menus and update their twisty images.
  // defect 6250 JLD correct code below
   menu = document.getElementById("d" + n);
   menu.style.display = '';
  // defect 6250 JLD commented out incorrect code below
  // i = 2
  // while (n.length >= i){		
  //   menu = document.getElementById("d" + n.substring(0, i));              
  //   menu.style.display = ""
  //   i += 2
  // }
 }
}

var newWin = '';
function openOnlyOneWindow(pageRequested, windowName){
 // handles Firefox and IE 6
 if (!newWin.closed && newWin.location){
  //alert("focus");
  newWin.focus();
 } else {
  if (!window.opener || window.opener.closed) {
   //alert("open");
   newWin = window.open(pageRequested, windowName);
   if (newWin.blur) {
    //alert("windowname: " + windowName);
    newWin.focus();
   }
  } else {
   //alert("self.name: " + self.name + "\npageRequested: " + pageRequested);
   window.opener.focus();
  }
 }
}
//-->
