



function renderAllData()
{
renderMiniChart();
renderIndices();

}



///// Data Declarations /////

function security(name, symbol, value, movement, percentMovement, volume)
{
	// Represents a security object
	this.name = name;
	this.symbol = symbol;
	this.value = value;
	this.movement = movement;
	this.percentMovement = percentMovement;
	this.volume = volume;
}

var indices = new Array();


///// Data values /////
indices[0] = new security('ASX 200','ASX.XJO','4853.200','56.000','1.17','1364784627','');
indices[1] = new security('Dow Jones','US.^DJI','10685.980','43.830','0.41','227418200','');
indices[2] = new security('NASDAQ','US.^COMP','2378.010','15.800','0.67','0','');
indices[3] = new security('FTSE','LSE.UKX','5620.430','26.580','0.48','0','');
indices[4] = new security('H.SENG','US.^HSI','21022.930','-56.170','-0.27','0','');
indices[5] = new security('Nikkei','US.^NI225','10721.710','-30.271','-0.28','0','');


///// Render functions /////
// (you can use your own if you like)

function startTable(caption, columns)
{
    document.write('<table class="wlTable" cellspacing="0">');
    document.write('    <caption>' + caption + '</caption>');
}

function endTable()
{
	document.write('</table>');
}


function renderMiniChart()
{
	startTable('All Ords', 1);
	document.write ('<tr><td><img src="http://clients.weblink.com.au/clients/standardpacific/all_ords.asp" width=180 height=120></td></tr>');
	endTable();
}

function renderIndices()
{
	renderSecurities(indices, 'Yesterday\u2019s Market Close', '');
}

function renderSecurities(dataArr, title, msg)
{
	startTable(title, 4);

    /*
    document.write('<thead>');
    document.write('    <tr>');
    document.write('        <th width="30%" align="left">Code</th>');
    document.write('        <th width="30%" align="right">Last</th>');
    document.write('        <th width="15%"></th>');
    document.write('        <th width="25%" align="right">Change</th>');
    document.write('    </tr>');
    document.write('</thead>');
    */
    document.write('<tbody>');

	if (msg != '')
		document.write ('<tfoot><tr><td colspan=4>' + msg + '</td></tr></tfoot>');


	for (var i=0; dataArr.length > i; i++) {
		var s = dataArr[i];

		if (s.movement > 0) {
			img = '<img src="http://clients.weblink.com.au/clients/standardpacific/images/arrow_up.gif">';
			mclStr = 'wlUp';
        } else if (0 > s.movement) {
			img = '<img src="http://clients.weblink.com.au/clients/standardpacific/images/arrow_dwn.gif">';
			mclStr = 'wlDown';
        } else {
			img = '<img src="http://clients.weblink.com.au/clients/standardpacific/images/steady.gif">';
			mclStr = 'wlEven';
        }

		if ((i % 2) == 0)
			clStr = 'wlOdd';
		else
			clStr = 'wlEven';

		document.write('<tr class="' + clStr + '">');
        document.write('    <td>' + s.name + '</td>');
        document.write('    <td align="right">' + s.value + '</td>');
        document.write('    <td align="right">' + img + '</td>');
        document.write('    <td align="right" class="' + mclStr + '">' + s.percentMovement + '%</td>');
        document.write('</tr>');

	}
    document.write('</tbody>');

	endTable();
}
