/**
 * ViewHomeItem
 */
var ViewHomeItem = Class.create({
  /**
   * Init ViewHomeItem
   */	
  initialize: function() {
	this.options = Object.extend({
	  elemContent : null
	}, arguments[0] || { });		
	
	ViewHomeItem.INACTIVE_Y = -1000;
	
    this.elemImage = this.options.elemContent.down('.image');
    this.elemImg = this.options.elemContent.down('img');

	this.image = new EggImage(this.elemImage);
	this.elemImage.observe('eggimage:loaded', this.onImageLoaded.bind(this));
    this.image.load();  

    this.elemContentText = this.options.elemContent.down('.contenttitle');
    this.contentTextFade = new EggFade({elemContent:this.elemContentText});
    this.elemContentText.observe('eggfade:hidden', this.onHidden.bind(this));

    this.elemContentLink = this.options.elemContent.down('.contentlink');
    this.contentLinkFade = new EggFade({elemContent:this.elemContentLink});
    
	this.options.elemContent.style.top = ViewHomeItem.INACTIVE_Y + 'px';	 
  },

  getContent: function() {
	return this.options.elemContent;
  },

  show: function() {
	this.options.elemContent.style.top = '0px';	  
	this.contentTextFade.show();
	this.contentLinkFade.show();
  	this.image.show();
  },

  hide: function() {
	this.contentTextFade.hide();
	this.contentLinkFade.hide();
	this.image.hide();
  },
  
  onHidden: function(evt) {	  
	this.options.elemContent.style.top = ViewHomeItem.INACTIVE_Y + 'px';
  },
  
  onImageLoaded: function(evt) {
  }
  
});
