var body = "";
var headlines = new Array();
var page = 1;
var pages = 1;
var pagesize = 20;
var total = 20;
page = 1;
pages = 21;
total = 412;
headlines.push({"dateTime":"Jul 29, 2010 20:59 EDT",
"headline":"METALS-Shanghai copper to open up ahead of U.S. Q2 GDP", "article":"urn:newsml:reuters.com:20100730:nTOE66T00N:2"});
headlines.push({"dateTime":"Jul 29, 2010 20:58 EDT",
"headline":"*TOP NEWS* Front Page", "article":"urn:newsml:reuters.com:20100730:nTOPNEWS:2"});
headlines.push({"dateTime":"Jul 29, 2010 20:58 EDT",
"headline":"DIARY-Philippines to August 26", "article":"urn:newsml:reuters.com:20100730:nSGE66T013:2"});
headlines.push({"dateTime":"Jul 29, 2010 20:57 EDT",
"headline":" Crescent Resources Final Debt Settlement CRC.V ", "article":"urn:newsml:reuters.com:20100730:nMKW46954a:3"});
headlines.push({"dateTime":"Jul 29, 2010 20:57 EDT",
"headline":"INSTANT VIEW 4-Samsung Elec posts record Q2 profit on chips", "article":"urn:newsml:reuters.com:20100730:nTOE66S07R:4"});
headlines.push({"dateTime":"Jul 29, 2010 20:57 EDT",
"headline":"UPDATE 2-DBS posts Q2 loss after surprise HK goodwill charge", "article":"urn:newsml:reuters.com:20100730:nSGE66S0PL:2"});
headlines.push({"dateTime":"Jul 29, 2010 20:57 EDT",
"headline":"Crescent Resources Final Debt Settlement CRC.V ", "article":"urn:newsml:reuters.com:20100730:nCCN1B5dDa:2"});
headlines.push({"dateTime":"Jul 29, 2010 20:57 EDT",
"headline":"Japan Hot Stocks-Shinsei Bank, Nintendo, Sony", "article":"urn:newsml:reuters.com:20100730:nTOE66T00I:2"});
headlines.push({"dateTime":"Jul 29, 2010 20:56 EDT",
"headline":"U.S. West Coast Products-Gasoline continues slide", "article":"urn:newsml:reuters.com:20100730:nN29231494:2"});
headlines.push({"dateTime":"Jul 29, 2010 20:55 EDT",
"headline":"SERVICE ALERT - RDF/RWS Svcs - Faraday House {CONFIRMED} see page ALERT77 ", "article":"urn:newsml:reuters.com:20100730:nVEN091452:2"});
headlines.push({"dateTime":"Jul 29, 2010 20:53 EDT",
"headline":"*TOP NEWS* Asia-Pacific", "article":"urn:newsml:reuters.com:20100730:nSGE66I0AW:2"});
headlines.push({"dateTime":"Jul 29, 2010 20:52 EDT",
"headline":"China starts laying $2 bln power line to Tibet", "article":"urn:newsml:reuters.com:20100730:nTOE66T00V:2"});
headlines.push({"dateTime":"Jul 29, 2010 20:52 EDT",
"headline":"UPDATE 3-Google says China search block may be tech glitch", "article":"urn:newsml:reuters.com:20100730:nN2989630:4"});
headlines.push({"dateTime":"Jul 29, 2010 20:52 EDT",
"headline":"Philippines - Market factors to watch - July 30", "article":"urn:newsml:reuters.com:20100730:nSGE66T005:2"});
headlines.push({"dateTime":"Jul 29, 2010 20:51 EDT",
"headline":"Clarkston Financial Corporation Reports Q2 Results", "article":"urn:newsml:reuters.com:20100730:nGNW97987a:4"});
headlines.push({"dateTime":"Jul 29, 2010 20:51 EDT",
"headline":"UPDATE 1-Japan factory output unexpectedly falls in June", "article":"urn:newsml:reuters.com:20100730:nTOE66T00Q:2"});
headlines.push({"dateTime":"Jul 29, 2010 20:50 EDT",
"headline":"GENTING SINGAPORE PLC (Miscellaneous :: Notice Of Extraordinary General Meeting) GENS.SI GNTG.SI ", "article":"urn:newsml:reuters.com:20100730:nSN7U40210:2"});
headlines.push({"dateTime":"Jul 29, 2010 20:49 EDT",
"headline":"PRECIOUS-Gold ticks lower, awaits U.S. Q2 GDP data", "article":"urn:newsml:reuters.com:20100730:nSGE66T00T:2"});
headlines.push({"dateTime":"Jul 29, 2010 20:49 EDT",
"headline":"UPDATE 1-Madoff trustee sues family entities", "article":"urn:newsml:reuters.com:20100730:nN29247505:2"});
headlines.push({"dateTime":"Jul 29, 2010 20:49 EDT",
"headline":"BRIEF-BlackRock advisors, llc provides statement on closed-end fund lawsuits", "article":"urn:newsml:reuters.com:20100730:nWEN8136:8"});
$(document).ready(function(){
var out = "";
if(body != null && body.length > 0){
out += body;
}
var white = true;
if(headlines.length > 0){
if(white) color = "ffffff";
else color = "eeeeee";
white = !white;
out += getPagination() + ""+
"
"+
""+
"";
out += ""+
"| Time | "+
" | "+
"News Story | ";
for(var i = 0; i < headlines.length; i++){
out += " | "+
" | "+
"";
var headline = headlines[i];
out += "| "+headlines[i].dateTime+" | "+
" | "+
""+
""+headlines[i].headline+"";
out += " | ";
}
out += " |
";
}
$('div#news').html(out);
});
function getPagination(){
var ret = "";
for(var i = 1; i < (pages + 1); i++){
var left = (i - 1) * pagesize;
var right = left + pagesize;
if(right > total) right = total;
var label = "["+left+"-"+right+"]";
if(i == page){
ret += "
"+label+"";
}else{
ret += "
"+label+"";
}
}
return ret + "
";
}