var body = ""; var headlines = new Array(); var page = 1; var pages = 1; var pagesize = 20; var total = 20; page = 1; pages = 2; total = 24; headlines.push({"dateTime":"Feb 01, 2010 16:30 EST", "headline":"INTERVIEW-UPDATE 2-Toyota Canada eyes sales resumption", "article":"urn:newsml:reuters.com:20100201:nN01205683:2"}); headlines.push({"dateTime":"Jan 26, 2010 14:14 EST", "headline":"NEWSMAKER-Persistence pays off for Spyker's CEO Victor Muller", "article":"urn:newsml:reuters.com:20100126:nLDE5BL0DK:2"}); headlines.push({"dateTime":"Jan 14, 2010 13:50 EST", "headline":"PREVIEW-Europe awaits Opel's new management team", "article":"urn:newsml:reuters.com:20100114:nLDE60B103:2"}); headlines.push({"dateTime":"Jan 13, 2010 20:40 EST", "headline":"AUTOSHOW-UPDATE 2-Magna seeking partners for battery production", "article":"urn:newsml:reuters.com:20100114:nN13169151:2"}); headlines.push({"dateTime":"Jan 13, 2010 18:27 EST", "headline":"BRIEF-Magna CEO says interested in lithium-ion battery manufacturing", "article":"urn:newsml:reuters.com:20100113:nWEN8387:7"}); headlines.push({"dateTime":"Jan 13, 2010 17:09 EST", "headline":"CANADA STOCKS-TSX ends modestly higher after choppy session", "article":"urn:newsml:reuters.com:20100113:nN13165956:4"}); headlines.push({"dateTime":"Jan 13, 2010 16:57 EST", "headline":"AUTOSHOW-UPDATE 1-Magna looking at supplier acquisitions", "article":"urn:newsml:reuters.com:20100113:nN13170462:4"}); headlines.push({"dateTime":"Jan 13, 2010 16:39 EST", "headline":"AUTOSHOW-UPDATE 2-Hummer sale awaits uncertain China approval", "article":"urn:newsml:reuters.com:20100113:nN13228372:2"}); headlines.push({"dateTime":"Jan 13, 2010 16:26 EST", "headline":"AUTOSHOW-UPDATE 1-GAZ may take partners for commercial vehicles", "article":"urn:newsml:reuters.com:20100113:nN13165782:2"}); headlines.push({"dateTime":"Jan 13, 2010 15:27 EST", "headline":"BRIEF-Magna co-CEO expects dramatic reduction in number of suppliers over 5-10 years", "article":"urn:newsml:reuters.com:20100113:nWEN8377:6"}); headlines.push({"dateTime":"Jan 13, 2010 06:03 EST", "headline":"UPDATE 1-Magna sees $19.5-$20.5 bln sales in 2010", "article":"urn:newsml:reuters.com:20100113:nSGE60C0CV:2"}); headlines.push({"dateTime":"Jan 13, 2010 12:57 EST", "headline":"BRIEF-Magna announces 2010 outlook", "article":"urn:newsml:reuters.com:20100113:nWNAB3756:9"}); headlines.push({"dateTime":"Jan 11, 2010 22:57 EST", "headline":" Mega Uranium Ltd. Acquires Securities of Macusani Yellowcake Inc.", "article":"urn:newsml:reuters.com:20100111:nMKW75534a:3"}); headlines.push({"dateTime":"Jan 11, 2010 22:58 EST", "headline":"Mega Uranium Ltd. Acquires Securities of Macusani Yellowcake Inc. MGA.TO ", "article":"urn:newsml:reuters.com:20100111:nCCNaDGvwa:3"}); headlines.push({"dateTime":"Jan 11, 2010 09:09 EST", "headline":"Reuters Insider - Among Booming Auto Parts Makers, Which Can Move Higher?", "article":"urn:newsml:reuters.com:20100111:nRTV67953:1"}); headlines.push({"dateTime":"Jan 07, 2010 07:04 EST", "headline":"PRESS DIGEST - Canada - Jan 7", "article":"urn:newsml:reuters.com:20100107:nSGE6060G0:2"}); headlines.push({"dateTime":"Jan 06, 2010 06:15 EST", "headline":"BRIEF-RESEARCH ALERT-Wells Fargo raises auto suppliers sector to overweight", "article":"urn:newsml:reuters.com:20100106:nWNBB5632:5"}); headlines.push({"dateTime":"Dec 30, 2009 07:16 EST", "headline":"Magna leads race for Karmann roof unit - sources", "article":"urn:newsml:reuters.com:20091230:nLDE5BT0S1:1"}); headlines.push({"dateTime":"Dec 29, 2009 11:57 EST", "headline":"Global auto sales set for big gains in 2010 -report", "article":"urn:newsml:reuters.com:20091229:nN29190346:2"}); headlines.push({"dateTime":"Dec 30, 2009 00:51 EST", "headline":"FACTBOX-Cameroon mining projects", "article":"urn:newsml:reuters.com:20091229:nLDE5BS0Q2:3"}); $(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 += ""+ ""+ ""+ ""; for(var i = 0; i < headlines.length; i++){ out += ""+ ""+ ""; var headline = headlines[i]; out += ""+ ""+ ""; } out += "
 Time News Story
 "+headlines[i].dateTime+""+ ""+headlines[i].headline+""; 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 + "
"; }