var mastercontainer = document.getElementById('clientlogos')
var clientSets = mastercontainer.getElementsByTagName('A')
var maxIdx = clientSets.length - 1

for (var cs = 0; cs < clientSets.length; cs++) 
  {
    currentSet = setOpacity(clientSets[cs],0)
  }

var currentSet = 0
var logoInterval = 4000


function fadeDown()
  {
    var thisobj = this; 
    var thisInc = function() {decOpacity.apply(thisobj)}
    setTimeout(thisInc,thisobj.masterInterval)
  }

function setupNext()
  {
    this.unsetZ();
    this.currentSet++
    if (this.currentSet > maxIdx) {this.currentSet = 0}
    this.currObj = clientSets[this.currentSet]
    this.setZ();
    var thisobj = this; 
    var thisInc = function() {incOpacity.apply(thisobj)}
    setTimeout(thisInc,thisobj.offInterval)
  }
  
function fadeUp()
  {
   logoTrack.setZ();
   incOpacity.apply(logoTrack)
  }
 
var logoTrack = {
  name : 'logoTrack',
  currentSet:0,
  currOpacity:0,
  opacStep:10, 
  opacInterval:60,
  masterInterval:3500,
  offInterval:500, 
  currObj:clientSets[this.currentSet], 
  setZ : function(){this.currObj.style.zIndex = 10},
  unsetZ:function(){this.currObj.style.zIndex = 1},
  terminalFunction:setupNext,
  terminalFunctionInc:fadeDown,
  toFullString:function() {enumerateProperties(logoTrack)}
  }
  

  
function getQuote()
  {
     var Q =  new Ajax.Request('/clientele/getQuote_ajx.cfm',{
        onSuccess: function(transport){replaceQuote(transport.responseText)}
    }
   )
  }
  
function blindUp(obj) { new Effect.BlindUp(obj); }
function blindDown(obj) { new Effect.BlindDown(obj); }
  
var testInnerTO;
function replaceQuote(responseText)
  {
    
    var quoteObj = eval('(' + responseText + ')'); 
    document.getElementById('quote1').innerHTML = quoteObj.text;
    document.getElementById('auth').firstChild.nodeValue = quoteObj.author;
    document.getElementById('co').firstChild.nodeValue = quoteObj.company;
    testInnerTO=setTimeout(getQuote,10000)
    //
  } 

var testInner = document.getElementById('test1') 
var proceed = true;


if (window.addEventListener)
  {
    window.addEventListener('load',function() {setTimeout(fadeUp,800)},false)
    window.addEventListener('load',function() {setTimeout(getQuote,4000)},false)
  }
else if (window.attachEvent)
  {
    window.attachEvent('onload',function() {setTimeout(fadeUp,800)})
    window.attachEvent('onload',function() {setTimeout(getQuote,4000)})
  }
else {window.onload = function() {setTimeout(fadeUp,800)}}
  

