

function headline(date, time, symbol, headline, id)
{
	// Represents a headline object
	this.date = date;
	this.time = time;
	this.symbol = symbol;
	this.headline = headline;
	this.id = id;
}

///// Data values /////
var headlines = new Array();

headlines[0] = new headline('30/01/2012','20:02','IMD','Change in substantial holding for SEH','6575760','','','');
headlines[1] = new headline('24/01/2012','16:40','IMD','Half Year 2012 Results Conference Call','6575016','','','');
headlines[2] = new headline('24/01/2012','8:26','IMD','Ceasing to be a substantial holder','6574902','','','');
headlines[3] = new headline('23/01/2012','8:25','IMD','Joint Venture Acquires Vaughn Energy Services','6574728','','','');
headlines[4] = new headline('23/01/2012','8:25','IMD','1H12 Trading Update','6574729','','','');
headlines[5] = new headline('20/01/2012','17:09','IMD','Ceasing to be a substantial holder from WBC','6574693','','','');
headlines[6] = new headline('20/01/2012','16:23','IMD','Ceasing to be a substantial holder from BTT','6574685','','','');
headlines[7] = new headline('12/01/2012','17:28','IMD','Change of Interests from WBC','6573940','','','');
headlines[8] = new headline('12/01/2012','17:24','IMD','Change in substantial holding from WBC','6573939','','','');
headlines[9] = new headline('12/01/2012','16:33','IMD','Change in substantial holding from BTT','6573933','','','');


///// Render functions /////
// (you can use your own if you like)

function viewArticle(articleID) {
	var urlStr = 'http://clients.weblink.com.au/clients/imdex/article.asp?view=' + articleID;
	var PopupWin = window.open(urlStr,"viewNews","scrollbars=yes,toolbar=no,directories=no,status=yes,menubar=no,resizable=yes,width=630,height=450")
	PopupWin.focus();
}

function renderHeadlinesList()
{
	document.write("<table class='wlNewsTable'>");
	document.write("	<thead>");
	document.write("		<tr>");
	document.write("			<th>Date</th>");
	document.write("			<th>Time</th>");
	document.write("			<th>Document</th>");
	document.write("		</tr>");
	document.write("	</thead>")
	document.write("	<tbody>")

	for (var i=0; i<headlines.length; i++) {
		var h = headlines[i];
		var cls = (i%2 == 0) ? "even" : "odd";
        var asxcode = 'IMD';
		if (h.symbol == '') continue;

		document.write("	<tr class='" + cls + "'>");
		document.write("		<td>" + h.date + "</td>");
		document.write("		<td>" + h.time + "</td>");
		document.write("		<td align=left><a target='_blank' href='http://clients.weblink.com.au/clients/imdex/article.asp?asx="+ asxcode +"&view=" + h.id + "'>" + h.headline + "</td>");
		document.write("	</tr>");

	}
	document.write("	</tbody>")
	document.write("</table>")
}

