tv_hslider = function( content_id, content, start_time, show_arrows ){

    $(document).ready(function() {

        var image_act = 0;
        var auto_effect_blocked = false;
        var content_node = $('#'+(images[0].content_id));
        var activeTimer = 0;

        if( image_act == 0 ){
             $( '#' + content_id + ' .tv_hslider_prev' ).css('visibilty','hidden');
        }

        $(content_node).css('display','block');

        $( '#' + content_id + ' .tv_hslider_next').click(function(){
            change_seal(true, 'next');
        });

        $( '#' + content_id + ' .tv_hslider_prev' ).click(function(){
            change_seal(true, 'prev');
        });

        $( '#' + content_id + ' .tv_hslider_content').mouseover(function(){
            clearTimeout(activeTimer);
        }).mouseout(function(){
            activeTimer = setTimeout(function() {
                change_seal(true, 'next');
            },1000);
        });

        function change_seal(automatic, dir) {

            image_act_temp = image_act;

            if (dir=='prev') {
                image_act_temp -=1;
            }

            if (dir=='next') {
                image_act_temp +=1;
            }

            if (image_act_temp < 0 ){
                image_act_temp = images.length -1;
            }
            if (image_act_temp >= images.length ){
                image_act_temp = 0;
            }

            $(content_node).fadeOut('fast', function() {

                clearTimeout( activeTimer );

                if (image_act_temp < 0 ){
                    image_act_temp = images.length -1;
                }
                if (image_act_temp >= images.length ){
                    image_act_temp = 0;
                }

                if( !show_arrows ){

                    if (image_act_temp == 0){
                        $( '#' + content_id + ' .tv_hslider_prev' ).css('visibility','hidden');
                    } else {
                        $( '#' + content_id + ' .tv_hslider_prev' ).css('visibility','visible');
                    }

                    if (image_act_temp == images.length -1){
                        $( '#' + content_id + ' .tv_hslider_next' ).css('visibility','hidden');
                    } else {
                        $( '#' + content_id + ' .tv_hslider_next' ).css('visibility','visible');
                    }
                }

                $(content_node).css('visibility','visible');

                $('.tv_hslider_content').css('backgroundImage',images[image_act_temp].bgimage);
                $('.tv_hslider_content').css('backgroundPosition',images[image_act_temp].bgimagepos);

                content_node = $('#'+(images[image_act_temp].content_id));

                $('#'+content_id+' .submenu').html(images[image_act_temp].headline);
                $(content_node).fadeIn();
                image_act = image_act_temp;
                if ( auto_effect_blocked ){
                    auto_effect_blocked = false;
                    return;
                }
                activeTimer = setTimeout(function() {
                    change_seal(true, 'next');
                },5000);



            });


        }

        activeTimer = setTimeout(function() {
            change_seal(true);
        },start_time);

    });
}

