var topNormal = 106, topFull = 0;
var duracion = 400;
var transUp = Fx.Transitions.Cubic.easeOut;
var transDown = Fx.Transitions.Cubic.easeOut;

var fx = new Fx.Elements($('content'), {wait:false, duration:duracion, transition: transUp});
var fxs = {};
window.addEvent("domready",function(){
var subir = function(e) {

e = new Event(e); var a = e.target; a = $(a);
while(a.getTag()!="div" || !a.hasClass("caso"))
a=$(a.getParent());
 if(a.hasClass("caso")) {
 var b = a.getElement('div[class=desc_caso]');
 b=$(b);
 if(b) {
 if(b.getProperty("moving") > 0) {
 fxs[b.getProperty("moving")].stop();
 b.setProperty("moving",0);
 }

 fx = new Fx.Elements(b, {wait:false, duration:(b.getStyle("top").toInt()/topNormal)*duracion, transition: transUp});
 var o = {}; o[0]={ 'top': [topFull]};
 var ran = $random(0,100000);
 fxs[ran]=fx;
 b.setProperty("moving",ran);
 fx.start(o);
 }
 }
 }

 var bajar = function(e) {
 e = new Event(e); var a = e.target; a = $(a);
 while(a.getTag()!="div" || !a.hasClass("caso"))
 a=$(a.getParent());
 if(a.hasClass("caso")) {
 var b = a.getElement('div[class=desc_caso]');
 b=$(b);
 if(b) {
 if( b.getProperty("moving") > 0) {
 fxs[b.getProperty("moving")].stop();
 b.setProperty("moving",0); }

 fx = new Fx.Elements(b, {wait:false, duration:((topNormal-b.getStyle("top").toInt())/topNormal)*duracion, transition: transDown});
 var o = {}; o[0]={ 'top': [topNormal]};
 b.setProperty("moving",1);
 var ran = $random(0,100000);
 fxs[ran]=fx;
 b.setProperty("moving",ran);
 fx.start(o);
 }
 };
 };

$$('.casoimg').addEvent("mouseenter",subir);
$$('.casoimg').addEvent("mouseleave",bajar);
 
})
