It doesn't have anything to do with the order in which the script is called, as that's done automatically after the page has loaded. It looks like some of your accordion DIV contents contain missing closing tags, throwing the script for a loop. For example, in your first header that doesn't work, the accordion DIV looks like:
Code:
<div contentindex="0c" class="testmenu">
<center>
<script type="text/javascript">
//Define your own array to hold the photo album images
//Syntax: ["path_to_thumbnail", "opt_image_title", "opt_destinationurl", "opt_linktarget"]
var pswingPDF=new Array()
pswingPDF[0]=["dn/PDF/PantoSwing/thumbnails/PSwing-LuPo-Schul_TY_US_tn.jpg", "", "dn/PDF/PantoSwing/PSwing-LuPo-Schul_TY_US.pdf"]
pswingPDF[1]=["dn/PDF/PantoSwing/thumbnails/PSwing-VF-Schul_TY_US_tn.jpg", "", "dn/PDF/PantoSwing/PSwing-VF-Schul_TY_US.pdf"]
pswingPDF[2]=["dn/PDF/PantoSwing/thumbnails/PSwing-2K_TY_US_tn.jpg", "", "dn/PDF/PantoSwing/PSwing-2K_TY_US.pdf"]
pswingPDF[3]=["dn/PDF/PantoSwing/thumbnails/PSwing-VF_TY_US_tn.jpg", "", "dn/PDF/PantoSwing/PSwing-VF_TY_US.pdf"]
pswingPDF[4]=["dn/PDF/PantoSwing/thumbnails/PSwing-LuPo_TY_US_tn.jpg", "", "dn/PDF/PantoSwing/PSwing-LuPo_TY_US.pdf"]
//initiate a photo gallery
//Syntax: new photogallery(imagearray, cols, rows, tablewidth, tableheight, opt_[paginatetext_prefix, paginatetext_linkprefix])
var thepics=new photogallery(pswingPDF, 5, 1, '595px', '170px',['Browse Cutsheets:', ''])
//OPTIONAL: Run custom code when an image is clicked on, via "onselectphoto"
//DELETE everything below to disable
//Syntax: function(img, link){}, whereby img points to the image object of the image, and link, its link object, if defined
thepics.onselectphoto=function(img, link){
if (link!=null) //if this image is hyperlinked
window.open(link.href, "", "width=800, height=600, status=1, resizable=1")
return false //cancel default action when clicking on image, by returning false instead of true
}
</script><table class="photogallery" id="photogallery-1" style="width: 595px; height: 170px;"><tbody><tr><td valign="top"><a href="http://www.debrotdesign.com/VS_Demo/dn/PDF/PantoSwing/PSwing-LuPo-Schul_TY_US.pdf" target=""><img src="test9_files/PSwing-LuPo-Schul_TY_US_tn.jpg" title=""></a></td><td valign="top"><a href="http://www.debrotdesign.com/VS_Demo/dn/PDF/PantoSwing/PSwing-VF-Schul_TY_US.pdf" target=""><img src="test9_files/PSwing-VF-Schul_TY_US_tn.jpg" title=""></a></td><td valign="top"><a href="http://www.debrotdesign.com/VS_Demo/dn/PDF/PantoSwing/PSwing-2K_TY_US.pdf" target=""><img src="test9_files/PSwing-2K_TY_US_tn.jpg" title=""></a></td><td valign="top"><a href="http://www.debrotdesign.com/VS_Demo/dn/PDF/PantoSwing/PSwing-VF_TY_US.pdf" target=""><img src="test9_files/PSwing-VF_TY_US_tn.jpg" title=""></a></td><td valign="top"><a href="http://www.debrotdesign.com/VS_Demo/dn/PDF/PantoSwing/PSwing-LuPo_TY_US.pdf" target=""><img src="test9_files/PSwing-LuPo_TY_US_tn.jpg" title=""></a></td></tr></tbody></table><div class="photonavlinks" id="photogallerypaginate-1">Browse Cutsheets: <a class="current" href="#navigate" rel="0">1</a> </div>
</center>
</div>
If you remove the portion in gray and replace that with some other content like "<b>This is a test</b>", that header now works.
Bookmarks