$(function()
{
  $.cssRule({
    "h2.slideTitle": [
      "margin:0;",
      "padding:0;",
      "font-size:15px;"
    ]
  });
  
  if (typeof(sIFR) == "function")
  {
    sIFR.replaceElement("h2.slideTitle", named({
      sCase: "upper",
      sColor: "#ffffff",
      sFlashSrc: "/includes/js/sifr/avantgardemedium.swf",
      sWmode: "transparent"
    }));
  }
  
  $("#homeSlides li").hide();
  $("#homeSlides li:first").show();
  
  $("#homeSlides").slider({
    animationDuration: 3000,
    onSlide: function(slider, fromSlide, toSlide)
    {
      if (fromSlide != toSlide)
      {
        var from = $("#" + this.items[fromSlide]);
        var to = $("#" + this.items[toSlide]);
        var props = this;
        
        from.stop().fadeOut(this.animationDuration);
        to.stop().fadeIn(this.animationDuration, function()
        {
          slider.slider_startTimer();
          props.onAfterSlide(slider, fromSlide, toSlide);
        });
      }
    },
    timerDelay: 10000
  });
});
