//Animated Collapsible DIV- Author: Dynamic Drive (http://www.dynamicdrive.com)
//Last updated June 27th, 07'. Added ability for a DIV to be initially expanded.
//Modified by D Fossum 7/7/09, doesn't slide due to issues with nested containers

function animatedcollapse(divId, animatetime, persistexpand, initstate){
	this.divId=divId
	this.divObj=document.getElementById(divId)
	this.expandLinkObj=document.getElementById("img" + divId)
	this.divObj.style.overflow="hidden"
	this.initstate=(typeof initstate!="undefined" && initstate=="block")? "block" : "contract"
	var thisobj=this;
	if(this.initstate == "block"){
		this.divObj.style.display="block";
		this.expandLinkObj.className = "expanded";
	}else{
		this.divObj.style.display="none";
		this.expandLinkObj.className = "collapsed";
	}
}

animatedcollapse.prototype.slidedown=function(){
	this.divObj.style.display = "block";
	this.expandLinkObj.className = "expanded";
}

animatedcollapse.prototype.slideup=function(){
	this.divObj.style.display = "none";
	this.expandLinkObj.className = "collapsed";
}

animatedcollapse.prototype.slideit=function(){
	if (this.divObj.style.display == 'none'){
		this.slidedown()
	}else{
		this.slideup()
	}
}
