function slideSwitch() {
    var $active = $('#slideshow DIV.active');

    if ( $active.length == 0 ) $active = $('#slideshow DIV:last');

    // use this to pull the divs in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow DIV:first');

    // uncomment below to pull the divs randomly
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 4000 );
});

// galerie-page

$(function () {  
  $('.backstage a')   
    // create our new span.hover and loop through anchor:
    .append('<span class="hover" id="rsscolor"/>').each(function () {
      
      // cache a copy of the span, at the same time changing the opacity
      // to zero in preparation of the page being loaded
      var $span = $('> span.hover', this).css('opacity', 0);
      
      // when the user hovers in and out of the anchor
      $(this).hover(function () {
        // on hover
      
        // stop any animations currently running, and fade to opacity: 1
        $span.stop().fadeTo(800, 1);
      }, function () {
        // off hover
     
        // again, stop any animations currently running, and fade out
        $span.stop().fadeTo(800, 0);
      });
    });
  $('.beauty a')   
    // create our new span.hover and loop through anchor:
    .append('<span class="hover" id="rsscolor"/>').each(function () {
      
      // cache a copy of the span, at the same time changing the opacity
      // to zero in preparation of the page being loaded
      var $span = $('> span.hover', this).css('opacity', 0);
      
      // when the user hovers in and out of the anchor
      $(this).hover(function () {
        // on hover
      
        // stop any animations currently running, and fade to opacity: 1
        $span.stop().fadeTo(800, 1);
      }, function () {
        // off hover
     
        // again, stop any animations currently running, and fade out
        $span.stop().fadeTo(800, 0);
      });
    });	
  $('.fashion a')   
    // create our new span.hover and loop through anchor:
    .append('<span class="hover" id="rsscolor"/>').each(function () {
      
      // cache a copy of the span, at the same time changing the opacity
      // to zero in preparation of the page being loaded
      var $span = $('> span.hover', this).css('opacity', 0);
      
      // when the user hovers in and out of the anchor
      $(this).hover(function () {
        // on hover
      
        // stop any animations currently running, and fade to opacity: 1
        $span.stop().fadeTo(800, 1);
      }, function () {
        // off hover
     
        // again, stop any animations currently running, and fade out
        $span.stop().fadeTo(800, 0);
      });
    });	
  $('.efecte a')   
    // create our new span.hover and loop through anchor:
    .append('<span class="hover" id="rsscolor"/>').each(function () {
      
      // cache a copy of the span, at the same time changing the opacity
      // to zero in preparation of the page being loaded
      var $span = $('> span.hover', this).css('opacity', 0);
      
      // when the user hovers in and out of the anchor
      $(this).hover(function () {
        // on hover
      
        // stop any animations currently running, and fade to opacity: 1
        $span.stop().fadeTo(800, 1);
      }, function () {
        // off hover
     
        // again, stop any animations currently running, and fade out
        $span.stop().fadeTo(800, 0);
      });
    });	
  $('.mirese a')   
    // create our new span.hover and loop through anchor:
    .append('<span class="hover" id="rsscolor"/>').each(function () {
      
      // cache a copy of the span, at the same time changing the opacity
      // to zero in preparation of the page being loaded
      var $span = $('> span.hover', this).css('opacity', 0);
      
      // when the user hovers in and out of the anchor
      $(this).hover(function () {
        // on hover
      
        // stop any animations currently running, and fade to opacity: 1
        $span.stop().fadeTo(800, 1);
      }, function () {
        // off hover
     
        // again, stop any animations currently running, and fade out
        $span.stop().fadeTo(800, 0);
      });
    });		
});

