/***********************************************
* 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 delay = 4000; //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(194,194,194); // start color (red, green, blue)
var endcolor=new Array(0,0,0); // end color (red, green, blue)

var fcontent=new Array();
begintag=''; //set opening tag, such as font declarations
fcontent[0]='<div class="newsheadline"><a href="http://www.reqwired.org/reqwired/resources/law/summary_165.jsp#approved">Alaska</a>: 12/6/07</div><div class="newsheadline"><a href="http://www.reqwired.org/reqwired/resources/law/summary_110.jsp#approved">Wisconsin</a>: 1/11/08</div><div class="newsheadline"><a href="http://www.reqwired.org/reqwired/resources/law/summary_45.jsp#approved">Kentucky</a>: 2/1/08</div><div class="newsheadline"><a href="http://www.reqwired.org/reqwired/resources/law/summary_167.jsp#approved">Oklahoma</a>: 7/3/08</div><div class="newsheadline"><a href="http://www.reqwired.org/reqwired/resources/law/summary_84.jsp">Oregon</a>: 3/20/08</div><div class="newsheadline"><a href="http://www.reqwired.org/reqwired/resources/law/summary_89.jsp">Tennessee</a>: 3/4/08</div>';
fcontent[1]='<span class="newsheadline">Alaska: 12/6/07</span><div class="newsstory">Effective 1/1/2008, Alaska will have a Mandatory Ethics Continuing Legal Education requirement.  3 Hours of Ethics must be obtained every year and at least 9 hours of Voluntary CLE are still encouraged.</div><div class="newslink"><a href="http://www.reqwired.org/reqwired/resources/law/summary_165.jsp#approved">More details</a></div>';
fcontent[2]='<span class="newsheadline">Wisconsin: 1/11/08</span><div class="newsstory">Those who are practicing law in another juristiction but are barred in Wisconsin do not need to abide by the Wisconsin CLE requirements but must still abide by the reporting requirements.</div><div class="newslink"><a href="http://www.reqwired.org/reqwired/resources/law/summary_110.jsp#approved">More details</a></div>';
fcontent[3]='<span class="newsheadline">Kentucky: 2/1/08</span><div class="newsstory">Time allowed for the completion of the New Attorney requirement may, upon written application, be extended.  The application must be received by the Commission no later than 30 days after the end of the new attorney period.</div><div class="newslink"><a href="http://www.reqwired.org/reqwired/resources/law/summary_45.jsp#approved">More details</a></div>';
fcontent[4]='<span class="newsheadline">Oklahoma: 7/3/08</span><div class="newsstory">The amount of On Demand learning credit which can be claimed has been raised from 3 to 6 as well as expanding acceptable On demand classes to include audio based courses.</div><div class="newslink"><a href="http://www.reqwired.org/reqwired/resources/law/summary_167.jsp#approved">More details</a></div>';
fcontent[5]='<span class="newsheadline">Oregon: 3/20/08</span><div class="newsstory">For periods ending 12/31/2009 and after, The Elimination of Bias requirement has been replaced by an every other period Access to Justice requirement.</div><div class="newslink"><a href="http://www.reqwired.org/reqwired/resources/law/summary_84.jsp">More details</a></div>';
fcontent[6]='<span class="newsheadline">Tennessee: 3/4/08</span><div class="newsstory">The amount of Distance Learning credit which can be claimed per period has been raised from 6 to 8 credits</div><div class="newslink"><a href="http://www.reqwired.org/reqwired/resources/law/summary_89.jsp#approved">More details</a></div>';
closetag='';

var fwidth='220px'; //set scroller width
var fheight='175px'; //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="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