function initSliderHandler(items,slide,rotate,interval,width,margin,start,end,showfade){
/*
    *** arguments list ***
    items - how many items to show
    slide - up (pp.com)/down (pc.com)
    rotate - use autorotation or only arrows
    interval - if rotate is set to true
    width - width of a single synopsis item
    margin - right margin of above
    start - the top position of the slider from which we'll animate
    end - ... to the end top position
    showfade - 'show': use show/hide, 'fade': use fadeIn/fadeOut
*/
    var show=(showfade=='show')?true:false;
    var sg=$(".hp-slider");//main container
    var al=$(".arrow-left",sg);//left arrow
    var ar=$(".arrow-right",sg);//right arrow
    var ala=$("a",al);//left arrow link
    var ara=$("a",ar);//right arrow link
    var s=$(".slider",sg);//animated container
    var si=$(".promotion",s);//promo item
    var a=$("a",si);//link in promo item
    var _current=0;//first item
    var _max=si.size();//items count
    var _cnt=(slide=='down')?'img':'img,h3,p';//what should I animate ?
    var _direction='right';//current animation direction 
    var _timer=null;
    var _active=false;
    var _items=sg.find('.promotion').size();
    s.css('width',_items*(margin+width));
    // left arrow click handler
    function update_arrows_state(){//update arrows state
        if(items==_max){//if the vieable items = max items hide arrows)
            ara.hide();
            ala.hide();
            _active=false;
        }else{
            _active=true;
            if(_current==0){
                if(show){
                    ala.hide();
                    ara.show();
                }else{
                    ala.fadeOut();
                    ara.fadeIn();
                }
                _direction='right';
            }
            if(_current==1)if(show)ala.show();else ala.fadeIn();
            if(_current==_max-items){
                if(show)ara.hide();else ara.fadeOut();
                _direction='left';
            }
            if(_current==_max-items-1)if(show)ara.show();else ara.fadeIn();
        }
    }
    
    update_arrows_state();
    ala.click(function(){// click event for left arrow
        if(!$(".slider").is(':animated')){ // to prevent double clicking
            _current--;
            update_arrows_state();
            $(".slider").animate({left:'+='+(width+margin)+'px'},{queue:false,duration:700});
        }
    });
    ara.click(function(){// click event for left arrow
        if(!$(".slider").is(':animated')){
            _current++;
            update_arrows_state();
            $(".slider").animate({left:'-='+(width+margin)+'px'},{queue:false,duration:700});
        }
    });

    si.hover(function(){//slide up/down handler, based on start, end and _cnt
        $(_cnt,$(this)).animate({top:end},{queue:false,duration:300});
    },function(){
        $(_cnt,$(this)).animate({top:start},{queue:false,duration:300});
    });

    si.click(function(){location.href=$(this).find('a').attr('href');});//fix for z-index in IE, attach click event to synopsis-item

    function rotate_items(){//rotate function
            update_arrows_state();//update arrows and direction
            if(_direction=='right')
                ara.trigger('click');//trigger click on the right arrow
            else
                ala.trigger('click');//trigger click on the left arrow
    }
    if(rotate=='rotate'&&_active){//if rotate is set and we have more items than the visible area
        sg.hover(function(){//if hover over clear the autorotation
            clearInterval(timer);
            timer=null;
        },function(){
            timer=setInterval(rotate_items,interval);
        });
        sg.trigger('mouseleave');//trigger hover over - set the autorotation
    }
}
