//***************************************************************************
// called from the empty initial framed content window to jump to the
// intented final document to be displayed in the bottom right corner frame 
//************************************************************** frm_setDoc()
function frm_setDoc()
{
window.location.replace(util_extractParameter("goTo", top.location.search));
}

//***************************************************************************
// called from the framed (final document) to replace the framed window 
//************************************************************* frm_unframe()
function frm_unframe()
{
if (top.frames.length>=3) 
  top.window.location.replace(top.frames[2].location.href);
}

//***************************************************************************
// called from the framed (final document) to set it's menus
//*********************************************************** frm_writeMenu()
function frm_writeMenu(menuBar, horizontal)
{
var doc
try
  {
  if (top.frames["FRAME_CONTENT"]==null) return false; 
  doc=top.frames[(horizontal)?1:0].document;
  doc.open(); doc.clear();
  doc.writeln("<!DOCTYPE html>");
  }
catch (error) { return false; }
doc.writeln("<html lang=\"en\">");
doc.writeln("<head>");
doc.writeln("  <meta charset=\"utf-8\">");
doc.writeln("  <title>menu</title>");
doc.writeln("  <base target=\"FRAME_CONTENT\">");
doc.writeln("</head>");
doc.writeln("<body>");
if (menuBar) 
  {
  var i=0, j=0; var caption, aHref;
  for (i=0; i<menuBar.length; i++)
    {  
    caption=menuBar[i].caption;
    if (menuBar[i].list)
      {
      doc.writeln("<b>"+caption+":&nbsp;</b>&nbsp;\n"); if (!horizontal) doc.writeln("<br/>");
      for (j=0; j<menuBar[i].list.length; j++)
        {
        caption=menuBar[i].list[j].caption;
        aHref=ldr_makeRelativeLink(menuBar[i].list[j].href);
        doc.writeln("<a href=\""+aHref+"\">"+caption+"</a> ");
        if (horizontal) doc.writeln("| "); else doc.writeln("<br\>");
        }
      doc.writeln("<br/>");
      }
    else 
      {
      aHref=ldr_makeRelativeLink(menuBar[i].href);
      doc.writeln("<a href=\""+aHref+"\">"+caption+"</a> ");
      if (horizontal) doc.writeln("| "); else doc.writeln("<br\>");
      }
    }
  }
else doc.writeln("<p>No links defined</p>");
doc.writeln("</body>");
doc.writeln("</html>");
doc.close();
return true;
}


