﻿/***********************************************
* Fading Scroller- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
//var step1 = '<a href="ChildrenArePeopleToo.aspx" style="text-decoration:none;"><img src="media/childrenhandspainted.jpg" style="float:right;margin-right:5px;width:250px;height:175px;border:0;" alt="Girl Paints on Glass" /><h2 style="color:red;">Children Are People Too</h2> This program offers an 8-week support group for children ages 5 to 14 who have been affected by someone that is chemically dependent.</a>';
//var step2 = '<a href="HIVPrevention.aspx" style="text-decoration:none;"><img src="media/redribbon.jpg" alt="Sample Image" width="250" height="175" style="margin-right:5px;padding: 5px;float:right;border:0;" /></span><h3>HIV/AIDS/STD Prevention</h3><strong>SWFAS</strong> is constantly striving to prevent new HIV infections by educating individuals with the facts about HIV/AIDS and ways on how to change their risky behavior. The majority of people with HIV do not know that they are infected with the virus. SWFAS will give you the HIV test free of charge, along with the confidentiality you deserve. It is your responsibility to know your HIV status.</a>';
var step1 = '<a href="ProjectSuccess.aspx" style="text-decoration:none;"><img alt="Young Adults" src="media/juvigroup.jpg" style="float:right;margin-right:5px; width:250px; height:175px;border:0;" /><h3>Project Success</h3> (<b>S</b>chools <b>U</b>sing <b>C</b>oordinated <b>C</b>ommunity <b>E</b>fforts to <b>S</b>trengthen <b>S</b>tudents) is a program designed to prevent and reduce substance abuse use and abuse among high risk, multi-problem adolescents in alternative schools. Project Success links the school to the community’s continuum of care. The adolescents targeted for Project Success are in the middle of the adolescent risk continuum. For the most, an alternative school is their last chance for a non-institutionalized education.</a>';
var step2 = '<a href="BRITE.aspx" style="text-decoration:none;"><img src="media/elderlywomen.jpg" style="margin-right:5px;float:right;width:250px;height:175px;border:0;" alt="" /><h3>What is BRITE?</h3><p>BRITE is an acronym for Brief Intervention and Treatment for Elders. The Florida BRITE Project began in 2004 as a pilot program to address the substance abuse issues of Florida’s elder population. There are multiple BRITE sites throughout Florida. SWFAS BRITE counselors offer evidence-based screening, brief intervention, and referral services to people aged 55 and older presenting with behaviors that are dangerous to one’s health. These behaviors may center around tobacco, alcohol, prescription, and over-the counter medications, or illicit drugs. The SWFAS BRITE Project serves individuals in Lee, Hendry, and Glades counties.</p></a>';
var step3 = '<a href="daretobeyou.aspx" style="text-decoration:none;"><img src="media/pyramidkids.jpg" style="margin-right:5px;float:right;width:250px;height:175px;border:0;" alt="" /><h3>Dare To Be You</h3><strong>"Dare to Be You"</strong> is a program designed to increase positive interactions between parents and their children, through the exploration and building of self-esteem. <strong>"Dare to Be You"</strong> also allows parents to interact with one another, share ideas on how to handle stressful everyday parenting situations and learn new concepts in a positive manner. Program participants are awarded a Certificate of Completion after attending a specified number of sessions.</a>';

//var step6 = '<a href="EarlyRisers.aspx" style="text-decoration:none;"><img src="media/childrenschool_smallsize.jpg" style="margin-right:5px;float:right;width:250px;height:175px;border:0;" alt="" /><h3 style="color:red;">Early Risers Skills for Success</h3>Works to prevent and reduce substance use and abuse among high risk children and adolescents at their attending school. Counselors work with students who are referred for academic and behavioral issues stemming from at-risk behavior displayed in the school setting. These students are at a higher risk for substance use and abuse. The counselors work with these children and adolescents, individually and at times in groups providing drug prevention education, social skill building, referrals and follow-ups with students and families needing further assistance and treatment.</a>';

var step4 = '<a href="childwelfareservice.aspx" style="text-decoration:none;"><img src="media/kidshands.jpg" style="margin-right:5px;float:right;width:250px;height:175px;border:0;" alt="" /><h3>Child Welfare Services</h3><p>In Lee County, approximately 80% of child welfare cases have substance abuse as one of the core factors.  SWFAS works in partnership with the Department of Children and Families to help these families get back on the right track.</p></a>';

var step5 = '<a href="http://ropes.swfas.org" target="_blank" style="text-decoration:none;"><img src="http://www.swfas.org/images/challengeropes.jpg" style="margin-right:5px;float:right;width:250px;height:175px;border:0;" alt="" /><h3>The Challenge Ropes Course</h3> The Challenge Ropes Course is an exhilarating network of cables, poles and ropes, offering a physical and an emotional challenge. The Ropes Course provides a custom-fitted group of activities, which are designed to promote teamwork, fun and to help you leave your comfort zone.  You will be working with your teammates to achieve a mutual goal and to feel a real sense of accomplishment.  A combination of icebreakers, warm ups, and games, provide both low and high challenges.</a>';
var step6 = '<a href="CommunityEducation.aspx" style="text-decoration:none;"><img src="media/kidgroup.jpg" style="margin-right:5px;float:right;width:250px;height:175px;border:0;" alt="" /><h3>Community Education</h3> By providing information we want to increase awareness of the risks associated with alcohol, tobacco, other drugs and additional problem behaviors among people of all ages.</a>';

var step7= '<a href="LifeSkills.aspx" style="text-decoration:none;"><img src="media/employerdirection.jpg" style="margin-right:5px;float:right;width:250px;height:175px;border:0;" alt="" /><h3>LIFE SKILLS</h3> The goal is to assess, assist and empower the individual to acquire necessary skills to interview and search for jobs. We also work on budgeting and critical thinking skills. While engaged with this service, they will receive education in different formats that will add to their quality of life.</a>';
var step8= '<a href="ParentingServices.aspx" style="text-decoration:none;"><img src="media/parentingfamily_small.jpg" style="margin-right:5px;float:right;width:250px;height:175px;border:0;" alt="" /><h3>Parenting Services</h3> The Real Life Parenting Skills Program – A parenting program specifically designed for parents who are recovering from addiction with children ages 5 and older. </a>';

var step9= '<a href="http://swfasprevention.org/catalog/" target="_blank" style="text-decoration:none;"><img src="http://swfasprevention.org/catalog/images/book1.jpg" style="margin-right:5px;float:right;width:250px;height:175px;border:0;" alt="" /><h3>Resource Library</h3> SWFAS has informational and preventional material available for adults and kids on: addiction, drugs, alcohol, tobacco, STD\'s and more!</a>';

var delay = 10000; //set delay between message change (in miliseconds)
var maxsteps=30; // number of steps to take to change from start color to endcolor
var stepdelay=40; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor= new Array(255,255,255); // start color (red, green, blue)
var endcolor=new Array(0,0,0); // end color (red, green, blue)

var fcontent=new Array();
begintag='<div style="font: normal 14px Arial; padding: 15px;">'; //set opening tag, such as font declarations

fcontent[0]=step1;
fcontent[1]= step2;
fcontent[2]= step3;
fcontent[3]= step4;
fcontent[4]= step5;
fcontent[5]= step6;
fcontent[6]= step7;
fcontent[7]= step8;
fcontent[8]= step9;
//fcontent[0]=step1;
//fcontent[1]=step2;
//fcontent[5]= step6;
closetag='</div>';

var fwidth='600px'; //set scroller width
var fheight='300px'; //set scroller height

var fadelinks=1;  //should links inside scroller content also fade like text? 0 for no, 1 for yes.

///No need to edit below this line/////////////////


var ie4=document.all&&!document.getElementById;
var DOM2=document.getElementById;
var faderdelay=0;
var index=0;


/*Rafael Raposo edited function*/
//function to change content
function changecontent(){
  if (index>=fcontent.length)
    index=0
  if (DOM2){
    document.getElementById("fscroller").style.color="rgb("+startcolor[0]+", "+startcolor[1]+", "+startcolor[2]+")"
    document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag
    if (fadelinks)
      linkcolorchange(1);
    colorfade(1, 15);
  }
  else if (ie4)
    document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag;
  index++
}

