
function startJSContentOverlay(key, border, width, height) {
    //get the body scroll position and height
    var bodyScrollTop = $(window).scrollTop(); //only works if body has overflow
    var bodyScrollHeight = $(window).height();
    var docHeight = $(document).height();

	//make sure there ain't nuttin overlayin'
	removeSiteOverlays(); //CUSTOM
	killTimers();

    //add the elements to the DOM
	$("body")
		.append('<div class="lightboxContainer siteOverlay"></div><a class="lightboxClose siteOverlay" href="javascript:void(0);"></a>');
	
    //position it correctly after downloading
    var mediaItemWidth = width;
    var mediaItemHeight = height;
	var marginTop = 16;
	if (bodyScrollHeight/2 - mediaItemHeight/2 - border > 16)
		var marginTop = bodyScrollHeight/2 - mediaItemHeight/2 - border;
    $(".lightboxContainer")
        .css({
            "border-width":border+"px",
            "top":         bodyScrollTop - 35 +"px",
            "left":        "50%",				
            "margin-top":  marginTop + "px",
            "margin-left": (-mediaItemWidth/2 - border) + "px",
            "height":	   mediaItemHeight + "px"
        })
        .animate({"opacity":"1"}, 400, "linear", function() {
            $(".lightboxClose")
                .css({
                    "top":        bodyScrollTop+"px",
                    "left":       "50%",				
                    "margin-top": (marginTop - 16) + "px",
                    "margin-left":(mediaItemWidth/2 - 128) + "px",
                    "opacity":    1
                });
        })
        .focus();

    //fill the lightbox container with html
    showInfo(key); //CUSTOM

    //initiate the removeOverlay
    window.removeJSContentOverlay();
}

function removeJSContentOverlay() {
    // allow users to be able to close the lightbox
	$(".lightboxClose, .lightboxOverlay").click(function(){
		$(".lightboxClose, .lightboxContainer, .lightboxOverlay").animate({"opacity":"0"}, 200, "linear", function(){
			$(".lightboxClose, .lightboxContainer, .lightboxOverlay").remove();
			
			//CUSTOM
			handleMoveInvite();
		});
	});
}

