window.onload = function() {
	$A($S('.est')).each(function(el) {
		el.onmouseover = hovon;
		el.onmouseout = hovoff;
		el.onclick = function() {
			window.location = '/Green_Bay/' + this.getAttribute('rel') + '/';
		};
	}, this);
	if ($('tsin').value>'') tsnow();
}

function hovon() { if (this.addClass) this.addClass('hover'); }
function hovoff() { if (this.removeClass) this.removeClass('hover'); }

function tsclr() {
	$('nores').style.display = 'none';
	r.each( function(res) {
		$('sr'+res.id).style.display = 'none';
		$('est'+res.id).style.display = 'block';
	}, this);
}
function tsnow() {
	if ($('tsin').value>'') {
		new ajax('/spotlight_members_search.php', {
			method: 'post',
			postBody: 'q=' + $('tsin').value,
			onComplete: tsfilter
		}).request();
	} else {
		tsclr();
	}
	return false;
}
function tsfilter(ajaxres) {
	var rows = ajaxres.split("\n");
	var cnt=0;
	r.each( function(res) {
		$('est'+res.id).style.display = 'none';
	}, this);
	rows.each( function(rawrow) {
		if (rawrow > '') {
			var row = rawrow.split("\t");
			$('est'+row[0]).style.display = 'block';
			$('sr'+row[0]).innerHTML = row[1];
			$('sr'+row[0]).style.display = 'block';
			cnt++;
		}
	}, this);
	if (cnt==0) {
		$('nores').innerHTML = 'Sorry, no results could be found matching your search.';	
		$('nores').style.display = 'block';
	} else {
		$('nores').style.display = 'none';
	}
}
