NS4 = (document.layers) ? 1 : 0; 
IE4 = (document.all) ? 1 : 0; 
ver4 = (NS4 || IE4) ? 1 : 0; 

if (ver4) { 
with (document) { 
write("<STYLE TYPE='text/css'>"); 
if (NS4) { 
write(".parent {position:absolute; visibility:visible}"); 
write(".child {position:absolute; visibility:visible}"); 
write(".regular {position:absolute; visibility:visible}") 
} 
else { 
write(".child {display:none}") 
} 
write("</STYLE>"); 
} 
} 

function getIndex(el) { 
ind = null; 
for (i=0; i<document.layers.length; i++) { 
whichEl = document.layers[i]; 
if (whichEl.id == el) { 
ind = i; 
break; 
} 
} 
return ind; 
} 

function arrange() { 
nextY = document.layers[firstInd].pageY +document.layers[firstInd].document.height; 
for (i=firstInd+1; i<document.layers.length; i++) { 
whichEl = document.layers[i]; 
if (whichEl.visibility != "hide") { 
whichEl.pageY = nextY; 
nextY += whichEl.document.height; 
} 
} 
} 


function SetCookie (name, value) {
          document.cookie = name + "=" + escape (value) ;
}
function getCookieVal(offset) {
   var endstr = document.cookie.indexOf (";", offset);
   if (endstr == -1) endstr = document.cookie.length;
   return unescape (document.cookie.substring(offset, endstr));
}
function GetCookie(name) {
   var arg = name+"=";
   var alen = arg.length;
   var clen = document.cookie.length;
   var i = 0;
   while (i < clen) {
      var j = i + alen;
      if (document.cookie.substring(i, j) == arg) return getCookieVal(j);
      i = document.cookie.indexOf(" ", i) + 1;
      if (i == 0) break;
   }
   return null;
}

var st=GetCookie("stat")

function initIt(){ 
if (!ver4) return; 

if ( st==null )
 { SetCookie("stat", gg);
   st=gg;
 }
 
if (NS4) { 
for (i=0; i<document.layers.length; i++) { 
whichEl = document.layers[i]; 
if (whichEl.id.indexOf("Child") != -1) 
{ le=whichEl.id.length;
  qt=whichEl.id.substring( 2, le-5 );
  ix=Number(qt)

  le=st.substring(ix-1,ix)
 if ( le=="0" )
  whichEl.visibility = "hide"; 
 else
  whichEl.visibility = "show";   
}
} 
arrange(); 
} 
else { 
divColl = document.all.tags("DIV"); 
for (i=0; i<divColl.length; i++) { 
whichEl = divColl(i); 
if (whichEl.className == "child")
{ ix=getIndex(whichEl.id)
  le=st.substring(ix-1,ix)
 if ( le=="0" )
  whichEl.style.display = "none"; 
 else
  whichEl.style.display = "block"; 

}
} 
} 
} 

function getIndex( kbname )
{ le=kbname.length;
  qt=kbname.substring( 2, le-5 );
  ix=Number(qt)
  return ix
}
function saveState( kbname,newst )
{ ix=getIndex(kbname )
  xx=""
  for ( var i=0; i<st.length; i++ )
   if ( i==Number(ix)-1 )
    xx=xx+newst;
   else
    xx=xx+st.substring(i,i+1);

  st=xx;
  SetCookie( "stat", st );
}

function expandIt(el) { 
if (!ver4) return; 
if (IE4) { 
whichEl = eval(el + "Child"); 
if (whichEl.style.display == "none") { 
whichEl.style.display = "block"; 
saveState( el+"Child", "1" );
} 
else { 
whichEl.style.display = "none"; 
saveState( el+"Child", "0" );
} 
} 
else { 
whichEl = eval("document." + el + "Child"); 
if (whichEl.visibility == "hide") { 
whichEl.visibility = "show"; 
saveState( el+"Child", "1" );
} 
else { 
whichEl.visibility = "hide"; 
saveState( el+"Child", "0" );
} 
arrange(); 
} 
} 
onload = initIt; 

