I really have not spent much time doing coding for vB5 which is why I didn't answer. I do wonder why do you have both these lines when the second one will replace the first one?
Code:
$page_parts = explode('<!-- Top navigtation -->', $output);
$page_parts = explode('<!-- DAB container -->', $page_parts[1]);
Also, echos aren't a good idea (unless it is debug code). I am pretty sure you want to do a return with the html and then spit it out into a template.
Other than that, there really isn't enough information for us to be able to 'install' it on our own test site and see what is going on.