function make_slow() { var $my_obj = new Array(); var _obj_length = 0; var _slow_myName = false; var _start = false; var _end = false; var _set = false; var _step = false; var _max_step = 200; var _wait = false; this.myName = function() { if ( _slow_myName != false ) return; for ( var o in window ) { if ( window[o] == this ) { _slow_myName = o; return true; } } if ( _slow_myName == false ) { alert("unable to install catch program\nobject not found in global name space\ndont use prefix \"var\" inside of functions"); return false; } } this.object = function(o) { $my_obj.push(o); } this.height_start = function(n) { _start = n; _set = n; } this.height_end = function(n) { _end = n; } this.step = function(n) { _step = n; } this.wait = function(n) { if (arguments.length > 0) { _wait = n; _count = 0; } else { for (var i=0; i<$my_obj.length; i++) { var v = Math.min(_set,_end); $my_obj[i].style.height = v + "px"; } if (_set < _end && _count < _max_step) { _set += _step; var _str = _slow_myName + ".wait()"; window.setTimeout(_str,_wait); _count++; } } } }