If you can get into the shell of it...
[user@host ~]$ cd [b]/path/to/top/directory[/b]
[user@host directory]$ find . -type d -print0 | xargs -0 chmod 0777
Otherwise, you could try using the [man]cwd/man to change to a directory, then use the [man]exec/man to execute the command above (find . -type ...).
If all that fails, then you'd have to either manually do it, or generate a looping code to look into all directories and sub-directories and chmod each folder.