// add as many or as few messages as you would like
var msg=new Array()
msg[0]="<CENTER>Welcome to NJPC WebSite!</CENTER>";
msg[1]="<CENTER>Helping Communities, Help Their Children!</CENTER>";
msg[2]="<CENTER>Thank you for being with us!</CENTER>";
msg[3]="<CENTER>Our Children, Our Future!</CENTER>";

// set your first set of colors.  Use as many or as few as you wish.
//var colors1=new Array("ffffff", "eeeeff", "ddddff", "ccccff", "bbbbff", "aaaaff", "9999ff",
//"8888ff", "7777ff", "6666ff", "5555ff", "4444ff", "3333ff","2222ff", "1111ff", "0000ff")

var colors1=new Array("ffffcc", "ff9966", "ff6600", "cc0000", "993333", "800000")
//set your second set of colors
// *** must have exactly the same number of colors as the array above ***
//var colors2=new Array("ffffff", "ffeeee", "ffdddd", "ffcccc", "ffbbbb", "ffaaaa", "ff9999",
//"ff8888", "ff7777", "ff6666", "ff5555", "ff4444", "ff3333", "ff2222", "ff1111", "ff0000")

var colors2=new Array("ffffcc", "ccffff", "33ccff", "0066cc", "0033cc", "1b3c85")

//set the height of the display in pixels
high=60;

//set the width of the display in pixels
wide=450;

//set the pixel coordinates for the upper left hand corner of the display
Xpos=275;
Ypos=270;

// move the display away from the edges of the background
pad=15;

// set the background color of the display
bgcol="E4E8DA";

//add a background image if you want.
// *** for no image, just leave empty quotes (ex. cellbg=""; ) ***
cellbg="faderbg.jpg";

// set the font
fntFam="verdana,helvetica,arial";
fntSize=12;

// set how how many seconds you want the message to stay remain at totality.
pause=2.5;


// Do not edit these values below!!!

icolor=0;
mcolor=1;
imsg=0;
spWidth=wide-(2*pad);
totality=false;
glowing=true;
var theMsg="";
var cellcontent="";
pause=pause*1000;
if(cellbg.length>4){cellbg=" background="+cellbg}
else{cellbg="";}

function openWin(URL) {
   mapWindow = window.open(URL,
     "mapWin","width=320,height=160,left=0,top=0,scrollbars=no resizable=no");
}

function doPause(){
   totality=false; t=setTimeout("changecolor()",pause);
   }
function initiate(){
  // openWin('display.htm')
  // getContentColor();
  // getMsg();
  // getCellContent();
   if(document.all){
   msgbg.innerHTML=cellcontent;
   msgfade.innerHTML=theMsg;
   msgbg.style.posLeft=Xpos;
   msgbg.style.posTop=Ypos;
   msgfade.style.posLeft=Xpos+pad;
   msgfade.style.posTop=Ypos+pad;
   t=setTimeout("changecolor()",50);}
   if(document.layers){
   document.msgbg.document.write(cellcontent);
   document.msgbg.document.close();
   document.msgfade.document.write(theMsg);
   document.msgfade.document.close();
   document.msgbg.left=Xpos;
   document.msgbg.top=Ypos;
   document.msgfade.left=Xpos+pad;
   document.msgfade.top=Ypos+pad;
   t=setTimeout("changecolor()",100);}
   startscroll()
   }
function changecolor(){
   if(totality==true){doPause();}
   else{
   getMsg();
   getContentColor();
   if(document.all){
   msgfade.innerHTML=theMsg;
   t=setTimeout("changecolor()",50);}
   if(document.layers){
   document.msgfade.document.write(theMsg);
   document.msgfade.document.close();
   t=setTimeout("changecolor()",70);}
   }
   }
function getFadeColor(){
   icolor=icolor-1;
   if(mcolor==1){contentcolor=colors1[icolor];}
   else{contentcolor=colors2[icolor];}
   }
function getGlowColor(){
   icolor=icolor+1;
   if(mcolor==1){contentcolor=colors1[icolor];}
   else{contentcolor=colors2[icolor];}
   }
function changemsg(){
   if(imsg==msg.length-1){imsg=0; mcolor=1;}
   else if(imsg != msg.lenght-1 && mcolor==1){imsg=imsg+1; mcolor=0;}
   else{imsg=imsg+1; mcolor=1;}
   }
function getContentColor(){
   if(icolor==colors1.length-1 && glowing==true){
   getFadeColor(); glowing=false; totality=true;}
   else if(icolor < colors1.length && glowing==true){
   getGlowColor();}
   else if(icolor < 1 && glowing==false){changemsg(); getGlowColor(); glowing=true;}
   else{getFadeColor();}
   }
