﻿/********************************************************************************
This script is made by and copyrighted to Thomas Brattli at www.bratta.com
Visit for more great scripts. 
This may be used freely as long as this msg is intact!
********************************************************************************
Browsercheck:*/
ie=document.all?1:0
n=document.layers?1:1

/********************************************************************************
Here are the variables you must set: (this is the only part you have to change)

Remember tho, if you wan't different size for the layers, different clip or anything
change that in the stylesheet.
*/

//The delay between the fades (in milliseconds) smaller value gives less time:
betweendelay=2000

//Do you wan't it to start over on the first one when it's gone trought all the news?
//(set to 0 if not)
var loop=1

//What font do you wan't it use?
FontFace='arial,helvetiva'

//What font-size (in pixel)?
FontSize=18

//Do you wan't it to fade out aswell? 1 for on, 0 for off
fadeback=1

//Set the colors, first color is same as background, last color is the color it stops at:
//You can have upto 7 colors, set the ones you wan't use to 0
colors=new Array()
colors[0]='#000063'
colors[1]=0;//'#332363'
colors[2]=0;//'#554563'
colors[3]=0;//'#886863'
colors[4]=0;//'#AA8A63'
colors[5]=0;//'#CCAC63'
colors[6]=0;//'#FFCF63'

//This is the news you wanna have, set the link and the text. If you don't wan't it to link anywhere
//use a # as the link
news=new Array()
//Copy there three lines and change the info and numbers to get more news.

news[0]=new Array()
news[0]["text"]="<img src='templatebannerimages/0short.jpg' width='400' height='92'border='0'>"
news[0]["link"]="http://www.etsu.edu/math/gardner/stooges/SHEMP.htm"

news[1]=new Array()
news[1]["text"]="<img src='templatebannerimages/1short.jpg' width='400' height='92' border='0'>"
news[1]["link"]="http://www.etsu.edu/math/godbole/gk12/gk12description.htm"

news[2]=new Array()
news[2]["text"]="<img src='templatebannerimages/2short.jpg' width='400' height='92' border='0'>"
news[2]["link"]="http://www.etsu.edu/math/seier/consuser.htm"

news[3]=new Array()
news[3]["text"]="<img src='templatebannerimages/3short.jpg' width='400' height='92' border='0'>"
news[3]["link"]="http://www.etsu.edu/math/alumni.htm"

news[4]=new Array()
news[4]["text"]="<img src='templatebannerimages/4short.jpg' width='400' height='92' border='0'>"
news[4]["link"]="http://www.etsu.edu/symbiosis/"

news[5]=new Array()
news[5]["text"]="<img src='templatebannerimages/5short.jpg' width='400' height='92' border='0'>"
news[5]["link"]="http://www.etsu.edu/math/Math-Honors/hontable.htm"

news[6]=new Array()
news[6]["text"]="<img src='templatebannerimages/6short.jpg' width='400' height='92' border='0'>"
news[6]["link"]="http://www.etsu.edu/math/"

news[7]=new Array()
news[7]["text"]="<img src='templatebannerimages/7short.jpg' width='400' height='92' border='0'>"
news[7]["link"]="http://www.etsu.edu/math/gradi.htm"

news[8]=new Array()
news[8]["text"]="<img src='templatebannerimages/8short.jpg' width='400' height='92' border='0'>"
news[8]["link"]="http://www.etsu.edu/math/gardner/stooges/stooges-statistics.htm"

news[9]=new Array()
news[9]["text"]="<img src='templatebannerimages/9short.jpg' width='400' height='92' border='0'>"
news[9]["link"]="http://www.etsu.edu/teqb/"

/*Dont change anything below this!
*********************************************************************************/
fadeInit=new Function("oNews=new makeObj('divNews','divCont'); fadeNews(0)")
function makeObj(obj,nest){
    objid = document.getElementById(obj);
    //nest=(!nest) ? '':'document.'+nest+'.';
    this.css=(n) ? document.getElementById(nest):objid.style; 
    this.writeref=(n) ? document.getElementById(nest):objid ;		
	this.fadeIt=b_fadeIt
    this.obj = obj + "Object"; 	eval(this.obj + "=this");	
}
function b_fadeIt(text,link,font,size,speed,fn,num,c0,c1,c2,c3,c4,c5,c6){
	if(num<arguments.length && arguments[num]!=0){
		writetext='<a href="'+link+'" style="text-decoration:none; font-size:'+size+'px">'
		+'<font face="'+font+'" color="'+arguments[num]+'">'+text+'</font></a>'
		//if(n){this.writeref.write(writetext); this.writeref.close()}
		if(ie || n) this.writeref.innerHTML=writetext		
		num++; 
		setTimeout(this.obj+'.fadeIt("'+text+'","'+link+'","'+font+'",'+size+','+speed+',"'
		+fn+'",'+num+',"'+c0+'","'+c1+'","'+c2+'","'+c3+'","'+c4+'","'+c5+'","'+c6+'")',speed)
	}else setTimeout('eval('+fn+')',betweendelay)
}
function fadeNews(num){
	if(num<news.length){
		fn=fadeback?'fadeBack('+num+')':'fadeNews('+(num+1)+')';
		oNews.fadeIt(news[num]["text"],news[num]["link"],FontFace,FontSize,100,fn,7,
		colors[0],colors[1],colors[2],colors[3],colors[4],colors[5],colors[6])
	}else if(loop)fadeNews(0)
}
function fadeBack(num){
	if(num>=0){
		oNews.fadeIt(news[num]["text"],news[num]["link"],FontFace,FontSize,200,'fadeNews('+(num+1)
		+')',7,colors[6],colors[5],colors[4],colors[3],colors[2],colors[1],colors[0])
	}
}
onload=fadeInit;

/*End of fadescript
**********************************************************************************/

