

function PhotosShowAndHide( original_id, nb_photos)
{
    if (original_id)
        this.id = original_id;
    else
        this.id = 0;

    this.nb_photos = nb_photos;
    this.show_and_hide = function( element_prefix, id_to_show )
    {
        if ( id_to_show == (nb_photos-1) )
        {
            link_next = document.getElementById( element_prefix + 'next');
            link_next.style.display = 'none';
            link_previous = document.getElementById( element_prefix + 'previous');
            link_previous.style.display = 'inline';
        }
        else if (id_to_show == 0)
        {
            link_next = document.getElementById( element_prefix + 'next');
            link_next.style.display = 'inline';
            link_previous = document.getElementById( element_prefix + 'previous');
            link_previous.style.display = 'none';
        }
        else
        {
            link_next = document.getElementById( element_prefix + 'next');
            link_next.style.display = 'inline';
            link_previous = document.getElementById( element_prefix + 'previous');
            link_previous.style.display = 'inline';
        }
        photo_to_hide = document.getElementById( element_prefix + this.id );
        photo_to_hide.style.display = 'none';
        photo_to_hide.style.align = 'center';

        photo_to_show = document.getElementById( element_prefix + id_to_show );
        photo_to_show.style.display = 'inline';
        photo_to_show.style.align = 'center';

        this.id = id_to_show;
    }

    this.show_and_hide_next = function( element_prefix )
    {
        if (this.id  == 0)
        {
            link_previous = document.getElementById( element_prefix + 'previous');
            link_previous.style.display = 'inline';
        }

        photo_to_hide = document.getElementById( element_prefix + this.id );
        photo_to_hide.style.display = 'none';

        photo_to_show = document.getElementById( element_prefix + (this.id+1) );
        photo_to_show.style.display = 'block';

        this.id = this.id+1;

        if (this.id == (nb_photos-1))
        {
            link_next = document.getElementById( element_prefix + 'next');
            link_next.style.display = 'none';
        }
    }

    this.show_and_hide_previous = function( element_prefix )
    {
        if (this.id == (nb_photos-1))
        {
            link_next = document.getElementById( element_prefix + 'next');
            link_next.style.display = 'inline';
            //logo_next = document.getElementById( element_prefix + 'logo_next');
            //logo_next.style.display = 'none';
        }

        photo_to_hide = document.getElementById( element_prefix + this.id );
        photo_to_hide.style.display = 'none';

        photo_to_show = document.getElementById( element_prefix + (this.id-1) );
        photo_to_show.style.display = 'block';

        this.id = this.id-1;;

        if (this.id  == 0)
        {
            link_previous = document.getElementById( element_prefix + 'previous');
            link_previous.style.display = 'none';
            //logo_previous = document.getElementById( element_prefix + 'logo_previous');
            //logo_previous.style.display = 'none';
        }
    }

}