/*
 * jQuery special link slider with cycle
 * Copyright (c) 2009 Peter Jerič (www.positiva.si)
 * Version: 1.0
 *
 * Description :
 *  - 
 *  
 * Need:   - jquery.js (http://jquery.com/)
 *         - jquery.cycle.all.js (http://www.malsup.com/jquery/cycle/)
 *         - chili-1.7.pack.js
 */
 var currentRel = 0;
jQuery(function($) {
    if ($("#border").size()) {
        var element = document.getElementById('border');
        var top = element.offsetTop;
        $("#border").css("top", top+"px");
        
        $("#bannerCenterRight a").click(
            function(i) {
                var position = $(this).attr("rel");
                var math = top + (position * $("#selectorHeight").val());
                $("#border").animate({"top": math+"px"}, "slow");
                $container.cycle(parseInt($(this).attr("rel")));
                if ($('#bannerCenter').size()) {
				    $container2.cycle(parseInt($(this).attr("rel"))); 
			}
		});
        var $container = $('#bannerCenter').cycle({
            fx:     'scrollHorz', 
            speed:   1000, 
            timeout: 0 
        });
		
		var $container2 = $('#event_books').cycle({  
            fx:     'fade', 
            speed:   1000, 
            timeout: 0 
        });
		var $container3 = $("#bestBooksCycle").cycle({
			fx:		"fade",
			speed:	1000,
			timeout: 5000
		});
    }
});
