//
// Source
//
  var SrcInd = new Array(
    "id", "Name","Birth","Death","Spouce","Father","Mother",
    1,"Richard Bartholomew Bova","04/03/1924","07/26/1978",2,3,4,
    2,"Emily Anne O'Keefe","09/06/1929","05/14/1995",1,8,0,
    3,"Michael John Bova","06/05/1893","01/12/1974",4,0,0,
    4,"Josephine Brigit McNamara","01/21/1895","03/21/1984",3,0,0,
    5,"Mary Catherine McNamara","10/26/1897","12/22/1994",0,0,0,
    6,"John Bernard Killoren","01/24/1917","05/02/2002",7,0,0,
    7,"Mary Elizabeth O'Keefe","09/02/1923","02/23/1990",6,0,0,
    8,"Michael Joseph O'Keefe","00/00/0000","00/00/00",0,0,0
    );
  SrcIndCols = 7;
  if (SrcInd.length % SrcIndCols) {
    document.write(
      "Error in Source Index Array." +
      " SrcInd length = " + SrcInd.length +
      " SrcIndCols = " + SrcIndCols +
      " remainder = " + (SrcInd.length % SrcIndCols) +
      "<BR>");
    }

function SrcIndList(){
//
// Source Index
//
//  document.write("Doing source index<BR>");
//  document.write("test" + SrcIndCols + "  " + SrcInd[0]);
  document.write("<CENTER><TABLE BORDER=1 CELLSPACING=1 CELLPADDING=2>");
  document.write("<TR>");
  for (sc = 1; sc < SrcIndCols; sc++) {
    document.write("<TD><b>"+ SrcInd[sc] + "</B></TD>");
    }
  document.write("</TR>");
  for (s = SrcIndCols; s < SrcInd.length; s++) {
    document.write("<TR>");
    a = "0000" + SrcInd[s];
    b = "" + SrcInd[s];
    a = a.substring(b.length);
    document.write("<TD><A NAME='gs" + SrcInd[s] + "'> </A><a href='gs" + a + ".htm'>" + SrcInd[(s + 1)] + "</A></TD>");
    document.write("<td>" + SrcInd[(s + 2)] + "</td>");
    document.write("<td>" + SrcInd[(s + 3)] + "</TD>");
    document.write("<td>");
    if (eval(SrcInd[s+4])) {document.write("<a href='#gs" + SrcInd[s+4] + "'>" + SrcInd[SrcInd[s+4] * SrcIndCols + 1] + "</A>");}
    else {document.write("&nbsp;");}
    document.write("</td>");
    document.write("<td>");
    if (eval(SrcInd[s+5])) {document.write("<a href='#gs" + SrcInd[s+5] + "'>" + SrcInd[SrcInd[s+5] * SrcIndCols + 1] + "</A>");}
    else {document.write("&nbsp;");}
    document.write("</td>");
    document.write("<td>");
    if (eval(SrcInd[s+6])) {document.write("<a href='#gs" + SrcInd[s+6] + "'>" + SrcInd[SrcInd[s+6] * SrcIndCols + 1] + "</A>");}
    else {document.write("&nbsp;");}
    document.write("</td>");
    document.write("</TR>");
    s = s + SrcIndCols -1;
    }
  document.write("</TABLE></CENTER>");
//  document.write("end of Source Index");
  }

function SrcIntro(id){
//
// Source Intro
//
//  document.write("Doing source index<BR>");
//  document.write("test" + SrcIndCols + "  " + SrcInd[0]);
  document.write(
    "This page contains the source documents for " + SrcInd[id * SrcIndCols + 1] +
    " who was born on " + SrcInd[id * SrcIndCols + 2] +
    " and died on " + SrcInd[id * SrcIndCols + 3] +
    "."
    );
  }

function SrcDocList(id){
//
// Source Document List
//
  document.write(
    "<p>" +
    "I have the following source records for " + SrcInd[id * SrcIndCols + 1] +
    ". If you would like a copy, send me an <a href='mailto:bova-genealogy@cox.net?subject=Source Record Request'>email</A>. <BR>"
    );
  }

function SrcSSN(ssn){
//
// Source SSN
//
//  document.write("Doing source SSN<BR>");
//  document.write("test" + SrcIndCols + "  " + SrcInd[0]);
  document.write(
    "<form method=post action='http://ssdi.rootsweb.com/cgi-bin/ssdi.cgi' target='bfg_off'>" +
    "<input type=hidden name=stat value=''>" +
	  "<input type=hidden name=lastname value=''>" +
	  "<input type=hidden name=firstname value=''>" +
    "<input type=hidden name=middlename value=''>" +
    "<input type=hidden name=ssn value='" + ssn + "'>" +
    "<input type=submit name=submit value='Social Security Record'>" +
    "</form>"
    );
  }

function SrcEIManifest(drive,roll,page){
//
// Source Ellis Island Manifest
//
//  document.write("Doing source EI Page<BR>");
//  document.write("drive " + drive + " roll " + roll + "page " + page + "<BR>");
  document.write(
    "<a href='http://www.ellisislandrecords.org/cgi-bin/tif2gif.exe?T="+ drive + ":&#92" + roll + "&#92" + roll + page + ".TIF&S=.5' target='bfg_off'>Ellis Island Manifest</A>"
    );
  }


function SrcKinshipBoat(ship) {
//
// Source Kinship Boats
//
  var letter = ship.toLowerCase();
  letter = letter ? letter.slice(0,1) : 'a';
  if (letter == 'j' || letter == 'x') { // no such boats on kinship site
     letter = 'a';
     }
  var directory = letter;
  if (directory == 'x' || directory == 'y' || directory == 'z') {
     directory = 'xyz';
     }
  else if (directory == 'u' || directory == 'v') {
    directory = 'uv';
    }
//  document.location=
//  "http://www.kinshipsprints.com/catalog/ships/" + directory + "/" + letter + ".htm";
    document.write(
    "<a href='http://www.kinshipsprints.com/catalog/ships/" + directory + "/" + ship + ".htm'target='bfg_off'>Kinships Ship Picture</A>"
    );
  }

function SrcEIBoat(ship) {
//
// Source Ellis Island Boats
//
  var boat = ship;
  // if boat name contains any spaces, need to remove them and append 01 at end
  // don't ask me why -- that's apparently the image-naming convention that EI used
  var re = / /gi;
  if (re.test(boat)) {
    boat = boat.replace(re,"")+"01";
    }
//        document.location=
//          "http://www.ellisislandrecords.org/shipping/shipImages/"+boat+".jpg";
//  document.write("<html><body><center>");
//  // following lines escapes the input to prevent cross-site scripting, but then needs
//  // to unescape %20 back to spaces so that the boat name prints out properly
//  re2 = /%20/gi;
//  document.write(escape(form.SHP.value).replace(re2," ") + "<br>");
//  document.write("<img src=http://www.ellisislandrecords.org/shipping/shipImages/"+boat+".jpg>");
//  document.write("</center></body></html>");
//  document.close();
  document.write(
    "<a href='http://www.ellisislandrecords.org/shipping/shipImages/" + boat + ".jpg' target='bfg_off'>Ellis Island Ship Picture</A>"
    );

  }