<!-- BorderTable.js  -->

function WriteCopywriteNotice()
{
 document.write('<CENTER>');
 document.write('<p>All materials (c) Jim Kitson 2004');
 document.write('<br>');

 emailE='cotakisni.com';
 emailE=('jimk' + '@' + emailE);
 document.write('<A href="mailto:' + emailE + '">' + emailE + '</a>');

 document.write('</center>');
}

function GetFullTableWidth()
{
var iTableWidth = browseWidth=document.body.clientWidth - 50;
if ( iTableWidth < 100 )
{
  iTableWidth = 100;
}
return iTableWidth;
}

function GetFullTableHeight()
{
var iTableHeight = 0;
if (typeof  window.innerHeight != 'undefined' )
{
  iTableHeight = window.innerHeight - 60;
}
else if (typeof  document.documentElement.offsetHeight != 'undefined' )
{
  iTableHeight = document.documentElement.offsetHeight - 60;
}

if ( iTableHeight < 100 )
{
  iTableHeight = 100;
}
return iTableHeight;

}

function WriteTBorderTableAuto(csText)
{
  WriteTBorderTable(csText, GetFullTableWidth());
}

function WriteTBorderTableWithTitleAuto(csText, csTitle)
{
  WriteTBorderTableWithTitle(csText, csTitle, GetFullTableWidth());
}

function WriteTBorderTableWithTitleWithFrameAndSourceAuto(csSource, csTitle, csFrameName, iFrameHeight)
{
  WriteTBorderTableWithTitleWithFrameAndSource(csSource, csTitle, csFrameName, GetFullTableWidth(), iFrameHeight);
}

function WriteTBorderTableWithFrameAndSourceAuto(csSource, csFrameName, iFrameHeight)
{
  WriteTBorderTableWithFrameAndSource(csSource, csFrameName, GetFullTableWidth(), iFrameHeight);
}

function WriteTBorderTableWithFrameAuto(csText, csFrameName, iFrameHeight, csRelativePath)
{
  WriteTBorderTableWithFrame(csText, csFrameName, GetFullTableWidth(), iFrameHeight, csRelativePath);
}

function WriteTBorderTableWithTitleWithFrameAuto(csText, csTitle, csFrameName, iFrameHeight, csRelativePath)
{
  WriteTBorderTableWithTitleWithFrame(csText, csTitle, csFrameName, GetFullTableWidth(), iFrameHeight, csRelativePath);
}


function WriteTBorderTable(csText, iTableWidth)
{
var csTableWidthTopAndBottom = "";
var csTableWidthCenter = "";


csTableWidthTopAndBottom = iTableWidth - 20;
csTableWidthCenter = iTableWidth - 10;

document.write("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>");
document.write(" <TR>");
document.write(" <TD>");
document.write(" <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>");
document.write("  <TR>");
document.write("   <TD WIDTH=10 HEIGHT=9 CLASS='TopLeft'>");
document.write("   </TD>");
document.write("   <TD  Width=" + csTableWidthTopAndBottom + " CLASS='TopCenter'> ");
document.write("   </TD>");
document.write("   <TD WIDTH=10 HEIGHT=9 CLASS='TopRight'>");
document.write("   </TD>");
document.write("  </TR>");
document.write(" </TABLE>");
document.write(" </TD>");
document.write(" </TR>");
document.write(" <TR>");
document.write(" <TD>");

document.write(" <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>");
document.write("  <TR>");
document.write("   <TD WIDTH=5 HEIGHT=9 CLASS='CenterLeft'>");
document.write("   </TD>");
document.write("   <TD   Width=" + csTableWidthCenter  + " CLASS='CenterCenter' > ");
document.write(csText);
document.write("   </TD>");
document.write("   <TD WIDTH=5 HEIGHT=9 CLASS='CenterRight'>");
document.write("   </TD>");
document.write("  </TR>");
document.write(" </TABLE>");
document.write(" </TD>");
document.write(" </TR>");
document.write(" <TR>");
document.write(" <TD>");
document.write(" <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>");
document.write("  <TR>");
document.write("   <TD WIDTH=10 HEIGHT=10 CLASS='BottomLeft'>");
document.write("   </TD>");
document.write("   <TD   Width=" + csTableWidthTopAndBottom  + "  CLASS='BottomCenter'> ");
document.write("   </TD>");
document.write("   <TD WIDTH=10 HEIGHT=10 CLASS='BottomRight'>");
document.write("   </TD>");
document.write("  </TR>");
document.write(" </TABLE>");

document.write(" </TD>");
document.write(" </TR>");

document.write("</TABLE>");
}


