function specials(page){
	new Ajax.Updater('bannerText', '/specials', {
		parameters: 'pageNum=' + page});
}

var live=true;

var timer=false;

if(live){
  var $j = jQuery.noConflict();
  $j(document).ready(function(){
    $j('#bannerImage img').attr('class', 'banner-image-original');
    $j('.special-banner-img').appendTo('#bannerImage');
    $j('.special-item').mouseover(function(){
      clearTimeout(timer);
      var thisid = $j(this).attr('id');
      var parts = thisid.split('-');
      var c = parts[2];
      var bannerID = '#special-banner-image-'+c;
      image_focus(bannerID);
    });
    $j('.special-item').mouseout(function(){
      waitForIt();
    });
    
    waitForIt();
    
  });
  
  function image_focus(bannerID){
    if(!$j(bannerID).hasClass('banner-focused')){
      $j(bannerID).addClass('banner-focused');
      $j(bannerID).css('display','none');
      $j(bannerID).css('zIndex',3);
      $j(bannerID).siblings().each(function(){
        $j(this).removeClass('banner-focused');
      });
      $j(bannerID).fadeIn(250, function(){
        $j(this).siblings().each(function(){
          $j(this).css('zIndex',1);
        });
        $j(bannerID).css('zIndex',2);
      });
    }
  }
  
  function nextImage(){
    var nextID = $j('.banner-focused').next().attr('id');
    if(!nextID || nextID=='undefined' || nextID==undefined){
      nextID = $j('#bannerImage>:first-child').attr('id');
    }
    image_focus('#'+nextID);
    waitForIt();
  }
  
  function waitForIt(){
    timer = setTimeout('nextImage()',3000);
  }
}


