// =======================================================================
// Modified Copy of TechTSP's MASTER_FILES/index.js
// =======================================================================
// global state/variables: must be set before calling qs_start_doc
// most are kept the same for all page sets 
//
// CONVENTIONS: 
// -----------
// IMAGES: 
//   img directory for images 
//   img/trans.gif: transparent one pixel image 
//   img/qsbg.jpg: height 1px, width=real wide, 2pixel in color scheme color
//   img/qslogo.jpg:  logo adapted to color scheme 
//
// COLOR VARIABLES 
//   var qs_page_color: scheme's foreground color 
//   var qs_link_color: scheme's foreground color
//   var qs_link_hover: color sufficiently diffent from foregound color
//   var qs_background_color: color scheme foreground color 
//   var qs_background:  color used for off white background in background image
// 	img/qspagecolor.jpg 1 pixel in color scheme color 
//
// MENU
//   the menu is build on the basis of the global qs_menu_target array variable
//   the function qs_build_menu_table builds the main menu on the left of the 
//   web page, qs_menu_across builds the menu references at the bottom of the 
//   page.  qs_location and qs_location_ref are helper fcts. All these functions//   are specific to page sets (Sweden has its own, so does Concorde, ....)
// 
// A minimal web page with menu is build as follows: 
//    1) include this file 
//    2) add script section with: 
//            qs_path = <PATH to this file";
//            qs_plain_doc_start('Menu Item', 'Submenuitem');
//            qs_body_start(true);
//            html();
//    3) page contents 
//    4) script section with 
//            qs_doc_finish("DATE"); 
//            html(); 
// 
// A minimal web page without menu is build as follows: 
//    1) include this file 
//    2) add script section with: 
//            qs_path = <PATH to this file";
//            qs_img_doc_start('Menu Item', 'Submenuitem', 'headline');
//            html();
//    3) page contents 
//    4) script section with 
//            qs_img_doc_finish("DATE");
//            html(); 
//
// optionally the following functions may be called: 
//   qs_doc_title(text)   == set the title to text instead of default string
//   qs_doc_headline(text) == underline headline at beginning of page contents
//
//   qs_spacer_row(w, h) == add a transparent spacer row, sizes are in pixels
//                          maybe called just before qs_doc_finish
//   qs_menu_set_bling_html(html) == insert html above menu 
// ---------------------------------------------------------------------


// ---------------------------------------------------------------------
// these variables are rarely changed 
var qs_trans_img = 'img/trans.gif'; 
var qs_width = 800;

// qspath the path to this file relative to the including file 
var qs_path = '.'; 

var qs_menu_bling_bling; 

function qs_init_vars(menu_loc, sub_menu_loc, tit)
{
   qs_background_img = qs_path + '/' + qs_background_img;
   qs_logo_img = qs_path + '/' + qs_logo_img;
   qs_color_img = qs_path + '/' + qs_color_img;
   qs_trans_img = qs_path + '/' + qs_trans_img;
   qs_my_location = qs_location(menu_loc, sub_menu_loc);
   qs_my_menu = menu_loc; 
   qs_my_sub_menu = sub_menu_loc; 
}

// ---------------------------------------------------------------------
// Menu definition
// is the same for a whole set of pages such as Concorde/Sweden/...
// ---------------------------------------------------------------------
var qs_menu_target = new Array(); 

qs_menu_target[qs_location('Home', undefined)] 
	= "index.html"; 

qs_menu_target[qs_location("Concorde", undefined)] 
	= "concorde/index.html"; 

qs_menu_target[qs_location("pla85900", undefined)] 
	= "pla85900/index.html"; 

qs_menu_target[qs_location("TSP History", undefined)] 
	= "history/index.html"; 


// =======================================================================
// =======================================================================
// =======================================================================
// from here on it's the same for all page sets 
// -----------------------------------------------------------------------

// -----------------------------------------------------------------------
// always need an undefined 
// -----------------------------------------------------------------------
var undefined; 