function WriteTBorderTableWithTitle(csText, csTitle, iTableWidth)
{
var csTableWidthTopAndBottom = "";
var csTableWidthCenter = "";
var csTableWidthTitle = "";

csTableWidthTopAndBottom = iTableWidth - 20;
csTableWidthCenter = iTableWidth - 10;
csTableWidthTitle = iTableWidth - 100 - 19 - 10;
var csTitleText = "<CENTER><B><FONT SIZE=3>" + csTitle + "</FONT></B></CENTER>";

document.write("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>");

document.write(" <TR>");
document.write(" <TD>");
document.write(" <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>");
document.write("  <TR>");
document.write("   <TD WIDTH=100 HEIGHT=8 ");
document.write("   </TD>");
document.write("   <TD WIDTH=19 HEIGHT=8 CLASS='TitleTopLeft'>");
document.write("   </TD>");
document.write("   <TD  Width=" + csTableWidthTitle + " CLASS='TitleTopCenter'> ");
document.write("   </TD>");
document.write("   <TD WIDTH=10 HEIGHT=8 CLASS='TitleTopRight'>");
document.write("   </TD>");
document.write("  </TR>");
document.write(" </TABLE>");
document.write(" </TD>");
document.write(" </TR>");


document.write(" <TR>");
document.write(" <TD>");
document.write(" <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>");
document.write("  <TR>");
document.write("   <TD WIDTH=100 HEIGHT=8 ");
document.write("   </TD>");
document.write("   <TD WIDTH=19 HEIGHT=19 CLASS='TitleCenterLeft'>");
document.write("   </TD>");
document.write("   <TD  Width=" + csTableWidthTitle + " CLASS='CenterCenter'> ");
document.write(csTitleText);
document.write("   </TD>");
document.write("   <TD WIDTH=10 HEIGHT=19 CLASS='TitleCenterRight'>");
document.write("   </TD>");
document.write("  </TR>");
document.write(" </TABLE>");
document.write(" </TD>");
document.write(" </TR>");




document.write(" <TR>");
document.write(" <TD>");
document.write(" <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>");
document.write("  <TR>");
document.write("   <TD WIDTH=10 HEIGHT=9 CLASS='TopLeft'>");
document.write("   </TD>");
document.write("   <TD  Width=" + csTableWidthTopAndBottom + " CLASS='TopCenter'> ");
document.write("   </TD>");
document.write("   <TD WIDTH=10 HEIGHT=9 CLASS='TitleBottomRight'>");
document.write("   </TD>");
document.write("  </TR>");
document.write(" </TABLE>");
document.write(" </TD>");
document.write(" </TR>");
document.write(" <TR>");
document.write(" <TD>");

document.write(" <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>");
document.write("  <TR>");
document.write("   <TD WIDTH=5 HEIGHT=9 CLASS='CenterLeft'>");
document.write("   </TD>");
document.write("   <TD   Width=" + csTableWidthCenter  + " CLASS='CenterCenter' > ");
document.write(csText);
document.write("   </TD>");
document.write("   <TD WIDTH=5 HEIGHT=9 CLASS='CenterRight'>");
document.write("   </TD>");
document.write("  </TR>");
document.write(" </TABLE>");
document.write(" </TD>");
document.write(" </TR>");
document.write(" <TR>");
document.write(" <TD>");
document.write(" <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>");
document.write("  <TR>");
document.write("   <TD WIDTH=10 HEIGHT=10 CLASS='BottomLeft'>");
document.write("   </TD>");
document.write("   <TD   Width=" + csTableWidthTopAndBottom  + "  CLASS='BottomCenter'> ");
document.write("   </TD>");
document.write("   <TD WIDTH=10 HEIGHT=10 CLASS='BottomRight'>");
document.write("   </TD>");
document.write("  </TR>");
document.write(" </TABLE>");

document.write(" </TD>");
document.write(" </TR>");

document.write("</TABLE>");
}

