1 function fx(el,op,ty,tz){
3 z.a = function(){z.el.style[ty]=z.now+z.o.unit};
4 z.max = function(){return z.el["io"+ty]||z.el["natural"+tz]||z.el["scroll"+tz]||z.cur()};
5 z.cur = function(){return parseInt($.getCSS(z.el,ty))};
6 z.show = function(){z.ss("block");z.custom(0,z.max())};
7 z.hide = function(){z.el.$o=$.getCSS(z.el,"overflow");z.el["io"+ty]=this.cur();z.custom(z.cur(),0)};
8 z.ss = function(a){if(y.display!=a)y.display=a};
9 z.toggle = function(){if(z.cur()>0)z.hide();else z.show()};
10 z.modify = function(a){z.custom(z.cur(),z.cur()+a)};
11 z.clear = function(){clearInterval(z.timer);z.timer=null};
12 z.el = el.constructor==String?document.getElementById(el):el;
15 y.overflow = "hidden";
18 duration: (op && op.duration) || 400,
19 onComplete: (op && op.onComplete) || op
21 z.step = function(f,tt){
22 var t = (new Date).getTime();
23 var p = (t - z.s) / z.o.duration;
24 if (t >= z.o.duration+z.s) {
27 setTimeout(function(){
29 if(y.height=="0px"||y.width=="0px")z.ss("none");
30 $.setAuto( z.el, "height" );
31 $.setAuto( z.el, "width" );
32 if(z.o.onComplete.constructor == Function){z.el.$_ = z.o.onComplete;z.el.$_();}
35 z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (tt-f) + f;
38 z.custom = function(f,t){
39 if(z.timer)return;this.now=f;z.a();z.io=z.cur();z.s=(new Date).getTime();
40 z.timer=setInterval(function(){z.step(f,t);}, 13);
43 fx.fn = ["show","hide","toggle"];
44 fx.ty = ["Height","Width","Left","Top"];
45 for(var i in fx.ty){(function(){
47 fx[c] = function(a,b){
48 return new fx(a,b,c.toLowerCase(),c);};
50 fx.Opacity = function(a,b){
51 var o = new fx(a,b,"opacity");
52 o.cur = function(){return parseFloat(o.el.style.opacity);};
55 if (o.now == 1) o.now = 0.9999;
56 if (window.ActiveXObject)
57 e.filter = "alpha(opacity=" + o.now*100 + ")";
64 fx.Resize = function(e,o){
66 var h = new fx.Height(e,o);
67 if(o) o.onComplete = null;
68 var w = new fx.Width(e,o);
69 function c(a,b,c){return (!a||a==c||b==c);}
70 for(var i in fx.fn){(function(){
73 if(c(a,b,"height")) h[j]();
74 if(c(a,b,"width")) w[j]();
77 z.modify = function(c,d){
82 fx.FadeSize = function(e,o){
84 var p = new fx.Opacity(e,o);
85 if(o) o.onComplete = null;
86 var r = new fx.Resize(e,o);
87 for(var i in fx.fn){(function(){
89 z[j] = function(a,b){p[j]();r[j](a,b);};
93 $.speed = function(s,o) {
94 if ( o && o.constructor == Function ) o = { onComplete: o };
96 var ss = {"crawl":1200,"xslow":850,"slow":600,"medium":400,"fast":200,"xfast":75,"normal":400};
97 o.duration = typeof s == "number" ? s : ss[s] || 400;
101 $.fn.hide = function(a,o) {
103 return a ? this.each(function(){
104 new fx.FadeSize(this,o).hide();
108 $.fn.show = function(a,o) {
110 return a ? this.each(function(){
111 new fx.FadeSize(this,o).show();
115 $.fn.slideDown = function(a,o) {
117 return this.each(function(){
118 new fx.Resize(this,o).show("height");
122 $.fn.slideUp = function(a,o) {
124 return this.each(function(){
125 new fx.Resize(this,o).hide("height");
129 $.fn.fadeOut = function(a,o) {
131 return a ? this.each(function(){
132 new fx.Opacity(this,o).hide();
136 $.fn.fadeIn = function(a,o) {
138 return a ? this.each(function(){
139 new fx.Opacity(this,o).show();
143 $.fn.center = function(f) {
144 return this.each(function(){
145 if ( !f && this.nodeName == 'IMG' &&
146 !this.offsetWidth && !this.offsetHeight ) {
148 setTimeout(function(){
149 $(self).center(true);
153 var p = this.parentNode;
154 if ( $.css(p,"position") == 'static' )
155 p.style.position = 'relative';
156 s.position = 'absolute';
157 s.left = parseInt(($.css(p,"width") - $.css(this,"width"))/2) + "px";
158 s.top = parseInt(($.css(p,"height") - $.css(this,"height"))/2) + "px";
163 $.setAuto = function(e,p) {