
	$(function(){

		var lightBoxStatus=0;function loadLightBox(){
			if(lightBoxStatus==0){
				$('div#LightBoxBackground').css({'opacity':0.2});
				$('div#LightBoxBackground').show();
				$('#LightBox').fadeIn('3000');
				lightBoxStatus=1
			}
		}
		function disableLightBox(){
			if(lightBoxStatus==1){
				$('div#LightBoxBackground').hide();
				$('#LightBox').fadeOut('3000');
				lightBoxStatus=0
			}
		}

		function centerLightBox(){
			var windowWidth=document.documentElement.clientWidth;
			var windowHeight=document.documentElement.clientHeight;
			var lightBoxHeight=$('div#LightBox').height();
			var lightBoxWidth=$('div#LightBox').width();
			$('div#LightBox').css({
				'position':'absolute','top':'10%','left':windowWidth/2-lightBoxWidth/2
			});
			$('div#LightBoxBackground').css({
				'height':windowHeight
			})
		}

		$('a[rel="aciona"]').click(function(){
			centerLightBox();
			loadLightBox()
		});
		$('div#LightBoxClose a, div#LightBoxCancel a, div#LightBoxBackground').click(function(){
			disableLightBox()
		});

		$(document).keypress(function(e){
			if(e.keyCode==27&&lightBoxStatus==1){
				disableLightBox()
			}
		});

	});
