function handleModal(id, liid) {
	var height = document.documentElement.clientHeight - 433;
	var width = document.documentElement.clientWidth - 599;
	height = height/2;
	width = width/2;
	var box = document.getElementById(id); 
	if (box.style.visibility == "visible") {
		if ( openbox == id ) {
			return;
		}
		box.style.visibility = "hidden"; 
		
	} 
	else { 
		var openedbox = document.getElementById(openbox);
		openedbox.style.visibility = "hidden"; 
		box.style.visibility = "visible";
	}
	openbox = id;
	assignArrow(liid);
}

function assignArrow(id) {
	var litoassign = document.getElementById(id);
	var openedarrow = document.getElementById(currentarrow);
	//alert("arrow to close: " + currentarrow + "\nLI Array length: " + lis.length);
	if(currentarrow != "startbox") {
		//alert("Closing already opened arrow");
		if(currentarrow == litoassign.id){ return; }
		else { openedarrow.style.listStyleImage = 'none'; }
	}
	
	litoassign.style.listStyleImage = 'url(images/zirrec-arrow.png)';
	
	currentarrow = id;
}

function closeModal(id) {
	
	var box = document.getElementById(openbox);
	var arrow = document.getElementById(currentarrow);
	
	box.style.visibility = "hidden";
	arrow.style.listStyleImage = "none";
	
	openbox = "start-box";
	currentarrow = "startbox";
	
}