Hi there,
a good way to do this, you would need to use the modulus (JavaScript : %, FormCalc : Mod(n1, n2)) to know exactly which day of the week the first date is,
you'll need to do some tests to see which day of the week represents which number... (I think 0 is sunday)
let's say you get a wednesday, you'll know you will need to do +7(weekend) considering +5 business days
Also if you're going in deep, if you have to consider the public holidays, you will have to register the days and then know exactly what is the modulus of that day on 365 for a normal year and 366 for a leap year
I hope this will help you to accomplish what you need...
If you have any other question, feel free to ask