// alert('docsweb.js loaded');
// bigwin will fill the screen of IE and Firefox. Width allows for border, height for toolbar.
var bigw=String(screen.width-25);
var bigh=String(screen.height-80);
var bigfeat="resizable=yes,scrollbars=yes,width="+bigw+",height="+bigh;
var bigwin;

/*
function openbigwin(url)
{
  if(!bigwin||bigwin.closed)
    {
      bigwin=window.open(url,"bigtar",bigfeat);
    }
  else 
    if(bigwin.focus)
      {
        bigwin.location.href=url;
        bigwin.focus();
      }
}
*/ 

function openbigwin(url)
{
   bigwin=window.open(url,"bigtar",bigfeat);
   bigwin.focus();
}

// smwin is a popup type and is moved after opening.
// smwin is used in menu items.
if (screen.width < 1199) var smw=String(screen.width-250)
else var smw=String(950);
var smh=String(screen.height-120);
var smfeat="resizable=yes,scrollbars=yes,width="+smw+",height="+smh;
var smwin;

function opensmwin(url)
{
   smwin=window.open(url,"smtar",smfeat);
   smwin.focus();
}

/* toggleMenu() "opens" one section of menu(s) using the parameter "currMenu" which is passed at the call.
This happens when:
1. Viewer clicks on a menu item that is followed by a :
2. Viewer opens a link - so that the menu in the new linked page will "remain" open (with its dot turned red, incidently**).
MenuOne uses parameters like "help_id1" etc.
MenuTwo is needed for gallery pages that have two menus that must both be opened when the page is loaded.
(The second call to toggleMenu is toward the end of the code for the gallery page.)
The code in the menuTwo is the same as in menuOne except for the qualifier _id2 and the rightbrdr.gif.  
The choices for "currMenu" with pages with a menu on left and right are: 
('hanga_id1')&('hanga_id2') or
('digit_id1')&('digit_id2').

** The red dots are turned on in the STYLE section of each page as in .home{color:#ff0000;}, above.     
*/
function toggleMenu(currMenu)
{
if(document.getElementById)
{
thisMenu=document.getElementById(currMenu).style
if(thisMenu.display=="block") 
thisMenu.display="none"
else
thisMenu.display="block"
return false
}
else
return true
}

function cleanUp()
{
  if(bigwin) 
  {
     if(!bigwin.closed) bigwin.close();
  }   
  if(smwin) 
  {
     if(!smwin.closed) smwin.close();
  }   
}

