I’m working on a new Ajax template - you want to help me to resolve some bugs?

<div>
<div align="left"></div>
<h3 align="left"><a id="closebutton" onclick="Effect.SlideUp('textsummary')"><img src="assets/templates/MODajax1/imgs/up.gif" alt="close" width="14" height="14" /></a> <a id="expandbutton" onclick="Effect.SlideDown('textsummary')"><img src="assets/templates/MODajax1/imgs/down.gif" alt="expand" width="14" height="14" /></a>[+title+]</h3>
<div id="textsummary">[+summary+]</div>
<div style="text-align: right;">
<p>[+link+]</p>
</div>
<hr /> </div>
IDs must be unique on each page.
You’d need to auto-generate a unique ID for each instance on a page, assign it to the relevant element to which you’re trying to apply the effect, and then attach the effect to that ID. Not trivial, but entirely doable I’d think.
//[[FAQ?faqFolder=foldernumber]]
//Replace foldernumber with the id of the folder
//Page title is displayed as the question and content is the answer.
//The question is in a CSS class "faq"
$resourceparent = isset($faqFolder) ? $faqFolder : $modx->documentIdentifier;
$output = "<script type="text/javascript">
function expand(thistag) {
styleObj = document.getElementById(thistag).style;
if (styleObj.display=='none') {styleObj.display = '';}
else {styleObj.display = 'none';}
}
</script>";
$faq = $modx->getActiveChildren($faqFolder,'pagetitle', 'ASC', $fields=' id, pagetitle, content');
$limit=count($faq);
if($limit<1) {
$output .= 'No Questions Found<br />';
}
for ($y = 0; $y < $limit; $y++) {
$output .= '<div onclick="expand(''.$faq[$y]['id'].'');" style="cursor:pointer;"><div class="faq">'.$faq[$y]['pagetitle'].'</div><div id="'.$faq[$y]['id'].'" style="display:none">'.$faq[$y]['content'].'</div></div><br />';
}
return $output;