function ProgressBar(options) {
     
    if (!(this instanceof ProgressBar)) {
      return new ProgressBar(options);
    }
   
    var bar=this;      

    $.extend(true,bar,bar.defaults,options); 
    bar.init();
}


$.extend(true, ProgressBar.prototype, {
    
        defaults: {

          container: 'body',

          className: 'pbar',

          css: {
            zIndex: 9999999,
            width: '100%',
            bottom: 0,
            position: 'absolute'
          },

          text: {

            value: '',

            css: {
              position: 'absolute',    
              left: '50%',
              textAlign: 'center',
              zIndex: 99999999,   
              bottom: '-3px',
              color: 'black',
              fontSize: 'small'   
            }

          }

        }, // progressBar defaults
    
        // instantiate dom elements 
        init: function progressBar_init() {
          var bar=this;
          bar.elem=$('progress.'+bar.className,$(bar.container));
     
          if (!bar.elem.length) { 

            // instantiate progressbar
            bar.elem=$('<progress class="'+bar.className+'" '+(bar.max?('max="'+bar.max+'" value="'+bar.value):(''))+'"></progress>');
            bar.elem.appendTo($(bar.container));   
            bar.elem.css(bar.css);
    
            // instantiate text span 
            bar.span=$('<span class="'+bar.className+'">'+bar.text.value+'</span>');
            bar.span.appendTo($(bar.container));   
            bar.span.css(bar.text.css);
          }

        }, // progressBar_init    

        // set progress bar position (percentage)     
        set: function progressBar_set(value) {
          var bar=this;
          $(bar.elem).attr('value',value); 
          $(bar.span).text(bar.text.value+' '+Math.round(value*100)+'% ');
     
        },  // progressBar_set    

        // remove dom elements     
        dispose: function progressBar_dispose() {
          var bar=this;
          $(bar.span).remove();
          $(bar.elem).remove();
        }, // progressBar_dispose  
     
}); // ProgressBar.prototype

@@ -1,16 +1,1330 @@
+/*%0A * freepano - WebGL panorama viewer%0A *%0A * Copyright (c) 2015 FOXEL SA - http://foxel.ch%0A * Please read %3Chttp://foxel.ch/license%3E for more information.%0A *%0A *%0A * Author(s):%0A *%0A *      Luc Deschenaux %3Cl.deschenaux@foxel.ch%3E%0A *%0A *%0A * This file is part of the FOXEL project %3Chttp://foxel.ch%3E.%0A *%0A * This program is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU Affero General Public License as published by%0A * the Free Software Foundation, either version 3 of the License, or%0A * (at your option) any later version.%0A *%0A * This program is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A * GNU Affero General Public License for more details.%0A *%0A * You should have received a copy of the GNU Affero General Public License%0A * along with this program.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A *%0A *%0A * Additional Terms:%0A *%0A *      You are required to preserve legal notices and author attributions in%0A *      that material or in the Appropriate Legal Notices displayed by works%0A *      containing it.%0A *%0A *      You are required to attribute the work as explained in the %22Usage and%0A *      Attribution%22 section of %3Chttp://foxel.ch/license%3E.%0A */%0A%0A
 function Progres

add header