function Sender(e)
{
  return window.event.srcElement;
}

function doEnter(e)
{
  e=Sender(e);
  e.style.color          ="#000000";
  e.parentElement.bgColor="#ffff00";
}

function doExit(e)
{
  e=Sender(e);
  e.style.color          ="#ffff00";
  e.parentElement.bgColor=e.parentColor;
}

function doBeginDrag(e)
{
  e=Sender(e);
  e.style.cursor="move";
}

function doEndDrag(e)
{
  e=Sender(e);
  e.style.cursor="default";
}

function makeAnyAsMenuText(e)
{
  e.className     ="TMenuText";
  e.style.color   ="#ffff00";
  e.style.fontSize="12px";
}

function makeLinkAsMenuOption(e)
{
  e.className           ="TMenuOption";
  e.style.color         ="#ffff00";
  e.style.textDecoration="none";
  e.style.fontWeight    ="bold";
  e.parentColor         =e.parentElement.bgColor;
  e.onmouseover         =doEnter;
  e.onmouseout          =doExit;
  e.ondragstart         =doBeginDrag;
  e.ondragend           =doEndDrag;
}

function makeTableAsMenu(oTable)
{
  oTable.className="TMenu";
  l=oTable.all.tags("a");
  for (i=0;i<l.length;i++)
    makeLinkAsMenuOption(l[i]);
  l=oTable.all.tags("td");
  for (i=0;i<l.length;i++)
    makeAnyAsMenuText(l[i]);
}

function makeTableRowAsGridRow(oRow)
{
  oRow.className="TGridRow";
  oRow.align    ="left";
  oRow.vAlign   ="top";
}

function makeTableColAsGridCol(oCol)
{
  oCol.className     ="TGridCol";
  oCol.align         ="left";
  oCol.vAlign        ="top";
  oCol.style.fontSize="12px";
}

function makeTableColAsGridHeader(oCol)
{
  oCol.className       ="TGridHeader";
  oCol.align           ="left";
  oCol.vAlign          ="top";
  oCol.style.fontSize  ="12px";
  oCol.style.fontWeight="bold";
}

function makeTableAsGrid(oTable)
{
  oTable.className  ="TGrid";
  oTable.border     ="1";
  oTable.cellSpacing="1"
  oTable.cellPadding="2"
  oTable.width      ="100%"
  l=oTable.all.tags("tr");
  for (i=0;i<l.length;i++)
    makeTableRowAsGridRow(l[i]);
  l=oTable.all.tags("th");
  for (i=0;i<l.length;i++)
    makeTableColAsGridHeader(l[i]);
  l=oTable.all.tags("td");
  for (i=0;i<l.length;i++)
    makeTableColAsGridCol(l[i]);
}