// ---------------------------------------------------------------------------
// table 
// ---------------------------------------------------------------------------
var number_of_open_tables = 0; 
function qs_table_start(b, w, extra) 
{
   number_of_open_tables = number_of_open_tables + 1;
   width = ""; 
   if (w != undefined) {
      width = " width=" + w + "px"; 
   }
   if (extra == undefined) { extra = ""; }
   s = '<table cellpadding=0 cellspacing=0 vspace=0 hspace=0' +
       ' border=' + b + 'px ' + width + " " + extra + ">";
   return s; 
}

function qs_table_finish() 
{
   number_of_open_tables--; 
   return "</table>"; 
}

function qs_row_spacer(h) 
{
   return '<tr>' + 
      '<td><img src=' + qs_trans_img + ' height=' + h + 'px ' + '></td>' + 
      '</tr>';
}

function qs_col_spacer(w, h, colsp)
{
   var span = ''; 
   if (colsp != undefined && colsp != 1) span = ' colspan=' + colsp; 
   return('<td' + span + '><img src=' + qs_trans_img + ' height=' + h + 'px ' + 
			 'width=' + w + 'px></td>');
}

// ----------------------------------------------------------------------------
// generators for <a href= ....
// ----------------------------------------------------------------------------
function qs_go_back_ref(txt) 
{
  return "<a href=javascript:history.back();>" + txt + "</a>"; 
} 

function qs_ref(text, target, status) 
{
   s = "<a href='" + target + "'";
   if (status != undefined) {   
     s += ' onMouseOver="window.status=\'' + status + '\'; return true;" ' +
	' onMouseOut="window.status=\'' + qs_my_location + '\'; return true;"';
   }
   s += ">" + text + "</a>"; 
   return s;
} 

function qs_font_color(sz) 
{
   if (sz != undefined) {
      size = 'size=' + sz; 
   } else {
      size = ''; 
   } 
   //return '<font ' + size + '>'; 
   return '<font ' + size + ' color=' + qs_page_color + '>'; 
}

// ---------------------------------------------------------------------------
// support for qs_menu function 
// ---------------------------------------------------------------------------
function qs_menu_ref(cur_loc, item_loc, text)
{
   var href = new String(qs_menu_target[item_loc]); 
   if (href.match(/^http:/)) {
      target_file = href; 
   } else {
      target_file = qs_path + "/" + qs_menu_target[item_loc]; 
   } 
   s = ('<a href=' + target_file + ' ' +
         'onMouseOver="window.status=\'' + item_loc + '\'; return true;" ' +
	 'onMouseOut="window.status=\'' + cur_loc + '\'; return true;">' +
	 text + '</a>'); 
   return s;
}

function qs_menu_item(cur_menu, cur_sub_menu, item_text, sub_item_text)
{
   cur_loc = qs_location(cur_menu, cur_sub_menu); 
   item_loc = qs_location(item_text, sub_item_text); 
   target_file = qs_path + "/" + qs_menu_target[item_loc]; 
   subitem  = (sub_item_text != undefined); 
   istext = (item_loc == cur_loc); 
   color = qs_page_color; 
   if (subitem) {
      text = sub_item_text; 
   } else {
      text = item_text;
   }
   if (istext) {
     ptr = '>&nbsp;';  
   } else {
     ptr = '&nbsp'; 
   }
   wd('<tr>'); 
   wd(qs_col_spacer(8,1, 1)); 
   wd(qs_col_spacer(8,1, 1)); 
   wd('<td width=16px><font color=' + color + '>' + ptr + '</font></td>');
   if (subitem) {
       wd(qs_col_spacer(16,1, 1)); 
       wd('<td align=left>'); 
   } else {
       wd('<td colspan=2 align=left>'); 
   } 
   wd(qs_menu_ref(cur_loc, item_loc, text));
   wd('</td></tr>'); 
   return (cur_menu == item_text);
}

