 //Written by Chris J. Davis
 
 //this is the constructor which defines all variables that we will be using for this object
 function makePrettyTable()
 {
 //variables we will be using for the object makeTable()
 this.borderWidth = "0";
 this.innerDivider = "1";
 this.borderColor = "#000000";
 this.tableWidth = "100%";
 this.tableAlign = "center";
 this.innerPadding = "3";
 this.cellClass = null; 
 this.cellAlign = null;
 this.cellValign = "top";
 this.cellColspan = null;
 this.cellWidth = null;
 
 //declarations of get/set functions that will be used for object makeTable()
 this.setBorderColor = setBorderColor;
 this.getBorderColor = getBorderColor;
 this.setBorderWidth = setBorderWidth;
 this.getBorderWidth = getBorderWidth;
 this.setInnerDivider = setInnerDivider;
 this.getInnerDivider = getInnerDivider;
 this.setTableWidth = setTableWidth;
 this.getTableWidth = getTableWidth;
 this.setTableAlign = setTableAlign;
 this.getTableAlign = getTableAlign;
 this.setInnerPadding = setInnerPadding;
 this.getInnerPadding = getInnerPadding;
 this.setCellClass = setCellClass;
 this.getCellClass = getCellClass;
 this.setCellAlign = setCellAlign;
 this.getCellAlign = getCellAlign;
 this.setCellValign = setCellValign;
 this.getCellValign = getCellValign;
 this.setCellColspan = setCellColspan;
 this.getCellColspan = getCellColspan;
 this.setCellWidth = setCellWidth;
 this.getCellWidth = getCellWidth;
 
 //declarations of actual doing code functions that will be used for object makeTable()
 this.startTable = startTable;
 this.endTable = endTable;
 this.startRow = startRow;
 this.endRow = endRow;
 this.makeCell = makeCell;
 this.alternateClasses = alternateClasses;
 this.resetCellValues = resetCellValues;
 this.setNullCellValues = setNullCellValues;
 }
//this is the end of the constructor function 

//-------------------------TABLE ATTRIBUTES GOES HERE-----------------------------------------
//-------------------------TABLE ATTRIBUTES GOES HERE-----------------------------------------
//-------------------------TABLE ATTRIBUTES GOES HERE-----------------------------------------




//Written by Chris J. Davis

/* list of function calls
setBorderColor("EEEEEEE");
getBorderColor();
setBorderWidth("1");
getBorderWidth();
setInnerDivider("1");
getInnerDivider();
setTableWidth("20%");
getTableWidth();
setTableAlign("center");
getTableAlign();
setInnerPadding("3");
getInnerPadding();
setCellClass("classname");
getCellClass();
setCellAlign("center");
getCellAlign();
setCellValign("top");
getCellValign();
setCellColspan("1");
getCellColspan();
setCellWidth("20%");
getCellWidth();
*/

//this is the beginning of the setting/getting attributes functions
function setBorderColor(newcolor)
{
this.borderColor = newcolor;
}
	
function getBorderColor()
{
return (this.borderColor);
} 
 
function setBorderWidth(newvalue)
{
this.borderWidth = newvalue;
}
	
function getBorderWidth()
{
return (this.borderWidth);
}
 
function setInnerDivider(newvalue)
{
this.innerDivider = newvalue;
}
	
function getInnerDivider()
{
return (this.innerDivider);
}

function setTableWidth(newvalue)
{
this.tableWidth = newvalue;
}
	
function getTableWidth()
{
return (this.tableWidth);
}

function setTableAlign(newvalue)
{
this.tableAlign = newvalue;
}
	
function getTableAlign()
{
return (this.tableAlign);
}

function setInnerPadding(newvalue)
{
this.innerPadding = newvalue;
}
	
function getInnerPadding()
{
return (this.innerPadding);
}
	
function setCellClass(newvalue)
{
this.cellClass = newvalue;
}
	
function getCellClass()
{
return (this.cellClass);
}	

function setCellAlign(newvalue)
{
this.cellAlign = newvalue;
}
	
function getCellAlign()
{
return (this.cellAlign);
}	

function setCellValign(newvalue)
{
this.cellValign = newvalue;
}
	
function getCellValign()
{
return (this.cellValign);
}	

function setCellColspan(newvalue)
{
this.cellColspan = newvalue;
}
	
