function DoOne(AName,ALink,ACurName)
{
  // For the pages in the download folders
  // And the chat page which is in directory 'chat'
  if ((ACurName=="") || (ACurName=="Chat")) ALink='../'+ALink;
  
  document.write('<li>');
  document.write('<a href="'+ALink+'" title="'+AName+'">');
  if (AName==ACurName) document.write('<span id="navselected">');
  document.write(AName);
  if (AName==ACurName) document.write('</span>');
  document.write('</a>');
  document.write('</li>');
}

function DoHeader(sName)
{
  document.write('<div id="header">');
  
  if (sName!='Chat') {
    document.write('<div id="chat" style="float:right; margin:0px 0px 0px 0px">');
    document.write('<iframe src="/chat/supportyn.php" width="110" height="60" frameBorder="0" scrolling="no" marginwidth="0" marginheight="0"></iframe>');
    document.write('</div>');
  }
  
  if ((sName.length==0) || (sName=='Chat')) {
    document.write('  <img src="../ppImg/penguin.gif" alt="Penguin Programs" border="0" />');
    document.write('  <h1>Penguin Programs</h1>');
  }
  else if (screen.width<600) {
    document.write('  <img src="./ppImg/penguin_div2.gif" alt="Penguin Programs" border="0" />');
    document.write('  <h1>');
    document.write('  Penguin Programs');
    document.write('  </h1>');
  }
  else {
    document.write('  <img src="./ppImg/penguin.gif" alt="Penguin Programs" border="0" />');
    document.write('  <h1>Penguin Programs</h1>');
  }
  document.write('  <span class="blurb">Developing software since 1984</span>');
  document.write('</div>');

  document.write('<div id="navcontainer">');
  document.write('  <ul>');
  
  DoOne("Home","index.php",sName);
  DoOne("Portfolio","Portfolio.php",sName);
  DoOne("Tools","Tools.php",sName);
  DoOne("CV","CV.php",sName);
  DoOne("Contact","Contact.php",sName);
  //DoOne("Chat","chat/ppchat.php",sName);
  DoOne("Download","login.php",sName);
  
  document.write('  </ul>');
  document.write('</div>');
  
  //if (screen.width<600) {
    document.write('<br clear="all" />');
  //}
}  

