Photo = function( )
{
    var self = this;
    var bReady = false;
    
    this.init = function( sBaseUrl, sImgDir )
    {
        this.sBaseUrl  = sBaseUrl;
        this.sImgDir   = sImgDir;
        this.bReady    = true;
        
        document.getElementById('months').removeAttribute( 'disabled' );
        document.getElementById('years').removeAttribute( 'disabled' );
        
        $(document).ready( 
        function()
        {
            $("#selector a").lightbox();
            $.Lightbox.construct
            (
                {
                      "speed": 700,
                      "keys": 
                      {
                            close: "q",
                            prev: "z",
                            next: "x"
                      },
                      "opacity": 0.7,
                      text: 
                      {
                            image: "Фотография",
                            of: "из",
                            close: "Закрыть",
                            closeInfo: "Клик вне картинки завершит просмотр.",
                            help: 
                            {
                              close: " ",
                              interact: " "
                            },
                            about: 
                            {
                              text: " ",
                              title: " ",
                              link: " "
                            }
                      },
                      files: {
                        images: {
                            prev:        sImgDir + "lightbox_img/prev.gif",
                            next:        sImgDir + "lightbox_img/next.gif",
                            blank:       sImgDir + "lightbox_img/blank.gif",
                            loading:     sImgDir + "lightbox_img/loading.gif"
                        }
                    }
                }
            );
        }
        );

    }
    
    this.chPage = function( )
    {
        if( !this.bReady ) return;
        
        var month = document.getElementById('months').value;
        var year  = document.getElementById('years').value;
        document.location = this.sBaseUrl + 'Photo/get/' + year + '/' + month + '/';
    }
    
}

PhotoObject = new Photo( );
