// JavaScript Document
current = "";

function expand(id) {
	
	if (id != current) {
		if (document.getElementById(id) != null) {
			
			height = document.getElementById(id+"_nav").offsetHeight;


			document.getElementById(id).style.paddingTop = "2px";
			document.getElementById(id).style.paddingBottom = "2px";
			document.getElementById(id).style.borderBottom = "1px dotted #ac0300";
			document.getElementById(id).style.display = "block";
			
			openSlide(id, height, 0);
			
			
			if (current != "") {
				
				height = parseInt(document.getElementById(current).style.height.replace("px",""));
				
				closeSlide(current, 0, height);
				
				current = "";
			}
			
			current = id;
		}
	}	
	else {
		
		height = parseInt(document.getElementById(current).style.height.replace("px",""));
				
		closeSlide(current, 0, height);
				
		current = "";
	}
	
	
}


function closeSlide (id, height, current) {
	
	speed = 4;
	
	if (current > height) {
		if ((current - speed) < height) {
			current = height;	
		}
		else {
			current -= speed;	
		}
		document.getElementById(id).style.height = current+"px";
		
		
		setTimeout ("closeSlide('"+id+"', "+height+", "+current+")", 10);
	}
	else {
		document.getElementById(id).style.overflow = "hidden";	
		document.getElementById(id).style.height = "0px";
		document.getElementById(id).style.paddingTop = "0px";
		document.getElementById(id).style.paddingBottom = "0px";
		document.getElementById(id).style.borderBottom = "0px dotted #ac0300";
	}
}

function openSlide (id, height, current) {
	
	speed = 4;
	
	if (current < height) {
		if ((current + speed) > height) {
			current = height;	
		}
		else {
			current += speed;	
		}
		document.getElementById(id).style.height = current+"px";
		
		
		setTimeout ("openSlide('"+id+"', "+height+", "+current+")", 10);
	}
}