function qs_menu_separator(color_img)
{
   wd('<tr>'); 
   wd(qs_col_spacer(8,1, 1));  
   wd('<td colspan=4 height=16px>' + 
      '<img src=' + color_img + ' width=144px height=2px>' + 
      '</td>');
   wd('</tr>'); 
}

function qs_menu_insert_bling_bling(html) 
{
   wd('<tr>'); 
   wd(qs_col_spacer(8,1, 1)); 
   wd('<td colspan=4 width=144px>');
   wd(html); 
   wd('</td></tr>'); 
} 

// --------------------------------------------------------------------------
// fcts used in page building 
// --------------------------------------------------------------------------
var qs_do_head = true; 

// EXPORTED; used in pages that request non default title 
function qs_doc_title(str) 
{
   if (qs_do_head) {
      wd('<meta content="text/html; charset=ISO-8859-1 ' + 
         'http-equiv="content-type">' + 
         '<title>' + str + '</title>' + 
         '</head>'); 
      qs_do_head = false;
   }
}

// EXPORTED 
function qs_menu_set_bling_html(html) 
{
    qs_menu_bling_bling = html; 
}

// EXPOERTED
function qs_plain_doc_start(menu_loc, sub_menu_loc, dotitle, tit) {
   qs_doc_setup(menu_loc, sub_menu_loc, true, dotitle, tit);

   wd(qs_table_start(0, undefined));
   wd(qs_setup_doc_line(10)); 
   // menu in first 2 cols on left,  page content in 2 cols on right 
   wd('<tr>'); 
   wd('<td valign=top ' + qs_debug_color() + 'colspan=2 rowspan=100>');
   qs_build_menu_table(qs_my_menu, qs_my_sub_menu); 
   wd('</td>'); 
   wd('<td rowspan=100 width=16px ' + qs_debug_color() + '>'+ 
		   '<img src=' + qs_trans_img + '></td>'); 
   // page content in its on table 
   wd('<td colspan=2>' + qs_table_start(0, 632, qs_debug_color())); 
   html(); 
}
   
// EXPOERTED
function qs_doc_headline(left)
{
   if (left != undefined) { 
      wd('<tr><td align=left>' + qs_font_color() + left + '</font></td></tr>'); 
   } 
   html(); 
}

// EXPOERTED
function qs_body_start(with_underline)
{
  if (with_underline) { 
     qs_line(true); 
  }
  if (with_underline) {
     wd('<tr><td colspan=2 height=16px><img width=632px height=2px src=' +
        qs_trans_img + '></td>'); 
     wd('</tr>'); 
  } 

  wd('<tr><td width=632px valign=top>'); 
  html();  // spit out HTML before  <SCRIPT> section is eneded 
}

// EXPORTED 
function qs_spacer_row(w, h) 
{
   wd('</td></tr>'); 
   if (h != undefined)  {
      ht = "height=" + h + "px"; 
   } else {
      ht = "";
   }
   wd('<tr>' + 
      '<td><img src=' + qs_trans_img + ht + ' width=' + w + 'px>'); 
   return '';
} 
// EXPOERTED
function qs_doc_finish(date, spacing) 
{
   wd('</td></tr>' + qs_table_finish()); // end of main page contents 
   wd('</td></tr>'); 
   if (spacing == undefined) {
      spacing = 36; 
   } 
   if (spacing < 0) {
      spacing = 36; 
   }
   wd(qs_row_spacer( spacing)); 
   qs_line(true); 

   //wd('<tr>'); 
   //wd('<td>'); 
   wd('<tr><td align=left ' + qs_debug_color() + '>'); 
   qs_menu_across(); 
   wd('</td>'); 
   wd('<td align=right' + qs_debug_color() + '>'); 
   wd(qs_go_back_ref("Back")); 
   wd('</td>'); 
   wd('</tr>'); 
   if (date != undefined) { 
      wd(qs_row_spacer( 8)); 
      wd('<tr' + qs_debug_color() + '>' + 
         '<td colspan=2 align=right>' + qs_font_color(-2) + 
              ' Last Updated: ' +   date + 
              '</font></td></tr>');
   }
   wd(qs_row_spacer( 8)); 
   wd(qs_table_finish()); 

   wd('</body>');
   html();
}

