/**
 * BZ IT Solutions
 * http://www.bz-it.de
 *
 * @author Ronny Hempel <rhempel@bz-it.de>
 * $LastChangedDate: 2010-02-11 15:06:25 +0100 (Do, 11 Feb 2010) $
 * $LastChangedRevision: 16 $
 * $LastChangedBy: rhempel $
 * $HeadURL: https://svn.bz-it.de/svn/dockersshop/trunk/skin/frontend/default/techdivision/js/jquery.slideshow.js $
 * @version $Id: jquery.slideshow.js 16 2010-02-11 14:06:25Z rhempel $
 */



/*** 
    Simple jQuery Slideshow Script
    Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc.  Please link out to me if you like it :)
***/

var slideStop = false;

function slideSwitch() {
	if (slideStop == true) {
		return true;
	}
    var $active = jQuery('#bzit_slideshow div.active');

    if ( $active.length == 0 ) $active = jQuery('#bzit_slideshow div:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : jQuery('#bzit_slideshow div:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // 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');
        });
}
jQuery(document).ready(function() {
	setInterval( "slideSwitch()", 5000 );
});

