var ticker_allow = false;
var old_active;
var new_active;
var t;

function ticker()
{
  if(ticker_allow)
  {
    old_active = $("#front-room-authors ul li.active").get(0);
    if($(old_active).is(":last-child"))
    {
      new_active = $("#front-room-authors ul li:first-child").get(0);
    }
    else
    {
      new_active = $(old_active).next();
    }
    $("#front-room-authors ul li.active img").pixastic("desaturate");
    $("#front-room-authors ul li.active").removeClass('active');
    Pixastic.revert($(new_active).children('a').children().get(0));
    $(new_active).addClass('active');
  }
  t = setTimeout("ticker()",5000);
}

$(document).ready(function(){
  if($("#front-room-authors:not(.author_page)").length > 0)
  {
//    $("#front-room-authors ul li img").pixastic("desaturate");
//    Pixastic.revert($("#front-room-authors ul li.active a").children().get(0));

//    $("#front-room-authors ul li img").pixastic("revert");
	$("#front-room-authors ul li.active img").pixastic("desaturate");
    
    $("#front-room-authors ul li").hover(function(){
//      $("#front-room-authors ul li.active img").pixastic("emboss");
//      $("#front-room-authors ul li.active").removeClass("active");
//      $(this).addClass("active");
//      Pixastic.revert($(this).children('a').children().get(0));
    });
    
    $("#front-room-authors").hover(function(){
      ticker_allow = false;
    },
    function(){
      ticker_allow = false;
    });
    
    t = setTimeout("ticker()",5000);
  }
});
