// These scripts are done to reduce code volume in the page.

// This builds a table row for the page title in the transcription. 
function trTitle(theTitle,theSheet){
    document.write('<tr><th colspan="8">' +
                   '<h3>' + 
                   '<a name="sheet_' + theSheet + '">' + theTitle + '</a></h3></th>' +
                   '<th colspan="3">' +
                   '<h3>Sheet ' + theSheet + '</h3></th>' +
                   '<th colspan="36"></th></tr>');
} //trTitle

// This builds a table row of column headers in the transcription.
//
// IE and Firefox seem to be calculating cell padding differently.
// Width of the last header should be 1236 based on column widths. This works in IE.
// Actual header image width is 1254. This works in Firefox.
// Compromise of 1245 is tolerable in both.
//
function trHead(){
  if(arguments.length==0) {
    document.write('<tr><th><img alt="" border="0" width="39" height="180" src="' + reference_server + root + includes + 'BlankHeader.jpg"></th>' +
                   '<th colspan="4"><img alt="" border="0" width="132" height="180" src="' + reference_server + root + includes + '1831MissisquoiCountyHeader1.jpg"></th>' +
                   '<th><img alt="" border="0" width="118" height="140" src="' + reference_server + root + includes + 'BlankHeader.jpg"><br>Name of Heads of Families</th>' +
                   '<th colspan="2"><img alt="" border="0" width="66" height="180" src="' + reference_server + root + includes + '1831MissisquoiCountyHeader2.jpg"></th>' +
                   '<th><img alt="" border="0" width="100" height="140" src="' + reference_server + root + includes + 'BlankHeader.jpg"><br>Trade or Profession</th>' +
                   '<th colspan="38"><img alt="" border="0" width="1245" height="180" src="' + reference_server + root + includes + '1831MissisquoiCountyHeader3.jpg"></th></tr>');
    } else {
    document.write('<tr><th><img alt="" border="0" width="39" height="183" src="' + reference_server + root + includes + 'BlankHeader.jpg"></th>' +
                   '<th colspan="4"><img alt="" border="0" width="132" height="183" src="' + reference_server + root + includes + 'BlankHeader.jpg"></th>' +
                   '<th><img alt="" border="0" width="118" height="183" src="' + reference_server + root + includes + 'BlankHeader.jpg"></th>' +
                   '<th colspan="2"><img alt="" border="0" width="66" height="183" src="' + reference_server + root + includes + 'BlankHeader.jpg"></th>' +
                   '<th><img alt="" border="0" width="100" height="183" src="' + reference_server + root + includes + 'BlankHeader.jpg"></th>' +
                   '<th colspan="38"><img alt="" border="0" width="1245" height="183" src="' + reference_server + root + includes + 'BlankHeader.jpg"></th></tr>');
    }
    document.write('<tr><th width="39" height="2"></th>' +
                   '<th width="28"></th>' +
                   '<th width="28"></th>' +
                   '<th width="28"></th>' +
                   '<th width="33"></th>' +
                   '<th width="118"></th>' +
                   '<th width="31"></th>' +
                   '<th width="30"></th>' +
                   '<th width="100"></th>' +
                   '<th width="28"></th>' +
                   '<th width="28"></th>' +
                   '<th width="28"></th>' +
                   '<th width="28"></th>' +
                   '<th width="28"></th>' +
                   '<th width="27"></th>' +
                   '<th width="28"></th>' +
                   '<th width="27"></th>' +
                   '<th width="28"></th>' +
                   '<th width="27"></th>' +
                   '<th width="28"></th>' +
                   '<th width="27"></th>' +
                   '<th width="28"></th>' +
                   '<th width="27"></th>' +
                   '<th width="28"></th>' +
                   '<th width="27"></th>' +
                   '<th width="28"></th>' +
                   '<th width="27"></th>' +
                   '<th width="28"></th>' +
                   '<th width="27"></th>' +
                   '<th width="28"></th>' +
                   '<th width="27"></th>' +
                   '<th width="28"></th>' +
                   '<th width="27"></th>' +
                   '<th width="28"></th>' +
                   '<th width="27"></th>' +
                   '<th width="28"></th>' +
                   '<th width="27"></th>' +
                   '<th width="28"></th>' +
                   '<th width="27"></th>' +
                   '<th width="28"></th>' +
                   '<th width="28"></th>' +
                   '<th width="28"></th>' +
                   '<th width="28"></th>' +
                   '<th width="28"></th>' +
                   '<th width="28"></th>' +
                   '<th width="28"></th>' +
                   '<th width="28"></th></tr>');
} //trHead

