/***********************************************
* 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 = 20000; //set delay between message change (in miliseconds)
var maxsteps=200; // number of steps to take to change from start color to endcolor
var stepdelay=15; // 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(105,127,108); // end color (red, green, blue)

//var endcolor= new Array(254,214,58); // start color (red, green, blue)
//var startcolor=new Array(0,0,0); // end color (red, green, blue)


var fcontent=new Array();
begintag='<div style="margin: 0px 20px 0px 20px; text-align:justify">'; //set opening tag, such as font declarations
fcontent[0]="<p>&quot;I have been in the heavy construction industry for over 35 years and have estimated work all over the world using about every type of estimating system one could think of starting with the old columnar pad and pencil and a frieden calculator to the new computer programs such as Timberline, Hard Dollar, EMC2 and the brand new HCSS for windows program, without a doublt the SHARPE ESTIMATOR beats them all!<br><br>After installing the program, reading some of the program manual, punching some buttons to see what would happen it was off the next day to do an estimate for real!&nbsp; It's great!&nbsp; Makes me glad we sent our previous estimating program back to the suppliers, (2 months without a usable estimate) as we were still trying &quot;to load it&quot; with our information&quot;.</p><p align=right><b>Larry E. Cowell</b><br>Chief Estimator<br>T.G. Phillips Engineering<br>Underground Piping Systems</p>";
fcontent[1]="<p>&quot;I wanted to let you and potential buyers know how much I like Sharpe Estimating Software.&nbsp; I have been using Sharpe for almost two years now and I could not go back to my old estimating program.&nbsp; In fact, I made the purchase of Sharpe Software a condition of my employment here at American (we ended up buying six copies).</p><p>The features I like most about Sharpe are its ease of use, it's flexibility and how it works like most estimators think.&nbsp; Sharpe was very easy for me to learn and it has been very easy for me to train the other estimators in our office.&nbsp; Most estimators should be able to bid a job with about an hour of training.&nbsp; This is not to say I know every feature of the program.&nbsp; I am constantly learning new features of the program that make my job easier&quot;.</p><p align=right><b>Keith D. Kenworthy</b><br>Chief Estimator<br>American Engineering &amp; Asphalt, Inc.</p>";
fcontent[2]="<p>&quot;I have tried to learn and program HCSS's estimating software their \"way\" with very little success.&nbsp; I tried to setup some of the modules the way I wanted to used the program with no success.&nbsp; I gave up and tried a different approach.</p><p>We as estimators need a system that is flexible.&nbsp; To adjust and move with each and every individual estimator, something that is user friendly; all estimators are not created equal.</p><p>Thank you for providing us with this type of software along with an excellent support group&quot;.</p><p align=right><b>Bob Barton</b><br>Chief Executive Officer<br>Bayview - General Engineering, Inc.</p>"; //Other estimators that I'm acquainted with as well as myself feel that an estimating program must be easy, flexible, user friendly, forgiving, fun to use, visual, and produces accurate estimates.
closetag='</div>';


//var fwidth='150px'; //set scroller width
//var fheight='150px'; //set scroller height

var fadelinks=0;  //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;
var index=Math.round(Math.random()*2);


/*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"></div>');

if (window.addEventListener)
window.addEventListener("load", changecontent, false)
else if (window.attachEvent)
window.attachEvent("onload", changecontent)
else if (document.getElementById)
window.onload=changecontent
