1) Script Title: Dynamic Ajax Content

2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...jaxcontent.htm

3) Describe problem:

I am new to web programming. The web site I am building is pretty much based on the concept of loading sub-pages dynamically into a div. I am using jQuery but it's not working properly.

I tried modified "Dynamic Ajax Content" by adding one more link and created a page using "Animated Collapsible DIV v2.4". The very first time you click on the link, page is loaded correctly but you click another one come back to this one, all the divs are expended. Here are the details:
anim.js
Code:
animatedcollapse.addDiv('cat', 'fade=0,speed=400,group=pets,hide=1');
animatedcollapse.addDiv('dog', 'fade=0,speed=400,group=pets,hide=1');
animatedcollapse.addDiv('rabbit', 'fade=0,speed=400,group=pets,hide=1');


animatedcollapse.ontoggle=function($, divobj, state){ //fires each time a DIV is expanded/contracted
	//$: Access to jQuery
	//divobj: DOM reference to DIV being expanded/ collapsed. Use "divobj.id" to get its ID
	//state: "block" or "none", depending on state
};

animatedcollapse.init();
anim.html
Code:
<p>LINK1</p><a href="javascript:animatedcollapse.toggle('cat')">?</a>
<div id="cat" style="text-align='justify'; background: #BDF381;">
	The cat (Felis catus), also known as the domestic cat or house.
</div>
<p>LINK2</p><a href="javascript:animatedcollapse.toggle('dog')">?</a>
<div id="dog" style="text-align='justify'; background: #BDF381;">
	The cat (Felis catus), also known as the domestic cat or house.
</div>
<p>LINK3</p><a href="javascript:animatedcollapse.toggle('rabbit')">?</a>
<div id="rabbit" style="text-align='justify'; background: #BDF381;">
	The cat (Felis catus), also known as the domestic cat or house.
</div>
and link on the main page (index.html)
Code:
<a href="javascript:ajaxpage('anim.html', 'rightcolumn'); loadobjs('anim.js')">Animated Collapsible Demo</a>
The two scripts that are required for "Animated Collapsible Demo" is called on "index.html"
Code:
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/animatedcollapse.js"></script>
I don't if you have to call it on "index.html" or in "anim.html"?


Thanks

Prashant