function tableMaker(obj)
{
	if(obj.table == undefined) return false;
	
	var table = document.createElement("table");
	//var tfoot = document.createElement("tfoot");
	
	/* CREAZIONE TABLE */
	tblObj = obj.table;
	if(tblObj.width != undefined)
		table.setAttribute("width",tblObj.width);
	
	if(tblObj.class != undefined)
		table.setAttribute("class",tblObj.class);
		
	if(tblObj.id != undefined)
		table.setAttribute("id",tblObj.id);
	
	
	
	/* CREAZIONE THEAD */
	if(tblObj.thead != undefined)
	{
		theadObj = tblObj.thead;
		
		if(theadObj.items != undefined)
		{
			thItemsObj = theadObj.items;
			theadRow = document.createElement("tr");
			for(i=0;i<thItemsObj.length;i++)
			{
				theadCol = document.createElement("th");
				item = thItemsObj[i];
				if(item.width != undefined)
					theadCol.setAttribute("width",item.width);
				titleCol = document.createTextNode(item.title);
				theadCol.appendChild(titleCol);
				theadRow.appendChild(theadCol);
			}
			var thead = document.createElement("thead");
			thead.appendChild(theadRow);
			table.appendChild(thead);
		}
	}
	
	
	/* CREAZIONE BODY */
	
	
	if(tblObj.tbody != undefined)
	{
		tbodyObj = tblObj.tbody;
		
		if(tbodyObj.rowItems != undefined)
		{
			tbRowItemsObj = tbodyObj.rowItems;
			var tbody = document.createElement("tbody");
			for(i=0;i<tbRowItemsObj.length;i++)
			{
				tbRowObj = tbRowItemsObj[i];
				tbodyRow = document.createElement("tr");
				
				if(tbRowObj.oddClass != "")
					tbodyRow.setAttribute("class",tbRowObj.oddClass);
			
				if(tbRowObj.items != undefined)
				{
					tbRowItems = tbRowObj.items;
					for(j=0;j<tbRowItems.length;j++)
					{
						tbColObj = tbRowItems[j];
						if(tbColObj.h != undefined && tbColObj.h == true)
							tbodyCol = document.createElement("th");
						else 
							tbodyCol = document.createElement("td");
							
						if(tbColObj.width != undefined)
							tbodyCol.setAttribute("width",tbColObj.width);
						
						if(tbColObj.content != undefined)
						{
							textCol = document.createTextNode(tbColObj.content);
							tbodyCol.appendChild(textCol);
						}
						if(tbColObj.html != undefined)
							tbodyCol.innerHTML = tbColObj.html;
						
						tbodyRow.appendChild(tbodyCol);
					}
				}
				tbody.appendChild(tbodyRow);
			}
			table.appendChild(tbody);
		}
	}
	
	return table;	
}
