// Dave modified this for scrolling Burma Shave Messages

/**********************************************************************************   
NewsSlideFade 
*   Copyright (C) 2001 <a href="/dhtmlcentral/thomas_brattli.asp">Thomas Brattli</a>
*   This script was released at DHTMLCentral.com
*   Visit for more great scripts!
*   This may be used and changed freely as long as this msg is intact!
*   We will also appreciate any links you could give us.
*
*   Made by <a href="/dhtmlcentral/thomas_brattli.asp">Thomas Brattli</a> 
*********************************************************************************/

function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=new lib_bwcheck()

nBetweendelay = 2000 //The delay before fading out.
nFont = 'georgia,verdana,tahoma' //The font for the news.
nFontsize = 10 //Font size in pixel.
nFadespeed = 100 //The speed to fade in, in milliseconds.

//Set the colors, first color is same as background, last color is the color it stops at:
//You can have as many colors you want
nColor=new Array('#F5F5F5','#FFD5D5','#FFB7B7','#FF8888','#FF4F4F','#FF1C1C','#FF0000')

nNews=new Array()
nNews[0]="BURMA-SHAVE SLOGANS"
nNews[1]="DON'T LOSE YOUR HEAD"
nNews[2]="TO GAIN A MINUTE"
nNews[3]="YOU NEED YOUR HEAD"
nNews[4]="YOUR BRAINS ARE IN IT"
nNews[5]="BURMA-SHAVE"
nNews[6]="DROVE TOO LONG"
nNews[7]="DRIVER SNOOZING"
nNews[8]="WHAT HAPPENED NEXT"
nNews[9]="IS NOT AMUSING"
nNews[10]="BURMA-SHAVE"
nNews[11]="BROTHER SPEEDERS"
nNews[12]="LET'S REHEARSE"
nNews[13]="ALL TOGETHER"
nNews[14]="GOOD MORNING NURSE"
nNews[15]="BURMA-SHAVE"
nNews[16]="CAUTIOUS RIDER"
nNews[17]="TO HER RECKLESS DEAR"
nNews[18]="LET'S HAVE LESS BULL"
nNews[19]="AND LOTS MORE STEER"
nNews[20]="BURMA-SHAVE"
nNews[21]="THE MIDNIGHT RIDE"
nNews[22]="OF PAUL FOR BEER"
nNews[23]="LED TO A"
nNews[24]="WARMER HEMISPHERE"
nNews[25]="BURMA-SHAVE"
nNews[26]="SPEED WAS HIGH"
nNews[27]="WEATHER WAS HOT"
nNews[28]="TIRES WERE THIN"
nNews[29]="X MARKS THE SPOT"
nNews[30]="BURMA-SHAVE"
nNews[31]="AROUND THE CURVE"
nNews[32]="LICKETY--SPLIT"
nNews[33]="IT'S A BEAUTIFUL CAR"
nNews[34]="WASN'T IT?"
nNews[35]="BURMA-SHAVE"
nNews[36]="PASSING CARS"
nNews[37]="WHEN YOU CAN'T SEE"
nNews[38]="MAY GET YOU A GLIMPSE"
nNews[39]="OF ETERNITY"
nNews[40]="BURMA-SHAVE"
nNews[41]="NO MATTER THE PRICE"
nNews[42]="NO MATTER HOW NEW"
nNews[43]="THE BEST SAFETY DEVICE"
nNews[44]="IN THE CAR IS YOU"
nNews[45]="BURMA-SHAVE"
nNews[46]="A GUY WHO DRIVES"
nNews[47]="A CAR WIDE OPEN"
nNews[48]="IS NOT THINKIN'"
nNews[49]="HE'S JUST HOPIN'"
nNews[50]="BURMA-SHAVE"
nNews[51]="AT INTERSECTIONS"
nNews[52]="LOOK EACH WAY"
nNews[53]="A HARP SOUNDS NICE"
nNews[54]="BUT ITS HARD TO PLAY"
nNews[55]="BURMA-SHAVE"
nNews[56]="BOTH HANDS ON THE WHEEL"
nNews[57]="EYES ON THE ROAD"
nNews[58]="THAT'S THE SKILLFUL"
nNews[59]="DRIVER'S CODE"
nNews[60]="BURMA-SHAVE"
nNews[61]="THE ONE WHO DRIVES WHEN"
nNews[62]="HE'S BEEN DRINKING"
nNews[63]="DEPENDS ON YOU"
nNews[64]="TO DO HIS THINKING"
nNews[65]="BURMA-SHAVE"
nNews[66]="PASSING SCHOOL ZONE"
nNews[67]="TAKE IT SLOW"
nNews[68]="LET OUR LITTLE"
nNews[69]="SHAVERS GROW"
nNews[70]="BURMA-SHAVE"
nNews[71]="Listen Birds"
nNews[72]="These signs cost money"
nNews[73]="So stay awhile"
nNews[74]="but don't get funny"
nNews[75]="BURMA-SHAVE"
nNews[76]="He saw the train"
nNews[77]="He tried to duck it"
nNews[78]="Kicked first the gas"
nNews[79]="And then the bucket"
nNews[80]="BURMA-SHAVE"
nNews[81]="Use this cream"
nNews[82]="A day or two"
nNews[83]="Then don't call her"
nNews[84]="She'll call you"
nNews[85]="BURMA-SHAVE"
nNews[86]="Does your husband misbehave"
nNews[87]="Grunt and grumble"
nNews[88]="Rant and rave"
nNews[89]="Shoot the brute some"
nNews[90]="BURMA-SHAVE"
nNews[91]="Past schoolhouses"
nNews[92]="Take it slow"
nNews[93]="Let the little"
nNews[94]="Shavers grow"
nNews[95]="BURMA-SHAVE"
nNews[96]="He had the ring"
nNews[97]="He had a flat"
nNews[98]="She felt his chin"
nNews[99]="And that was that"
nNews[100]="BURMA-SHAVE"
nNews[101]="We've made grandpa"
nNews[102]="Look so trim"
nNews[103]="The local draft board's"
nNews[104]="After him"
nNews[105]="BURMA-SHAVE"
nNews[106]="Many a forest"
nNews[107]="Used to stand"
nNews[108]="Where a lighted match"
nNews[109]="Got out of hand"
nNews[110]="BURMA-SHAVE"
nNews[111]="On curves ahead"
nNews[112]="Remember, sonny"
nNews[113]="That rabbit's foot"
nNews[114]="Didn't save"
nNews[115]="The bunny"
nNews[116]="BURMA-SHAVE"
nNews[117]="Substitutes"
nNews[118]="Are like a girdle"
nNews[119]="They find some jobs"
nNews[120]="They just can't hurdle"
nNews[121]="BURMA-SHAVE"
nNews[122]="Grandpa's out with"
nNews[123]="Junior's date"
nNews[124]="Old technique"
nNews[125]="With brand new bait"
nNews[126]="BURMA-SHAVE"
nNews[127]="Dinah doesn't"
nNews[128]="Treat him right"
nNews[129]="But if he'd shave"
nNews[130]="Dyna-Mite!"
nNews[131]="BURMA-SHAVE"
nNews[132]="A peach looks good"
nNews[133]="With lots of fuzz"
nNews[134]="But man's no peach"
nNews[135]="And never was"
nNews[136]="BURMA-SHAVE"
nNews[137]="Approached"
nNews[138]="A crossing"
nNews[139]="Without looking"
nNews[140]="Who will eat"
nNews[141]="His widow's cooking?"
nNews[142]="BURMA-SHAVE"
nNews[143]="SHAVING BRUSHES"
nNews[144]="YOU'LL SOON SEE 'EM"
nNews[145]="ON THE SHELF"
nNews[146]="IN SOME MUSEUM"

