Report abuse


			
this.checkImage[i] = new PeriodicalExecuter(function(i) {
  if ($('lightwindow_image_'+i) == null) return;
  if ($('lightwindow_image_'+i).complete && !(typeof $('lightwindow_image_'+i).naturalWidth != "undefined" && $('lightwindow_image_'+i).naturalWidth == 0)) {
    this.checkImage[i].stop();

    var imageHeight = $('lightwindow_image_'+i).getHeight();
    if (imageHeight > this.resizeTo.height) {
      this.resizeTo.height = imageHeight;
    }
    this.resizeTo.width += $('lightwindow_image_'+i).getWidth();
    this.imageCount--;

    $('lightwindow_image_'+i).setStyle({
      height: '100%', width: '100%'
    });

    if (this.imageCount == 0) {
      this._processWindow();
    }
  }
}.bind(this, i), 1);