// JavaScript Document
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='#'
// 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);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';
			}
		}
		window.onload=dohides;