function getCellColspan()
{
return (this.cellColspan);
}	

function setCellWidth(newvalue)
{
this.cellWidth = newvalue;
}
	
function getCellWidth()
{
return (this.cellWidth);
}	
//this is the end of the setting/getting attributes functions



//-------------------------TABLE ATTRIBUTES GOES HERE-----------------------------------------
//-------------------------TABLE ATTRIBUTES GOES HERE-----------------------------------------
//-------------------------TABLE ATTRIBUTES GOES HERE-----------------------------------------


//-------------------------TABLE FUNCTIONS GOES HERE------------------------------------------
//-------------------------TABLE FUNCTIONS GOES HERE------------------------------------------
//-------------------------TABLE FUNCTIONS GOES HERE------------------------------------------

//written by Chris J. Davis
//this is the beginning of the table functions

/* list of function calls
startTable();
endTable();
startRow();
endRow();
makeCell();
resetCellValues();
setNulltCellValues();
alternateClasses("tablecontent1" , "tablecontent2");
*/

function startTable()
{
var attr1 = "";
var attr2 = "";
var attr3 = "";
var attr4 = "";
var attr5 = "";
var attr6 = "";

if (this.tableWidth != null)
	attr1 = ' width="' + this.tableWidth + '"';
if (this.tableAlign != null)
	attr2 = ' align="' + this.tableAlign + '"';
if (this.borderColor != null)
	attr3 = ' bgcolor="' + this.borderColor + '"';
if (this.borderWidth != null)
	attr4 = ' cellpadding="' + this.borderWidth + '"';
if (this.innerPadding != null)
	attr5 = ' cellpadding="' + this.innerPadding + '"';
if (this.innerDivider != null)
	attr6 = ' cellspacing="' + this.innerDivider + '"';
	
var start ='<table border="0"' + attr1 + attr2 + attr3 + attr4 + 'cellspacing="0">\n';
	'\t<tr>\n';
		start +='\t\t<td width="100%" valign="top">\n'; 
		start +='<table  width="100%" border="0"' + attr5 + attr6 + '>\n';
	document.write(start);
}
	
function endTable()
{
var end ='</table>\n';
		end += '\t\t</td>\n';
	end += '\t</tr>\n';
end += '</table>\n';
document.write(end);
}	

function startRow()
{
var start = '\t<tr>';
document.write(start);
}

function endRow()
{
var end = '\t</tr>';
document.write(end);
}

function makeCell(cellvalue)
{
var attr1 = "";
var attr2 = "";
var attr3 = "";
var attr4 = "";
var attr5 = "";

if (this.cellClass != null)
	attr1 = ' class="' + this.cellClass + '"';
if (this.cellAlign != null)
	attr2 = ' align="' + this.cellAlign + '"';
if (this.cellValign != null)
	attr3 = ' valign="' + this.cellValign + '"';
if (this.cellColspan != null)
	attr4 = ' colspan="' + this.cellColspan + '"';
if (this.cellWidth != null)
	attr5 = ' width="' + this.cellWidth + '"';

var newcell = '\t\t<td' + attr1 + attr2 + attr3 + attr4 + attr5 + '>';
newcell += cellvalue;
newcell += '</td>\n';	
document.write(newcell);
}

function alternateClasses(class1 , class2)
{
var newclass = this.getCellClass();
if (newclass == class1)
	this.setCellClass(class2)
else
	this.setCellClass(class1)
}

function resetCellValues()
{
this.cellClass = "tablecontent1"; 
this.cellAlign = null;
this.cellValign = "top";
this.cellColspan = null;
this.cellWidth = null;
}

function setNullCellValues()
{
this.cellClass = null; 
this.cellAlign = null;
this.cellValign = null;
this.cellColspan = null;
this.cellWidth = null;
}	

//this is the end of beginning of the table functions


//-------------------------TABLE FUNCTIONS GOES HERE------------------------------------------
//-------------------------TABLE FUNCTIONS GOES HERE------------------------------------------
//-------------------------TABLE FUNCTIONS GOES HERE------------------------------------------




//calls to other .js files associate with this object  
//document.write('<scri' + 'pt src="table_attributes.js" language="javascript" type="text/javascript"></script>');
//document.write('<scri' + 'pt src="table_functions.js" language="javascript" type="text/javascript"></script>');


