function ResetPage() {
    setTimeout("document.location=document.location", 1500);
}

function UploadBericht(p_strId) {
    SendRequest('/Ajax/Group/BerichtVoegtoe.aspx', 'gId=' + p_strId);
}


function SaveBericht(p_strId) {
    DHTMLAreaToTextArea();
    var l_blnError = false;
    
    if(document.getElementById('BerichtTitel').value == '') {
        alert ('De titel is verplicht!');
        document.getElementById ('BerichtTitel').focus();
        l_blnError = true;
    }
    if(!l_blnError) {
        SendRequestFunction('/Ajax/Group/BerichtVoegtoe.aspx', GetAllValues('FormBerichtUpload') + '&gId=' + p_strId, ResetPage);
    }
}


function EditBericht(p_strId) {
    SendRequest('/Ajax/Group/BerichtEdit.aspx', 'rId=' + p_strId);
}


function SaveEditBericht(p_strId) {
    DHTMLAreaToTextArea();
    if(document.getElementById('BerichtDelete').checked) {
        SendRequestFunction('/Ajax/Group/BerichtEdit.aspx', GetAllValues('FormBerichtUpload') + '&rId=' + p_strId, ResetPage);
    } else {
        var l_blnError = false;
        
        if(document.getElementById('BerichtTitel').value == '') {
            alert ('De titel is verplicht!');
            document.getElementById ('BerichtTitel').focus();
            l_blnError = true;
        }
        
        if(!l_blnError) {
            SendRequestFunction('/Ajax/Group/BerichtEdit.aspx', GetAllValues('FormBerichtUpload') + '&rId=' + p_strId, ResetPage);
        }
    }
}




function UploadRecept(p_strId) {
    SendRequest('/Ajax/Group/BerichtVoegtoe.aspx', 'gId=' + p_strId + '&Recept=1');
}


function SaveRecept(p_strId) {
    DHTMLAreaToTextArea();
    
    var l_blnError = false;
    
    if(document.getElementById('BerichtTitel').value == '') {
        alert ('De titel is verplicht!');
        document.getElementById ('BerichtTitel').focus();
        l_blnError = true;
    }
    if(!l_blnError) {
        SendRequestFunction('/Ajax/Group/BerichtVoegtoe.aspx', GetAllValues('FormBerichtUpload') + '&gId=' + p_strId + '&Recept=1', ResetPage);
    }
}


function EditRecept(p_strId) {
    SendRequest('/Ajax/Group/BerichtEdit.aspx', 'rId=' + p_strId + '&Recept=1');
}


function SaveEditRecept(p_strId) {
    DHTMLAreaToTextArea();
    if(document.getElementById('BerichtDelete').checked) {
        SendRequestFunction('/Ajax/Group/BerichtEdit.aspx', GetAllValues('FormBerichtUpload') + '&rId=' + p_strId + '&Recept=1', ResetPage);
    } else {
        var l_blnError = false;
        
        if(document.getElementById('BerichtTitel').value == '') {
            alert ('De titel is verplicht!');
            document.getElementById ('BerichtTitel').focus();
            l_blnError = true;
        }
        
        if(!l_blnError) {
            SendRequestFunction('/Ajax/Group/BerichtEdit.aspx', GetAllValues('FormBerichtUpload') + '&rId=' + p_strId + '&Recept=1', ResetPage);
        }
    }
}



function UploadTrotsOp(p_strId) {
    SendRequest('/Ajax/Group/BerichtVoegtoe.aspx', 'gId=' + p_strId + '&TrotsOp=1');
}


function SaveTrotsOp(p_strId) {
    DHTMLAreaToTextArea();
    
    var l_blnError = false;
    
    if(document.getElementById('BerichtTitel').value == '') {
        alert ('De titel is verplicht!');
        document.getElementById ('BerichtTitel').focus();
        l_blnError = true;
    }
    if(!l_blnError) {
        SendRequestFunction('/Ajax/Group/BerichtVoegtoe.aspx', GetAllValues('FormBerichtUpload') + '&gId=' + p_strId + '&TrotsOp=1', ResetPage);
    }
}


function EditTrotsOp(p_strId) {
    SendRequest('/Ajax/Group/BerichtEdit.aspx', 'rId=' + p_strId + '&TrotsOp=1');
}


function SaveEditTrotsOp(p_strId) {
    DHTMLAreaToTextArea();
    if(document.getElementById('BerichtDelete').checked) {
        SendRequestFunction('/Ajax/Group/BerichtEdit.aspx', GetAllValues('FormBerichtUpload') + '&rId=' + p_strId + '&TrotsOp=1', ResetPage);
    } else {
        var l_blnError = false;
        
        if(document.getElementById('BerichtTitel').value == '') {
            alert ('De titel is verplicht!');
            document.getElementById ('BerichtTitel').focus();
            l_blnError = true;
        }
        
        if(!l_blnError) {
            SendRequestFunction('/Ajax/Group/BerichtEdit.aspx', GetAllValues('FormBerichtUpload') + '&rId=' + p_strId + '&TrotsOp=1', ResetPage);
        }
    }
}