var animatedcollapse={divholders:{},divgroups:{},lastactiveingroup:{},preloadimages:[],show:function(divids){if(typeof divids=="object"){for(var i=0;i1&&(action=="show"||action=="toggle"&&$divref.css('display')=='none')){if(targetgroup.lastactivedivid&&targetgroup.lastactivedivid!=divid) this.slideengine(targetgroup.lastactivedivid,'hide') this.slideengine(divid,'show') targetgroup.lastactivedivid=divid} else{this.slideengine(divid,action)}}},slideengine:function(divid,action){var $divref=this.divholders[divid].$divref var $togglerimage=this.divholders[divid].$togglerimage if(this.divholders[divid]&&$divref.length==1){var animateSetting={height:action} if($divref.attr('fade')) animateSetting.opacity=action $divref.animate(animateSetting,$divref.attr('speed')?parseInt($divref.attr('speed')):500,function(){if($togglerimage){$togglerimage.attr('src',($divref.css('display')=="none")?$togglerimage.data('srcs').closed:$togglerimage.data('srcs').open)} if(animatedcollapse.ontoggle){try{animatedcollapse.ontoggle(jQuery,$divref.get(0),$divref.css('display'))} catch(e){alert("An error exists inside your \"ontoggle\" function:\n\n"+e+"\n\nAborting execution of function.")}}}) return false}},generatemap:function(){var map={} for(var i=0;i0){animatedcollapse[/expand/i.test(relattr)?'show':/collapse/i.test(relattr)?'hide':'toggle'](divids) return false}})}) $(window).bind('unload',function(){ac.uninit()})})},uninit:function(){var opendivids='',groupswithpersist='' jQuery.each(this.divholders,function(){if(this.$divref.css('display')!='none'){opendivids+=this.id+','} if(this.getAttr('group')&&this.getAttr('persist')) groupswithpersist+=this.getAttr('group')+','}) opendivids=(opendivids=='')?'nada':opendivids.replace(/,$/,'') groupswithpersist=(groupswithpersist=='')?'nada':groupswithpersist.replace(/,$/,'') this.setCookie('acopendivids',opendivids) this.setCookie('acgroupswithpersist',groupswithpersist)},getCookie:function(Name){var re=new RegExp(Name+"=[^;]*","i");if(document.cookie.match(re)) return document.cookie.match(re)[0].split("=")[1] return null},setCookie:function(name,value,days){if(typeof days!="undefined"){var expireDate=new Date() expireDate.setDate(expireDate.getDate()+days) document.cookie=name+"="+value+"; path=/; expires="+expireDate.toGMTString()} else document.cookie=name+"="+value+"; path=/"},urlparamselect:function(){window.location.search.match(/expanddiv=([\w\-_,]+)/i) return(RegExp.$1!="")?RegExp.$1.split(","):[]},preloadimage:function(){var preloadimages=this.preloadimages for(var i=0;i0){preloadimages[preloadimages.length]=new Image() preloadimages[preloadimages.length-1].src=arguments[i]}}}}