
var quotes = new Array();
quotes[quotes.length] = 'The reason a dog has so many friends is that he wags his tail instead of his tongue.';
quotes[quotes.length] = 'Don\'t accept your dog\'s admiration as conclusive evidence that you are wonderful.';
quotes[quotes.length] = 'If there are no dogs in Heaven, then when I die I want to go where they went.';
quotes[quotes.length] = 'There is no psychiatrist in the world like a puppy licking your face.';
quotes[quotes.length] = 'A dog is the only thing on earth that loves you more than he loves himself.';
quotes[quotes.length] = 'The average dog is a nicer person than the average person.';
quotes[quotes.length] = 'We give dogs time we can spare, space we can spare and love we can spare. And in return, dogs give us their all. It\'s the best deal man has ever made.';
quotes[quotes.length] = 'Dogs love their friends and bite their enemies, quite unlike people, who are incapable of pure love and always have to mix love and hate.';
quotes[quotes.length] = 'I wonder if other dogs think poodles are members of a weird religious cult.';
quotes[quotes.length] = 'A dog teaches a boy fidelity, perseverance, and to turn around three times before lying down.';
quotes[quotes.length] = 'Anybody who doesn\'t know what soap tastes like never washed a dog.';
quotes[quotes.length] = 'If I have any beliefs about immortality, it is that certain dogs I have known will go to heaven, and very, very few persons.';
quotes[quotes.length] = 'If your dog is fat, you aren\'t getting enough exercise.';
quotes[quotes.length] = 'My dog is worried about the economy because Alpo is up to $3.00 a can. That\'s almost $21.00 in dog money.';
quotes[quotes.length] = 'Ever consider what our dogs must think of us? I mean, here we come back from a grocery store with the most amazing haul -- chicken, pork, half a cow. They must think we\'re the greatest hunters on earth!';
quotes[quotes.length] = 'Women and cats will do as they please, and men and dogs should relax and get used to the idea.';
quotes[quotes.length] = 'If you pick up a starving dog and make him prosperous, he will not bite you; that is the principal difference between a dog and a man.';
quotes[quotes.length] = 'You can say any foolish thing to a dog, and the dog will give you a look that says, "Wow, you\'re right! I never would\'ve thought of that!"';
quotes[quotes.length] = 'Dogs are not our whole life, but they make our lives whole.';
quotes[quotes.length] = 'If you think dogs can\'t count, try putting three dog biscuits in your pocket and then give him only two of them.';
quotes[quotes.length] = 'My goal in life is to be as good of a person my dog already thinks I am.';

var authors = new Array();
authors[authors.length] = 'Anonymous';
authors[authors.length] = 'Ann Landers';
authors[authors.length] = 'Will Rogers';
authors[authors.length] = 'Ben Williams';
authors[authors.length] = 'Josh Billings';
authors[authors.length] = 'Andy Rooney';
authors[authors.length] = 'M. Acklam';
authors[authors.length] = 'Sigmund Freud';
authors[authors.length] = 'Rita Rudner';
authors[authors.length] = 'Robert Benchley';
authors[authors.length] = 'Franklin P. Jones';
authors[authors.length] = 'James Thurber';
authors[authors.length] = 'Unknown';
authors[authors.length] = 'Joe Weinstein';
authors[authors.length] = 'Anne Tyler';
authors[authors.length] = 'Robert A. Heinlein';
authors[authors.length] = 'Mark Twain';
authors[authors.length] = 'Dave Barry';
authors[authors.length] = 'Roger Caras';
authors[authors.length] = 'Phil Pastoret';
authors[authors.length] = 'Unknown';




function addEvent(objTarget, sType, fDest){ 

      if(typeof(objTarget.events) == 'undefined')     objTarget.events = new Object(); 

      if(typeof objTarget.events[sType] == 'undefined'){ 

           var oldEvent = objTarget[sType]; 

           objTarget.events[sType] = []; 

           if(typeof(oldEvent == 'function')) objTarget.events[sType][0] = oldEvent; 

           objTarget[sType] = function(e){ 

                for(var i=0; i < this.events[sType].length; i++){ 

                     if(typeof this.events[sType][i] == 'function'){     this.events[sType][i](e); } 

                } 

           } 

      } 

      objTarget.events[sType][objTarget.events[sType].length] = eval(fDest); 

 } 


//set delay between message change (in miliseconds)
var delay = 8000;

// number of steps to take to change from start color to endcolor
var maxsteps=30; 

// time in miliseconds of a single step
var stepdelay=80;

//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect

// start color (red, green, blue)
var endcolor= new Array(9,42,75);

// end color (red, green, blue)
var startcolor=new Array(255,239,239); 

//set opening tag, such as font declarations
var begintag = '<strong>'; 
var closetag='</div><br style="clear: right;" />';

var fwidth='380px'; //set scroller width
var fheight='125px'; //set scroller height

//should links inside scroller content also fade like text? 0 for no, 1 for yes.
var fadelinks=1;  

///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 >= quotes.length)
    index = 0;
    
  if (DOM2)
  {
    document.getElementById("fscroller").style.color = "rgb(" + startcolor[0] + ", " + startcolor[1] + ", " + startcolor[2] + ")";
    document.getElementById("fscroller").innerHTML = begintag + quotes[index] + '</strong><br /><div style="float: right; color: #C91B1B;">- ' + authors[index] + closetag
    
    if (fadelinks)
      linkcolorchange(1);
      
    colorfade(1, 15);
  }
  
  else if (ie4)
    document.all.fscroller.innerHTML=begintag+quotes[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 (window.addEventListener)
window.addEventListener("load", changecontent, false)
else if (window.attachEvent)
window.attachEvent("onload", changecontent)
else if (document.getElementById)
window.onload=changecontent
*/
  
addEvent(window, 'onload', 'changecontent');