// >>>>> Esse código é para abrir as imagens no centro <<<<<
// >>>>> Início
links = document.getElementsByTagName("a");
for (i = 0; i < links.length; i++) {
	if (links[i].parentNode.id == "up" || links[i].parentNode.id == "leftside" || links[i].parentNode.id == "rightside" || links[i].parentNode.id == "bottom") {
		links[i].onclick = function() {
			document.getElementById("photo").innerHTML = "<img id=\"z" + this.id + "\" src=\"photos/" + this.id + ".jpg\" width=\"480px\" height=\"360px\" alt=\"\" />";
			image_zoom(this.id);
			return(false);
		}
	}
}
// >>>>> Fim

// >>>>> Esse código é para abrir a foto grande <<<<<
// >>>>> Início
img_zoom = document.getElementById("photo").getElementsByTagName("img");
for (k = 0; k < img_zoom.length; k++) {
	id = img_zoom[k].id;
	id = id.substr(1);
	img_zoom[k].onclick = function() {
		document.getElementById("zoom").innerHTML = "<img src=\"photos/" + id + ".jpg\" width=\"760px\" height=\"570px\" alt=\"\" /><a href=\"\">Fechar</a>";
		document.getElementById("zoom").style.display = "block";
		document.getElementById("greybox").style.display = "block";
		close_zoom();
		return(false);
	}
}

function image_zoom(id) {
	img_zoom = document.getElementById("photo").getElementsByTagName("img");
	for (k = 0; k < img_zoom.length; k++) {
		img_zoom[k].onclick = function() {
			document.getElementById("zoom").innerHTML = "<img src=\"photos/" + id + ".jpg\" width=\"760px\" height=\"570px\" alt=\"\" /><a href=\"\">Fechar</a>";
			document.getElementById("zoom").style.display = "block";
			document.getElementById("greybox").style.display = "block";
			close_zoom();
			return(false);
		}
	}
}
// >>>>> Fim

// >>>>> Esse código fecha a foto grande <<<<<
// >>>>> Início
function close_zoom(){
	aclose = document.getElementById("zoom").getElementsByTagName("a");
	aclose[0].onclick = function(){
		document.getElementById("zoom").style.display = "none";
		document.getElementById("greybox").style.display = "none";
		return(false);
	}
}
// >>>>> Fim
