//** Animated Collapsible DIV v2.0- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com. //** May 24th, 08'- Script rewritten and updated to 2.0. //** June 4th, 08'- Version 2.01: Bug fix to work with jquery 1.2.6 (which changed the way attr() behaves). var animatedcollapse={ divholders: {}, //structure: {div.id, div.attrs, div.$divref} divgroups: {}, //structure: {groupname.count, groupname.lastactivedivid} lastactiveingroup: {}, //structure: {lastactivediv.id} show:function(divids){ //public method if (typeof divids=="object"){ for (var i=0; i1 && (action=="show" || action=="toggle" && $divref.css('display')=='none')){ //If current DIV belongs to a group if (targetgroup.lastactivedivid && targetgroup.lastactivedivid!=divid) //if last active DIV is set this.slideengine(targetgroup.lastactivedivid, 'hide') //hide last active DIV within group first this.slideengine(divid, 'show') targetgroup.lastactivedivid=divid //remember last active DIV } else{ this.slideengine(divid, action) } } }, slideengine:function(divid, action){ var $divref=this.divholders[divid].$divref if (this.divholders[divid] && $divref.length==1){ //if this DIV exists var animateSetting={height: action} if ($divref.attr('fade')) animateSetting.opacity=action $divref.animate(animateSetting, $divref.attr('speed')? parseInt($divref.attr('speed')) : 500) return false } }, generatemap:function(){ var map={} for (var i=0; i