window.addEvent('domready', function() {
   var elements = $$('.item_expandable');
   var image;
   var firstDiv;

   var widthElem = 0;
   var heightElem = 0;

   elements.each(function(item, index) {
        item.addEvent('mouseenter', function(e) {
	    e.stop();

            if (!(widthElem)) { widthElem = this.getStyle('width'); }
            if (!(heightElem)) { heightElem = this.getStyle('height'); }

            this.morph({
              'position':'absolute', 'z-index':1, width:220, height:320,
              'border-color':'#ff0000'
            });

            image = this.getElement('img');
            image.morph({'width':'180px','height':'180px'});

            firstDiv = this.getElement('div');
            firstDiv.morph({'display':''});
 	});

	item.addEvent('mouseleave', function(e) {
    	    e.stop();

            firstDiv = this.getElement('div');
            firstDiv.morph({'display':'none'});

            image = this.getElement('img');
            image.morph({'width':'90px','height':'90px'});

            this.morph({
              'z-index':0, width:widthElem, height:heightElem,
              'border-left-color':'#ffffff','border-top-color':'#ffffff','border-right-color':'#cccccc','border-bottom-color':'#cccccc'
            });
	});
   });
});
