<!-- Hide from older browsers
// memorials3.js  7/29/2010

// The default works well for IE
// Make this -200 to hide the menu off-screen
var gMenuTop = 81;
var gBookmarksString = 'Bookmarks: Ctrl + D<br>';

function PersonObject(
	IDNo, Rank, RankAbbr, Grade, 
	FName, MName, LName, Suffix,
	Unit, Svc, MOS, 
	LenSvc, City, St, 
	Panel, Line, BirDate, StartTour, CasDate, 
	Age, Location, 
	Remains, CasType, CasReason, CasDetail,
	PromotionNote, IncidentDate, 
	StatusDate, StatusChange, Repatriated, Identified,
	alpha_ndx, states_ndx, panel_ndx, unit_ndx,
	commonURLKeyList, NotUsed1, NotUsed2 )
{
  this.IDNo = IDNo;
  this.Rank = Rank;
  this.RankAbbr = RankAbbr;
  this.Grade = Grade;
  this.FName = FName;
  this.MName = MName;
  this.LName = LName;
  this.Suffix = Suffix;
  this.Unit = Unit;
  this.Svc = Svc;
  this.MOS = MOS;
  this.LenSvc = LenSvc;
  this.City = City;
  this.St = St;
  this.Panel = Panel;
  this.Line = Line;
  this.BirDate = BirDate;
  this.StartTour = StartTour;
  this.CasDate = CasDate;
  this.Age = Age;
  this.Location = Location;
  this.Remains = Remains;
  this.CasType = CasType;
  this.CasReason = CasReason;
  this.CasDetail = CasDetail;
  this.PromotionNote = PromotionNote;
  this.IncidentDate = IncidentDate; 
  this.StatusDate = StatusDate;
  this.StatusChange = StatusChange;
  this.Repatriated = Repatriated;
  this.Identified = Identified;
  this.alpha_ndx = alpha_ndx;
  this.states_ndx = states_ndx;
  this.panel_ndx = panel_ndx;
  this.unit_ndx = unit_ndx;
  this.commonURLKeyList = commonURLKeyList;
  this.NotUsed1 = NotUsed1;
  this.NotUsed2 = NotUsed2;

  this.MI = this.MName.slice(0,1);

  this.GetMIandSpace = GetMIandSpace;

  this.GetFullName = GetFullName;

  this.GetWallName = GetWallName;

  this.GetRankAndFullName = GetRankAndFullName;

  this.GetRankAndWallName = GetRankAndWallName;

  this.Posessive = Posessive;

  this.GetURL = GetURL;

  this.GetURLNoHttp = GetURLNoHttp;
}


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 GetURLNoHttp(){
    var URL0 = GetURL();
    // can't put 2 slashes together because that's a comment
    var URL1 = URL0.replace("http:/","");
    var URL2 = URL1.replace("/www","www");
    return URL2;
}


function GetFullName(){
  var name = this.FName + " ";
  if("" != this.MName)
  {
    name = name + this.MName + " ";
  }
  name = name + this.LName;
  if("" != this.Suffix)
  {
    name = name + " " + this.Suffix;
  }
  return name;
}

function GetWallName(){
  var name = this.FName + " " + this.GetMIandSpace() + this.LName;
  if(this.Suffix.length != 0)
  {
    name = name + " " + this.Suffix;
  }
  return name;
}

function GetRankAndFullName(){
  return (this.RankAbbr + " " + this.GetFullName());
}

function GetRankAndWallName(){
  return (this.RankAbbr + " " + this.GetWallName());
}

function Posessive(inName){
  var name = inName;
  if(name.length < 2){
    return name;
  }
  else if (name.charAt(name.length-1) =="s" ){
    return name + "\'";
  }
  else
    return name + "\'s";
}

function GetMIandSpace(){
  if(this.MName.length == 0)
  {
    return "";
  }
  return (this.MName.slice(0,1) + " ");
}


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 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 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 onLastJSLineMenu(){
}


