
function startSliderScheda(sliderId, start) {

    var $panels = $('#slider_'+sliderId+' .scrollContainer > div.panel');
    var $container = $('#slider_'+sliderId+' .scrollContainer');
	//alert('panel='+$panels.length+' $container='+$container.length);
    // if false, we'll float all the panels left and fix the width 
    // of the container
    var horizontal = true;

    // float the panels left if we're going horizontal
    if (horizontal) {
        $panels.css({
            'float' : 'left',
            'position' : 'relative' // IE fix to ensure overflow is hidden
        });

        // calculate a new width for the container (so it holds all panels)
        $container.css('width', $panels[0].offsetWidth * $panels.length);
    }

    // Rimuove le scrollbars
    var $scroll = $('#slider_'+sliderId+' .scroll').css('overflow', 'hidden');


    
    function selectNav() {
        $(this)
            .parents('ul:first')
                .find('a')
                    .removeClass('selected')
                .end()
            .end()
            .addClass('selected');
		
		var divId = $(this).attr('href');
		var divHeight = $(divId).innerHeight();
		
		$('#slider_'+sliderId+' .scroll').css("height",divHeight);
    }

    

    
    function trigger(data) {
        var el = $('#slider_'+sliderId+' .navigation').find('a[href$="' + data.id + '"]').get(start);
        selectNav.call(el);
    }

    //if (window.location.hash) {
    //    trigger({ id : window.location.hash.substr(1) });
    //} else {

		
    //}

    // offset is used to move to *exactly* the right place, since I'm using
    // padding on my example, I need to subtract the amount of padding to
    // the offset.  
    var offset = parseInt((horizontal ? 
        $container.css('paddingTop') : 
        $container.css('paddingLeft')) 
        || 0) * -1;


    var scrollOptions = {
        target: $scroll, 

        items: $panels,

        navigation: $('#slider_'+sliderId+' .navigation a'),

        prev: 'img.left', 
        next: 'img.right',

        // scroll effect in entrambe le direzioni
        axis: 'xy',

        onAfter: trigger,

        offset: offset,

        // durata dello sliding effect
        duration: 250,

        easing: 'swing'
    };

    // applico serialScroll allo slider
    $('#slider_'+sliderId).serialScroll(scrollOptions);

    // applico localScroll
    $('#slider_'+sliderId).localScroll(scrollOptions);

	

    //scrollOptions.duration = 1;
    //$.localScroll.hash(scrollOptions);
	
	$('#slider_'+sliderId+' ul.navigation a').click(selectNav);
	$('#slider_'+sliderId+' ul.navigation a:eq('+start+')').trigger('click');

}