// EXPOERTED
function qs_img_doc_start(menu_loc, sub_menu_loc, tit) {
   qs_doc_setup(menu_loc, sub_menu_loc, false, undefined, tit);

   wd(qs_table_start(0, undefined, 'bgcolor="' + qs_background_color + '"'));
   wd('<TR>'); 
   wd(qs_col_spacer(16,12));
   wd(qs_col_spacer(qs_width-16,12));
   wd('</TR>'); 

   wd('<TR>'); 
   wd(qs_col_spacer(16,1));
   wd('<TD>' + qs_font_color() + tit + '</font></td>'); 
   wd('</TR>'); 

   wd(qs_row_spacer( 12)); 

   wd('<TR>'); 
   wd(qs_col_spacer(16,1));
   wd('<TD>' ); 
}
   
// EXPOERTED
function qs_img_doc_finish(date) 
{
   wd('</td></TR>'); 
   wd(qs_table_finish()); 
   // end of main page contents 

   wd(qs_table_start(0, undefined, 'bgcolor="' + qs_background_color + '"' ));

   wd(qs_setup_doc_line(12)); 
   // colored line
   wd('<tr>' + 
      '<td colspan=5 align=left>' + 
           '<img src=' + qs_color_img + ' height=3px width=' + 
           qs_width + 'px>' + 
           '</td></tr>');
   wd(qs_setup_doc_line(12)); 

   wd('<tr>'); 
   wd(qs_col_spacer(1,1)); 
   wd('<td align=left>'  + qs_go_back_ref("Back") + '</td>'); 
   wd(qs_col_spacer(1,1)); 
   wd('<TD>'); qs_menu_across(); wd('</td>'); 
   wd('</tr>'); 

   if (date != undefined) { 
      wd('<tr>' + '<td colspan=5 align=right>' + qs_font_color(-2) + 
                  ' Last Updated: ' +   date + '</font></td></tr>');
   } else { 
      wd(qs_row_spacer( 8)); 
   }
   wd(qs_row_spacer( 8)); 
   wd(qs_table_finish()); 
   wd('</body>');
//alert('number_of_open_tables=' + number_of_open_tables); 
   html();
}

function qs_setup_doc_line(height) 
{
   return '<tr>' + 
          qs_col_spacer(8, height, 1) +    // width, height, #colspan
          qs_col_spacer(144, height, 1) + 
          qs_col_spacer(16, height, 1) + 
          qs_col_spacer(632, height, 2) + 
          '</tr>';
   // debugging version
   s = 
      '<tr> ' +
      '<td  height=' + height + 'px ' + 
	       'width=8px bgcolor=yellow><img src=' + qs_trans_img + '></td>' +
      '<td  height=' + height + 'px ' + 
	       'width=144px bgcolor=black><img src=' + qs_trans_img + '></td>' +
      '<td  height=' + height + 'px ' + 
	       'width=16px bgcolor=beige><img src=' + qs_trans_img + '></td>' +
      '<td  height=' + height + 'px ' + 
	       'bgcolor=pink><img width=400px height=1px src=' + qs_trans_img + '></td>' +
      '<td  height=' + height + 'px ' + 
	       'bgcolor=purple><img src=' + qs_trans_img + '></td>' +
      '</tr> '; 
   return s;
} 

