//
//  Starts the table
// param: h - height
// param: w - width
// param: bgcolor - background color
// param: bgimg - background image
// param: border - border size
// param: cspace - cellspacing
// param: cpad - cellpadding
// param: vspace - extra vertical spacing around table
// param: hspace - extra vertical spacing around table
//
function startTable(inpercent, h, w, bgcolor, bgimg, border, cspace, cpad, vspace, hspace)
{
  document.write("<table ")
  if (h > 0)
  {
    document.write("height=\"", h)
    if (inpercent)
      document.write("%")

    document.write("\" ")
  }

  if (w > 0)
  {
    document.write("width=\"", w)
    if (inpercent)
      document.write("%")

    document.write("\" ")
  }

  if (bgcolor.length > 0)
    document.write("bgcolor=\"", bgcolor, "\" ")

  if (bgimg.length > 0)
    document.write("background=\"", bgimg, "\" ")

  if (vspace > 0)
    document.write("vspace=\"", vspace, "\" ")

  if (hspace > 0)
    document.write("hspace=\"", hspace, "\" ")

  document.write("border=\"", border, "\" cellspacing=\"", cspace, "\" cellpadding=\"", cpad, "\" >")
}

//
// starts a table row
//
function startRow()
{
  document.write("<TR>")
}

//
// ends a table row
//
function endRow()
{
  document.writeln("</TR>")
}

//
// starts a table column
// param: h - height
// param: w - width
// param: bgcolor - background color of column
// param: bgimg - background image of column
// param: valign - vertical alignment - "TOP", "CENTER", "BOTTOM"
// param: align - horizontal aligment - "LEFT", "CENTER", "RIGHT"
// param: colspan - number of columns to span
// param: rowspan - number of rows to span
function startCol(h, w, bgcolor, bgimg, valign, align, colspan, rowspan)
{
  document.write("<TD ")

  if (h > 0)
   document.write("HEIGHT=\"", h, "\" ")

  if (w > 0)
    document.write("WIDTH=\"", w, "\" ")

  if (bgcolor.length > 0)
    document.write("BGCOLOR=\"", bgcolor, "\" ")

  if (bgimg.length > 0)
    document.write("BACKGROUND=\"", bgimg, "\" ")

  if (valign.length > 0)
    document.write("VALIGN=\"", valign, "\" ")

  if (align.length > 0)
    document.write("ALIGN=\"", align, "\" ")

  if (colspan > 0)
    document.write("COLSPAN=\"", colspan, "\" ")
 
  if (rowspan > 0)
    document.write("ROWSPAN=\"", rowspan, "\" ")

  document.write(">")  
}

function endCol()
{
  document.writeln("</TD>")
}


function endTable()
{
  document.write("</TABLE>")
}
