what you need to do, is have 2 recordsets, one for departments and one for contacts, (and you probably have to hand code some of it because dreamweaver doesn't like to nest repeat regions)
start off with the departments recordset, unfiltered, displaying the department name in a repeat region.
then add the contacts recordset, WITHIN the repeat region, filtered by departmentID.
each increment of the loop should show only the contacts for each relevant department.
the contact name should be in a repeat region, within the departments repeat region