

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('05/03/2010','11:42','APK','Australian Power and Gas and Titans strengthen ties','2585553','','','');
headlines[1] = new headline('03/03/2010','14:45','APK','Updated Appendix 4D and Half Year Accounts','2585213','','','');
headlines[2] = new headline('26/02/2010','20:09','APK','APK reports $60m revenue, maiden profit, confirm FY forecast','2584735','','','');
headlines[3] = new headline('26/02/2010','20:05','APK','Appendix 4D and Half Year Accounts','2584734','','','');
headlines[4] = new headline('19/02/2010','16:41','APK','Change of Director`s Interest Notice','2583400','','','');
headlines[5] = new headline('19/02/2010','16:40','APK','Appendix 3B','2583399','','','');
headlines[6] = new headline('08/02/2010','14:49','APK','Interview with James Myatt, Managing Director of APK','2581864','','','');
headlines[7] = new headline('04/02/2010','16:25','APK','Supplementary Employee Prospectus','2581586','','','');
headlines[8] = new headline('29/01/2010','16:41','APK','Appendix 3B for Disclosure Document','2580981','','','');
headlines[9] = new headline('29/01/2010','16:28','APK','Employee Prospectus','2580971','','','');


///// Render functions /////
// (you can use your own if you like)

function viewArticle(articleID) {
	var urlStr = 'http://clients.weblink.com.au/clients/mvl/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 = 'APK';
		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/mvl/article.asp?asx="+ asxcode +"&view=" + h.id + "'>" + h.headline + "</td>");
		document.write("	</tr>");
		
	}
	document.write("	</tbody>")
	document.write("</table>")
}
