// 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() {
  document.writeln ('<dl><dt>COMPANY</dt>');
  document.writeln ('  <dd><a href="/internet/news/news.htm">News</a></dd>');
  document.writeln ('  <dd><a href="/internet/company/contact.htm">Contact</a></dd>');
  document.writeln ('  <dd><a href="/internet/company/about.htm">About</a></dd>');
  document.writeln ('  <dd><a href="/internet/jobs/jobs.htm">Jobs</a></dd>');
  document.writeln ('</dl>');
  document.writeln ('<dl><dt>PRODUCTS</dt>');
  document.writeln ('  <dd><a href="/internet/products/sound_cards/soundcards.htm">MPEG Sound Cards</a></dd>');
  document.writeln ('  <dd><a href="/internet/products/sound_cards/soundcards_pcm.htm">PCM Sound Cards</a></dd>');
  document.writeln ('  <dd><a href="/internet/products/tuner_cards/tunercards.htm">Tuner Products</a></dd>');
  document.writeln ('  <dd><a href="/internet/products/cobranet/cobranet.htm">Network Products</a></dd>');
  document.writeln ('  <dd><a href="/internet/products/cables/cables.htm">Cables &amp; BOB</a></dd>');
  document.writeln ('  <dd><a href="/internet/products/oem/oem.htm">Custom &amp; OEM</a></dd>');
  document.writeln ('  <dd><a href="/internet/products/rohs/rohs.htm">RoHS</a></dd>');
  document.writeln ('</dl>');
  document.writeln ('<dl><dt>HOW TO BUY</dt>');
  document.writeln ('  <dd><a href="/internet/reseller/var.htm">VARs</a></dd>');
  document.writeln ('  <dd><a href="/internet/reseller/distributor.htm">Distributors</a></dd>');
  document.writeln ('</dl>');
  document.writeln ('<dl><dt>DOWNLOAD</dt>');
  document.writeln ('  <dd><a href="/internet/download/win_drivers.htm">Windows Drivers</a></dd>');
  document.writeln ('  <dd><a href="/internet/download/linux_drivers.htm">Linux Drivers</a></dd>');
  document.writeln ('  <dd><a href="/internet/download/apps.htm">Applications</a></dd>');
  document.writeln ('  <dd><a href="/internet/download/sdk/sdk.htm">SDKs</a></dd>');
  document.writeln ('  <dd><a href="/internet/download/docs.htm">Documentation</a></dd>');
  document.writeln ('</dl>');
  document.writeln ('<dl><dt>SUPPORT</dt>');
  document.writeln ('  <dd><a href="/internet/support/support.htm">Tech Support</a></dd>');
  document.writeln ('  <dd><a href="/internet/support/returns.htm">Warranty &amp; Repair</a></dd>');
  document.writeln ('  <dd><a href="/internet/support/advisories.htm">Product Advisories</a></dd>');
  document.writeln ('  <dd><a href="/internet/support/faqs.htm">FAQs</a></dd>');
  document.writeln ('</dl>');
  document.writeln ('<dl><dt>TECHNOLOGY</dt>');
  document.writeln ('  <dd><a href="/internet/tech/compression.htm">Compression</a></dd>');
  document.writeln ('  <dd><a href="/internet/tech/mrx.htm">MRX&trade;</a></dd>');
  document.writeln ('  <dd><a href="/internet/tech/tsx.htm">TSX&trade;</a></dd>');
  document.writeln ('  <dd><a href="/internet/tech/ssx.htm">SSX&trade; & SSX2&trade;</a></dd>');
  document.writeln ('  <dd><a href="/internet/tech/soundguard.htm">SoundGuard&trade;</a></dd>');
  document.writeln ('</dl>');
  document.writeln ('<dl><dt>GALLERY</dt>');
  document.writeln ('  <dd><a href="/internet/gallery/gallery.htm">Product Images & Advertisements</a></dd>');
  //document.writeln ('  <dd><a href="/internet/gallery/gallery.htm">Advertisements</a></dd>');
  document.writeln ('</dl>');
}

// 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 ('<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();
}