function qs_doc_setup(menu_loc, sub_menu_loc, dobg, dohead, tit) 
{
   if ((dohead != undefined) && (dohead != true)) {
      qs_do_head = false; 
   }
//   alert(menu_loc + '\n' + 
//        sub_menu_loc + '\n' +
//        'bg=' + dobg + '\n' + 
//        'head=' + dohead + '\n' +
//        'dohead=' + qs_do_head + '\n' +
//        'tit=' + tit);

   qs_init_vars(menu_loc, sub_menu_loc, tit); 
   window.status = qs_my_location; 

   if (tit != undefined) {
      tit = '&nbsp;&nbsp;  ' + tit ; 
   } else {
      tit = '';
   }
   qs_doc_title(qs_my_location + tit); 
   bgimg = ''; 
   if (dobg) { 
      bgimg = 'background=' + qs_background_img;
   } else {
      bgimg = 'bgcolor=' + qs_background_color; 
   }
   wd('<body ' + bgimg + 
      ' link=' + qs_link_color +
      ' alink=' + qs_link_hover +
      ' vlink=' + qs_link_visited +
      ' leftmargin=0 topmargin=0' +
   ' marginheight=0 marginwidth=0 >');
   // The Page is a table: with the following row layout
   // | 8 | 144       | 16 | 632 over 2 cols                              
   //  the logo takes up col 1,2,3 over two rows 
   //  the color bar extends on the lower row next to the logo in col 4
   //  the menu takes up he first two columns
   // the document body is inside a table that takes up grid entry 4,4
   
   wd(qs_table_start(0, undefined)); 
   wd(qs_setup_doc_line(1)); 

   // logo (spreads over two rows) 
   // location at right side  
   wd('<tr> ');
    wd('<td rowspan=2 colspan=3 ' + qs_debug_color() + 'width=168px height=72px>' + 
      '<img border=0px width=168px height=72px src="' + qs_logo_img + '" alt="Logo">' + 
      '</td> ');
   wd('<td height=36px colspan=2 align=right bdcolor=blue>' + qs_font_color() + 
       qs_location_ref(qs_my_menu, qs_my_sub_menu) + '</font></td>');
   wd('</tr>');

   // the color bar
   wd('<tr>'); 
   wd('<td height=36px colspan=2>' + 
      '<img src=' + qs_color_img + ' border=0px height=36px width=632px>' +
      '</td></tr>');
   
   wd(qs_table_finish()); 
}

function qs_line(visible)
{
  img = qs_color_img;
  wd('<tr' + qs_debug_color() + '>' + 
     '<td colspan=2 height=16px><img width=632px height=2px src=' + img + '>' +
     '</td></tr>'); 
}


// -----------------------------------------------------------------------
// htm text gathering fcts 
// -----------------------------------------------------------------------
var html_text = ''; 

// EXPOERTED
function wd(s)   { html_text += s + '\n'; }

// EXPOERTED
function alerthtml()  { 
  alert(html_text); 
  html(); 
}

// EXPOERTED
function html()  { 
  document.writeln(html_text);
  html_text = '\n'; 
}

// -----------------------------------------------------------------------
// debugging support
// -----------------------------------------------------------------------
function handle_error(msg, url) 
{
   file = new String(url); 
   if (file.length > 40) {
       file = "..." + file.substring(file.length-40); 
   } 
   alert(file + ": \n" + msg); 
}

window.onerror = handle_error; 

var debug_color_index = 0; 
var debug_color = new Array(); 
debug_color[0] = "red"; 
debug_color[1] = "green";
debug_color[2] = "blue"; 
debug_color[8] = "#777777"; 
debug_color[3] = "yellow"; 
debug_color[4] = "maroon"; 
debug_color[7] = "#555555"; 
debug_color[5] = "purple"; 
debug_color[6] = "orange"; 
debug_color[9] = "pink"; 

function qs_debug_color() 
{
   // do return s when you want to debug 
   return ' ';
   debug_color_index  = debug_color_index + 1;
   if (debug_color_index > 9) debug_color_index = 0; 
   s =  ' bgcolor=' + debug_color[debug_color_index] + ' '; 
   return s;
} 

