function initToolbar(n) {
  imageDown   = new Array(n)
  imageUp     = new Array(n)
  buttonOn    = new Array(n)
  buttActive  = new Array(n)
  helpTxt     = new Array(n)
  appFn       = new Array(n)
  formName    = new Array(n)
  for (var i=0;i<n;++i) {
    imageUp[i]    = new Image(); imageDown[i]  = new Image();
    buttonOn[i]   = 0;           buttActive[i] = 0;
    appFn[i]      = '';          formName[i]   = '';
    helpTxt[i]    = ''
  }
}
function mouseOver(n) {
  document.images[n].src = imageUp[n].src
  window.status = helpTxt[n]
}
function mouseOut(n) {
  document.images[n].src = imageDown[n].src
  document.status = ''
}
function cellOver(n) {
  mouseOver(n)
}
function cellOut(n) {
  mouseOut(n)
}
function imgInit(n) {
  document.images[n].src = imageDown[n].src
}
function userClick(frm, actn) {
  if (actn == 'submit') {
    details.submit()
  }
} 
function swapImage (image_name, current_name)
{
  var new_image = "menu-image/"+image_name;
}

function getPersonNames( n ) {

var id;

  if ( n==1 ) id="ottar";
  if ( n==2 ) id="sheila";
  if ( n==3 ) id="mons";
  if ( n==4 ) id="alan";
  if ( n==5 ) id="karen";

  return(id);
}

initToolbar(12);
for (n=1;n<6;n++) {
var id;
  
  id = getPersonNames( n );
  imageDown[n].src = "img/blue.gif";
  imageUp[n].src   = "img/"+id+".jpg";
  formName[n]      = "hc_name_edit";
}

helpTxt[1] = "Ottar";    appFn[1] = "ottar/";
helpTxt[2] = "Sheila";   appFn[2] = "sheila/";
helpTxt[3] = "Mons";     appFn[3] = "mons/";
helpTxt[4] = "Alan";     appFn[4] = "alan/";
helpTxt[5] = "Karen";    appFn[5] = "karen/";

function userClick(n) {
  document.location = appFn[n]
}

function printStillPortrait(n) {

var id;

    iDown = new Image();  iUp = new Image();
    
    id = getPersonNames( n );
    
    iDown.src = "../img/blue.gif";
    iUp.src = "../img/" + id + ".jpg";
    
    document.write("<img src=\"../img/blue.gif\" ");
    document.write("alt=\""+id+"\" ");
    document.write("onMouseOver=\"document.images[0].src = iUp.src\" ")
    document.write("onMouseOut=\"document.images[0].src = iDown.src\" > ")
}

function printPortraitLinks(n) {

    document.write("<img src=\"img/blue.gif\" ")
    document.write("height=\"125\" ")
    document.write("alt=\""+helpTxt[n]+"\" ")
    document.write("onMouseOver=\"mouseOver("+n+")\" ")
    document.write("onMouseOut=\"mouseOut("+n+")\" ")
    
    document.write("onClick=\"userClick("+n+")\" >")
}

function printMenu() {
  document.write("<table border=\"0\" align=\"center\"><tr>")
  for (n=1;n<6;n++) {
    document.write("<td align=\"center\">")
    printPortraitLinks(n);
    document.images[n].src = imageDown[n].src;
    document.write("</td>")
    document.write("")
  }
  document.write("</tr><tr>")
  for (n=1;n<6;n++) {
    document.write("<td align=\"center\" onMouseOver=\"cellOver("+n+")\" ")
    document.write("onMouseOut=\"cellOut("+n+")\" ")
    document.write("><a href=\""+appFn[n]+"\">"+helpTxt[n]+" ")
    document.write("</a></td>")
  }
  document.write("</tr></table>")
}

function printFooter(n) {

    document.write("<hr>")
    document.write("<p>This has been written in a text editor by a real programmer</p>")
    document.write("<p><a href=\"http://www.kvindesland.no/clank/\">To clanK</a></p>")
    document.write("</body></html>")
}

function printOttarFooter(n) {

    document.write("<hr>")
    document.write("<p>Comments? Please contact me at ")
    document.write("<p><a href=\"http://shack.la9iha.ampr/~ottar/clank/contact.php?i=395412/\">HERE</a></p>")
    printFooter(n);
}