Selected = new Array();

function PointMatrix(PointCell,MatrixX,MatrixY){
	PointCell.style.backgroundColor = "#ffccaa";

	if(Selected[MatrixY] == undefined){
		QuestionCell = document.getElementById("QuestionNumberCell_0-" + MatrixY);
		QuestionCell.style.backgroundColor = "#ffeeee";
	}

	if(MatrixY < 64){
		AnswerCellY = Math.floor((MatrixY - 1) / 5) * 5;
	}else{
		AnswerCellY = Math.floor((MatrixY - 4) / 5) * 5 + 3;
	}
	AnswerCell = document.getElementById("AnswerNumberCell_" + MatrixX + "-" + AnswerCellY);
	AnswerCell.style.backgroundColor = "#ffffcc";
}

function PointOutMatrix(PointOutCell,MatrixX,MatrixY){
	if(MatrixY % 2 == 1){
		PointOutCell.style.backgroundColor = "#f5f5f5";
	}else{
		PointOutCell.style.backgroundColor = "#e4e4e4";
	}
	if(Selected[MatrixY] == undefined){
		QuestionCell = document.getElementById("QuestionNumberCell_0-" + MatrixY);
		QuestionCell.style.backgroundColor = PointOutCell.style.backgroundColor;
	}

	if(MatrixY < 64){
		AnswerCellY = Math.floor((MatrixY - 1) / 5) * 5;
	}else{
		AnswerCellY = Math.floor((MatrixY - 4) / 5) * 5 + 3;
	}
	AnswerCell = document.getElementById("AnswerNumberCell_" + MatrixX + "-" + AnswerCellY);
	AnswerCell.style.backgroundColor = "#eeeeee";
}

function ChangeSelectedCell(QuestionID){
	QuestionCell = document.getElementById("QuestionNumberCell_0-" + QuestionID);
	QuestionCell.style.backgroundColor = "#ffdddd";
	Selected[QuestionID] = 1;
}

