// catchfence banner v1.0
// author: Geoff Roth (geoff@shockboy.com)


// edit these values
// use &#39; for all apostrophes & single-quotes
var news_alert = '';

var news = [
		// MAIN/CUP NEWS BEGIN
		{
		header:		'<B><I>Caught In The CatchFence</font><font face="Verdana, Arial, Helvetica" size="-3" color="#FFFF00">&copy;......&nbsp;</I></font></B>',
		title:		'MAIN/CUP NEWS:',
		link: 		'http://www.catchfence.com/index1.html/#Caught',
		headlines:	[   
		             'Doug Yates Forms "Yates Racing;" Newman/Haas/Lanigan Racing Out Of Picture', 
		             'Robert Yates Retiring At End Of Seson',
		             'NASCAR, Sprint Nextel Reach Agreement With AT&T In Branding Dispute',
                     'Smith to take the wheel of DEI’s fourth entry; Martin and Almirola to take over the No. 8',
		             'Crew Chief Joe Lax Fined, Suspended Due To Rule Violations at California',
					 'Richmond Int&#39l Raceway Announces 32nd Consecutive Sellout',
					 'Jeremy Mayfield&#39s Father Passes Away',
		             'Joe Gibbs Racing Will Switch To Toyota In 2008'
                     // no comma after last item
					 ]
		}, // do not forget this comma
		// MAIN/CUP NEWS END
		
		
		
		// BUSCH NEWS BEGIN
		{
		header:		'',
		title:		'BUSCH NEWS:',
		link: 		'http://www.catchfence.com/bgncts/nbs.html',
		headlines:	[ 
		              'Brad Keselowski injures leg in 4-car crash',
                      'Burton passes Busch in closing laps for Calif. win',
					  'Crew Chief Fined, Placed on Probation for Violations at Michigan',
					  'A.J. Allmendinger Joins Chip Ganassi Racing with Felix Sabates',
					  'NASCAR scrambling to find new sponsor for Busch Series'				  
					   // no comma after last item
					 ]
		}, // do not forget this comma
		// BUSCH NEWS END
		
		
		// TRUCK NEWS BEGIN
		{
		header:		'',
		title:		'TRUCK NEWS:',
		link: 		'http://www.catchfence.com/bgncts/cts.html',
		headlines:	[ 
		             'Benson gets by Hornaday late to win Gateway race',
					 'Jacques Villeneuve Completes First NASCAR Test'
		    		  // no comma after last item
					 ]
		}, // do not forget this comma
		// TRUCK NEWS END
		
		
		// ARCA NEWS BEGIN
		{
		header:		'',
		title:		'ARCA NEWS:',
		link: 		'http://www.catchfence.com/arca/arca.html',
		headlines:	[
		             'Brett Butler To Run In ARCA RE/MAX Series For Eddie Sharp Racing',
					 'Schrader Shines Again on DuQuoin’s “Magic Mile” Dirt',
					 'Rookie Clauson Earns Career; First Victory at Gateway',
					 'ARCA Issues Post-Milwaukee Penalties'
					 // no comma after last item
					 ]
		}, // do not forget this comma
		// ARCA NEWS END
		
		
		];




// don't edit anything below this line

function getAlert() {
	try {
		return news_alert + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp';
	} catch (e) {
		return '';
	}
}

function getNews() {
	try {
		return news;
	} catch (e) {
		return [];
	}
}

function getNewsItem(index) {
	try {
		return getNews()[index];
	} catch (e) {
		return {header: '', title: '', link: '', separator: '', headlines: []};
	}
}

function writeBanner() {
	var separator = '&nbsp;&nbsp;<B>·</B>&nbsp;&nbsp;';
	str = getAlert();
	var nlen = getNews().length;
	for (var i=0; i<nlen; i++) {
		if (getNewsItem(i) != undefined) {
			str += getNewsItem(i).header;	
			str += '<b><font face="Verdana, Arial, Helvetica" size="-1" color="#FFFF00">'
			if (getNewsItem(i).link != '') str += '<A HREF="' + getNewsItem(i).link + '" CLASS="e">';
			str += '<B>' + getNewsItem(i).title + '&nbsp;&nbsp;</B>';
			var len = getNewsItem(i).headlines.length;
			for (var j=0; j<len; j++) {
				if (getNewsItem(i).headlines[j] != undefined) {
					str += getNewsItem(i).headlines[j];
					if (j == len-1 && getNewsItem(i).link != '') str += '</A>';
					str += separator;
				}
			}
			str += '</b></font>';
		}
	}
	var banner = '<center><marquee behavior="scroll" direction="left" bgcolor="BLACK" loop="" scrollamount="5"  width="95%" height="2"><div class="banner"><b><font face="Verdana, Arial, Helvetica" size="-1" color="#FFFF00">' + str + '</font></B></div></marquee></center>';
	document.write(banner);
}
