
/*
Fading Scroller- By DynamicDrive.com
For full source code, 100's more DHTML scripts, and TOS,
visit http://www.dynamicdrive.com
*/
/*
modified by D Cowlin 
www.prague-online.net
*/
var delay=2000 //set delay between message change (in miliseconds)

begintag='<font face="Arial" size=2>' //set opening tag, such as font declarations
closetag='</font>'

var fwidth=150 //set scroller width
var fheight=100 //set scroller height

///No need to edit below this line/////////////////

var faderdelay=0
var index=0

var headlinetext="";
var headlineurl="";
var artnum=-1;

var ie4=document.all&&!document.getElementById
var ns4=document.layers
var DOM2=document.getElementById
var frame=20;
var hex=255  // Initial color value.
if (DOM2)
faderdelay=1500

//function to change content
function changecontent(){
if (article == null) return
if (artnum >= article.length) artnum = -1; // Loop if all articles done
if (artnum == -1) {
	headlinetext = article[0].cluster + " - Courtesy of Moreover.com";
  headlineurl = "http://www.moreover.com";
}else {
	//if (DOM2){
		//document.getElementById("fscroller").style.color="rgb(255,255,255)"
		headlinetext = "<b>"+article[artnum].headline_text + "</b><br><font size=\"-1\"><i>- " + article[artnum].source+" -</i></font>";
   	headlineurl = article[artnum].url;
		//document.getElementById("fscroller").innerHTML=begintag+headlinetext+closetag
		//colorfade()
	//}else if (ie4)//document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag
	//else if (ns4){
	//	document.fscrollerns.document.fscrollerns_sub.document.write(begintag+fcontent[index]+closetag)
	//	document.fscrollerns.document.fscrollerns_sub.document.close()
	//}
	
	}
	writeheadline()
	artnum++
	setTimeout("changecontent()",delay+faderdelay)
}

function writeheadline(){
if (DOM2){
		document.getElementById("fscroller").style.color="rgb(255,255,255)"
		document.getElementById("fscroller").innerHTML=begintag+headlinetext+closetag
		colorfade()
	}else if (ie4){
		document.all.fscroller.innerHTML=begintag+headlinetext+closetag
	}else if (ns4){
		document.fscrollerns.document.fscrollerns_sub.document.write(begintag+headlinetext+closetag)
		document.fscrollerns.document.fscrollerns_sub.document.close()
	}
}
// colorfade() partially by Marcio Galli for Netscape Communications.  ////////////
// Modified by Dynamicdrive.com



function colorfade() {	         	
// 20 frames fading process
if(frame>0) {	
hex-=12; // increase color value
document.getElementById("fscroller").style.color="rgb("+hex+","+hex+",255)"; // Set color value.
frame--;
setTimeout("colorfade()",30);	
}
else{
document.getElementById("fscroller").style.color="rgb(0,0,255)";
frame=20;
hex=255
}   
}
function gotoarticle()
{
  //document.headlineform.headlinebox.blur();
  window.open(headlineurl);
}