// --------------------------------------------------------------------------
// pages style sheet
// 
function css_link() {
   var s = ('\n<STYLE type="text/css">\n' +
        '<!--\n' +
   'body, p, td, a { \n' +
   '   font-family: Arial, Helvetica, sans-serif;\n' +
        '   font-size: 14px;\n' +
        '   line-height: 18px;\n' +
   '} \n' +
   '' +
        'A { text-decoration: none; \n' +
   '} \n' +
   'A:hover {\n' +
   '    color: ' + qs_link_hover + '; \n' +
   '}\n' +
        '-->\n' +
        '</STYLE>\n');
   //alert(s);
   return s;
}

// =======================================================================
// End of Copy of TechTSP's index.js 
// =======================================================================

// =======================================================================
// SPECIFICS FOR SWEDEN 
// =======================================================================

// qspath the path to this file relative to the including file 
var qs_path = '.'; 

// these vars are the same for whole sets of pages 
// such as all Sweden/Concorde pages 
// paths are givemn relative to this_location/qs_path
var qs_background_img = 'img/qsbg.jpg'; 
var qs_background_color = '#f8f2f6';
var qs_logo_img = 'img/qslogo.jpg'; 
var qs_color_img = 'img/qspagecolor.jpg'; 

var qs_link_hover = '#ff8e05'; // orangy 
// blue scheme 
var qs_link_color = '#33689a';
var qs_page_color = '#33689a';
var qs_link_visited = qs_page_color; 

var qs_my_location = "UNDEFINED MY LOCATION"; 
var qs_my_menu     = "UNDEFINED"; 
var qs_my_sub_menu = "UNDEFINED SUB MENU"; 

// ---------------------------------------------------------------------
// Menu definition
// is the same for a whole set of pages such as Concorde/Sweden/...
// ---------------------------------------------------------------------
var qs_menu_target = new Array(); 

qs_menu_target[qs_location("Home", undefined)] 
	= "../index.html"; 
qs_menu_target[qs_location("Optimal Tours", undefined)] 
	= "../optimal/index.html"; 
qs_menu_target[qs_location("pla85900 Home", undefined)] 
	= "index.html"; 
qs_menu_target[qs_location("The Application", undefined)] 
	= "bell/bell.htm"; 
qs_menu_target[qs_location("The Application", "Bell Labs")] 
	= "bell/laser_bell.htm"; 
qs_menu_target[qs_location("The Application", "Optima")] 
	= "bell/optima.htm"; 
qs_menu_target[qs_location("The Application", "pla7397")] 
	= "bell/pla7points.htm"; 
qs_menu_target[qs_location("The Application", "pla33810")] 
	= "bell/pla3points.htm"; 
qs_menu_target[qs_location("The Application", "pla85900")] 
	= "bell/pla8points.htm"; 
qs_menu_target[qs_location("Pictures", undefined)] 
	= "tours/tours.htm";
qs_menu_target[qs_location("Pictures", "Zoom")]
        = "tours/zoom1/pla8map.htm";
qs_menu_target[qs_location("Pictures", "Solid")]
        = "tours/maze.htm";
qs_menu_target[qs_location("Pictures", "Large Solid")]
        = "tours/maze_big.htm";
qs_menu_target[qs_location("Pictures", "Small Line")]
        = "tours/pla8tour_small.htm";
qs_menu_target[qs_location("Pictures", "Medium Line")]
        = "tours/pla8tour_medium.htm";
qs_menu_target[qs_location("Pictures", "Large Line")]
        = "tours/pla8tour_large.htm";

qs_menu_target[qs_location("15-Year Race", undefined)] 
	= "heur/heur.htm";

qs_menu_target[qs_location("Solution", undefined)] 
	= "compute/compute.htm";
qs_menu_target[qs_location("Solution", "CPU Time")] 
	= "compute/cpu.htm";
qs_menu_target[qs_location("Solution", "Software")] 
	= "compute/software.htm";
qs_menu_target[qs_location("Solution", "Hardware")] 
	= "compute/hardware.htm";
qs_menu_target[qs_location("Solution", "B&C Trees")] 
	= "compute/tree.htm";
