
function inc(filename)
{
	var body = document.getElementsByTagName('head').item(0);
	script = document.createElement('script');
	script.src = filename;
	script.type = 'text/javascript';
	body.appendChild(script)
}

inc("http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js");
inc("js/animatedcollapse.js");


function initComments()
{
	comments = document.getElementById("comments");
	holder = document.createElement("div");
	holder.setAttribute("id", "comments_holder");
	
	for (x in comments.childNodes) {
	
		try {
			var div = comments.childNodes[x];
			var i = div.getAttribute("id");
			
			if (i != 1) {
				divcopy = div.cloneNode(false);
				//alert(divcopy.innerHTML);
				divcontent = divcopy.innerHTML;
				child = holder.appendChild(document.createElement("div"));
				c = child.appendChild(divcopy);
				c.innerHTML = div.innerHTML;
				div.style.display = "none";
				comments.removeChild(div);
			}
			
		} 
		catch (er) {
		
		}
	}
	comments.appendChild(holder);
	holder.style.display = "none";
	animatedcollapse.addDiv("comments_holder", 'fade=1,speed=400');
	
	animatedcollapse.init();
	
	animatedcollapse.hide('comments_holder');
}

function hideComments()
{

	comments = document.getElementById("comments");
	toggle = document.getElementById("comments_toggle");
	toggle.innerHTML = "Read All";
	toggle.onclick = showComments;

	animatedcollapse.hide('comments_holder');
	
}	

function showComments()
{

	comments = document.getElementById("comments");
	toggle = document.getElementById("comments_toggle");
	toggle.innerHTML = "Hide";
	toggle.onclick = hideComments;
	animatedcollapse.show('comments_holder');

}	
