function overlay(){ 
	$('.overlay').addClass("active");
	$('.overlay').css({'display':'block','opacity':0,'width':$(window).width(),'height':$(document).height()}).fadeTo("slow",0.5);
	
			var topPos = parseInt($(window).height() / 2 - $('.box').height() / 2 - 30); 
		   	var leftPos = parseInt($(window).width() / 2 - $('.box').width() / 2);
	   			$('.box').css({'top': topPos, 'left': leftPos}); // this may need to be reworked to account for the module manager.
 };

$(window).resize(function(){
  if($('.overlay').hasClass('active')){
 	  $('.overlay').css({'width':$(document).width(), 'height':$(document).height()});

		   var topPos = parseInt($(window).height() / 2 - $('.box').height() / 2 - 30); 
		   var leftPos = parseInt($(window).width() / 2 - $('.box').width() / 2);
	   			$('.box').css({'top': topPos, 'left': leftPos}); // 150 should be topPos
	}
 });

function hide(){
	$(".box").hide();
	$(".inner").hide();
	$(".overlay").fadeTo("slow", 0).queue(function() {
				$(".overlay").hide();
	        $(this).dequeue();
		})
};

$(document).ready(function(){
		$(".box").removeAttr("id");
		$('.box').appendTo('body').hide().css('position', 'absolute');
		$('.inner').hide();
		$('#top, #bottom').show();
		$('div#percentages').show();
	});


function box27a() {
	overlay();
	$(".box").show()
	$("#inner27a").show();
}

function box34() {
	overlay();
	$(".box").show()
	$("#inner34").show();
}

function box43() {
	overlay();
	$(".box").show()
	$("#inner43").show();
}

function box47() {
	overlay();
	$(".box").show()
	$("#inner47").show();
}

function box48() {
	overlay();
	$(".box").show()
	$("#inner48").show();
}

function box54() {
	overlay();
	$(".box").show()
	$("#inner54").show();
}

function box56() {
	overlay();
	$(".box").show()
	$("#inner56").show();
}

function box57() {
	overlay();
	$(".box").show()
	$("#inner57").show();
}
function box61() {
	overlay();
	$(".box").show()
	$("#inner61").show();
}
function box73() {
	overlay();
	$(".box").show()
	$("#inner73").show();
}
function box96() {
	overlay();
	$(".box").show()
	$("#inner96").show();
}
