/*
 * ConvertDivsToLinks
 * 
 *    Makes an entire div hyperlink. An anchor cannot
 *    contain block elements.
 *
 * Tom Coppeto
 * 18 January 2008
 */


function ConvertDivsToLinks() {
    var divs = getElementsByClassName("linked");
    for (var i = 0; i < divs.length; i++) {
	var link = divs[i].getElementsByTagName("a");
	if (link.length == 1) {
	    divs[i].onclick = new Function("window.location.href='" + link[0].href + "'");
	    divs[i].onmouseover = new Function("this.className='highlight'");
	    divs[i].onmouseout = new Function("this.className=''");
	}
    }
}


addEvent(window, "load", ConvertDivsToLinks);

