/***********************************************
* 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]='"Marlene, I wanted to thank you very much for assisting me in finding a job.  You have been so thoughtful and kind to me.  I will definitely mention your firm to anyone that is looking for a new job.  Thanks again Marlene!"<br />- <em><strong>Mary S.</strong></em>';
fcontent[1]='"Marlene, I have been extremely impressed by your knowledge, professionalism and straight forward responses to any questions I have had.  My original skepticism regarding your client\'s opportunity has turned into intrigue due to comments you shared about the organization. Please keep me informed of any developments regarding this opportunity. Thanks again for thinking of me and for taking the time to enlighten me and change my preconceived notions."<br />- <em><strong>Michelle C.</strong></em>';
fcontent[2]='"Marlene is always very good at understanding our needs and finding the right candidates - even when we change our minds."<br />- <em><strong>Consulting Firm</strong></em>';
fcontent[3]='"I am writing to tell you what a pleasure it has been working with your company and especially Marlene Miller.  Earlier this year when I ran an ad in the newspaper for a Sales Account Executive, I received a call from Marlene. What a wonderful surprise as she had read our ad and decided to see if she could be of assistance in finding us a good candidate in the Cedar Rapids Area. I agreed reluctantly to let her help me but have always hesitated to work with a recruiter and pay those fees!  Marlene did a thorough job of gathering information from me about the position and arranged for interviews at your office. We were treated like royalty and found several very qualified candidates. Needless to say, we hired from that group and are extremely happy with the results.<br>I am very impressed with Management Recruiters of Cedar Rapids and feel your company has gone the extra mile to help us find excellent employees! The fee seems very small when I see what you have done for our company. I look forward to working with Management Recruiters of Cedar Rapids on our next hire.<br>Thanks again for the privilege of working with your company. Your whole staff is very professional and you definitely find the right candidates to fit a position."<br />- <em><strong>Office Furniture Company</strong></em>';
fcontent[4]='"Just a note to say thank you for all your hard work assembling candidates for us.  We\'ve been very pleased with Melissa\'s progress in training.  Your insight into our needs was very valuable and appreciated."<br />- <em><strong>Sue E.<br />Office Manager<br />Consulting Firm</strong></em>'
fcontent[5]='"Thank you for all your time and efforts in finding me a position within an organization in which I believe will allow me to grow both professionally and personally.  You have made my job search less stressful and a positive experience for me."<br />- <em><strong>Jenny H.</strong></em>'
fcontent[6]='"Just wanted to share with you that today in the staff meeting, Julie was specifically recognized for all the hard work she did related to our  clients\'  Fiscal Year End....getting all the bills out the door....keeping a very important customer happy. She is EXACTLY what I needed, and we are so glad to have her.  Thanks for finding her for us!"<br />- <em><strong>President, Technology Company</strong></em>'
fcontent[7]='"Thank you so much for giving me the opportunity to work with a company that understands and shares my conviction to customer service.  I am so looking forward to Monday!<br /><br />Also, thank you for your wonderful and professional approach to helping those like myself find a match.  You are, simply, wonderful."<br />- <em><strong>Jill, Administrative Assistant</strong></em>'
closetag='</div>';

fcontent[8]='"Marlene Miller has done a wonderful job. Our positions tend to be difficult to pinpoint. She has worked hard to really understand the dynamics of our corporate structure and office culture. We appreciate her efforts."<br />- <em><strong>Consulting Firm</strong></em>'
closetag='</div>';

fcontent[9]='"Marlene recently assisted me in the interview process with an MRI customer.  This customer was very thorough in their screening and interviewing.  Marlene’s communication was outstanding!<br /><br />In all situations, even those where someone is not placed on a new job, there is great value in the work that Marlene and all your associates do.  That value for me became  a sense of increased confidence and professionalism when approaching a prospective employer.  This benefit came as a result of the excellent coaching and preparation Marlene did with me."<br />- <em><strong>Corporate Trainer</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
}