/*
 */
function doDeleteOpenInvitation(invitation)
{
    var confirmDelete = confirm("Are you sure you want to close and delete this invitation?");
    if (confirmDelete)
    {
        var theForm = document.getElementById("invitationFunctions");
        theForm.action = "/MyCommunity/DeleteInvitation.html?invitation=" + invitation;
        theForm.submit();
    }
}
/*
 */
function doDeleteClosedInvitation(invitation)
{
    var confirmDelete = confirm("Are you sure you want to clear this completed invitation?");
    if (confirmDelete)
    {
        var theForm = document.getElementById("invitationFunctions");
        theForm.action = "/MyCommunity/DeleteInvitation.html?invitation=" + invitation;
        theForm.submit();
    }
}
/*
 */
function doResendInvitation(invitation)
{
    var confirmDelete = confirm("Are you sure you want to resend this invitation?");
    if (confirmDelete)
    {
        var theForm = document.getElementById("invitationFunctions");
        theForm.action = "/MyCommunity/ResendInvitation.html?invitation=" + invitation;
        theForm.submit();
    }
}
/*
 */
function doAdministratorResetPassword(memberId)
{
    var confirmDelete = confirm("Are you sure you want to reset this member's password?");
    if (confirmDelete)
    {
        var theForm = document.getElementById("communityMemberFunctions");
        theForm.action = "/MyCommunity/AdministratorResetPassword.html?member=" + memberId;
        theForm.submit();
    }
}
/*
 */
function doAdministratorRemoveMember(memberId)
{
    var confirmDelete = confirm("Are you sure you want to remove this member from the community?  This cannot be reversed.");
    if (confirmDelete)
    {
        var theForm = document.getElementById("communityMemberFunctions");
        theForm.action = "/MyCommunity/AdministratorRemoveMember.html?member=" + memberId;
        theForm.submit();
    }
}
/*
 */
function doMakeAdministrator(memberId)
{
    var confirmDelete = confirm("Are you sure you want make this member an administrator?  They will be able to edit/delete all content and manage new and existing members.  This cannot be reversed.");
    if (confirmDelete)
    {
        var theForm = document.getElementById("communityMemberFunctions");
        theForm.action = "/MyCommunity/MakeAdministrator.html?member=" + memberId;
        theForm.submit();
    }
}
/*
 */
function doSuggestFriendlyName()
{
    var forename = document.getElementById("forename").value;
    forename = forename.substring(0,20);
    document.getElementById("friendlyName").value=forename;
}
/*
 */
function doSuggestCategoryDescription()
{
    var categoryName = document.getElementById("categoryName").value;
    if (categoryName=="Friends and Family")
    {
        document.getElementById("categoryDescription").value="Our community website for keeping in touch.";
    }
    else if(categoryName=="Formal Group")
    {
        document.getElementById("categoryDescription").value="Our online organisation and communication package.";
    }
    else if(categoryName=="Social Club")
    {
        document.getElementById("categoryDescription").value="Our online organisation and communication package.";
    }
    else if(categoryName=="Sports Club")
    {
        document.getElementById("categoryDescription").value="Our online organisation package.";
    }
    else
    {
        document.getElementById("categoryDescription").value="";
    }
}