function galleryBrowser( photosNb, boolAdm )
{
    var objGalleryBrowser = new Object();
    objGalleryBrowser.arrDisplayed = new Array();
    objGalleryBrowser.currentPhoto = 0;
    objGalleryBrowser.boolAdmin = boolAdm;
    objGalleryBrowser.photosNb = photosNb;
    objGalleryBrowser.hideAll = function() {
        $$( 'div.galleryPhoto' ).each( function( e ) { e.hide(); } );
    }
    objGalleryBrowser.previous = function() {
        if ( this.currentPhoto <= 0 ) { return; }
        this.currentPhoto--;
        this.showPhoto( this.currentPhoto );
    }
    objGalleryBrowser.next = function() {
        if ( this.currentPhoto >= this.photosNb - 1 ) { return; }
        this.currentPhoto++;
        this.showPhoto( this.currentPhoto );
    }
    objGalleryBrowser.showPhoto = function( intIndex ) {
    	
        this.hideAll();        
        this.currentPhoto = intIndex;
        $( 'galleryPhoto'+intIndex ).show();
        intPhotoDbId = $F( "photo_id_"+intIndex );
        if ( ! this.boolAdmin && ! this.arrDisplayed.in_array( intPhotoDbId ) ) {
        	this.arrDisplayed.push( intPhotoDbId );
        	updateDisplayCount( intPhotoDbId );
        } // endif	
        if ( $( "comment_photo_id" ) ) {
		    $( "comment_photo_id" ).value = intPhotoDbId;
		}
    }
    return objGalleryBrowser;
}