function WriteTBorderTableWithTitleWithFrameAndSource(csSource, csTitle, csFrameName, iTableWidth, iFrameHeight)
{
var csTableWidthCenter = "";

csTableWidthCenter = iTableWidth - 20;
var csCompleteFrameText = "<CENTER><IFRAME NAME='" + csFrameName + "' SRC='" + csSource + "' Width=" + csTableWidthCenter +" Height=" + iFrameHeight + " FRAMEBORDER=0> </IFRAME></CENTER>";
WriteTBorderTableWithTitle(csCompleteFrameText, csTitle, iTableWidth);
}

function WriteTBorderTableWithFrameAndSource(csSource, csFrameName, iTableWidth, iFrameHeight)
{
var csTableWidthCenter = "";

csTableWidthCenter = iTableWidth - 20;
var csCompleteFrameText = "<CENTER><IFRAME NAME='" + csFrameName + "' SRC='" + csSource + "' Width=" + csTableWidthCenter +" Height=" + iFrameHeight + " FRAMEBORDER=0> </IFRAME></CENTER>";
WriteTBorderTable(csCompleteFrameText, iTableWidth);
}


function WriteTBorderTableWithFrame(csText, csFrameName, iTableWidth, iFrameHeight, csRelativePath)
{
var csTableWidthCenter = "";

csTableWidthCenter = iTableWidth - 20;
var csIFrameText = '<link rel="stylesheet" href="' + csRelativePath + 'tree.css"><link rel="stylesheet" href="' + csRelativePath + 'Table/table.css"><BODY CLASS="CenterCenter">' + csText + '</BODY>';
var csCompleteFrameText = "<CENTER><IFRAME NAME='" + csFrameName + "' SRC='Blank.htm' Width=" + csTableWidthCenter +" Height=" + iFrameHeight + " FRAMEBORDER=0> </IFRAME></CENTER>";

WriteTBorderTable(csCompleteFrameText, iTableWidth);

document.write("<SCRIPT>");
document.write("self." + csFrameName + ".document.open();");
document.write("self." + csFrameName + ".document.write('" + csIFrameText + "');");
document.write("self." + csFrameName + ".document.close();");
document.write("</SCRIPT>");
}


function WriteTBorderTableWithTitleWithFrame(csText, csTitle, csFrameName, iTableWidth, iFrameHeight, csRelativePath)
{
var csTableWidthCenter = "";

csTableWidthCenter = iTableWidth - 20;
var csIFrameText = '<link rel="stylesheet" href="' + csRelativePath + 'tree.css"><link rel="stylesheet" href="' + csRelativePath + 'Table/table.css"><BODY CLASS="CenterCenter">' + csText + '</BODY>';
var csCompleteFrameText = "<CENTER><IFRAME NAME='" + csFrameName + "' SRC='Blank.htm' Width=" + csTableWidthCenter +" Height=" + iFrameHeight + " FRAMEBORDER=0> </IFRAME></CENTER>";

WriteTBorderTableWithTitle(csCompleteFrameText, csTitle, iTableWidth);

document.write("<SCRIPT>");
document.write("self." + csFrameName + ".document.open();");
document.write("self." + csFrameName + ".document.write('" + csIFrameText + "');");
document.write("self." + csFrameName + ".document.close();");
document.write("</SCRIPT>");
}


