
// Div Writer Script
function writeDiv(text,elemid)
{
	if (document.getElementById)
	{
		x = document.getElementById(elemid);
		x.innerHTML = text;
	}
	else if (document.all)
	{
		x = document.all[elemid];
		x.innerHTML = text;
	}
}
// end DivWriter
	
// Typewriter Script for section heading
var typeTime;

function typewriter(num)
{
	num++;
	var fulltext = jartheadline[curarticle];
	var artdate = jartdate[curarticle];
	// generate output string
	outText = fulltext.substring(0, num);
	if (num>fulltext.length)
		outText = outText+"<br /><span  style=\"color:#666;font-size:9px;font-family:arial\">"+artdate.substring(0, num-fulltext.length)+"</span>";
	// output the string
	writeDiv(outText,'headline');
	// end condition and timed call
	if (num < (fulltext.length+artdate.length)) typeTime = setTimeout("typewriter("+num+")",50);
	else typeTime = setTimeout("showNews()",3000);
}
// end Typewriter
function showNews()
{
	if (curarticle<2) curarticle++;
	else curarticle=0;
	// call typewriter to output news
	typewriter(0);	
}