qs_menu_target[qs_location("Solution", "Tree 1")] 
	= "compute/pla8tree1.htm";
qs_menu_target[qs_location("Solution", "Tree 2")] 
	= "compute/pla8tree2.htm";
qs_menu_target[qs_location("Solution", "Tree 3")] 
	= "compute/pla8tree3.htm";
qs_menu_target[qs_location("Solution", "Tree 4")] 
	= "compute/pla8tree4.htm";
qs_menu_target[qs_location("Solution", "Tree 5")] 
	= "compute/pla8tree5.htm";
qs_menu_target[qs_location("Solution", "Tree 6")] 
	= "compute/pla8tree6.htm";
qs_menu_target[qs_location("Solution", "Tree 7")] 
	= "compute/pla8tree7.htm";
qs_menu_target[qs_location("Solution", "Tree 8")] 
	= "compute/pla8tree8.htm";
qs_menu_target[qs_location("Solution", "Tree 9")] 
	= "compute/pla8tree9.htm";
qs_menu_target[qs_location("Solution", "Tree 10")] 
	= "compute/pla8tree10.htm";
qs_menu_target[qs_location("Solution", "Tree 11")] 
	= "compute/pla8tree11.htm";
qs_menu_target[qs_location("Solution", "Tree 12")] 
	= "compute/pla8tree12.htm";
qs_menu_target[qs_location("Solution", "Tree 13")] 
	= "compute/pla8tree13.htm";
qs_menu_target[qs_location("Solution", "Tree 14")] 
	= "compute/pla8tree14.htm";
qs_menu_target[qs_location("Solution", "Tree 15")] 
	= "compute/pla8tree15.htm";
qs_menu_target[qs_location("Solution", "Tree 16")] 
	= "compute/pla8tree16.htm";
qs_menu_target[qs_location("Solution", "Tree 17")] 
	= "compute/pla8tree17.htm";
qs_menu_target[qs_location("Solution", "Tree 18")] 
	= "compute/pla8tree18.htm";
qs_menu_target[qs_location("Solution", "Tree 19")] 
	= "compute/pla8tree19.htm";
qs_menu_target[qs_location("Solution", "Tree 20")] 
	= "compute/pla8tree20.htm";
qs_menu_target[qs_location("Solution", "DP-Log 0")] 
	= "compute/DPlog.htm";

qs_menu_target[qs_location("Data Sets", undefined)] 
	= "data/data.htm";

// qs_menu_target[qs_location("Contact Info", undefined)] = "contact/contact.htm";


