var scrollerwidth=250
var scrollerwidth2=233
var scrollerheight=40
var scrollerbgcolor='#000000'
var pausebetweenimages=5000
var pausetoshow=5000
var times;
var slidetexts=new Array()

//    slidetexts[0]='<font class="text1">Extra! Extra! Read all about it. Check out the latest YMCA Headlines. <a href="what/news.htm" class="c2">   &lt;more details&gt;</a></font>'
    slidetexts[0]='<font class="text1">Anaheim Achieves. Keeping more than 4,500 kids safe after school each day with academic, enrich- ment and recreational activities. <a href="service/anaheim.htm" class="c2"> &lt;more details&gt;</a></font>'
	slidetexts[1]='<font class="text1">Join our mailing list for all the latest Y news. &nbsp;&nbsp;&nbsp;<a href="javascript:timeWin(\'cont/online.htm\')" class="c2">   &lt;more details&gt;</a></font>'
	//slidetexts[2]='<font class="text1">Serve your community and earn an educational award. Become an AmeriCorps member. <a href="get/ameri.htm" class="c2"> &lt;more details&gt;</a></font>'
	slidetexts[2]='<font class="text1">Make a BIG difference in the life of a small child. Become a mentor or volunteer. <a href="get.htm" class="c2"> &lt;more details&gt;</a></font>'
	//slidetexts[5]='<font class="text1">Learn what\'s happening at the Anaheim Family YMCA. Read the latest YMCA newsletter online.<a href="what.htm" class="c2">  &lt;more details&gt;</a></font>'
	slidetexts[3]='<font class="text1">The YMCA is a premier employer. Learn about current job openings and join the YMCA family.<a href="employ.htm" class="c2"> &lt;more details&gt;</a></font>'
	slidetexts[4]='<font class="text1">The YMCA depends on charitable support from the community. Discover how you can make a difference.&nbsp;&nbsp;&nbsp;<a href="contri.htm" class="c2"> &lt;more details&gt;</a></font>'
	//slidetexts[7]='<font class="text1">Y Youth Sports Sign-ups are now available online.  &nbsp;&nbsp;&nbsp;<a href="http://www.signupthekids.com/parents/business-schedule-view.cfm?bid=648" target="signup" class="c2"> &lt;View the Schedule and Sign Up for Now&gt;</a></font>'

if (slidetexts.length>2){
times=2
} else if (slidetexts.length<2){
	   slidetexts[1]= ''
		times=0
} else{
		times=0
}

function move1(whichlayer){
tlayer=eval(whichlayer)
if (tlayer.top>0&&tlayer.top<=5){
tlayer.top=0
setTimeout("move1(tlayer)",pausetoshow)
setTimeout("move2(document.main.document.second)",pausebetweenimages)
return
}
if (tlayer.top>=(tlayer.document.height + 20)*-1){
tlayer.top-=3
setTimeout("move1(tlayer)",80)
}
else{
tlayer.top=60
tlayer.document.write(slidetexts[times])
tlayer.document.close()
if (times==slidetexts.length-1)
times=0
else
times++
}
}

function move2(whichlayer){
tlayer2=eval(whichlayer)
if (tlayer2.top>0&&tlayer2.top<=5){
tlayer2.top=0
setTimeout("move2(tlayer2)",pausetoshow)
setTimeout("move1(document.main.document.first)",pausebetweenimages)
return
}
if (tlayer2.top>=(tlayer2.document.height + 20)*-1){
tlayer2.top-=3
setTimeout("move2(tlayer2)",80)
}
else{
tlayer2.top=60
tlayer2.document.write(slidetexts[times])
tlayer2.document.close()
if (times==slidetexts.length-1)
times=0
else
times++
}
}

function move3(whichdiv){
tdiv=eval(whichdiv)
if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=5){
tdiv.style.pixelTop=0
setTimeout("move3(tdiv)",pausetoshow)
setTimeout("move4(second2)",pausebetweenimages)
return
}
if (tdiv.style.pixelTop>=(tdiv.offsetHeight + 20)*-1){
tdiv.style.pixelTop-=3
setTimeout("move3(tdiv)",80)
}
else{
tdiv.style.pixelTop=60
tdiv.innerHTML=slidetexts[times]
if (times==slidetexts.length-1)
times=0
else
times++
}
}

function move4(whichdiv){
tdiv2=eval(whichdiv)
if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=5){
tdiv2.style.pixelTop=0
setTimeout("move4(tdiv2)",pausetoshow)
setTimeout("move3(first2)",pausebetweenimages)
return
}
if (tdiv2.style.pixelTop>=(tdiv2.offsetHeight + 20)*-1){
tdiv2.style.pixelTop-=3
setTimeout("move4(second2)",80)
}
else{
tdiv2.style.pixelTop=60
tdiv2.innerHTML=slidetexts[times]
if (times==slidetexts.length-1)
times=0
else
times++
}
}

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

function addnewsIE(){
if (document.all){
document.writeln('<span id="main2" style="position:absolute;left:0;top:308;width:'+scrollerwidth+';height:'+scrollerheight+'; overflow:hiden;background-color:'+scrollerbgcolor+'">')
document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0;top:0">')
document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:11;top:1;">')
document.write(slidetexts[0])
document.writeln('</div>')
document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:11;top:0">')
document.write(slidetexts[1])
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</span>')
}
}

function addnewsNS(){
if (document.layers){
document.writeln ("<ilayer name='main' left=0  top=0 width=" + scrollerwidth2 +" height="+scrollerheight+" bgColor="+scrollerbgcolor+" visibility=hide>");
document.writeln ("<layer id='first' left='11' top='1' width='"+scrollerwidth2+"';>");
document.write(slidetexts[0]);
document.writeln ("</layer>");
document.writeln("<layer id='second' left='11' top='0' width='"+scrollerwidth2+"'; visibility='hide'>");
document.write(slidetexts[1]);
document.writeln("</layer>");
document.writeln("</ilayer>");
}
}

function timeWin(url) {

     remote=window.open(url,'timelineWin','height=450,width=520,alwaysLowered=0,alwaysRaised=0,channelmode=0,dependent=1,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=1,scrollbars=1,status=0,titlebar=0,toolbar=0,z-lock=0');
     if (!remote.opener) 
                        remote.opener = self;
         if (window.focus)
                remote.focus();  
}