var lastDiv = "";

function showDiv(divName) {
	// hide last div
	if (lastDiv) {
	document.getElementById(lastDiv).className = "hiddenDiv";
	}
	
	//if value of the box is not nothing and an object with that name exists, then change the class
	if (divName && document.getElementById(divName)) {
	document.getElementById(divName).className = "visibleDiv";
	lastDiv = divName;
	}
}

var prevDiv = "";

function showMat(layerName) {
	// hide last div
	if (prevDiv) {
	document.getElementById(prevDiv).className = "hiddenDiv";
	}
	
	//if value of the box is not nothing and an object with that name exists, then change the class
	if (layerName && document.getElementById(layerName)) {
	document.getElementById(layerName).className = "visibleDiv";
	prevDiv = layerName;
	}
}

function verify(current) {
	var objdiv = document.getElementById("chkboxes");
	var allElements = objdiv.getElementsByTagName("*");
	var ctr = 0;

	for (var i = 0; i < allElements.length; i++){
		var status = checkStatus(allElements[i]);
		if (status == true){
			ctr++;
		}
	}
	if (ctr > 3) {
		alert("You can't select more than 3 frame samples.");
		current.checked = false;
	}
}

function checkStatus(chkBox) {
	if (chkBox.checked == true)
	return true;
	else
	return false;
}