i=0;
function navega_foto(d) {
	switch(d) {
		case "+" : i++; break;
		case "-" : i--; break;
	}
	if(i > 4) {
		i = 1;
	} else if (i < 1) {
		i = 4;
	}
	if (document.images['foto']) {
		document.images['foto'].src = "thumb.php?filename=" + eval('p'+i) + "&width=442&height=332";
		var img = document.getElementById("foto_produto_img");
		img.src = eval('p'+i);
	}
}
function mostra_foto(i) {
	document.images['foto'].src = eval('p'+i);
	if (document.images['foto']) {
		document.images['foto'].src = "thumb.php?filename=" + eval('p'+i) + "&width=442&height=332";
		var img = document.getElementById("foto_produto_img");
		img.src = eval('p'+i);
	}
}
function troca_news() {
	document.getElementById("forms").style.display = "block";
	/*
		if(document.getElementById("texto")) {
		document.getElementById("texto").style.display = "none";
		document.getElementById("forms").style.display = "block";
	}*/
}

function AbreFoto(foto, tamx, tamy) {
	lf = Math.floor(screen.width/2) - Math.floor(tamx/2);
	tp = Math.floor(screen.height/2) - Math.floor(tamy/2);
	w = open(foto,"Foto","resizable=no,toolbar=no,status=no,menubar=no,scrollbars=no,width=" + tamx + ",height=" + tamy + ", left = " + lf + ", top = " + tp)
	w.document.open();
	w.document.write("<html><title>BRASIGRAN</title>");
	w.document.write("<body bgcolor=\"#FFFFFF\" topmargin=\"0\" leftmargin=\"0\" rightmargin=\"0\" bottommargin=\"0\">");
	w.document.write("<img src=\""+foto+"\">");
	w.document.write("</body></html>");
	w.document.close();
}
