function addStyleSheets(name, style)
{
	if (!document.styleSheets.length) document.createStyleSheet();
	document.styleSheets[document.styleSheets.length - 1].addRule(name,style);
}

addStyleSheets('.STtab',   'font-family:arial;font-size:10;');

function dataArray(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) 
{
	this.col1 = a; this.col2 = b; this.col3 = c; this.col4 = d; this.col5 = e; this.col6 = f; 
	this.col7 = g; this.col8 = h; this.col9 = i; this.col10 = j; this.col11 = k; this.col12 = l; 
	this.col13 = m; this.col14 = n; this.col15 = o; this.col16 = p; this.col17 = q; this.col18 = r; 
	this.col19 = s; this.col20 = t; this.col21 = u; this.col22 = v; this.col23 = w; this.col24 = x; 
	this.col25 = y; this.col26 = z;
}

var ignoreRowsQty = 0;

function createTable(tableName, tableHolderName, startIndex)
{
	thn = document.getElementById(tableHolderName);

	str = '<br><table width="' + tableWidth + '" class="STtab" border=0 id="' + 
			tableName + '" style="background:' + tableBgColor + 
			';"><tr>';

	for (a = 0; a < tableHeadings.length; a++)
	{
		if (a == 0)
		{
			if (rowNumbersEnabled) str += '<td type="header"></td>';
  		}
		else
   			str += '<td type="header"><b>' + tableHeadings[a] + '</b>&nbsp;</td>';
 	}

	str += '</tr></table>';
	thn.innerHTML = str;
	tmp = document.getElementsByTagName('TR');
//	for (a = 0; a < tmp.length; a++) if(tmp[a].parentElement.parentElement.id == tableName) ignoreRowsQty += 1;
	makeTable(tableName, startIndex)
}

function makeTable(tableName, startIndex)
{
	tb = document.getElementById(tableName);
	ft = document.getElementById('findText');
	fr = document.getElementById('findResult');

	for (a = 0; a < tableData.length; a++)
	{
  		tb.insertRow(); 
		r = tb.rows[tb.rows.length - 1];
		r.type = "tableDataRow";
		r.style.background = dataBgColor;

		if(rowNumbersEnabled)
		{
			c0 = r.insertCell();
			c0.innerText=a + startIndex;
			c0.type='header';
		}

		for(b = 1; b < tableHeadings.length; b++)
		{
			tmp = 'tableData['+a+'].col'+b;
			tmp2 = eval(tmp);
			com = 'c' + b + '=r.insertCell();c' + b + '.innerHTML="' + tmp2 + '";';
   			eval(com);
		}
	}

	i = document.getElementsByTagName('TD');

	for(a = 0; a < i.length; a++)
		if (i[a].type == 'header')
		{
			i[a].style.background = headerBgColor;
			i[a].style.color = headerTxtColor;
			i[a].style.cursor = 'default';
		}
}

function clearTable(tableName)
{
	tb = document.getElementById(tableName);
	i = tb.rows.length; 
	for (a = ignoreRowsQty; a < i; a++) tb.deleteRow();
}
