function r2 (q) 
{
	return Math.round(q*100)/100;
}

function nfv(v) 
{
	x = v.indexOf(',');
	vl = (x<=0)?v.length:x;
	if (vl<4) 
	return (v);
	else
	return nfv((v.substr(0,vl-3))+','+v.substr(vl-3));
}


function frow(symarr,str) 
{
	sym = symarr[6];
	last = symarr[14];
	if (symarr[20]!='d') {
	udimg='arrow_up_grn.gif';
	} else  {
	udimg='arrow_dwn_red.gif';
	}
	pclose = symarr[23];
	change = parseInt(100*(last-pclose))/100;
	if (pclose==0) {
	pchange=100;
	} else {
	pchange = parseInt(100*(((last*100)/pclose)-100))/100;
	}
	vol = symarr[18];
	x = "<tr>";
	x += "<td class='gratop2'><a target=_top href='/about/listed/lcddata.html?ticker="+sym+"'>"+sym+"</a></td>";
	x += "<td class='gratop2' nowrap>"+str+"</td>";
	x += "<td class='gratop2' align='right'>"+r2(last)+"</td>";
	x += "<td class='gratop2' align='right'> <img src='/images/common/"+udimg+"'></td>";
	x += "<td class='gratop2' align='right'>"+change+"</td>";
	x += "<td class='gratop2' align='right'>"+pchange+"%</td>";
	x += "<td class='gratop2' align='right'>"+nfv(vol)+"</td>";
	x += "</tr>\n";
	document.write (x);
}


var ETFTickerList = [['NYC',"iShares NYSE Composite Index Fund"], ['NY',"iShares NYSE 100 Index Fund"], ['GLD',"SPDR Gold Trust<sup>*</sup>"],['IWM',"iShares Russell 2000 Index Fund"],['EWJ',"iShares MSCI Japan Index Fund"], ['IVV',"iShares S&P 500 Index Fund"], ['DIA',"The Dow Industrials DIAMONDS"]];
for(var i=0;i<SYMLIST.length;i++) {
	for(var j=0;j<ETFTickerList.length;j++){
		if(SYMLIST[i] == ETFTickerList[j][0]){
		frow (eval('tick'+i),ETFTickerList[j][1]);
		}
	}
}

