
function errmsg(msg, url, line) {
  var txt;
  txt = "Javascript error has occurred\n";
  txt += "Error message: " + msg + "\n";
  txt += "URL: " + url + "\n";
  txt += "Line #: " + line ;
  alert(txt);
  return true;
}


window.onerror=errmsg;



function build_catalog_menu(menu_num) {

  
  var title     = [  "Catalog Intro", "Browse Catalog", "Send Comments", "Updates or Corrections"];
  var link      = [  "catalog_intro.html", "catalog.html", "catalog_comments.html", "catalog_update.html"];

  var n_items = title.length;
  var item_num;
  var class1, class2, class3;
  document.writeln();
  document.writeln('      <div id="top_menu_background_1">');
  document.writeln('        <ul class="top_menu_right">');
  for (item_num=n_items-1; item_num>=0; item_num--) {
    class1 = "";
    class2 = "";
    if (item_num === n_items-1) {class1 = "rmi"}
    if (menu_num === item_num)  {class2 = "tmSelected"}
    class3 = class1 + ' ' + class2;
    if (class3.length > 1) {class3 = "class=\"" + class3 + "\""}
    document.writeln('            <li ' + class3 +  '><a href="', link[item_num], '">',  
      title[item_num],  '</a></li>');
  }
  document.writeln('         </ul>  <!-- end of top_menu -->');
  document.writeln('        <div style="clear:both"></div>');
  document.writeln('      </div> <!-- end top_menu_background_1 -->');

}
