var pd = paydate.getDay();
// converts the value from the "paydate" field to an integer.
var adj = clientMASTER_assoc_adjachdays;
// converts the integer from the "clientMASTER_assoc_adjachdays" field to a variable.
var comp = (pd+adj);
// adds the two variables, pd and adj together, and converts the result to a variable.
comp = comp%6;
// constrains the results of the previous mathematical equation to a value of // less than or equal to 6.
var arDays = new Array("Sunday", "Monday", "Tuesday",
"Wednesday", "Thursday", "Friday", "Saturday");
// opens an array of the days of the week (0=Sunday,1=Monday...)
var achd = arDays[comp];
//compares the results of the comp variable to the arDays array and converts the result to another variable; the day of the week.
//outputs the achd variable
... In case anyone else ever needs to know.