﻿//function pageLoad()
//{
    //This will be needed whenever an ajax enabled UpdatePanel is posting back to a page and it uses thickbox.
//    var isAsyncPostback = Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();
//    if (isAsyncPostback) {
//        tb_init('a.thickbox, area.thickbox, input.thickbox');
//    }
//}


//kc april 8 2009


function ShowPledgeThankYou() {

    var showthankyou = false;

    $.ajax(
    {
        
        type: "GET",
        async: false,
        cache: false,
        url: "../ajax/ShowPledgeThankyou.aspx",
        success: function(msg) {
//alert(msg);
            if(msg=="yes"){
                showthankyou = true;
            }
        }
    });

    return showthankyou;
};

function AddPledgeModalWindow(ID, height, width, refreshDiv)
{

    if (ShowPledgeThankYou())
    {
       
        tb_show("", "modal/AddPledgeConfirm.aspx?ID=" + ID + "&refreshDiv=" + refreshDiv + "&TB_iframe=true&height=" + height + "&width=" + width, false);
    }
    else
    {
        //increment
        $.ajax(
        {
            type: "GET",
            async: false,
            url: "../ajax/PledgeWithoutConfirmDialog.aspx?ID=" + ID ,
            success: function(msg) {
            }
        });
      
      if(refreshDiv != '')
      {
        self.__doPostBack(refreshDiv, '');
      }
    }
   //return true; 
}
        
function FlagContent(ID, Source)
{
    tb_show("", "modal/FlagInappropriate.aspx?ID=" + ID + "&Source=" + Source + "&TB_iframe=true&height=483&width=888", false);
}
        
function CloseAndRedirect(webpage)
{
    window.location = webpage;
}

function CommentOnWebisode(WebisodeID, CommentID)
{
    tb_show("", "modal/CommentOnWebisode.aspx?WebisodeID=" + WebisodeID + "&CommentID=" + CommentID + "&TB_iframe=true&height=483&width=888", false);
}

function RemovePledgeModalWindow(ID, height, width, refreshDiv)
{
    tb_show("", "modal/RemovePledgeConfirm.aspx?ID=" + ID + "&refreshDiv=" + refreshDiv + "&TB_iframe=true&height=" + height + "&width=" + width, false);
}


function ShowLightbox(link)
{
    tb_show("", link, false);
}

        
        
