var previous;
var prev_link;
var current;
var cur_id;


function menu(div_id) {
			
	if (div_id) {
		cur_id = "pull-" + div_id;
		current = document.getElementById(cur_id).style.visibility;
		previous = cur_id;
		prev_link = div_id;
	}
		
	if (!div_id) {	
		current = document.getElementById(cur_id).style.visibility;
		if ( current == "visible" ) {
			document.getElementById(previous).style.visibility = "hidden";
			hoveroff(prev_link);
		}
		else {
			document.getElementById(previous).style.visibility = "visible";
			hoveron(prev_link);
		}
	}
	
	if ( current == "visible" ) {
			document.getElementById(cur_id).style.visibility = "hidden";
			hoveroff(prev_link);
	}
	else {
			document.getElementById(cur_id).style.visibility = "visible";
			hoveron(prev_link);
	}
	
}

function hoveron(id) {
	image = "images/nav_" + id + "1.png";
	name = "img_" + id;
	document[name].src = image;
//if (id == "portfolio"){
//Effect.Appear('portfolio_menu');
//}
}

function hoveroff(id) {
	image = "images/nav_" + id + "0.png";
	name = "img_" + id;
	document[name].src = image;
}
