﻿function FileProgress(container) {
    this.container = $('#' + container);

    if (this.container) {
        this.subContainer = $('<div>');
        this.progressBar = $('<div>');

        this.progress = 0;

        this._updateBar();
        this.progressBar.addClass("progressBarInProgress");

        this.progressBar.appendTo(this.subContainer);
        this.subContainer.appendTo(this.container);
    }

    this.height = this.constructor.offsetHeight;
}

FileProgress.prototype.setProgress = function(percentage) {
    this.progress = percentage;
    this._updateBar();
}

FileProgress.prototype._updateBar = function() {
    this.progressBar.width(Math.round(this.progress * 2.06) + 'px');
    if (this.progress > 0) {
        $('#status-info').html('uploading, please wait');
/*
        $('#pdfSelectorButton').css('visibility', 'hidden');
        $('#pdfSelectorButton').css('margin-bottom', '-24px');
        $('#divFileProgressContainer').css('display', 'block');
*/
    }
    
    if (100 == this.progress) {
        $('#status-info').html('finalizing, please wait');
    }
}

$(document).ready(function() {
    $(function() {
        $(".tooltip").tipTip();
    });
});

