function dohides() {
	var ps,tohide,newlink,newtext;
	// get all P elements, loop over them
	ps=document.getElementsByTagName('p');
	for (i=0;i<ps.length;i++) {	
		// check if the class contains trigger
		if(/trigger/.test(ps[i].className)) {
			// get the next sibling until it really is an element, if so, hide it
			tohide=ps[i].nextSibling;
			while(tohide.nodeType!=1) { tohide=tohide.nextSibling; }
			tohide.style.display='none';
			/// assemble a link and take the content of the p as its text
			newlink=document.createElement('a');
			newtext=document.createTextNode(ps[i].firstChild.nodeValue);
			newlink.appendChild(newtext);
			newlink.href='#';
			newlink.className='closed';
			// create a new object attribute, this saves us looping in the showhide function
			// add the event handlers
			newlink.colobj=tohide;
			newlink.onclick=function(){showhide(this.colobj);chClassName(this);return false;}
			//newlink.onkeypress=function(){showhide(this.colobj);return false}
			// replace the paragraph with the link
			ps[i].replaceChild(newlink,ps[i].firstChild)
		}
	}
}
function showhide(o) {
	if(o) { o.style.display=o.style.display=='none'?'block':'none'; }
}
function chClassName(o) { 
	if(o) { o.className=o.className=='open'?'closed':'open'; } 
}
window.onload=dohides;
// JavaScript Document
