/*
     $Revision$
     $Id$
*/
function updateDisc(purole, pautfunction)
{
  var lsrtdis_key = $("#srtdisc :selected").val();
  var offerte = $("#offerte").val();
  $("#discmulti").load("../Shared/loadDisc.asp?urole=" + purole
                                           + "&autfunction=" + pautfunction
                                           + "&srtdisc_key=" + lsrtdis_key
                                           + (offerte >= 0? "&offerte=" + offerte : ""),
                       function ()
                       {
                         // Laad de stdmeldingen
                         updateStdm(purole, pautfunction);
                       });
}

function updateStdm(purole, pautfunction)
{
  var srtdisc_key = $("#srtdisc").val();
  var ldisc_key_arr = new Array();
  var offerte = $("#offerte").val();
  $('#discmulti :selected').each(function(i, selected)
                                   {
                                     ldisc_key_arr[i] = $(selected).val();
                                   });
  $("#sm").load("../Shared/loadStdmelding.asp?urole=" + purole
                                                 + "&autfunction=" + pautfunction
                                                 + (srtdisc_key > 0? "&srtdisc_key=" + srtdisc_key : "")
                                                 + (ldisc_key_arr.length != 0? "&disc_key_arr=" + ldisc_key_arr : "")
                                                 + (offerte >= 0? "&offerte=" + offerte : ""));
}
