﻿function alleVacatures(afdelingID) {
    startPauze();
    SVC_Vacatures.alleVacatures(afdelingID, onVacaturesGot);
}
function vacaturesHoofdtrainer(afdelingID) {
    startPauze();
    SVC_Vacatures.vacaturesVanType(afdelingID, 1, onVacaturesGot);
}
function vacaturesSenioren(afdelingID) {
    startPauze();
    SVC_Vacatures.vacaturesVanType(afdelingID, 2, onVacaturesGot);
}
function vacaturesTC(afdelingID) {
    startPauze();
    SVC_Vacatures.vacaturesVanType(afdelingID, 11, onVacaturesGot);
}
function vacaturesKeeperTr(afdelingID) {
    startPauze();
    SVC_Vacatures.vacaturesVanType(afdelingID, 5, onVacaturesGot);
}
function vacaturesJeugdTr(afdelingID) {
    startPauze();
    SVC_Vacatures.vacaturesVanType(afdelingID, 4, onVacaturesGot);
}
function vacaturesOverig(afdelingID) {
    startPauze();
    SVC_Vacatures.vacaturesOverig(afdelingID, onVacaturesGot);
}
function vacatureMelding(afdelingID) {
    startPauze();
    SVC_Vacatures.vacatureMelding(afdelingID, onVacaturesGot);
}
function onVacaturesGot(result) {
    var hp=$get('mainContent');
    if (hp) hp.innerHTML=result;
    stopPauze();
}
function sendVacMail() {
    //Controleer de invoer
    var nm=$get('vacNaam');
    var ml=$get('vacMail');
    var cl=$get('vacClub');
    if (nm && ml && cl) {
        if (nm.value!='' && ml.value!='' && cl.value!='') {
            SVC_Vacatures.vacatureMail(nm.value, ml.value, cl.value, onVacatureSent);
            var ms=$get('vacMsg');
            if (ms) ms.innerHTML='Bedankt voor uw aanmelding!';        
            var bt=$get('vacBtn');
            if (bt) bt.style.visibility='hidden';
        } else {
            var ms=$get('vacMsg');
            if (ms) ms.innerHTML='Vul alle velden in!, uw aanvraag is nog niet verstuurd!';
        }
    } else {
        var ms=$get('vacMsg');
        if (ms) ms.innerHTML='Vul alle velden in!, uw aanvraag is nog niet verstuurd!';
    }
}
function onVacatureSent(result) {

}
