
function $(id){

	return document.getElementById(id);
	
}

var Foto = {
	
	//Abre janela
	'openFoto': function(foto,w,h){
		
		$('foto').src = foto;
		
		$('janela-foto').style.display = 'block';
		$('janela-foto').focus();
		
		var winW;
		var winH;

		if(parseInt(navigator.appVersion) > 3) {
			if(navigator.appName=="Netscape") {
				winW = window.innerWidth;
				winH = window.innerHeight;
			}
			if(navigator.appName.indexOf("Microsoft")!=-1) {
				winW = document.documentElement.offsetWidth;
				winH = document.documentElement.offsetHeight;
			}
		}
		
		var posx = (winW - w) / 2;
		var posy = ((winH - h) / 2);

		$('janela-foto').style.left=posx + 'px';
		$('janela-foto').style.top=posy + 'px';
		
		$('janela-foto-content').style.width = w + 10;
		$('janela-foto-content').style.height = h + 10;
	},
	
	//Fecha janela
	'Close': function(){
		$('janela-foto').style.display = 'none';
	}

}

