//****************FOTOS INICIO***************************
function abreFoto(img){
	carregar = new Image();
	carregar.src = img;
	document.getElementById("dvFundo").style.display = "block";
	document.getElementById("dvFoto").style.display = "block";
	document.getElementById("dvFoto").style.backgroundColor="";
	document.getElementById("dvPic").innerHTML = '<img id="imPic" src="images/carregando.gif" style="vertical-align:middle;" /><span>Carregando...<\span>';
	setTimeout("verificaCarregamento()",100);
}

function verificaCarregamento(){
	if(carregar.complete){
		if(navigator.appName.indexOf('Internet Explorer')>0){
			document.getElementById("dvFecha").style.display = "block";
			document.getElementById("dvFoto").style.backgroundColor="#FFFFFF";
			document.getElementById("dvPic").innerHTML = '<img id="imPic" src="'+carregar.src+'" alt="" onload="dvFoto.style.width=screen.availWidth-160;" />';
			document.getElementById("dvFoto").style.marginLeft = -((screen.availWidth-160)/2)+"px";
			document.getElementById("dvFoto").style.left = "50%";
		}else{
			document.getElementById("dvFecha").style.display = "block";
			document.getElementById("dvFoto").style.backgroundColor="#FFFFFF";
 			document.getElementById("dvPic").innerHTML = '<img id="imPic" src="'+carregar.src+'" alt=""/>';
			document.getElementById("dvFoto").style.width = screen.width-160+"px";
			document.getElementById("dvFoto").style.marginLeft = -((screen.width-160)/2)+"px";
			document.getElementById("dvFoto").style.left = "50%";
		}
	}
	else{
		setTimeout("verificaCarregamento()",100);
	}
}
function fechar(){
	document.getElementById("dvFecha").style.display = "none";
	document.getElementById("dvFundo").style.display = "none";
	document.getElementById("dvFoto").style.display = "none";
}
//****************FOTOS FIM***************************
