// JavaScript Document
var delay = 7500; //set delay between message change (in miliseconds)
var maxsteps=200; // number of steps to take to change from start color to endcolor
var stepdelay=30; // 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 13px Arial;  text-align: justify; padding: 5px; margin-left: 5px;">'; //set opening tag, such as font declarations
fcontent[0]="<br><br><br><br><br><div id=\"scroll\" class=\"triangle-isosceles bottom\" style=\" margin-top: -87px; padding: 30px;\"><b>Saved from Foreclosure</b><br><br>I had hired a local attorney who could do nothing for me except to say I would have to pay them or else. I had IRS and State tax liens, and a judgment for $172,000. With your help and expertise you negotiated my tax liabilities away and saved my home from foreclosure.<br><br><b><div id=\"testis\" style=\"font-family: Verdana,Georgia,Arial,Times,serif; font-style: normal; font-size: 10px; text-align: right; letter-spacing: .9px;\">-Restaurant Owner</b></div>";
fcontent[1]="<br><br><br><br><br><div id=\"scroll\" class=\"triangle-isosceles bottom\" style=\" margin-top: -87px; padding: 30px;\"><b>$18,000 in Tax Liens— Eliminated</b><br><br>When we first got together, the IRS had filed tax liens for back taxes amounting to nearly $18,000. With your help, the full amount of these assessments were eliminated.<br><br><b><div id=\"testis\" style=\"font-family: Verdana,Georgia,Arial,Times,serif; font-style: normal; font-size: 10px; text-align: right; letter-spacing: .9px;\">-Individual Wage Earner</div></b></div>";
fcontent[2]="<br><br><br><br><br><div id=\"scroll\" class=\"triangle-isosceles bottom\" style=\" margin-top: -87px; padding: 30px;\"><b>Company Rescued</b><br><br>I thought I could handle the problem myself, later an attorney recommended filing bankruptcy, BIG MlSTAKE ... it cost my company thousands and thousands of dollars which could have reduced my tax debt. No one was able to help. Finally I went to Equity Search and you were able to save my company.<br><br><b><div id=\"testis\" style=\"font-family: Verdana,Georgia,Arial,Times,serif; font-style: normal; font-size: 10px; text-align: right; letter-spacing: .9px;\">-Printing Company Owner</div></b></div>";
closetag='</div>';

var fwidth='270px'; //set scroller width
var fheight='270px'; //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="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
