var item = 0;
var myColumn = new Array();

function Column(title, datatype, keyList) {  
  this.title = title;
  this.datatype = datatype;
  this.key = keyList.split('\t');
}

function setColumn(title, datatype, keyList) {
  myColumn[item++] = new Column(title, datatype, keyList);
}

function setTitle(title_input) {
	title = title_input;
}

var isFont_Alchemy = /^font=Alchemy$/;
var isColor = /^color$/;
var isText = /^text$/;

function ColorBlock(backgroundColor) {
	var output_html = '<font style=background-color:'
		+ backgroundColor
		+ '>&nbsp;&nbsp;&nbsp;&nbsp;</font>';
	
	return (output_html);
}

function DisplayKey(Column_Index, KeyValue, Font_Size) {
	var output_html = '<font size="' + Font_Size + '">';
	
	if (isColor.test(myColumn[Column_Index].datatype)) output_html += ColorBlock(myColumn[Column_Index].key[KeyValue]);
	else if (isFont_Alchemy.test(myColumn[Column_Index].datatype)) output_html += '<font face=Alchemy>' + myColumn[Column_Index].key[KeyValue] + '</font>';
	else if (isText.test(myColumn[Column_Index].datatype)) output_html += myColumn[Column_Index].key[KeyValue];
	else output_html += myColumn[Column_Index].key[KeyValue];
	output_html += '</font>';

	return (output_html);
}
