// This JavaScript contains all of the functions and variables needed to make
// a simple template-base dHMTL web structure.

// This creates the left-hand navigation menu - change this when choices are added/removed/modified.
// It is created as a definition list (DL) and the DL/DT/DD elements are laid out with CSS via style.css
// New main headings will be dt entries, and new subheadings will be dd entries.
function lhn() {
  var root="/internet";
  var path=location.pathname;
  var paths=location.pathname.split("/");
  if (paths[1] != "internet") {
    root="/" + paths[1] + "/internet";
  }
  root="http://www.audioscience.com/internet";
  document.writeln ('<h1>COMPANY</h1><ul class="dots">');
  document.writeln ('  <li><a href="' + root + '/news/news.htm">&#8226; News</a></li>');
  document.writeln ('  <li><a href="' + root + '/company/contact.htm">&#8226; Contact</a></li>');
  document.writeln ('  <li><a href="' + root + '/company/about.htm">&#8226; About</a></li>');
  document.writeln ('  <li><a href="' + root + '/jobs/jobs.htm">&#8226; Jobs</a></li>');
  document.writeln ('</ul>');
  document.writeln ('<h1>PRODUCTS</h1><ul class="dots">');
  document.writeln ('  <li><a href="' + root + '/products/network_audio.htm">&#8226; Network Audio</a></li>');
  document.writeln ('  <li><a href="' + root + '/products/sound_cards/soundcards.htm">&#8226; Sound Cards</a></li>');
  document.writeln ('  <li><a href="' + root + '/products/tuner_cards/tunercards.htm">&#8226; Tuner Products</a></li>');
  document.writeln ('  <li><a href="' + root + '/products/cables/cables.htm">&#8226; Cables &amp; BOB</a></li>');
  document.writeln ('  <li><a href="' + root + '/products/oem/oem.htm">&#8226; Custom &amp; OEM</a></li>');
  document.writeln ('</ul>');
  document.writeln ('<h1>HOW TO BUY</h1><ul class="dots">');
  document.writeln ('  <li><a href="' + root + '/reseller/var.htm">&#8226; VARs</a></li>');
  document.writeln ('  <li><a href="' + root + '/reseller/distributor.htm">&#8226; Distributors</a></li>');
  document.writeln ('</ul>');
  document.writeln ('<h1>DOWNLOAD</h1><ul class="dots">');
  document.writeln ('  <li><a href="' + root + '/download/win_drivers.htm">&#8226; Windows Drivers</a></li>');
  document.writeln ('  <li><a href="' + root + '/download/linux_drivers.htm">&#8226; Linux Drivers</a></li>');
  document.writeln ('  <li><a href="' + root + '/download/osx_drivers.htm">&#8226; OS X Drivers</a></li>');
  document.writeln ('  <li><a href="' + root + '/download/apps.htm">&#8226; Applications</a></li>');
  document.writeln ('  <li><a href="' + root + '/download/sdk/sdk.htm">&#8226; SDKs</a></li>');
  document.writeln ('  <li><a href="' + root + '/download/docs.htm">&#8226; Documentation</a></li>');
  document.writeln ('</ul>');
  document.writeln ('<h1>SUPPORT</h1><ul class="dots">');
  document.writeln ('  <li><a href="' + root + '/support/support.htm">&#8226; Tech Support</a></li>');
  document.writeln ('  <li><a href="' + root + '/support/returns.htm">&#8226; Warranty &amp; Repair</a></li>');
  document.writeln ('  <li><a href="' + root + '/support/advisories.htm">&#8226; Product Advisories</a></li>');
  document.writeln ('  <li><a href="' + root + '/support/faqs.htm">&#8226; FAQs</a></li>');
  document.writeln ('  <li><a href="' + root + '/products/rohs/rohs.htm">&#8226; RoHS</a></li>');
  document.writeln ('</ul>');
  document.writeln ('<h1>TECHNOLOGY</h1><ul class="dots">');
  document.writeln ('  <li><a href="' + root + '/tech/compression.htm">&#8226; Compression</a></li>');
  document.writeln ('  <li><a href="' + root + '/tech/mrx.htm">&#8226; MRX&trade;</a></li>');
  document.writeln ('  <li><a href="' + root + '/tech/tsx.htm">&#8226; TSX&trade;</a></li>');
  document.writeln ('  <li><a href="' + root + '/tech/ssx.htm">&#8226; SSX&trade; & SSX2&trade;</a></li>');
  document.writeln ('  <li><a href="' + root + '/tech/soundguard.htm">&#8226; SoundGuard&trade;</a></li>');
  document.writeln ('  <li><a href="' + root + '/tech/lowlatency.htm">&#8226; Low Latency</a></li>');
  document.writeln ('  <li><a href="' + root + '/tech/lsx.htm">&#8226; LSX&trade; - Lua</a></li>');
  document.writeln ('</ul>');
  document.writeln ('<h1>GALLERY</h1><ul class="dots">');
  document.writeln ('  <li><a href="' + root + '/gallery/gallery.htm">&#8226; Product Images &amp;<br>Advertisements</a></li>');
//  document.writeln ('  <dd><a href="' + root + '/gallery/gallery.htm">&#8226; Advertisements</a></dd>');
  document.writeln ('</ul>');
}

// This function takes the hidden data that came to us from the actual HTML file
// and displays it on the screen in the main data display area.  This is the "d"
// part of the dHTML that is this page.
function populate() {
  var destination=document.getElementById("display_data");
  var source=document.getElementById("main_data");
  destination.innerHTML=source.innerHTML;
  source.innerHTML=""; 
  source.className = "no_display";
}

// This is the main function.  Its purpose is to take the document that was given to the
// browser by the web server (which contains nothing visible to print on the screen) and
// builds the menu structure around it.  Finally, it calls the populate function which
// takes the hidden data and puts it on the screen in the right place.
function display_page() {
  var d = new Date();
  document.writeln ('<center>');
  document.writeln ('<br>');
  document.writeln ('<a href="/index.htm"><div id="logo">&nbsp;</div></a>');
  document.writeln ('<table id="container"');
  document.writeln ('<tr><td rowspan=2 id="lhn">');
  lhn();
  document.writeln ('</td><td id="well"><div id="display_data">');
  document.writeln ('</div></td></tr><tr><td id="copyright">');
  document.writeln ('Copyright &copy; 1996-' + d.getFullYear() + ' AudioScience Inc.');
  document.writeln ('</td></tr></table>');
  document.writeln ('</center>');
  populate();
}

