var junk=new Array();

//0:title,1:link,2:source,3:summary,4:picture,5:width,6:height
junk[0]=new Array('Disturbing images of Tibet protests reach exile','http://www.phayul.com/news/article.aspx?id=30816','','More disturbing images of Chinese brutality in Tibet have reached exile. The photos are from the January 24 protests that engulfed Serthar in eastern Tibet where a large crowd of Tibetans gathered in the central town and started raising slogans calling for Tibet’s independence.', '120203041143BO.jpg', '110', '76');junk[1]=new Array('Gory images of Tibetans killed and injured reach exile','http://www.phayul.com/news/article.aspx?id=30808','','The first graphic images of the January 23 protests in Drango, received by Phayul, shows in gory details, bullet injuries suffered by Tibetan protesters following the violent crackdown by Chinese security forces.', '120202061558CX.jpg', '110', '68');junk[2]=new Array('China arrests 100 Tibetans on protest charges','http://www.phayul.com/news/article.aspx?id=30806','','Chinese authorities have arrested a hundred Tibetans from Drango, eastern Tibet on suspicion of their participation in the January 23 mass protests in the region. Hundreds of Tibetans had come out on the streets calling for Tibet’s freedom and the return of the Dalai Lama', '120202044040GT.jpg', '110', '82');junk[3]=new Array('Tibetan MP calls for massive protests','http://www.phayul.com/news/article.aspx?id=30804','','Speaking at a candle light vigil yesterday in Dharamshala, a member of the Tibetan parliament called for massive protests in the exile community in solidarity with the ongoing critical situation inside Tibet.', '120202031043K5.jpg', '110', '84');junk[4]=new Array('India gearing-up for a limited conflict with China: US Official','http://www.phayul.com/news/article.aspx?id=30801','','A top US intelligence official has said that the Indian Army is preparing itself for a “limited conflict” with China despite their efforts at holding boundary talks and soaring economic relations. "We judge that India is increasingly concerned about China\'s posture along their disputed border ', '120202120111RU.jpg', '110', '69');junk[5]=new Array('US Senator tells China to stop targeting Tibetan protesters and allow access to journalists','http://www.phayul.com/news/article.aspx?id=30795','','In a ‘Resolution Expressing Support for the People of Tibet,’ US Senator Dianne Feinstein (D-Calif.) on Monday expressed “deep concern” about the current situation in Tibet and “steadfast support” for the Tibetan people', '120202110922QL.jpg', '87', '110');junk[6]=new Array('Kalachakra surplus donations go to charitable organisations','http://www.phayul.com/news/article.aspx?id=30794','','The organising committee of the 32nd Kalachakra formally released the financial statement of the ten-day teachings at a press conference held earlier today. The organisers said that a total income of Rs 32,93,33,249.00 was received through donations', '120202112710EF.jpg', '110', '83');junk[7]=new Array('Cycling students hit Chennai','http://www.phayul.com/news/article.aspx?id=30793','','The three Tibetan school students who are pedaling across India demanding a peaceful resolution to the Tibet crisis, reached the Indian city Chennai in Tamil Nadu state earlier this week. After meeting local media at the press club, the three students cycled throughout the city', '1202021144514W.jpg', '110', '74');junk[8]=new Array('Lobsang Yeshi sworn in as Member of Parliament','http://www.phayul.com/news/article.aspx?id=30790','','Lobsang Yeshi was sworn in as the newest member of the 15th Tibetan Parliament-in-Exile (TPiE) at a ceremony held at the Tibetan Parliamentary Secretariat yesterday in Dharamshala.', '1202010146135T.jpg', '110', '73');junk[9]=new Array('Top official calls for stringent security measures in Tibet','http://www.phayul.com/news/article.aspx?id=30784','','In a clear sign of China’s fear and weakness in maintaining its iron grip over Tibet, a top party official in Lhasa has asked for stringent security measures aimed at containing the spread of popular protests that has engulfed eastern Tibet.', '120201124341LT.jpg', '110', '82');
if(arrLength>10)
{
	arrLength=10;
}

document.write("<table width=" + tWidth + " bgColor=" + bgColor + " cellpadding=" + tPadding + ">");
for(i=0; i<=arrLength-1; i++)
{

	document.write("<tr>");
	document.write("<td>");

	//SHOWS ARTICLE TITLE
	document.write("<a target=\"_blank\" href=\"" + junk[i][1] + "\"><font face=\"" + AtfType + "\" color=" + AtfColor + " size=" + AtfSize + ">");

	if(AtB) { document.write("<b>"); }
	if(AtI) { document.write("<i>"); }
	document.write(crop_text(junk[i][0], AtLen));
	if(AtI) { document.write("</i>"); }
	if(AtB) { document.write("</b>"); }

	document.write("</font></a>");


	//SHOWS ARTICLE SOURCE
	if(ShowASource && junk[i][2]!="-")
	{
		document.write("<br><font face=\"" + AsfType + "\" color=" + AsfColor + " size=" + AsfSize + ">");
		if(AsB) { document.write("<b>"); }
		if(AsI) { document.write("<i>"); }
		if(AsU) { document.write("<u>"); }
		document.write(junk[i][2]);
		if(AsU) { document.write("</u>"); }
		if(AsI) { document.write("</i>"); }	
		if(AsB) { document.write("</b>"); }
	}	

	//SHOWS ARTICLE SUMMARY
	if(ShowASummary)
	{
		document.write("<br><font face=\"" + AsumfType + "\" color=" + AsumfColor + " size=" + AsumfSize + ">");
		
		//SHOW PICTURE
		if(ShowPic && junk[i][4]!="")
		{
			document.write("<IMG height=" + junk[i][6] + " width=" + junk[i][5] + " hspace=" + SpHS + " vspace=" + SpVS + " border=" + SpB + " src=\"http://www.phayul.com/images/thumbnails/news/articles/" + junk[i][4] + "\"  align=left>");
		}

		if(AsumB) { document.write("<b>"); }
		if(AsumI) { document.write("<i>"); }
		if(AsumU) { document.write("<u>"); }
		document.write(junk[i][3]);
		if(AsumU) { document.write("</u>"); }
		if(AsumI) { document.write("</i>"); }	
		if(AsumB) { document.write("</b>"); }
	}	

	document.write("</td></tr>");

}	
document.write("<tr><td><a href=\"http://www.phayul.com\" target=\"_blank\"><font face=\"Arial, Helvetica, sans-serif\" color=\"#999999\" size=\"1\">News powered by Phayul.com</font></a></td></tr>");
document.write("</table>");


function crop_text(text, max_length) {
  // If the string is already small enough, return it unscathed
  if (text.length <= max_length) { return( text ); }

  // If the user has specified a length of 0, it means he wants the whole thing
  if (max_length == 0) { return( text ); }

  // Start looking for a space, leaving space for an elipsis on the end
  var test_length = (max_length - 3);
  if (test_length < 1) { return( '...' ); }   // max_length too small
  while (text.charAt(test_length) != ' ') {
    test_length--;

    // If we didn't find any spaces to break on, return the string broken at max_length
    if (test_length == 0) { return( text.substring(0, max_length - 3) + '...' ); }
  }

  return text.substring(0, test_length) + '...';
}

