function getElementsByClass(searchClass,node,tag) {
	var i,j;
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

function blocksHover (section) {
	var i;
	if (!document.getElementsByTagName) return false;
	var tags = getElementsByClass(section);
        for (i=0;i<tags.length;i++) {
	       tags[i].onmouseover=function() {this.className+=" blocksHover";}
		tags[i].onmouseout=function()
{this.className=this.className.replace(new RegExp(" blocksHover\\b"), "")}
		tags[i].onclick = function () {location.href = this.getElementsByTagName("a")[0].href}
	}		
}

function liblocksHover (section) {
	var i;
	if (!document.getElementsByTagName) return false;
	var tags = getElementsByClass(section);
        for (i=0;i<tags.length;i++) {
	       tags[i].onmouseover=function() {this.className+=" liblocksHover";}
		tags[i].onmouseout=function()
{this.className=this.className.replace(new RegExp(" liblocksHover\\b"), "")}
		tags[i].onclick = function () {location.href = this.getElementsByTagName("a")[0].href}
	}		
}


window.onload=function() {blocksHover('blocks');liblocksHover('liblocks')};
	
