<!--
// right hand side column of ads in a table
// table sectioned
// 'holiday & travel', insurance, entertainment(tv, phones), miscellaneous
// ads within each section to be randomised
// order of sections to be randomised so each time it appears (refresh page / new page, it's different

function rightColumnSorted()
{
// id for where column of ads goes
var col = document.getElementById("rightAdsThemed")

// create table and tbody elements
var tab1 = document.createElement("table")
tab1.setAttribute("border","0")
tab1.setAttribute("width","150px")
tab1.setAttribute("className","adsTable")

var tabBody = document.createElement("tbody")

// all above is fixed

// have data array with headings for subsections
// this will be randomised by the algorithm

// noHeadings = advertsRightThemed.length
// extracted from js data file

for (var i=0; i<advertRightThemed.length; i++)
{
	// top cell/tr to be a title
	var trHeading=document.createElement("tr")
	// create td
	var tdHeading = document.createElement("td")
	tdHeading.setAttribute("bgColor","#bf8660")
	tdHeading.setAttribute("height","30px")

	// create textNode
	var tdHeadingText = document.createTextNode(advertRightThemed[i][0][3])
	tdHeading.appendChild(tdHeadingText)
	trHeading.appendChild(tdHeading)
	
	tabBody.appendChild(trHeading)
	
	// now loop round to make rest of trs for this theme
	
	for (var j=0; j<advertRightThemed[i].length; j++)
	{
		// create row - j = no of row
		var row = document.createElement("tr")
		
		// create one td per row
		var cell = document.createElement("td")
		cell.setAttribute("height","66px")//test height
		cell.setAttribute("border","0")
	
		// make them clickable	
		var cella = document.createElement("a")
		cella.setAttribute("href",advertRightThemed[i][j][1])
		cella.setAttribute("title",advertRightThemed[i][j][2])
		
		// banners should be 120x60px
		var cellimg = document.createElement("img")
		cellimg.setAttribute("src",advertRightThemed[i][j][0])
		cellimg.setAttribute("border","0")
		
		if(advertRightThemed[i][j][4]>0)
		{
			cellimg.setAttribute("height",advertRightThemed[i][j][4])
			cellimg.setAttribute("width",advertRightThemed[i][j][5])
		}
		
	
		// image is child of <a>
		cella.appendChild(cellimg)
		cell.appendChild(cella)
		
		row.appendChild(cell)
//		titleCaption.setAttribute("border","0")
//		titleCaption.setAttribute("className","heading")
		
		// create cells - 1 column + as many rows as ads
			
			
		// add the row to the bottom of the table body
		tabBody.appendChild(row)
	}


}

// put the tbody in the table
tab1.appendChild(tabBody)

// append table into body
col.appendChild(tab1)

// set border attribute to 2 and width 150px
tab1.setAttribute("border","2")
tab1.setAttribute("width","150px")

}
-->	
	
