add max window calculation for children

http://manage.dimagi.com/default.asp?151398