function setBlockEffects(prnt,elm,cls,clck,mover,mout) 
{
	// set hover and click effects on whole blocks
	
	// use the following three properties as a way of targeting the element
	// prnt = parent element IDname in which target element occurs (opt.),
	// elm = target element (tagname), cls = elements with which classname (opt.)
	// clck, mover and mout are booleans for applying click, mouseover and mouseout actions
	
	if(!document.getElementsByTagName) 
		return false;
		
	if(!document.getElementById) 
		return false;
	if(!prnt) 
		prnt = document;
	else
		prnt = document.getElementById(prnt);		
		
	items = prnt.getElementsByTagName(elm);	
	
	
	for(var u = 0; u < items.length; u++) 
	{
		obj = items[u];		
		
		
		if(obj.className.match(cls) || !cls) 
		{		
			//alert('item: '+obj.className)
			
			if(clck) obj.onclick = goTo;
			if(mover) obj.onmouseover = function() { addClass(this,"hover") }
			if(mout) obj.onmouseout = function() { killClass(this,"hover") }			
			
			// when click effect active, copy title attribute value from first occurring anchor
			
			theLink = obj.getElementsByTagName("a");
			if(clck && theLink.length > 0) obj.title = theLink[0].title;
			
			// use the class 'set' in for instance your css; 
			// it is only present when this script executes successfully
			// and offers opportunities for graceful degredation
			
			addClass(obj, "set");
		}
	}
}

function goTo() {
	// redirect to the target of the first occurring anchor
	link = this.getElementsByTagName("a")[0];
	document.location = link;
}

function addClass(obj,cName) {
	// add a classname to obj
	killClass(obj, cName); 
	return obj.className += (obj.className.length > 0 ? ' ' : '') + cName; 
}

function killClass(obj,cName) { 
	// remove a classname from obj
	return obj.className = obj.className.replace(new RegExp("^" + cName + "\\b\\s*|\\s*\\b" + cName + "\\b", 'g'), ''); 
}