$productslideshow = {
    context: false,
	timer: 0,
    timeout: 15000,
    slideSpeed: 1500,
    fx: 'scrollDown',
    easing: 'bounceout',
	
    init: function() {
		this.timer = 0;
        this.context = $('#module_products #slider');
        this.prepareSlideshow();
    },
    
    prepareSlideshow: function() {
        $('div.slides > ul', $productslideshow.context).cycle({
            fx: $productslideshow.fx,
            easing: $productslideshow.easing,
			timeout: $productslideshow.timeout,
            speed: $productslideshow.slideSpeed,
            pauseOnPagerHover: true,
			before: $productslideshow.onBefore,
			after: $productslideshow.onAfter,
			next:   '#nextProduct', 
			prev:   '#previousProduct',
            pause: true
        });            
    },
	
	onAfter: function() {
		if($productslideshow.timer == 1) {
			$productslideshow.timer = 0;
		} else if($productslideshow.timer == 0) {
			$productslideshow.timer = 1;
		}
	},
	
	onBefore: function() {
		/*
		var color;
		if($productslideshow.timer == 1) {
			//color = "#fd8537";
			color = "#bbcb37";
		} else if($productslideshow.timer == 0) {
			color = "#3f73a0";
		}
		$('#slider').css("background", color);
		*/
	}
};

$(function() {
    $('body').addClass('js');
    $productslideshow.init();
});  
