
var siteStatus = 0;

function centerPopup(){
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = 600;
	var popupWidth = 955;
	$("#contentWrapper").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
}

function loadSite(){
	if(siteStatus==0){
		$("#overlayHold").hide();
		$("#contentWrapper").fadeIn("slow", function() {
			$("#contentContainer").fadeIn("slow", function() {
				thisAddEffects();
			});
		});
		siteStatus = 1;
	}
}

//****************************************************

function addFunctions() {
	$(".more").click(function(){
		$(this).next().fadeIn("slow");
	});
}

function thisAddCustomScrollbar() {
	$('#longText').jScrollPane(
		{
			topCapHeight: 130,
			bottomCapHeight: 130,
			scrollbarWidth: 8,
			scrollbarMargin: 25
		}
	);
}

$(document).ready(function(){
	// $("#startSite").hide();

	centerPopup();
	loadSite();
	$("#startSite").hide();
	

	$("#startSite").click(function(){
		$(this).show("hide");
		centerPopup();
		loadSite();
	});

	// addFunctions();
	$(window).resize(function(){
		centerPopup();
  });
});
