// JavaScript Document
var lightActive = false;

function loadLight(){
	if(lightActive==false){
		$("#lightBack").css({
			"opacity": "0.7"
		});
		$("#inhoudLight").css({
			"opacity": "1"
		});
		$("#lightBack").fadeIn("slow");
		$("#inhoudLight").fadeIn("slow");
		
		lightActive = true;
	}
}

function centerPopup(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#inhoudLight").height();
	var popupWidth = $("#inhoudLight").width();
	//centering
	$("#inhoudLight").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
	//only need force for IE6
	
	$("#lightBack").css({
		"height": windowHeight
	});
	
}

function disablePopup(){
	//disables popup only if it is enabled
	if(lightActive==true){
			$("#lightBack").fadeOut("slow");
		$("#inhoudLight").fadeOut("slow");
		lightActive = false;
	}
}
