Core.Widget.BlindAnimator=function(b,i){var j=YAHOO.util.Anim,c=Object.is(i)?i:{},f=YAHOO.util.Dom,k=function(){},g=false,h=null;
var e={node:f.get(b)};
if(!e.node){return
}if(!c.animSpeedDown){c.animSpeedDown=0.5
}if(!c.animSpeedUp){c.animSpeedUp=0.5
}if(!c.bottomPadding){c.bottomPadding=0
}if(!c.minHeight){c.minHeight=0
}if(!c.maxHeight){var a=f.getRegion(e.node);
c.maxHeight=a.bottom-a.top;
g=true
}var d={blindDown:new j(e.node,{height:{from:c.minHeight,to:c.maxHeight}},c.animSpeedDown,c.easing),blindUp:new j(e.node,{height:{from:c.maxHeight,to:c.minHeight}},c.animSpeedUp,c.easing)};
d.blindDown.onStart.subscribe(function(){f.setStyle(e.node,"overflow","hidden")
});
d.blindUp.onComplete.subscribe(function(){f.setStyle(e.node,"overflow","visible")
});
d.blindDown._onComplete.subscribe(function(){g=true
});
d.blindUp._onComplete.subscribe(function(){g=false
});
if(c.scrollToViewport){d.blindDown._onTween.subscribe(function(){var n=f.getRegion(e.node),o=Core.Client.getScrollOffset(),l=Core.Client.getViewportSize(),p=n.bottom+c.bottomPadding,m=o.y+l.y;
if(p>m){window.scroll(0,o.y+p-m)
}})
}k.prototype={blindDown:function(){h.stop();
d.blindDown.animate()
},blindUp:function(){h.stop();
d.blindUp.animate()
},stop:function(){d.blindDown.stop();
d.blindUp.stop()
},toggle:function(){h[g?"blindUp":"blindDown"]()
},subscribe:function(m,n,p,q){var l=p?d.blindUp:d.blindDown;
if(l[m]&&l[m].subscribe){l[m].subscribe(n,q)
}}};
h=new k();
return h
};
