// var thisPage = ""; home, products, customers, partners, about, contact
// must be defined in the HTML

function goToPage(pageName) {
  var pageUrl = "http://www.visualcalc.com";
  switch (pageName) {
    case "home":
      pageUrl = "/";
      break;
    case "products":
      pageUrl = "products.htm";
      break;
    case "customers":
      pageUrl = "customers.htm";
      break;
    case "partners":
      pageUrl = "partners.htm";
      break;
    case "about":
      pageUrl = "about.htm";
      break;
    case "contact":
      pageUrl = "contact.htm";
      break;
    default:
      break;
  }
  skipReferrer(); // referrer.js skip referrer because document.location clears
  document.location = pageUrl;
} // end function goToPage(pageName)

// begin preload images -------
var imgLoadSrcArr = new Array();
imgLoadSrcArr[0] = "images/menu_bg_gray.gif";
imgLoadSrcArr[1] = "images/menu_select.gif";
imgLoadSrcArr[2] = "images/blank.gif";
var imgLoadSrcArrLength = imgLoadSrcArr.length;
for (var iIdx=0;iIdx<imgLoadSrcArrLength;iIdx++) {
  var tmpImg = new Image;
  tmpImg.src = imgLoadSrcArr[iIdx];
}
// end preload images -------


var menu_bg_gray_src = "images/menu_bg_gray.gif";
var menu_select_src = "images/menu_select.gif";
var blank_src = "images/blank.gif";

function outTopMenu(linkName) {
  window.status = ""; // clear status at bottom of page
  switch (linkName) {
    case "home":
      document.home_select.src = blank_src;
      break;
    case "products":
      document.products_select.src = blank_src;
      break;
    case "customers":
      document.customers_select.src = blank_src;
      break;
    case "partners":
      document.partners_select.src = blank_src;
      break;
    case "about":
      document.about_select.src = blank_src;
      break;
    case "contact":
      document.contact_select.src = blank_src;
      break;
    default:
      break;
  } // end switch (linkName)

  if (thisPage != linkName) {
    document.getElementById(linkName+"_menu_text").style.color = "686868";
    document.getElementById(linkName+"_menu_text").style.fontWeight = "normal";
  }
  // make sgt reddy & bg color default back
  switch (thisPage) {
    case "home":
      document.home_select.src = menu_select_src;
      break;
    case "products":
      document.products_select.src = menu_select_src;
      break;
    case "customers":
      document.customers_select.src = menu_select_src;
      break;
    case "partners":
      document.partners_select.src = menu_select_src;
      break;
    case "about":
      document.about_select.src = menu_select_src;
      break;
    case "contact":
      document.contact_select.src = menu_select_src;
      break;
    default:
      break;
  }

  //  --- end making the red slider appear on new ---
} // end function outTopMenu(linkName)

function hoverTopMenu(linkName, statusText) {
  // linkName = which link: home, products, customers, partners, about, contact

  window.status = statusText;

  // clear the default slider image
  switch (thisPage) {
    case "home":
      document.home_select.src = blank_src;
      break;
    case "products":
      document.products_select.src = blank_src;
      break;
    case "customers":
      document.customers_select.src = blank_src;
      break;
    case "partners":
      document.partners_select.src = blank_src;
      break;
    case "about":
      document.about_select.src = blank_src;
      break;
    case "contact":
      document.contact_select.src = blank_src;
      break;
    default:
      break;
  }

  if (thisPage != linkName) {
    document.getElementById(linkName+"_menu_text").style.color = "3357CD";
    document.getElementById(linkName+"_menu_text").style.fontWeight = "bold";
  }
  //  --- begin making the red slider appear on new ---
  switch (linkName) {
    case "home":
      document.home_select.src = menu_select_src;
      break;
    case "products":
      document.products_select.src = menu_select_src;
      break;
    case "customers":
      document.customers_select.src = menu_select_src;
      break;
    case "partners":
      document.partners_select.src = menu_select_src;
      break;
    case "about":
      document.about_select.src = menu_select_src;
      break;
    case "contact":
      document.contact_select.src = menu_select_src;
      break;
    default:
      break;
  } // end switch (linkName)
  //  --- end making the red slider appear on new ---

} // end function hoverTopMenu(status, linkName)








