/* 
animation for where2buy wheel 
NOTE: jQuery noConflict Mode must be enabled (var $j = jQuery.noConflict();)
*/


currentItem = 0;
previousItem = 7;
logos = new Array("#block1", "#block2", "#block3", "#block4", "#block5", "#block6", "#block7", "#block8", "#block9");



function initializeLogoslider() {
  for (i=0; i < logos.length; i++) { resetLogo(i); }
}



function resetLogo(logosIndex) {
  $j(logos[logosIndex])
    .css("left","200px")
    .css("display","none")    
    .css("visibility","visible")
    .css("display","inline-block")
    .css("opacity","0");
}


function showNextLogo() {
  resetLogo(currentItem);

  $j('#plink').attr('href', $j(logos[currentItem]).attr("href"));

  $j(logos[currentItem])
    .animate({left: "-=20", opacity: "1"}, 500, 'linear')
    .animate({left: "-=160"}, 3500, 'linear')
    .animate({left: "-=20", opacity: "0"}, 500, 'linear');

  previousItem = (previousItem + 1) % logos.length;
  currentItem = (currentItem + 1) % logos.length;

  setTimeout("showNextLogo()", 4000);

}

$j(document).ready(function() { initializeLogoslider(); showNextLogo(); });

