<!-- Hide from older browsers
// indexesLevel1.js  3/13/2010

// The default works well for IE
var gMenuTop = 81;
var gBookmarksString = 'Bookmarks: Ctrl + D<br>';


function onMouseOverTopBanner(){
  document.b1.src ="./pics/TopBanner1B.gif";
}

function onMouseOutTopBanner(){
  document.b1.src ="./pics/TopBanner1A.gif";
}

function onMouseOverBottomBanner(){
  document.b2.src ="./pics/TopBanner1B.gif";
}

function onMouseOutBottomBanner(){
  document.b2.src ="./pics/TopBanner1A.gif";
}

function hideMenu(inMenu){ 
  var menuStyle=document.getElementById(inMenu).style; 
  menuStyle.display="none"; 
}


function addThisPageToFavorites(){
 var exactBrowserName = getExactBrowserName();
 if(exactBrowserName == "Netscape")
 {
    var message = "You can put the address of this page into the Bookmarks menu in your browser.\n\n";
      message += "To do that, after you dismiss this alert by pressing the OK button below,\n";
      message += "hold down the CTRL key and then press D";
    window.alert(message);
 }
 else if((exactBrowserName == "Opera")||(exactBrowserName == "Safari")||(exactBrowserName == "Chrome")||(exactBrowserName == "Firefox"))
 { // don't use any \n's
    var message="To quickly return to this index page ";
      message += ", you can put the address of this page into the Bookmarks menu in your browser.";
      message += " To do that, after you dismiss this alert by pressing the OK button below,";
      message += " hold down the CTRL key and then press D";
    window.alert(message);
 }
else if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4))
 {
   var thisURL = window.location;
   // window.alert(thisURL);    

   // TODO This code does not work
   var foundAt = -1;
   //foundAt = thisURL.indexOf("file:");
   //window.alert("foundAt =" + foundAt );    

   if (foundAt >= 0)
   {
    // According to Microsoft web site and verified by tests, window.external.AddFavorite
    // will FAIL if the html file is on the local machine e.g. "file://..."
    var warning= 'This Internet Explorer function does not work for this file';
    window.alert(warning);    
   }
   else
   {
     javascript:window.external.AddFavorite(thisURL, document.title);
   }
 }
 else
 {
    var message="We are sorry, this function is not supported on your\n" + exactBrowserName + " browser.";
    window.alert(message);
 }
 return false;
}


function GetURL(){
  var poundIndex = -1;
  if(window){
    var URL0 = window.location + "";
    var URL1 = URL0.replace("virtualwall","VirtualWall");
    poundIndex = URL1.indexOf("#");
    if (poundIndex > 1){
      URL0 = URL1.slice(0, poundIndex);
      URL1 = URL0;
    }
    return URL1;
  }
  else{
    return "";
  }
}



function getExactBrowserName(){
  var exactName="";
  var agent = navigator.userAgent;
  var browsers = new Array("Firefox","Chrome","Netscape","Opera","Safari", "AOL ");

  if(navigator.appName == "Microsoft Internet Explorer")
  {
    exactName="Internet Explorer";
    return exactName;
  }
  else
  {
    var i = 0;
    for (i = 0; i < browsers.length; i++)
    {
      if (-1 != agent.indexOf(browsers[i]))
      {
        exactName=browsers[i];
        return exactName;
      }
    }
  }
  // if all the tests above failed, the returned string is empty
  return exactName;
}



function setGlobalVariables(){
  var exactBrowser = getExactBrowserName();
  var bookmarkMenuText = 'Add to Bookmarks: Ctrl + D';

  // do the default for IE
  gMenuTop=81;

  if(exactBrowser == "Firefox"){
    gMenuTop=72;
  }
  else if(exactBrowser == "Safari"){
    gMenuTop=72;
  }
  else if(exactBrowser == "Chrome"){
    gMenuTop=72;
  }
  else if(exactBrowser == "Opera"){
    gMenuTop=72;
  }
  else if(exactBrowser == "Netscape"){
    gMenuTop=72;
  }
  else if(exactBrowser == "Internet Explorer"){
    gMenuTop=81;
    bookmarkMenuText = 'Add to Favorites: Ctrl + D';
  }
  else{
    // AOL
    gMenuTop=81;
  }
  gBookmarksString = '<a href="#" onclick="return addThisPageToFavorites();">&nbsp;' + bookmarkMenuText + '</a><br>';
  //  '<a href="#" onclick="return addThisPageToFavorites();">&nbsp;Find This Page Quickly</a><br>'+
}


function showMenu(inMenu) {
  var menuStyle=document.getElementById(inMenu).style; 
  menuStyle.top=gMenuTop;
  menuStyle.display="block";
}


function onLoadPageIndexL1(){
  hideMenu('indexL1Menu1');
  hideMenu('indexL1Menu2');
}

function onUnloadPageIndexL1(){
  //var message="The page has been UN loaded";
  //window.alert(message);
}


