/**
 * Create BigTeaser object
 */
BigTeaser = Class.create();

BigTeaser.prototype = {
  
  initialize: function(iFePageId, sDestinationElement, sSourceElement) {
    this.iFePageId = iFePageId;
    this.sDestinationElement = sDestinationElement;
    this.sSourceElement = sSourceElement;
    
    Event.observe(window, "load", this.vSetPreloadImage.bind(this));
  },
  
  vShowImage: function(iUid) {
    $(this.sDestinationElement).className = 'bigImageBlock '+this.sSourceElement+iUid;
  },
  
  vSetPreloadImage: function() {
    var bFound = false;
    var oImg = $$('.img');
    for(i = 0; i < oImg.length; i++) {
      if ($(oImg[i]).className == 'img ' + this.sSourceElement + this.iFePageId) {
        bFound = true;
      }
    }
    /**
     * If it is sub page. Else show first image
     */
    if (bFound) {
      $(this.sDestinationElement).className = 'bigImageBlock ' + this.sSourceElement + this.iFePageId;  
    } else {
      $(this.sDestinationElement).className = 'bigImageBlock ' + $(oImg[0]).className;
    }
  }
    
}