// PRIVATE (specific to page set)  
function qs_build_menu_table(menu_loc, sub_menu_loc) 
{
   wd(qs_table_start(0, undefined)); 

   if (qs_menu_bling_bling != undefined) { 
      qs_menu_insert_bling_bling(qs_menu_bling_bling); 
      qs_spacer_row(1, 4); 
      qs_menu_separator(qs_color_img)
   }

   qs_menu_item(menu_loc, sub_menu_loc, 'Home', undefined); 
   qs_menu_separator(qs_color_img)

   qs_menu_item(menu_loc, sub_menu_loc, 'Optimal Tours', undefined); 
   qs_menu_separator(qs_color_img)

   qs_menu_item(menu_loc, sub_menu_loc, 'pla85900 Home', undefined); 
   qs_menu_separator(qs_color_img)

   if (qs_menu_item(menu_loc, sub_menu_loc, 'The Application', undefined)) {
       qs_menu_item(menu_loc, sub_menu_loc, 'The Application', 'Bell Labs');
       qs_menu_item(menu_loc, sub_menu_loc, 'The Application', 'Optima');
       qs_menu_item(menu_loc, sub_menu_loc, 'The Application', 'pla7397');
       qs_menu_item(menu_loc, sub_menu_loc, 'The Application', 'pla33810');
       qs_menu_item(menu_loc, sub_menu_loc, 'The Application', 'pla85900');

   }
   qs_menu_separator(qs_color_img)

   if (qs_menu_item(menu_loc, sub_menu_loc, 'Pictures', undefined)) {
       qs_menu_item(menu_loc, sub_menu_loc, 'Pictures', 'Zoom');
       qs_menu_item(menu_loc, sub_menu_loc, 'Pictures', 'Solid');
       qs_menu_item(menu_loc, sub_menu_loc, 'Pictures', 'Large Solid');
       qs_menu_item(menu_loc, sub_menu_loc, 'Pictures', 'Small Line');
       qs_menu_item(menu_loc, sub_menu_loc, 'Pictures', 'Medium Line');
       qs_menu_item(menu_loc, sub_menu_loc, 'Pictures', 'Large Line');
   }
   qs_menu_separator(qs_color_img)

   qs_menu_item(menu_loc, sub_menu_loc, '15-Year Race', undefined); 
   qs_menu_separator(qs_color_img)

   if (qs_menu_item(menu_loc, sub_menu_loc, 'Solution', undefined)) {
       qs_menu_item(menu_loc, sub_menu_loc, 'Solution', 'CPU Time');
       qs_menu_item(menu_loc, sub_menu_loc, 'Solution', 'Software');
       qs_menu_item(menu_loc, sub_menu_loc, 'Solution', 'Hardware');
       qs_menu_item(menu_loc, sub_menu_loc, 'Solution', 'B&C Trees');
       qs_menu_item(menu_loc, sub_menu_loc, 'Solution', 'DP-Log 0');
   }
   qs_menu_separator(qs_color_img)

   qs_menu_item(menu_loc, sub_menu_loc, 'Data Sets', undefined); 
   qs_menu_separator(qs_color_img)

   //qs_menu_item(menu_loc, sub_menu_loc, 'Contact Info', undefined); 
   //qs_menu_separator(qs_color_img)
   wd(qs_table_finish()); 
}

// PRIVATE (specific to page set)  
function qs_menu_across() 
{
   cur_loc = qs_location(qs_my_menu, qs_my_sub_menu); 
   wd(qs_menu_ref(cur_loc, qs_location('Home', undefined), 
	       'Home')); 
   wd(qs_font_color() + ' | </font>'); 
   wd(qs_menu_ref(cur_loc, qs_location('pla85900 Home', undefined), 'pla85900 Home')); 

}

// PRIVATE (specific to page set)  
function qs_location(item_text, sub_item_text ) 
{
   loc = 'pla85900 Home';
   if (item_text != 'pla85900 Home')  {
      loc +=  ' > ' + item_text;
   }
   if (sub_item_text != undefined)  {
      loc += ' > ' + sub_item_text; 
   } 
   return loc; 
}

// PRIVATE (specific to page set)  
function qs_location_ref(item_text, sub_item_text) 
{
   loc = qs_location('pla85900 Home', undefined); 
   s = qs_menu_ref(qs_my_location, loc, 'pla85900 Home'); 

   if (item_text != 'pla85900 Home')  {
      loc = qs_location(item_text, undefined); 
      s += ' > ' + qs_menu_ref(qs_my_location, loc, item_text); 
   }
   if (sub_item_text != undefined) { 
      loc = qs_location(item_text, sub_item_text); 
      s += ' > ' + qs_menu_ref(qs_my_location, loc, sub_item_text);
   }
   return s; 
}

// ------------------------------------------------------------------------
// Sweden spcific 
function qs_doc_start(menu_loc, sub_menu_loc, dotitle, tit) {
   qs_menu_set_bling_html(
                '<center> ' + 
                '<img src=' + qs_path + '/img/pla8maze_grey.gif ' + 
                              'alt="Concorde Plane">' + 
                '</center>'); 
    qs_plain_doc_start(menu_loc, sub_menu_loc, dotitle, tit); 
}

wd(css_link());
var report_load;
if (report_load) alert("index.js loaded"); 
