// 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;
	}
}
function loadConfigTemplate(){
				document.getElementById('inhoudLight').style.width = 850 + 'px';
				document.getElementById('contentLight').style.width = 850 + 'px';
				document.getElementById('inhoudLight').style.height = 650 + 'px';
				document.getElementById('contentLight').style.height = 650 + 'px';
		
				//document.getElementById('headerLight').innerHTML = "Template Setup!";
				//phpNaarDiv('contentLight','/action/template_setup.php',false,'');
		
				$(document).ready(function(){ 
				loadLight(); 
				centerPopup();
				});
			}
