// test javascript file

//Neon Lights Text II by G.P.F. (gpf@beta-cc.de)
//visit http://www.beta-cc.de
//Visit http://www.dynamicdrive.com for this script 
function doneon(mess){
var a=new neon1(mess);
a.out();
}

function neon1(mess){
this.message=mess //"NOVEMBER - Lodge Giveaway WINNER - Nathan Griffith!"
}

neon1.prototype.out=function(){
this.setup();
this.n=0
if (document.all||document.getElementById){
document.write('<font color="'+this.neonbasecolor+'">')
for (this.m=0;this.m<this.message.length;this.m++)
document.write('<span id="neonlight'+this.m+'">'+this.message.charAt(this.m)+'</span>')
document.write('</font>')
}
else {document.write(this.message)}
this.beginneon()
}

neon1.prototype.crossref = function(number){
crossobj=document.all? eval("document.all.neonlight"+number) : document.getElementById("neonlight"+number)
return crossobj
}

neon1.prototype.neon = function(){
var self=this;
//Change all letters to base color
if (this.n==0){
for (this.m=0;this.m<this.message.length;this.m++)
this.crossref(this.m).style.color=this.neonbasecolor
}

//cycle through and change individual letters to neon color
this.crossref(this.n).style.color=this.neontextcolor

if (this.n>this.flashingletters-1) this.crossref(this.n-this.flashingletters).style.color=this.neontextcolor2 
if (this.n>(this.flashingletters+this.flashingletters2)-1) this.crossref(this.n-this.flashingletters-this.flashingletters2).style.color=this.neonbasecolor


if (this.n<this.message.length-1)
this.n++
else{
this.n=0
clearInterval(this.flashing)
setTimeout(function(){self.beginneon();},this.flashpause)
return
}

}

neon1.prototype.beginneon = function(){
var self=this;
if (document.all||document.getElementById)
this.flashing=setInterval(function(){self.neon();},this.flashspeed)
}

neon1.prototype.setup=function(){
this.neonbasecolor="#B6121A"
this.neontextcolor="#426A89"
this.neontextcolor2="yellow"
this.flashspeed=100						// speed of flashing in milliseconds
this.flashingletters=3						// number of letters flashing in neontextcolor
this.flashingletters2=1						// number of letters flashing in neontextcolor2 (0 to disable)
this.flashpause=0						// the pause between flash-cycles in milliseconds
///No need to edit below this line/////
}
