// JavaScript Document
// JavaScript Document
var bottom_expanded = "";


function bottom_expand (id, top_height) {
	if (bottom_expanded == "") {
		
		document.getElementById(id).style.display = "block";
		bottom_show (id, top_height);	
	}
	else {
		
		if (bottom_expanded != id) {
			bottom_hide (bottom_expanded);

			document.getElementById(id).style.display = "block";
			bottom_show (id, top_height);
		}
		else {
			bottom_hide (bottom_expanded);
		}
		
		
		
	}
}

function bottom_show (id, top_height) {
	var cur_height = document.getElementById(id).style.height;
	
	cur_height = cur_height.replace("px", "");
	if (cur_height != "") {
		cur_height = parseInt(cur_height);	
	}
	
	if (cur_height < top_height) {
		if ((cur_height + 10) > top_height) {
			cur_height = top_height;
		}
		else {
			cur_height += 10;
		}
		document.getElementById(id).style.height = cur_height+"px";
		
		setTimeout ("bottom_show('"+id+"', "+top_height+")", 10);
	}
	else {
		bottom_expanded = id;
	}
}

function bottom_hide (id) {
	var the_height = document.getElementById(id).style.height;
	
	the_height = the_height.replace("px", "");
	if (the_height != "") {
		the_height = parseInt(the_height);	
	}
	
	if (the_height > 0) {
		if ((the_height-10) < 0) {
			the_height = 0;
		}
		else {
			the_height -= 10;
		}
		document.getElementById(id).style.height = the_height+"px";
		
		setTimeout ("bottom_hide('"+id+"')", 10);
	}
	else {
		document.getElementById(id).style.display = "none";
		if (bottom_expanded == id) {
			bottom_expanded = "";
		}
	}
}