// =======================================================================
// 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_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 = '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 + '/img/' + qs_background_img;
   qs_logo_img = qs_path + '/img/' + qs_logo_img;
   qs_color_img = qs_path + '/img/' + qs_color_img;
   qs_trans_img = qs_path + '/img/' + 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/...
// is specific to each set of pages 
// ---------------------------------------------------------------------
var qs_menu_target = new Array(); 


// 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')); 
}

// PRIVATE (specific to page set)  
function qs_location(item_text, sub_item_text ) 
{
   loc = 'Home';
   if (item_text != '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('Home', undefined); 
   s = qs_menu_ref(qs_my_location, loc, 'Home'); 

   if (item_text != '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; 
}

// =======================================================================
// =======================================================================
// =======================================================================
// 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_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>' ); 
   wd('<tr>' + 
      '<td><img src=' + qs_trans_img + ' height=' + h + 'px ' + 
			 'width=' + w + 'px>'); 
} 
// 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 THSI PAGE SET  
// =======================================================================
// 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 = 'qsbg.jpg'; 
var qs_background_color = '#f8f2f6';
var qs_logo_img = 'qslogo.jpg'; 
var qs_color_img = 'qspagecolor.jpg'; 

var qs_link_hover = '#ff8e05'; // orangy 
var qs_link_color = '#29809e';
var qs_page_color = '#29809e';
var qs_link_visited = qs_link_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("Applications", undefined)] 
	= "index.html"; 
qs_menu_target[qs_location("Applications", "Genome")] 
	= "genome.html"; 
qs_menu_target[qs_location("Applications", "Starlight")] 
	= "starlight.html"; 
qs_menu_target[qs_location("Applications", "Scan Chains")] 
	= "scan.html"; 
qs_menu_target[qs_location("Applications", "DNA")] 
	= "dna.html"; 
qs_menu_target[qs_location("Applications", "Whizzkids")] 
	= "whizzkids.html"; 
qs_menu_target[qs_location("Applications", "Baseball")] 
	= "ballparks.html"; 
qs_menu_target[qs_location("Applications", "Coin Collection")] 
	= "coins.html"; 
qs_menu_target[qs_location("Applications", "Airport Tours")] 
	= "airports.html"; 
qs_menu_target[qs_location("Applications", "USA Trip")] 
	= "usatrip.html"; 
qs_menu_target[qs_location("Applications", "Sonet Rings")] 
	= "sonet.html"; 
qs_menu_target[qs_location("Applications", "Power Cables")] 
	= "cables.html"; 

// 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)

   if (qs_menu_item(menu_loc, sub_menu_loc, 'Applications', undefined)) 
   {
      qs_menu_item(menu_loc, sub_menu_loc, 'Applications', "Genome"); 
      qs_menu_item(menu_loc, sub_menu_loc, "Applications", "Starlight"); 
      qs_menu_item(menu_loc, sub_menu_loc, "Applications", "Scan Chains"); 
      qs_menu_item(menu_loc, sub_menu_loc, "Applications", "DNA"); 
      qs_menu_item(menu_loc, sub_menu_loc, "Applications", "Whizzkids"); 
      qs_menu_item(menu_loc, sub_menu_loc, "Applications", "Baseball"); 
      qs_menu_item(menu_loc, sub_menu_loc, "Applications", "Coin Collection"); 
      qs_menu_item(menu_loc, sub_menu_loc, "Applications", "Airport Tours"); 
      qs_menu_item(menu_loc, sub_menu_loc, "Applications", "USA Trip"); 
      qs_menu_item(menu_loc, sub_menu_loc, "Applications", "Sonet Rings"); 
      qs_menu_item(menu_loc, sub_menu_loc, "Applications", "Power Cables"); 
   } 
   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('Applications', undefined), 
                  'Applications')); 

}

// PRIVATE (specific to page set)  
function qs_location(item_text, sub_item_text ) 
{
   loc = 'Applications';
   if (item_text != 'Applications')  {
      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('Applications', undefined); 
   s = qs_menu_ref(qs_my_location, loc, 'Applications'); 

   if (item_text != 'Applications')  {
      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; 
}


wd(css_link());
if (report_load) alert("index.js loaded"); 

var report_load;
if (report_load) alert("index.js load started"); 

