var refreshT;
function showBox(box) {
	var windowHeight = $(document).height();
    var windowWidth = $(window).width();
    $('#screen').css({'width':windowWidth,'height':windowHeight});
 
    $('#screen').fadeIn(500);   
	$('#screen').fadeTo("fast",0.7); 
 
    var winHeight = $(window).height();
    var winWidth = $(window).width();
    $(box).css('top',  winHeight/2-$(box).height()/2);
    $(box).css('left', winWidth/2-$(box).width()/2);
    $(box).fadeIn(1000);
}

function hideBox(box) {
	$(box).hide();
}

function reloadPage() {
	window.location.reload();
	clearInterval(refreshT);
}


$(document).ready(function() { 
 $('.close').click(function (e) {
        e.preventDefault();
        $('#screen').fadeOut();
		$('.popbox').fadeOut();
		refreshT = setInterval("reloadPage()", 5000);
		
    });    
     
    $('#screen').click(function () {
        $(this).fadeOut();
        $('.popbox').fadeOut();
		//refreshT = setInterval("reloadPage()", 5000);
    });       
     
});
