

// JavaScript File



function StartPrivateChat(withUserID)
{
    SetUpdating();
    
    var postbackUrl = "/appchat/ajax/invite.aspx";
    postbackUrl += "?roomid=" + roomID;
    postbackUrl += "&userid=" + userID;
    postbackUrl += "&invite=" + escape(withUserID);
    
    GetAjaxContent(postbackUrl, PrivateChatReady);
    
    LaunchPrivateChat(withUserID);
}

function PrivateChatReady(responseText)
{
    SetIdle();
    
    if (responseText == "ERROR")
        ShowMessageWindow("<div class=\"MediumHeader\">Private Chat:</div><br />The private chat cannot be created at this time.");
    else
    {
        HideMessageWindow();
    }
}

function LaunchPrivateChat(withUserID)
{
    if (withUserID == undefined)
        ShowMessageWindow("<div class=\"MediumHeader\">Private Chat:</div><br />The other user is not available.  This private chat cannot be launched.");

	var chatWindow = window.open("/appchat/private/" + userID + "/" + withUserID + "/","chat" + userID + "x" + withUserID,"width=525,height=475");
    if (window.focus)
    	chatWindow.focus();
}

function AcceptPrivateChatInvite()
{
    // TODO TODO
}