var home_sgt_src = blank_src;
var products_sgt_src = blank_src;
var customers_sgt_src = blank_src;
var partners_sgt_src = blank_src;
var about_sgt_src = blank_src;
var contact_sgt_src = blank_src;
switch (thisPage) {
  case "home":
    home_sgt_src = menu_select_src;
    break;
  case "products":
    products_sgt_src = menu_select_src;
    break;
  case "customers":
    customers_sgt_src = menu_select_src;
    break;
  case "partners":
    partners_sgt_src = menu_select_src;
    break;
  case "about":
    about_sgt_src = menu_select_src;
    break;
  case "contact":
    contact_sgt_src = menu_select_src;
    break;
  default:
    break;
}
document.write("        <Table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td height=8 width=100% bgcolor=c0c0c0><\/td><\/tr><\/table>");
document.write("        <!-- begin menu button header -->");
document.write("        <table border=0 cellspacing=0 cellpadding=0 width=100%>");
document.write("          <tr>");
document.write("            <Td width=175 valign=top>");
document.write("            <\/td>");
document.write("            <Td class=\"td_link\" onmouseover=\"hoverTopMenu('home', 'Home');\" onmouseout=\"outTopMenu('home');\" onClick=\"goToPage('home');\" valign=top>");
document.write("              <!-- begin home button -->");
document.write("              <table border=0 cellspacing=0 cellpadding=0>");
document.write("                <Tr><Td height=10><\/td><\/tr>");
document.write("                <tr>");
document.write("                  <td align=center width=80>");
if (thisPage == "home") {
  document.write("                    <font style=\"color: #3357CD; font-weight: bold; text-decoration: none; font-size: 11px; font-family: verdana;\" id='home_menu_text'>Home <\/font>");
} else {
  document.write("                    <font style=\"color: #686868; text-decoration: none; font-size: 11px; font-family: verdana;\" id='home_menu_text'>Home <\/font>");
}
document.write("                  <\/td>");
document.write("                <\/tr>");
document.write("                <Tr><Td height=4><\/td><\/tr>");
document.write("              <\/table>");
document.write("              <Table border=0 cellspacing=0 cellpadding=0 width=100%><Tr><td background=\""+menu_bg_gray_src+"\" align=center height=13 id=\"home_bgbar\" width=100%><img src=\""+home_sgt_src+"\" name=\"home_select\"><\/td><\/tr><\/table>");
document.write("              <!-- end home button -->");
document.write("            <\/td>");
document.write("            <Td class=\"td_link\" onmouseover=\"hoverTopMenu('products', 'Products');\" onmouseout=\"outTopMenu('products');\" onClick=\"goToPage('products');\" valign=top>");
document.write("              <!-- begin products button -->");
document.write("              <table border=0 cellspacing=0 cellpadding=0>");
document.write("                <Tr><Td height=10><\/td><\/tr>");
document.write("                <tr>");
document.write("                  <td align=center width=94>");
if (thisPage == "products") {
  document.write("                    <font style=\"color: #3357CD; font-weight: bold; text-decoration: none; font-size: 11px; font-family: verdana;\" id='products_menu_text'>Products <\/font>");
} else {
  document.write("                    <font style=\"color: #686868; text-decoration: none; font-size: 11px; font-family: verdana;\" id='products_menu_text'>Products <\/font>");
}
document.write("                  <\/td>");
document.write("                <\/tr>");
document.write("                <Tr><Td height=4><\/td><\/tr>");
document.write("              <\/table>");
document.write("              <Table border=0 cellspacing=0 cellpadding=0 width=100%><Tr><td background=\""+menu_bg_gray_src+"\" align=center height=13 id=\"products_bgbar\" width=100%><img src=\""+products_sgt_src+"\" name=\"products_select\"><\/td><\/tr><\/table>");
document.write("              <!-- end products button -->");
document.write("            <\/td>");
document.write("            <Td class=\"td_link\" onmouseover=\"hoverTopMenu('customers', 'Customers');\" onmouseout=\"outTopMenu('customers');\" onClick=\"goToPage('customers');\" valign=top>");
document.write("              <!-- begin customers button -->");
document.write("              <table border=0 cellspacing=0 cellpadding=0>");
document.write("                <Tr><Td height=10><\/td><\/tr>");
document.write("                <tr>");
document.write("                  <td align=center width=107>");
if (thisPage == "customers") {
  document.write("                    <font style=\"color: #3357CD; font-weight: bold; text-decoration: none; font-size: 11px; font-family: verdana;\" id='customers_menu_text'>Customers <\/font>");
} else {
  document.write("                    <font style=\"color: #686868; text-decoration: none; font-size: 11px; font-family: verdana;\" id='customers_menu_text'>Customers <\/font>");
}
document.write("                  <\/td>");
document.write("                <\/tr>");
document.write("                <Tr><Td height=4><\/td><\/tr>");
document.write("              <\/table>");
document.write("              <Table border=0 cellspacing=0 cellpadding=0 width=100%><Tr><td background=\""+menu_bg_gray_src+"\" align=center height=13 id=\"customers_bgbar\" width=100%><img src=\""+customers_sgt_src+"\" name=\"customers_select\"><\/td><\/tr><\/table>");
document.write("              <!-- end customers button -->");
document.write("            <\/td>");
document.write("            <Td class=\"td_link\" onmouseover=\"hoverTopMenu('partners', 'Partners');\" onmouseout=\"outTopMenu('partners');\" onClick=\"goToPage('partners');\" valign=top>");
document.write("              <!-- begin partners button -->");
document.write("              <table border=0 cellspacing=0 cellpadding=0>");
document.write("                <Tr><Td height=10><\/td><\/tr>");
document.write("                <tr>");
document.write("                  <td align=center width=93>");
if (thisPage == "partners") {
  document.write("                    <font style=\"color: #3357CD; font-weight: bold; text-decoration: none; font-size: 11px; font-family: verdana;\" id='partners_menu_text'>Partners <\/font>");
} else {
  document.write("                    <font style=\"color: #686868; text-decoration: none; font-size: 11px; font-family: verdana;\" id='partners_menu_text'>Partners <\/font>");
}
document.write("                  <\/td>");
document.write("                <\/tr>");
document.write("                <Tr><Td height=4><\/td><\/tr>");
document.write("              <\/table>");
document.write("              <Table border=0 cellspacing=0 cellpadding=0 width=100%><Tr><td background=\""+menu_bg_gray_src+"\" align=center height=13 id=\"partners_bgbar\" width=100%><img src=\""+partners_sgt_src+"\" name=\"partners_select\"><\/td><\/tr><\/table>");
document.write("              <!-- end partners button -->");
document.write("            <\/td>");
document.write("            <Td class=\"td_link\" onmouseover=\"hoverTopMenu('about', 'About Us');\" onmouseout=\"outTopMenu('about');\" onClick=\"goToPage('about');\" valign=top>");
document.write("              <!-- begin about button -->");
document.write("              <table border=0 cellspacing=0 cellpadding=0>");
document.write("                <Tr><Td height=10><\/td><\/tr>");
document.write("                <tr>");
document.write("                  <td align=center width=96>");
if (thisPage == "about") {
  document.write("                    <font style=\"color: #3357CD; font-weight: bold; text-decoration: none; font-size: 11px; font-family: verdana;\" id='about_menu_text'>About Us <\/font>");
} else {
  document.write("                    <font style=\"color: #686868; text-decoration: none; font-size: 11px; font-family: verdana;\" id='about_menu_text'>About Us <\/font>");
}
document.write("                  <\/td>");
document.write("                <\/tr>");
document.write("                <Tr><Td height=4><\/td><\/tr>");
document.write("              <\/table>");
document.write("              <Table border=0 cellspacing=0 cellpadding=0 width=100%><Tr><td background=\""+menu_bg_gray_src+"\" align=center height=13 id=\"about_bgbar\" width=100%><img src=\""+about_sgt_src+"\" name=\"about_select\"><\/td><\/tr><\/table>");
document.write("              <!-- end about button -->");
document.write("            <\/td>");
document.write("            <Td class=\"td_link\" onmouseover=\"hoverTopMenu('contact', 'Contact Info');\" onmouseout=\"outTopMenu('contact');\" onClick=\"goToPage('contact');\" valign=top>");
document.write("              <!-- begin contact button -->");
document.write("              <table border=0 cellspacing=0 cellpadding=0>");
document.write("                <Tr><Td height=10><\/td><\/tr>");
document.write("                <tr>");
document.write("                  <td align=center width=115>");
if (thisPage == "contact") {
  document.write("                    <font style=\"color: #3357CD; font-weight: bold; text-decoration: none; font-size: 11px; font-family: verdana;\" id='contact_menu_text'>Contact Info <\/font>");
} else {
  document.write("                    <font style=\"color: #686868; text-decoration: none; font-size: 11px; font-family: verdana;\" id='contact_menu_text'>Contact Info <\/font>");
}
document.write("                  <\/td>");
document.write("                <\/tr>");
document.write("                <Tr><Td height=4><\/td><\/tr>");
document.write("              <\/table>");
document.write("              <Table border=0 cellspacing=0 cellpadding=0 width=100%><Tr><td background=\""+menu_bg_gray_src+"\" align=center height=13 id=\"contact_bgbar\" width=100%><img src=\""+contact_sgt_src+"\" name=\"contact_select\"><\/td><\/tr><\/table>");
document.write("              <!-- end contact button -->");
document.write("            <\/td>");
document.write("          <\/tr>");
document.write("        <\/table>");
document.write("        <table border=0 cellspacing=0 cellpadding=0><tr><td height=3><\/td><\/tr><\/table>");
document.write("        <!-- end menu button header -->");