// colorfade() partially by Marcio Galli for Netscape Communications.  ////////////
// Modified by Dynamicdrive.com

function linkcolorchange(step){
  var obj=document.getElementById("fscroller").getElementsByTagName("A");
  if (obj.length>0){
    for (i=0;i<obj.length;i++)
      obj[i].style.color=getstepcolor(step);
  }
}

/*Rafael Raposo edited function*/
var fadecounter;
function colorfade(step) {
  if(step<=maxsteps) {	
    document.getElementById("fscroller").style.color=getstepcolor(step);
    if (fadelinks)
      linkcolorchange(step);
    step++;
    fadecounter=setTimeout("colorfade("+step+")",stepdelay);
  }else{
    clearTimeout(fadecounter);
    document.getElementById("fscroller").style.color="rgb("+endcolor[0]+", "+endcolor[1]+", "+endcolor[2]+")";
    setTimeout("changecontent()", delay);
	
  }   
}

/*Rafael Raposo's new function*/
function getstepcolor(step) {
  var diff
  var newcolor=new Array(3);
  for(var i=0;i<3;i++) {
    diff = (startcolor[i]-endcolor[i]);
    if(diff > 0) {
      newcolor[i] = startcolor[i]-(Math.round((diff/maxsteps))*step);
    } else {
      newcolor[i] = startcolor[i]+(Math.round((Math.abs(diff)/maxsteps))*step);
    }
  }
  return ("rgb(" + newcolor[0] + ", " + newcolor[1] + ", " + newcolor[2] + ")");
}

if (ie4||DOM2)
  document.write('<div id="fscroller" style="background: url(media/program_background.jpg);border:0px solid black;width:'+fwidth+';height:'+fheight+'"></div>');

if (window.addEventListener)
window.addEventListener("load", changecontent, false)
else if (window.attachEvent)
window.attachEvent("onload", changecontent)
else if (document.getElementById)
window.onload=changecontent