var width = 600;    // lightbox width
var height = 500;   // lightbox height

// called from UserEnrollment on EventDetails.ascx page
function enrollConfirm(confirmText, hasDemographics)
{
    if (confirm(confirmText))
    {
        if (hasDemographics)
        {
            showInLightbox();
            return false;
        }
        return true;
    }
    else
    {
        return false;
    }
}

// demographicsId is set on the EventDetails.ascx page
function showInLightbox()
{
    var title = "Related Questions";
    tb_show(title, "#TB_inline?height=" + height + "&width=" + width + "&inlineId=" + demographicsId + "&modal=true", null);
}

// closes the lightbox and calls the Signup button on the EventDetails.ascx page
function closeLightbox()
{
    tb_remove(); // close light box
    
    // the signup button has a javascript post back callback. run that 
    // when closing the lightbox
    var cmdSignup = document.getElementById("cmdSignup");
    eval(cmdSignup.href);
}

var j$ = jQuery.noConflict();