function showOutOfService(){
  window.open("./docs/outofservice.htm","outofservice",
      "toolbar=no,resizable=yes,scrollbars=no,width=440,height=180,screenX=10,screenY=10");
}

function showPrivacyPolicy(){
  window.open("./js/privacy.htm","privacy",
      "toolbar=no,resizable=yes,scrollbars=yes,width=550,height=580,screenX=10,screenY=10");
  return false;
}


function tellOthers(){
  open("./js/tellothersindex.htm","tellOthers","toolbar=no,resizable=yes,scrollbars=yes,width=700,height=640,screenX=10,screenY=10");
 return false;
}


function WriteJSIndexL1Menus(){
  setGlobalVariables();
 //TOP BANNER
 var someText='<a href="./index.html"><img border="0" src="./pics/TopBanner1A.gif" name="b1" width="620"'+
  ' height="32" alt="" title="To the home page of The Virtual Wall (TM)&reg;"'+
  ' onmouseout="onMouseOutTopBanner();" onmouseover="onMouseOverTopBanner();"></a><br>';
 document.writeln(someText);

 // FIND A NAME MENU
 someText= '<table width=620 border=0 cellpadding=0 cellspacing=0><tbody><tr>'+
  '<td style="vertical-align:top; width:310px;" onmouseout="hideMenu(\'indexL1Menu1\');" '+
  'onmouseover="showMenu(\'indexL1Menu1\'); hideMenu(\'indexL1Menu2\');"> '+
  '<img src="./pics/Nav_IndexFindA.gif" width="310" height="32" alt="" title="Find A Name"> ';
 document.writeln(someText);

 someText= '<br><div id=indexL1Menu1 class=indexL2menu1Style>'+
  '<a href="./iAlpha.htm">&nbsp;By Last Name</a><br>'+
  '<a href="./iPanels.htm">&nbsp;Wall Panels By Date</a><br>'+
  '<a href="./iStates.htm">&nbsp;By State and City</a><br>'+
  '<a href="./valor.htm">&nbsp;Height of Valor (medals)</a><br>'+
  '<a href="./faces/index.html">&nbsp;Faces Of Freedom (photos)</a><br>'+
  '<a href="./iunits.htm">&nbsp;By Military Unit</a><br>'+
  '<a href="./pmsea.htm">&nbsp;POW/MIA Status</a><br>'+
  '<a href="./units.htm">&nbsp;Groups and Battles</a><br>'+
  '<a href="./sendpics.htm">&nbsp;Add a Photograph</a><br>'+
  '<a href="./namenotfound.htm">&nbsp;Name Not Found</a><br>'+
  '&nbsp;<br>'+
  '</div></td>';
 document.writeln(someText);

// The Virtual Wall Menu
 someText= '<td style="vertical-align: top; width: 310px;" onmouseout="hideMenu(\'indexL1Menu2\');" '+
  'onmouseover="showMenu(\'indexL1Menu2\'); hideMenu(\'indexL1Menu1\'); "> '+
  '<img src="./pics/Nav_IndexTVWA.gif" width="310" height="32" alt="" title="The Virtual Wall&reg;"> ';
 document.writeln(someText);

 someText= '<br><div id=indexL1Menu2 class=indexL2menu1Style>'+
  gBookmarksString +
  '<a href="#" onclick="return tellOthers();">&nbsp;Tell Others About This Page</a><br>'+
  '<a href="./index.html">&nbsp;Home: The Virtual Wall&reg;</a><br>'+
  '<a href="./aboutWal.htm">&nbsp;About The Wall in Washington</a><br>'+
  '<a href="./about.htm">&nbsp;About The Virtual Wall&reg;</a><br>'+
  '<a href="./docs/faqs.htm">&nbsp;Frequently Asked Questions</a><br>'+
  '<a href="./docs/nps.htm">&nbsp;The National Park Service</a><br>'+
  '<a href="./whoweare/index.htm">&nbsp;Who We Are</a><br>'+
  '<a href="./docs/trademark.htm">&nbsp;Our Registered Trademarks&reg;</a><br>'+
  '<a href="./docs/copyright.htm">&nbsp;Copyright and Attribution</a><br>'+
  '<a href="./docs/vwdbase.htm">&nbsp;Coffelt Database</a><br>'+
  '<a href="./linksvw.htm">&nbsp;Related Links</a><br>'+
  '<a href="./map.htm">&nbsp;Web Site Map: More</a><br>'+
  '<a href="./contactus.htm">&nbsp;Contact Us</a><br>'+
  '<a href="#" onclick="return showPrivacyPolicy();">&nbsp;Privacy Policy</a><br>'+
  '<a href="./medals.htm">&nbsp;About Medals<a><br>'+
  '&nbsp;<br>'+
  '</div></td>' +
  '</tr></tbody></table>';
 document.writeln(someText);

}
// End hiding -->