// This builds a table row in the transcription. 
function trRow(theLine,theVal01,theVal02,theVal03,theVal04,theName,theVal05,theVal06,theOccupation,theVal07,theVal08,theVal09,theVal10,theVal11,theVal12,theVal13,theVal14,theVal15,theVal16,theVal17,theVal18,theVal19,theVal20,theVal21,theVal22,theVal23,theVal24,theVal25,theVal26,theVal27,theVal28,theVal29,theVal30,theVal31,theVal32,theVal33,theVal34,theVal35,theVal36,theVal37,theVal38,theVal39,theVal40,theVal41,theVal42,theVal43,theVal44){
    document.write('<tr>' +
                   '<td align="middle">' + theLine + '</td>' +
                   '<td align="middle">' + theVal01 + '</td>' +
                   '<td align="middle">' + theVal02 + '</td>' +
                   '<td align="middle">' + theVal03 + '</td>' +
                   '<td align="middle">' + theVal04 + '</td>' +
                   '<TD align=left>' + theName + '</td>' +
                   '<td align="middle">' + theVal05 + '</td>' +
                   '<td align="middle">' + theVal06 + '</td>' +
                   '<TD align=left>' + theOccupation + '</td>' +
                   '<td align="middle">' + theVal07 + '</td>' +
                   '<td align="middle">' + theVal08 + '</td>' +
                   '<td align="middle">' + theVal09 + '</td>' +
                   '<td align="middle">' + theVal10 + '</td>' +
                   '<td align="middle">' + theVal11 + '</td>' +
                   '<td align="middle">' + theVal12 + '</td>' +
                   '<td align="middle">' + theVal13 + '</td>' +
                   '<td align="middle">' + theVal14 + '</td>' +
                   '<td align="middle">' + theVal15 + '</td>' +
                   '<td align="middle">' + theVal16 + '</td>' +
                   '<td align="middle">' + theVal17 + '</td>' +
                   '<td align="middle">' + theVal18 + '</td>' +
                   '<td align="middle">' + theVal19 + '</td>' +
                   '<td align="middle">' + theVal10 + '</td>' +
                   '<td align="middle">' + theVal21 + '</td>' +
                   '<td align="middle">' + theVal22 + '</td>' +
                   '<td align="middle">' + theVal23 + '</td>' +
                   '<td align="middle">' + theVal24 + '</td>' +
                   '<td align="middle">' + theVal25 + '</td>' +
                   '<td align="middle">' + theVal26 + '</td>' +
                   '<td align="middle">' + theVal27 + '</td>' +
                   '<td align="middle">' + theVal28 + '</td>' +
                   '<td align="middle">' + theVal29 + '</td>' +
                   '<td align="middle">' + theVal30 + '</td>' +
                   '<td align="middle">' + theVal31 + '</td>' +
                   '<td align="middle">' + theVal32 + '</td>' +
                   '<td align="middle">' + theVal33 + '</td>' +
                   '<td align="middle">' + theVal34 + '</td>' +
                   '<td align="middle">' + theVal35 + '</td>' +
                   '<td align="middle">' + theVal36 + '</td>' +
                   '<td align="middle">' + theVal37 + '</td>' +
                   '<td align="middle">' + theVal38 + '</td>' +
                   '<td align="middle">' + theVal39 + '</td>' +
                   '<td align="middle">' + theVal40 + '</td>' +
                   '<td class="bg" align="middle">' + theVal41 + '</td>' +
                   '<td class="bg" align="middle">' + theVal42 + '</td>' +
                   '<td class="bg" align="middle">' + theVal43 + '</td>' +
                   '<td class="bg" align="middle">' + theVal44 + '</td>' +
                   '</tr>');
} //trRow

// This builds the last row on each page in the transcription.
function trNull(){
    document.write('<tr><td></td><td colspan="45"></td><td></td></tr>');
} //trNull