/********************************************************************************
Object code...Object constructors and functions...
********************************************************************************/
function makeNewsObj(obj,nest,font,size,color,news,fadespeed,betweendelay){
    nest=(!nest) ? "":'document.'+nest+'.'
   	this.css=bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+"document.layers." +obj):0;	
   	this.writeref=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+"document.layers." +obj+".document"):0;
	if(font){this.color=new Array(); this.color=eval(color); this.news=new Array(); this.news=eval(news)
		this.font=font; this.size=size; this.speed=fadespeed; this.delay=betweendelay;
		this.fadeIn=b_fadeIn;this.fadeOut=b_fadeOut; this.newsWrite=b_newsWrite; this.y=1
		if(bw.dom || bw.ie4){this.css.width=150; this.css.textAlign='center'; this.css.fontFamily=this.font; this.css.fontSize=this.size; this.css.fontWeight='bold'; this.css.color=this.color[0]}
	}
	this.obj = obj + "Object"; 	eval(this.obj + "=this"); return this
}

function b_newsWrite(num,i){
	if (bw.ns4){
		this.writeref.write("<center><b style=\"text-decoration:none; font-size:"+this.size+"px\">"
			+"<font face=\""+this.font+"\" color=\""+this.color[i]+"\">"+this.news[num]+"</font></b></center>")
		this.writeref.close()
	}else this.writeref.innerHTML = '<span id="'+this.obj+'link' +'" style="text-decoration:none; font-size:'+this.size+'px; color:'+this.color[i]+'">'+this.news[num]+'</span>'
}
//The fade functions
function b_fadeIn(num,i){
	if (i<this.color.length){
		if (i==0 || bw.ns4) this.newsWrite(num,i)
		else{
			obj = bw.ie4?eval(this.obj+"link"):document.getElementById(this.obj+"link")
			obj.style.color = this.color[i]
		}
		i ++
		setTimeout(this.obj+".fadeIn("+num+","+i+")",this.speed)
	}else setTimeout(this.obj+".fadeOut("+num+","+(this.color.length-1)+")",this.delay)
}

function b_fadeOut(num,i){
	if (i>=0){
		if (i==0 || bw.ns4) this.newsWrite(num,i)	
		else{
			obj = bw.ie4?eval(this.obj+"link"):document.getElementById(this.obj+"link")
			obj.style.color = this.color[i]
		}
		i --
		setTimeout(this.obj+".fadeOut("+num+","+i+")",this.speed)
	}else{
		num ++
		if(num==this.news.length) num=0
		setTimeout(this.obj+".fadeIn("+num+",0)",500)
	}
}
/********************************************************************************************
The init function. Calls the object constructor and set some properties and starts the fade
*********************************************************************************************/
function fadeInit(){
	if (!bw.bw) return
	oNews = new makeNewsObj('divNews','divNewsCont',nFont,nFontsize,"nColor","nNews",nFadespeed,nBetweendelay)
	oNewsCont = new makeNewsObj('divNewsCont')
	if (!bw.opera5) oNews.fadeIn(0,0)
	oNewsCont.css.visibility = "visible"
}

//Calls the init function on pageload. 
//if(bw.bw) onload = fadeInit

