
    var rangeVar = 100
    var arrTxt
    var i = 0
    var j = 0
    
    txtArray = new Array()
    
    txtArray[0] = 'Try not to become a man of success but a man of value. |Albert Einstein';
    txtArray[1] = 'You see things; and you say "Why?" But I dream things that never were; and I say "Why not?" |George Bernard Shaw';
    txtArray[2] = 'Impossible is a word to be found only in the dictionary of fools. |Unknown ';
    txtArray[3] = 'If you\'re going through hell, keep going. |Sir Winston Churchill';    
    txtArray[4] = 'Intelligence is not trying. |Unknown';
    txtArray[5] = 'We are what we repeatedly do. Excellence, then, is not an act but a habit. |Aristotle ';
    txtArray[6] = 'Without goals, you will end up going nowhere, or, you will end up following someone else\'s map! |Catherine Pulsifer';
    txtArray[7] = 'Failure leaves open a door for us to try, and try again. |Robert M. Hensel';
    txtArray[8] = 'There is nothing either good or bad, but thinking makes it so. |William Shakespeare ';
    txtArray[9] = 'Optimism means expecting the best, but confidence means knowing how to handle the worst.|Unknown';    
    txtArray[10] = 'Author In the Midst of movement and chaos, keep stillness inside of you. |Deepak Chopra';
    txtArray[11] = 'What lies behind us and what lies before us are small matters compared to what lies within us. |Ralph Waldo Emerson';
    txtArray[12] = 'Skill is successfully walking a tightrope over Niagara Falls.|Unknown';
    txtArray[13] = 'Never make a move if you are merely optimistic. |The Zurich Axioms';    

    function fadeOut(){

      if(rangeVar > 0){

          rangeVar = rangeVar - 10
          document.getElementById('messBody').className = 'messBody trans' + rangeVar          
          //document.form1.className.value = document.getElementById('messBody').className
          setTimeout("fadeOut()",100)
      
      }else{
          rangeVar = 0
          document.getElementById('messBody').className = 'messBody trans' + rangeVar  
          //document.form1.className.value = document.getElementById('messBody').className    
      }
    }
    
    function fadeIn(){

      if(rangeVar < 100){

          rangeVar = rangeVar + 10
          document.getElementById('messBody').className = 'messBody trans' + rangeVar  
          //document.form1.className.value = document.getElementById('messBody').className        
          setTimeout("fadeIn()",100)
      
      }else{
          rangeVar = 100
          document.getElementById('messBody').className = 'messBody trans' + rangeVar 
          //document.form1.className.value = document.getElementById('messBody').className     
      }
    }
    
    function txtTicker(txtIndex){
    
    //document.getElementById('messBody').className = 'messBody trans100'    
    document.getElementById('messFooter').innerHTML = 'Quote: ' + parseInt(txtIndex+1) + '/' + txtArray.length

      if(txtIndex < txtArray.length){
        arrTxt = txtArray[txtIndex].split('');
        loopTxtVals(txtIndex)
      }
    }
    
    function loopTxtVals(txtIndex){
      
      fadeIn()
      
      if(i < arrTxt.length){
        if(arrTxt[i]=='|'){
          document.getElementById('messBody').innerHTML += '<br>';
        }else{
          document.getElementById('messBody').innerHTML += arrTxt[i];
        }
          i=i+1
          setTimeout("loopTxtVals("+parseInt(txtIndex)+")",50)
        }else{        
          if(parseInt(txtIndex)==(txtArray.length-1)){
            fadeOut()
            setTimeout("resetTicker(0)",1000)
          }else{
            fadeOut()
            setTimeout("resetTicker(" + parseInt(txtIndex + 1) + ")",3000)
          }
        }
     
    }
    
    function resetTicker(txtIndex){
     // Clearing messText field for next or first index (if the last index is reached)
        
        
        //alert(rangeVar + ' - class: ' + document.getElementById('messBody').className)
        document.getElementById('messBody').innerHTML = ''
        i=0
        txtTicker(txtIndex)
    
    }
  
