// Copyright (c) Graham Voce 2001 - may not be used without permission.

function htmlGen(){
	//Methods
	this.addIMG = addIMG;
	this.addText = addText;
	this.setFont = setFont;
	this.setBkg = setBkg;
	this.setTitle = setTitle;
	this.genOutput = genOutput;
	this.startTable = startTable;
	this.finishTable = finishTable;
	this.addCell = addCell;
	this.setScript = setScript;
	this.addRaw = addRaw;
	
	//Attributes
	this.htmlOutput = "";
	this.Font = "";
	this.Colour = "";
	this.bkgIMG = "";
	this.title = "";
	this.script = "";
}

function addRaw(raw){
	this.htmlOutput += raw;
}

function genOutput(){
	this.htmlOutput = "<HEAD>\n<TITLE>" + this.title + "</TITLE><SCRIPT LANGUAGE=\"javascript\" SRC=\"" + this.script + "\"></SCRIPT></HEAD>\n<BODY BACKGROUND=\"" + this.bkgIMG + "\" >" + this.htmlOutput + "</BODY>\n";
//	alert(this.htmlOutput);
	return this.htmlOutput;
}

function addIMG(src, name, click){
	this.htmlOutput += "<IMG SRC=\"" + src + "\" NAME=\"" + name + "\" onclick=\"" + click + "\">\n";	
}

function startTable(){
	this.htmlOutput += "<TABLE COLS=2 WIDTH=\"100%\"><tr><td>";
}

function addCell(){
	this.htmlOutput += "</td><td>";
}

function finishTable(){
	this.htmlOutput += "</td></tr></TABLE>";
}

function setFont(font, colour){
	this.Font = font;
	this.Colour = colour;
}

function setBkg(bkg){
	this.bkgIMG = bkg;
}

function addText(text){
	this.htmlOutput += "<FONT face =\"" + this.Font + "\" color=\"" + this.Colour + "\">" + text + "</FONT>\n";
}

function setScript(src){
	this.script = src;
}

function setTitle(title){
	this.title = title;
}

//alert("Gen loaded");