function WriteJSMemorialMenus(){
 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:207px;" onmouseout="hideMenu(\'menu1\');" '+
  'onmouseover="showMenu(\'menu1\'); hideMenu(\'menu2\'); hideMenu(\'menu3\'); "> '+
  '<img src="../pics/Nav_MemFindA.gif" width="207" height="32" alt="" title="Find A Name"> ';
 document.writeln(someText);

 someText= '<br><div id=menu1 class=menu1style>'+
  '<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="../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: 206px;" onmouseout="hideMenu(\'menu2\');" '+
  'onmouseover="showMenu(\'menu2\'); hideMenu(\'menu1\'); hideMenu(\'menu3\'); "> '+
  '<img src="../pics/Nav_MemTVWA.gif" width="206" height="32" alt="" title="The Virtual Wall&reg;"> ';
 document.writeln(someText);

 someText= '<br><div id=menu2 class=menu1style>'+
  '<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>'+
   '&nbsp;<br>'+
 '</div></td>';
 document.writeln(someText);

// THIS MEMORIAL PAGE MENU
 someText= '<td style="vertical-align: top; width: 207px;" onmouseout="hideMenu(\'menu3\');" '+
 'onmouseover="showMenu(\'menu3\'); hideMenu(\'menu1\'); hideMenu(\'menu2\'); "> '+
 '<img src="../pics/Nav_MemThisA.gif" width="207" height="32" alt="" title="This Memorial Page"> ';
 document.writeln(someText);

 someText= '<br><div class=menu1style id=menu3>'+
  gBookmarksString +
  '<a href="#" onclick="return tellOthers();">&nbsp;Tell Others About This Page</a><br>'+
  '<a href="#" onclick="return doNameRubbing();">&nbsp;Digital Name Rubbing</a><br>'+
  '<a href="#" onclick="return addARemembrance();">&nbsp;Add A Remembrance</a><br>'+
  '<a href="#" onclick="return addAPhoto();">&nbsp;Add A Photograph</a><br>'+
  '<a href="#" onclick="return updateEmailAddress();">&nbsp;Update Your Email Address</a><br>'+
  '<a href="#" onclick="return showCommonGround();">&nbsp;Common Ground</a><br>'+
  '<a href="#" onclick="return showProfilePage();">&nbsp;Full Profile</a><br>'+
  '<a href="#" onclick="return showPrivacyPolicy();">&nbsp;Privacy Policy</a><br>'+
  '<a href="../medals.htm">&nbsp;About Medals<a><br>'+
   '&nbsp;<br>'+
   '&nbsp;<br>'+
  '</div></td>' +
  '</tr></tbody></table>';
 document.writeln(someText);
}


// Below merged from memorialsactions.js  on 02/06/2009

function addThisPageToFavorites(){
 var exactBrowserName = getExactBrowserName();
 var bookmarksPerson = window.Person;
 if(exactBrowserName == "Netscape")
 {
    var message="To quickly return to this memorial page for " + bookmarksPerson.GetRankAndFullName() + ",\n";
      message += "you can put the address of his memorial 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 memorial page for " + bookmarksPerson.GetRankAndFullName();
      message += ", you can put the address of his memorial 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 file: URLs\n" +  bookmarksPerson.FName + 
          " " + bookmarksPerson.MI + bookmarksPerson.LName ;
    window.alert(warning);    
   }
   else
   {
     var title= bookmarksPerson.GetRankAndFullName() + " on The Virtual Wall(TM)";
     javascript:window.external.AddFavorite(thisURL,title);
   }
 }
 else
 {
    var message="We are sorry, this function is not supported on your\n" + exactBrowserName + " browser.";
    window.alert(message);
 }
 return false;
}


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

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

function updateEmailAddress(){
  open("../js/updateemail.htm","updateemail","toolbar=no,resizable=yes,scrollbars=no,width=620,height=512,screenX=10,screenY=10");
 return false;
}

function addAPhoto(){
  open("../js/addphotograph2.htm","addphotograph","toolbar=no,resizable=yes,scrollbars=yes,width=700,height=600,screenX=10,screenY=10");
//  open("../sendpics.htm","addphotograph","toolbar=yes,resizable=yes,scrollbars=yes,width=700,height=600,screenX=10,screenY=10");
 return false;
}


function addARemembrance(){
  open("../js/addremembrance.htm","addrem","toolbar=no,resizable=yes,scrollbars=yes,width=650,height=600,screenX=10,screenY=10");
 return false;
}


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

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

function doSearch(){
  open("../js/searchfromperson.htm","searchfromperson","toolbar=no,resizable=yes,scrollbars=no,width=600,height=240,screenX=10,screenY=10");
 return false;
}

function onLoadMemPage(){
  hideMenu('menu1');
  hideMenu('menu2');
  hideMenu('menu3');
  //var message="The page has been loaded " + Person.LName;
  //window.alert(message);
}

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

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

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

function showCommonGround(){
  //open("../js/commonground.htm","commonground","toolbar=no,resizable=yes,scrollbars=yes,width=720,height=620,screenX=10,screenY=10");
  open("../js/commonground.htm","commonground","toolbar=no,resizable=yes,scrollbars=yes");
 return false;
}

function doForwarding(inID){
  window.anonymousID = inID;
  open("../js/forwarding.htm","forwarding","toolbar=no,resizable=yes,scrollbars=yes,width=660,height=700,screenX=10,screenY=10");
 return false;
}

function onLastJSLine(){
  onLastJSLineMenu();
}

// End hiding -->

