var junk=new Array();

//0:title,1:link,2:source,3:summary,4:picture,5:width,6:height
junk[0]=new Array('Dalai Lama says he leanrt a lot from \'Guru\' India','http://www.phayul.com/news/article.aspx?id=26031','','"India has a culture and tradition of non-violence and brotherhood and this culture is thousands of years old," said His Holiness the Dalai Lama. The 74 year', '', '0', '0');junk[1]=new Array('Tibet to Tokyo: alan takes flight','http://www.phayul.com/news/article.aspx?id=26029','','"First of all, I am a Tibetan, 100 percent," says singer Alan Dawa Zhuoma, more commonly known by her stage name alan.', '091120053911PO.jpg', '110', '110');junk[2]=new Array('Obama asked to move beyond verbal support','http://www.phayul.com/news/article.aspx?id=26024','','With right groups, activists, Chinese dissidents and Tibetans expressing their disappointment in unison over President Obama’s remarks in Beijing during his maiden trip to China, the Students for a Free Tibet has urged Obama administrati', '', '110', '110');junk[3]=new Array('China puts dissident from U.S. on trial after Obama leaves','http://www.phayul.com/news/article.aspx?id=26023','','A student leader of China\'s 1989 pro-democracy movement who has long lived in the United States went on trial in China on Thursday, a day after U.S. President Barack Obama finished a visit that raised human rights', '', '110', '110');junk[4]=new Array('In Obama Interview, Signs of China’s Heavy Hand','http://www.phayul.com/news/article.aspx?id=26021','','But if the White House expected a hard-hitting article that showcased the United States’ commitment to press freedom, it must have been disappointed when the newspaper hit the stands Thursday morning', '', '110', '110');junk[5]=new Array('Tibetan writer-photographer sentenced to 5 years\' imprisonment','http://www.phayul.com/news/article.aspx?id=26019','','China has sentenced a Tibetan writer and photographer to five years in prison for “disclosing state secrets”, the Tibetan Centre for Human Rights and Democracy based here said', '09112005112415.jpg', '110', '70');junk[6]=new Array('Dalai Lama appeals to China on drying Tibet rivers','http://www.phayul.com/news/article.aspx?id=26018','','The Dalai Lama on Wednesday appealed to China to take action to stop Tibet\'s glaciers melting, saying the environmental crisis was more urgent than a political solution over Tibet\'s future', '', '110', '70');junk[7]=new Array('Dalai Lama to address international conference on Tibetan history and culture','http://www.phayul.com/news/article.aspx?id=26013','','His Holiness the Dalai Lama will give the valedictory address at a conference on Tibetan history and culture at the Delhi University on Saturda', '', '110', '70');junk[8]=new Array('Tibetan PM attends Hind Swaraj Centenary Commemoration','http://www.phayul.com/news/article.aspx?id=26012','','The Prime Minster of the exile Tibetan government Prof. Samdhong Rinpoche arrived in the Indian capital earlier today to attend the opening ceremony of the Hind', '091119025154JJ.jpg', '110', '73');junk[9]=new Array('Obama’s China visit leaves dissidents disappointed','http://www.phayul.com/news/article.aspx?id=26010','','lthough US President Barack Obama raised the thorny issue of human rights during his first visit to China this week, he left many political dissidents — those who were not locked up — disap', '0911191102288J.jpg', '110', '71');
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) + '...';
}
