/***********************************************
* 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 = 10000; //set delay between message change (in miliseconds)
var maxsteps=50; // 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 11px verdana; padding:7px 0px;">'; //set opening tag, such as font declarations
fcontent[0]='"In my 17+ years of Human Resources, I have hired many types of employees.  The industry I work in now requires talent and skill from Ph.D levels, scientific, strategic to information technology, marketing and receptionist.  I have always received the very best candidates from Sarah.  She has excellent understanding of each position and, just as importantly, how that position relates to the overall structure and success of the company.  She is easy to work with, demonstrates the highest integrity and has added value in the form of superior candidates and hires for many years now."<br />- <em><strong>Human Resources Director Manufacturing</strong></em>';
fcontent[1]='"Sarah was very thorough in finding out what I truly wanted from my career and then found me a position that met my needs.  I was so impressed with her professionalism and follow-up that I recommended her to my husband.  In less than a month Sarah was able to place my husband.<br /><br />Sarah\'s word was gold; if she made a commitment whether finding out information or letting us know the status on an interview, she called us when she said she would and even took the time to call us from her home if she was unable to reach us personally.  We truly appreciated her going the extra mile for us and at the same time, never making us feel as if we were bothering her.   As I said, Sarah really took care of us and I have recommended her to many of my friends and will continue to do so in the future.  She is a great ambassador for your organization!"<br />- <em><strong>Julie W., Human Resources</strong></em>';
fcontent[2]='"I want to thank you and the staff of Management Recruiters of Cedar Rapids for finding an exceptional employee for the organization.  For six months we had advertised and bet the bushes nationally and locally for a senior development officer to add to our fund raising staff and had not found anyone that fit the bill.  I was delighted when several of the museum\'s trustees suggested Management Recruiters of Cedar Rapids and I began to have renewed optimism when Cindy Lyness and Sarah Fare so clearly understood the type of person we were looking for.  Nevertheless, I was both amazed and grateful when you successfully located the perfect candidate for our needs and then helped us in the hiring process.  I could not be more pleased with the process and the outcome."<br />- <em><strong>Executive Director<br />Non-Profit Organization</strong></em>';
fcontent[3]='"Thank you for helping me find and start a new career.  You do a wonderful job as a recruiter/account manager!  I can understand why you have won all those awards.  Your counsel and advice have been very much appreciated and it helped to make this life change not so daunting.  Thanks again!"<br />- <em><strong>Cheree<br />Sales Representative</strong></em>';
fcontent[4]='"Sarah,<br />I wanted to thank you for your time and hard work toward finding the right job for me.  I am very excited to start my new job that I consider a great opportunity in my professional careers.<br /><br />It has been a real pleasure and honor to work with you.  I will not hesitate to tell about you to others that may need your services, you are incredible amazing at what you do!"';
fcontent[5]='"Thank you, Sarah, you have helped me out tremendously and I am so thankful for your call to help me find the perfect job.  I was in a rough spot and you came to my RESCUE!!  I am really starting to settle in and get to know everyone.  With much appreciation!"<br />- <em><strong>Inside Sales Representative</strong></em>';
fcontent[6]='"I understand that you are batting 1.000. Hiring Manager says he has hired for two positions and a candidate for the third position will visit us in CR later this week.<br><br>That was a tough job in a tight market, so thank you!<br><br>Enjoy some time off tomorrow, hopefully far away from the telephone."<br><br>All the best,<br>- <em><strong>VP Marketing</strong></em>';
fcontent[7]='"Just want to drop a note to say thank you.  I really appreciate all of the assistance you have provided and for getting me the interviews at your client.  I really felt like you went above and beyond to do everything you could to make sure that I had all the information I needed and felt comfortable with everything.  I also really appreciate your taking the time to talk with me after hours since it was hard for me to talk during the day.<br><br>I am extremely excited about  my new job!"<br><br>Thank you again,<br>- <em><strong>Human Resources Manager- Manufacturing Company</strong></em>';
fcontent[8]='"Our company has worked with Sarah for several years now.  I consider her to be our committed partner.  Sarah has taken the time to truly understand our business and to become acquainted with our staff in order to identify the best candidates for hire.  She has an appreciation for the core values of our company and our employee ownership culture.  Sarah is a great problem solver  and critical thinker.  She is a very important member of our team!"<br><br>- <em><strong>RN, CCM<br>Chief Operations Officer<br>Healthcare</strong></em>';

closetag='</div>';

var fwidth='400px'; //set scroller width

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;


function getIndex() {
	var range = fcontent.length;
	var ph = Math.floor(Math.random() * range);
	return ph;
}

/*Rafael Raposo edited function*/
//function to change content
function changecontent(){
	
  index=getIndex();

  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);
  }
  else if (ie4) {
    document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag;
  }

  /*
  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);
  }
  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("colorfadeout(maxsteps)", delay);
	
  }   
}

var fadecounter2;
function colorfadeout(step) {
  if(step>=0) {	
    document.getElementById("fscroller").style.color=getstepcolor(step);
    if (fadelinks)
      linkcolorchange(step);
    step--;
    fadecounter2=setTimeout("colorfadeout("+step+")",stepdelay);
  }else{
    clearTimeout(fadecounter2);
    document.getElementById("fscroller").style.color="rgb("+endcolor[0]+", "+endcolor[1]+", "+endcolor[2]+")";
	changecontent();
    //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] + ")");
}

function fadeText() {
	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
}