function AccordionMenu(){};
AccordionMenu.prototype.expandMenuGroup = function(container, id, minHeight, maxHeight){
    var item = document.getElementById(id);
    if (item)
    {
        if (!container.currentHeight) container.currentHeight = minHeight; //if no mem is set, set it first;
        if (!item.currentHeight) item.currentHeight = minHeight; //if no mem is set, set it first;
		this.doHeightChangeMem(container,item,container.currentHeight,maxHeight,10,40,0.333,false);
    }
}
AccordionMenu.prototype.collapseMenuGroup = function(container, id, minHeight, maxHeight){
    var item = document.getElementById(id);
    if (item)
    {
        if (!container.currentHeight || !item.currentHeight) return; //avoid error if mouseout an element occurs before the mosueover
											//(e.g. the pointer already in the object when onload)
		this.doHeightChangeMem(container,item,container.currentHeight,minHeight,10,40,0.5,true);
    }
}
AccordionMenu.prototype.heightChange = function() {
	if (!this.currentHeight) this.currentHeight = 22; //if no mem is set, set it first;
	this.doHeightChangeMem(this,this.currentHeight,150,10,10,0.333);
}
AccordionMenu.prototype.heightRestore = function() {
	if (!this.currentHeight) return;	//avoid error if mouseout an element occurs before the mosueover
										//(e.g. the pointer already in the object when onload)
	this.doHeightChangeMem(this,this.currentHeight,22,10,10,0.5);
}
AccordionMenu.prototype.easeInOut = function(minValue,maxValue,totalSteps,actualStep,powr) {
//Generic Animation Step Value Generator By www.hesido.com
	var delta = maxValue - minValue;
	var stepp = minValue+(Math.pow(((1 / totalSteps)*actualStep),powr)*delta);
	return Math.ceil(stepp)
}
AccordionMenu.prototype.doHeightChangeMem = function(container,elem,startHeight,endHeight,steps,intervals,powr,collapsing) {
//Height changer with Memory by www.hesido.com
	if (container.heightChangeMemInt) window.clearInterval(container.heightChangeMemInt);
	var actStep = 0;
	var func = this.easeInOut;
	container.heightChangeMemInt = window.setInterval(
		function() {
			container.currentHeight = func(startHeight,endHeight,steps,actStep,powr);
			elem.currentHeight = func(startHeight,endHeight,steps,actStep,powr);
			container.style.height = container.currentHeight+"px";
			elem.style.height = elem.currentHeight+"px";
			actStep++;
			if (actStep > steps)window.clearInterval(container.heightChangeMemInt);
		}
		,intervals)
}
window._AccordionMenu = new AccordionMenu();