//====================== Add rollover functionality to tablerow
function rollOverTR() {
	// get the table 'result-table' as start point
	this.TRItems = new Array();
	var startNode = document.getElementById('result-table');
	if (!startNode) {
		return false;
	}
	else {
		// find all tablerows in 'result-table'
		var arrItems = startNode.getElementsByTagName('tr');
		for (var i=0; i<arrItems.length; i++) {
		// if the tablerow contains tablecells, look inside it for links
			var dItems = arrItems[i].getElementsByTagName('td');
			for (var j=0; j<dItems.length; j++) {
				var dContents = dItems[j].getElementsByTagName('a');
				for (k=0; k<dContents.length; k++) {
					// if the cells contain links, store them in the array together with the link href
					this.TRItems[this.TRItems.length] = new divItem(this,arrItems[i],dContents[k],dContents[k].getAttribute("href"));
				}
			}
		}
	}
}


//====================== Add rollover functionality to a div
function rollOverDiv() {
	// get all the divs and put them in an array
	this.divItems = new Array();
	var startNode = document.getElementById('content');
	if (!startNode) {
		return false;
	}
	else {
		// find all divs
		var arrItems = startNode.getElementsByTagName('div');
		for (var i=0; i<arrItems.length; i++) {
			if (arrItems[i].className == "search-res") {
			// if the div has the class name 'search-res', look inside it for divs and links
				var dItems = arrItems[i].getElementsByTagName('div');
				for (var j=0; j<dItems.length; j++) {
					// and look inside the div for links
					var dContents = dItems[j].getElementsByTagName('a');
					for (k=0; k<dContents.length; k++) {
						// if the divs contain links, store them in the array together with the link href
						this.divItems[this.divItems.length] = new divItem(this,dItems[j],dContents[k],dContents[k].getAttribute("href"));
					}
				}
			}
		}
	}
}
divItem = function(rollOverDiv,area,link,url) {
	this.rollOverDiv = rollOverDiv;
	this.area = area;
	this.link = link;
	this.url = url;
	//alert(this.area);
	this.area.divItem = this;
	this.area.onmouseover = function () {
        this.divItem.over();
        return false;
    }
	this.area.onmouseout = function () {
        this.divItem.out();
        return false;
    }
	this.area.onclick = function () {
        this.divItem.clicked();
        return false;
    }
}
divItem.prototype.over = function () {
	this.area.className = "over";
}
divItem.prototype.out = function () {
	this.area.className = "";
}
divItem.prototype.clicked = function () {
	location.href=this.url;
}