/*
   Copyright (c) 2001 Moonstone Interactive, Inc.
      All Rights Reserved. No portion of this file, including but
      not limited to any associated code, documents or images, may be
      copied, retransmitted, reposted, duplicated or otherwise
      used without the express written permission of Moonstone Interactive, Inc.

*/

//requires misc_constants.js?   
 
function build_navbar()
{
 // This is for the preload function
 image_name_array = new Array("images/gb_nav_home_on.gif",
         "images/gb_nav_attorneys_on.gif",
         "images/gb_nav_staff_on.gif",
         "images/gb_nav_profile_on.gif",
         "images/gb_nav_contact_on.gif");
 
         
 // Start building the navbar tags here.       
 
 // Set the default images for the navbar tabs
 // We may change the navbar image for the current page in
 // switch statement below.
  tab01_image = "images/gb_nav_home.gif";  
  tab02_image = "images/gb_nav_attorneys.gif"; 
  tab03_image = "images/gb_nav_staff.gif";    
  tab04_image = "images/gb_nav_profile.gif";        
  tab05_image = "images/gb_nav_contact.gif";

 nav_spacer_tag = '';
 leader_tag = '<img src="images/gb_nav_leader.gif" alt="" border="0" width="174" height="22">';
 trailer_tag = '<img src="images/gb_nav_trailer.gif" alt="" border="0" width="100" height="22">';
 
 if (document.images)
 {
  // Image swaps are supported add the image swap code
  tab01_anchor = "<A HREF=\"index.html\" onmouseover=\"document.images['tab01'].src='images/gb_nav_home_on.gif';\" onmouseout=\"document.images['tab01'].src='images/gb_nav_home.gif';\">";
  tab02_anchor = "<A HREF=\"attorneys.html\" onmouseover=\"document.images['tab02'].src='images/gb_nav_attorneys_on.gif';\" onmouseout=\"document.images['tab02'].src='images/gb_nav_attorneys.gif';\">";
  tab03_anchor = "<A HREF=\"staff.html\" onmouseover=\"document.images['tab03'].src='images/gb_nav_staff_on.gif';\" onmouseout=\"document.images['tab03'].src='images/gb_nav_staff.gif';\">";
  tab04_anchor = "<A HREF=\"profile.html\" onmouseover=\"document.images['tab04'].src='images/gb_nav_profile_on.gif';\" onmouseout=\"document.images['tab04'].src='images/gb_nav_profile.gif';\">";
  tab05_anchor = "<A HREF=\"contact.html\" onmouseover=\"document.images['tab05'].src='images/gb_nav_contact_on.gif';\" onmouseout=\"document.images['tab05'].src='images/gb_nav_contact.gif';\">";
 }
 else
 {  
  // If image swaps aren't supported don't add swap code  
  tab01_anchor = "<A HREF=\"index.html\">";
  tab02_anchor = "<A HREF=\"attorneys.html\">";  
  tab03_anchor = "<A HREF=\"staff.html\">";
  tab04_anchor = "<A HREF=\"profile.html\">";
  tab05_anchor = "<A HREF=\"contact.html\">";
 }
 
  
 // Set the page specific parameters as needed  
 // SR: I commented out the code that prevents user from going back to section main pages
 switch (current_tab)
 {
  case 0:
   break;
   
  case 1:
   tab01_image = "images/gb_nav_home_on.gif";
   tab01_anchor = "<A>";
   break;
   
  case 2:
   tab02_image = "images/gb_nav_attorneys_on.gif";
   tab02_anchor = "<A HREF=\"attorneys.html\">";
   break;
   
  case 3:
   tab03_image = "images/gb_nav_staff_on.gif";
   tab03_anchor = "<A>";
   break;
   
  case 4:
   tab04_image = "images/gb_nav_profile_on.gif";
   tab04_anchor = "<A>";
   break;
   
  case 5:
   tab05_image = "images/gb_nav_contact_on.gif";
   tab05_anchor = "<A>";
   break;   
 }
 
 
 // Build the HTML tags for the tabs
 
 tab01_tag = tab01_anchor + "<IMG SRC=\"" + tab01_image + "\" WIDTH=\"46\" HEIGHT=\"22\" NAME=\"tab01\" ALT=\"\" BORDER=\"0\"></A>";
 tab02_tag = tab02_anchor + "<IMG SRC=\"" + tab02_image + "\" WIDTH=\"130\" HEIGHT=\"22\" NAME=\"tab02\" ALT=\"\" BORDER=\"0\"></A>";
 tab03_tag = tab03_anchor + "<IMG SRC=\"" + tab03_image + "\" WIDTH=\"95\" HEIGHT=\"22\" NAME=\"tab03\" ALT=\"\" BORDER=\"0\"></A>";
 tab04_tag = tab04_anchor + "<IMG SRC=\"" + tab04_image + "\" WIDTH=\"85\" HEIGHT=\"22\" NAME=\"tab04\" ALT=\"\" BORDER=\"0\"></A>";
 tab05_tag = tab05_anchor + "<IMG SRC=\"" + tab05_image + "\" WIDTH=\"90\" HEIGHT=\"22\" NAME=\"tab05\" ALT=\"\" BORDER=\"0\"></A>";
  
   
 all_tabs = leader_tag + nav_spacer_tag + tab01_tag + nav_spacer_tag + tab02_tag + nav_spacer_tag + tab03_tag + nav_spacer_tag + tab04_tag + nav_spacer_tag + tab05_tag + nav_spacer_tag + trailer_tag;
 
}


function preload_navbar()
{
 if (document.images)
 { 
  for (count = 0; count < image_name_array.length; count ++)
  {
  var next_image = new Image();
  next_image.src = image_name_array[count];
  }
 }
}