function addMethod(str){
	var obj = document.getElementById(str);
	obj.style.overflow='hidden';
	
	obj.animationOpenClose = new aoc();
					
	function aoc(){
		var height = 0;
		var targetHeight = 0;
		var maxHeight = 0;
		var cutSpeed = 8;
		var objVisible = false;
		var moving = false;
		var targetObj = obj;
		var triggerImgObject = obj;
	
		//this.setTargetObj = setTargetObj;
		this.show = show;
		this.hide = hide;
		this.eswitch = eswitch;
		this.setTriggerImgObject = setTriggerImgObject;
		
		this.getObjVisible = getObjVisible;
		this.getMoving = getMoving;
	
		function setTargetObj(val)
		{
			targetObj = val;
		}
		function setTriggerImgObject(val)
		{
			triggerImgObject = val;
		}
		function getObjVisible(){
			return objVisible;
		}
		function getMoving(){
			return moving;
		}

		
		function show(){
			if(!moving){
				targetObj.style.display='block';
				if (maxHeight == 0){
					maxHeight = parseInt(targetObj.offsetHeight);
				}
				targetObj.style.height = 0
				targetHeight = maxHeight;
				objVisible = true;
				moving = true;
				cutInDiv();
			}
		}
		
		function cutInDiv(){
			height += cutSpeed;
			if(height>targetHeight){
				height=targetHeight;
			}
			targetObj.style.height = height+"px";
			if(height<targetHeight){
				setTimeout(cutInDiv,20);
			}else{
				targetObj.style.height = '';
				targetObj.style.display="block";
				moving = false;
			}
		}
		
		
		function hide(){
			if(!moving){
				if (maxHeight == 0){
					maxHeight = parseInt(targetObj.offsetHeight);
					height = maxHeight;
				}
				targetHeight=0;
				moving=true;
				cutOutDiv();
			}
		}
		
		
		function cutOutDiv(){
			height -= cutSpeed;
			if(height<targetHeight){
				height=targetHeight;
			}
			targetObj.style.height = height+"px";
			if(height>targetHeight){
				setTimeout(cutOutDiv,20);
			}else{
				targetObj.style.display="none";
				objVisible = false;
				moving = false;
			}
		}
		
		function eswitch(){
			if(!moving){
				if(targetObj.style.display=="none"){
					triggerImgObject.src = '/it_IT/static/images/menus.gif';	
					this.show();
				} else {
					triggerImgObject.src = '/it_IT/static/images/add.gif';
					this.hide();
				}
			}
		}
	
	}
}
