var parametros;
$(document).ready(function(){
	/*$("#overlay").toggle(
		function () {
			$(this).fadeTo("slow", 0.1);
		},
		function () {
			$(this).fadeTo("slow", 1);
		}
    );*/	
	$("#bt_fechar, #overlay").click(function(){
		$("#lightbox").fadeOut("last");												 
	});	
	//ligthBox("http://www.abissaldesign.com.br/uploads/imagens_projetos/20090121155457.jpg", 715, 440, "Legenda Teste"); 
	$("a.link_news").nyroModal({
		width:552,
		height:400
	});
});
//função que mostra o lightbox
function ligthBox(imagem, largura, altura, legenda) {
	
	$("#overlay").css({	"opacity": 0.5, "width": $(document).width() });
	
	$("#imagem_lightbox").parent().css({
				"width": 50,
				"height": 50,
				"left": ($(document).width()-70)/2,
				"top": ($(document).height()-70)/2,
				"margin": 0
	});
	
	esquerda = $(document).width()-largura-20;
	topo = $(document).height()-altura-20;	
	//alert("Imagem: "+imagem+" e largura: "+largura+" e altura: "+altura+" e legenda: "+legenda);
	$("#legenda_lightbox").html(legenda);
	$("#imagem_lightbox").
			attr({ 
			  "src": imagem, 
			  "width": largura, 
			  "height": altura	  
			 	})
			.hide()
			.parent().animate({
				"width": largura,
				"height": altura+40,
				"left": esquerda/2,
				"top": topo/2,
				"margin": 0
				  }, "slow", function (){
						$("#imagem_lightbox").fadeIn("slow");
					  });
	$("#lightbox").fadeIn("fast");
}
