var menuOpen;
menuOpen = false;

function revealCol(x){
	done = false;
	thisRow = 1;
	while(!done){
		thisCell = "c"+x+"r" + thisRow;
		if(document.getElementById(thisCell)){
			//alert("Yes: "+thisCell);
			document.getElementById(thisCell).style.visibility = "visible";
			document.getElementById(thisCell).style.position = "relative";
			for(col = 0; col < x; col++){
				document.getElementById("c"+col+"r"+thisRow).style.position = "relative";
				document.getElementById("c"+col+"r"+thisRow).style.visibility = "hidden";
			}
			document.getElementById("row"+thisRow).style.visibility = "visible";
			document.getElementById("row"+thisRow).style.position = "relative";
			thisRow++;
		}else{
			done=true;
		}	
	}
	menuOpen = true;
}
/*
function menuCollapse(){
	alert(menuOpen);
}
*/

function menuCollapse(){


	if(menuOpen){

		for(col = 0; col < 5;  col++){
			//alert(col);	

			done=false;
			thisRow = 1;
			while(!done){
				thisCell = "c"+col+"r" + thisRow;
				//alert(thisCell);
				if(document.getElementById(thisCell)){
					//alert("Yes: "+thisCell);
					document.getElementById(thisCell).style.visibility = "hidden";
					document.getElementById(thisCell).style.position = "absolute";
					document.getElementById("row"+thisRow).style.visibility = "hidden";
					document.getElementById("row"+thisRow).style.position = "absolute";					
					thisRow++;
				}else{
					done = true;
					
				}
			}
	
		}
		//alert("Final col~row: " + thisCell);
	}
}

function keepAtt(mycol){
	//alert("Keeping my attention!");
	revealCol(mycol);
}