function getMsg() {
   theMsg="<span style='font-size:"+fntSize+"pt; font-family:"+fntFam+"; width:"+spWidth+";'>"
   theMsg+="<B><font color="+contentcolor+">"+msg[imsg]+"</font></B> "
   theMsg+="</span>"
   }
function getCellContent(){
   cellcontent="<TABLE height="+high+
   " width="+wide+" bgcolor="+bgcol+" cellpadding=0 cellspacing=0><TR><TD"+cellbg+"> </TD></TR></TABLE>"}
   

   //configure the below five variables to change the style of the scroller
var scrollerwidth=380
var scrollerheight=80
var scrollerbgcolor="#E4E8DA"
//var scrollerbgcolor='lightyellow'
//set below to '' if you don't wish to use a background image
var scrollerbackground='scrollerback.gif'

//configure the below variable to change the contents of the scroller
var messages=new Array()
messages[0]="<font face='Arial' size=3><a class=ww1 href='http://www.newjerseyparentscaucus.org/Empowerment.htm'><strong>Eli Lilly & Company Partners with NJPC to Provide Parent's Empowerment Academy to Parents and Caregivers Throughout New Jersey (Click here)</strong></a></font>"
messages[1]="<font face='Arial' size=3 ><a class=ww2  href='http://www.ffcmh.org'><strong>NJPC is named state organization for The Federation of Families For Childrens Mental Health (Click here)</strong></a></font>"
messages[2]="<font face='Arial' size=3 ><a class=ww3 href='http://www.newjerseyparentscaucus.org/htmls/youth_justice_initiative.html'><strong>NJPC Announces Learner's Academy For Children (Click here)</strong></a></font>"
messages[3]="<font face='Arial' size=3 ><a class=ww4 href='http://www.newjerseyparentscaucus.org/asp/custsurvey0.asp'><B>Have you or someone you know ever faced Custody Relinquishment in order to access Mental Health Services in NJ? If so, we need your help by filling out a SURVEY(Click here)</B></a></font>"
//messages[3]="<font face='Arial' size=3 ><a class=ww4 href='http://www.newjerseyparentscaucus.org/htmls/agenda_reg.asp'><B>Save the date!</strong><br>The New Jersey Parents' Caucus 2004 Annual Conference"
///////Do not edit pass this line///////////////////////

if (messages.length>1)
i=3
else
i=0

function move1(whichlayer){
tlayer=eval(whichlayer)
if (tlayer.top>0&&tlayer.top<=5){
tlayer.top=0
setTimeout("move1(tlayer)",3000)
setTimeout("move2(document.main.document.second)",4000)
return
}
if (tlayer.top>=tlayer.document.height*-1){
tlayer.top-=5
setTimeout("move1(tlayer)",100)
}
else{
tlayer.top=scrollerheight
tlayer.document.write(messages[i])
tlayer.document.close()
if (i==messages.length-1)
i=0
else
i++
}
}

function move2(whichlayer){
tlayer2=eval(whichlayer)
if (tlayer2.top>0&&tlayer2.top<=5){
tlayer2.top=0
setTimeout("move2(tlayer2)",4000)
setTimeout("move1(document.main.document.first)",4000)
return
}
if (tlayer2.top>=tlayer2.document.height*-1){
tlayer2.top-=5
setTimeout("move2(tlayer2)",100)
}
else{
tlayer2.top=scrollerheight
tlayer2.document.write(messages[i])
tlayer2.document.close()
if (i==messages.length-1)
i=0
else
i++
}
}

function move3(whichdiv){
tdiv=eval(whichdiv)
if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=5){
tdiv.style.pixelTop=0
setTimeout("move3(tdiv)",4000)
setTimeout("move4(second2)",4000)
return
}
if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){
tdiv.style.pixelTop-=5
setTimeout("move3(tdiv)",100)
}
else{
tdiv.style.pixelTop=scrollerheight
tdiv.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}
}

function move4(whichdiv){
tdiv2=eval(whichdiv)
if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=5){
tdiv2.style.pixelTop=0
setTimeout("move4(tdiv2)",4000)
setTimeout("move3(first2)",4000)
return
}
if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){
tdiv2.style.pixelTop-=5
setTimeout("move4(second2)",100)
}
else{
tdiv2.style.pixelTop=scrollerheight
tdiv2.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}
}

function startscroll(){
if (document.all){
move3(first2)
second2.style.top=scrollerheight
second2.style.visibility='visible'
}
else if (document.layers){
document.main.visibility='show'
move1(document.main.document.first)
document.main.document.second.top=scrollerheight+5
document.main.document.second.visibility='show'
}
}

//window.onload=startscroll
