// JavaScript Document
var nav_expanded = "";


function expand (id, top_height) {
	if (nav_expanded == "") {
		
		document.getElementById(id).style.display = "block";

		show (id, top_height);	
	}
	else {
		
		if (nav_expanded != id) {
			hide (nav_expanded);

			document.getElementById(id).style.display = "block";
			show (id, top_height);
		}
		else {
			hide (nav_expanded);
		}
		
		
		
	}
}

function 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 ("show('"+id+"', "+top_height+")", 10);
	}
	else {
		document.getElementById(id+"_header").className = "nav_header_over";
		nav_expanded = id;
	}
}

function hide (id) {
	var the_height = document.getElementById(id).offsetHeight+"px";
	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 ("hide('"+id+"')", 10);
	}
	else {
		document.getElementById(id).style.display = "none";3
		document.getElementById(id+"_header").className = "nav_header";
		if (nav_expanded == id) {
			nav_expanded = "";
		}
	}
}




<!-- FORMS! -->

function clearForm(id) {
	id.value = "";	
}
function returnForm(id, message) {
	if (id.value == "") {
		id.value = message;	
	}
}



<!-- POPS! -- >

function showPopup(id) {

	document.getElementById('overlay').style.display = "block";
	document.getElementById(id).style.display = "block";

}

function disposePop() {

	document.getElementById('overlay').style.display = "none";
	document.getElementById('send_to_friend').style.display = "none";
	document.getElementById('feedback').style.display = "none";
}
