
/*
    Function to detect browser and platform, and returns a string:

    pcnetscape6  = netscape 6.x on pc
    pcnetscape4  = netscape 4.x on pc

    macie        = ie on macinstosh
    macnetscape4 = netscape 4.x on macintosh
    macnetscape6 = netscape 6.x on macintosh

    linux        = linux platform (browser not specified)
*/

function sniffer()
{
  result = ' ';
  var testos = navigator.platform.toLowerCase();
  if(navigator.appVersion.indexOf("Win") !=-1)
  {
    if(navigator.appName=="Netscape" && document.layers)
    {
      result = 'pcnetscape4';
      return result;
    }
    else if(navigator.appName=="Netscape" && document.getElementById)
    {
      result = 'pcnetscape6';
      return result;
    }
    else if(navigator.appName!="Netscape")
    {
      result = 'pcie';
      return result;
    }
  }
  else if (testos.indexOf("mac")==0)
  {
    var macnav = navigator.appName.toLowerCase();

    if (macnav.indexOf("netscape")==0 && document.layers)
    {
      result = 'macnetscape4';
      return result;
    }
    else if(macnav.indexOf("netscape")==0 && document.getElementById)
    {
      result = 'macnetscape6';
      return result;
    }
    else if(macnav.indexOf("netscape")!=0 && document.all)
    {
      result = 'macie';
      return result;
    }
  }

  else if(testos.indexOf("linux") == 0)
  {
    result = 'linux';
    return result;
  }
}

/*
   Function to sniff out platform and insert appropriate style sheet
*/

function insertcss()
{
  if( sniffer() == 'pcnetscape4')
    document.write ('<link rel=stylesheet href="zito_styles_nn.css">');

  if( sniffer() == 'pcnetscape6')
    document.write ('<link rel=stylesheet href="zito_styles_ie.css">');

  if( (sniffer()) == 'pcie')
    document.write('<link rel=stylesheet href="zito_styles_ie.css">');

  if( (sniffer() == 'macnetscape4') || (sniffer() == 'macnetscape6') || (sniffer() == 'macie') )
    document.write ('<link rel=stylesheet href="zito_styles_mac.css">');
}


/*
    Function to perform mouseovers on buttons, but will optionally change an extra image
    too. The extra image may have more than one rollover image, which can be specified.
*/

function imageswap(imagename,swaptype,imagename2,image2index) // swaptype 0 = onmouseover, 1 = onmouseout, 2 = onclick
{
  if(document.images)
  {
    if(swaptype==0) // onmouseover
    { document.images[imagename].src = eval(imagename + "b.src"); }
    if(swaptype==1) // onmouseout
    { document.images[imagename].src = eval(imagename + "a.src"); }
    if(swaptype==2) // onclick
    { document.images[imagename].src = eval(imagename + "c.src"); }

    if(imagename2!="") // test to see if an optional extra image to swap is specified
    {
      if(image2index==0) // onmouseover
      { document.images[imagename2].src = eval(imagename2 + "b.src"); }
      if(image2index==1) // onmouseout restore this page's default 'section' image
      { document.images[imagename2].src = eval(imagename2 + "a.src"); }
    }
  }
}


function changesection(section)
{
  switch (section)
  {
    case 1:
         top.frames[0].location.href = "top_nav_about.html";
         top.frames[1].location.href = "about.html";
         break;
    case 2:
         top.frames[0].location.href = "top_nav_victsurv.html";
         top.frames[1].location.href = "victsurvive.html";
         break;
    case 3:
         top.frames[0].location.href = "top_nav_newreport.html";
         top.frames[1].location.href = "newreport.html";
         break;
    case 4:
         top.frames[0].location.href = "top_nav_press.html";
         top.frames[1].location.href = "press.html";
         break;
    case 5:
         top.frames[0].location.href = "top_nav_contact.html";
         top.frames[1].location.href = "contact.php";
         break;
    case 6:
         top.frames[0].location.href = "top_nav_inqreps.html";
         top.frames[1].location.href = "inqreps.html";
         break;
    case 7:
         top.frames[0].location.href = "top_nav_home.html";
         top.frames[1].location.href = "home.html";
         break;
    case 8:
         top.frames[0].location.href = "top_nav_pressrels.html";
         top.frames[1].location.href = "pressrels.html";
         break;
    case 9:
         top.frames[0].location.href = "top_nav_backdocs.html";
         top.frames[1].location.href = "backdocs.html";
         break;
    case 10:
         top.frames[0].location.href = "top_nav_tsunami.html";
         top.frames[1].location.href = "tsunami.html";
         break;
    case 11:
         top.frames[0].location.href = "top_nav_support.html";
         top.frames[1].location.href = "support.html";
    default:
         break;
  }
}




