I'm using the animated collapse JS library here:
<http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm>

and i'm trying to use it for dynamic div's however it's not toggling. Any ideas?

```
<head>
<script type="text/javascript" src="includes/js/animatedcollapse.js"></script>
</head>
<body>
<?PHP
for ($i = 1; $i <= 5; $i++) { ?>

<script type="text/javascript">
animatedcollapse.addDiv('location-<?PHP echo $i; ?>', 'fade=1')
</script>

<div id="location-<?PHP echo $i; ?>">
<a href="javascript:animatedcollapse.hide('location-<?PHP echo $i;?>')">CLOSE</a>
TEST
</div>

<a href="javascript:animatedcollapse.toggle('location-<?PHP echo $i;?>')">TOGGLE</a>
<?PHP } ?>
<script type="text/javascript">
animatedcollapse.ontoggle=function($, divobj, state){}
animatedcollapse.init()
</script>

```