function href(link) {
	document.location.href = link;
}
function click_row() {
	Array.filter(this.childNodes, function(elem) {
		Array.filter(elem.childNodes, function(elem) {
			if (elem.href)
				href(elem.href);
		});
	});
}
function make_row_clickable(elem) {
	elem.onclick = click_row;
	elem.style.cursor = "pointer";
}

function click_link() {
	Array.filter(this.childNodes, function(elem) {
			if (elem.href)
				href(elem.href);
		}
	);
}
function make_clickable(elem) {
	elem.onclick = click_link;
	elem.style.cursor = "pointer";
	elem.className = "js_" + elem.className;
}

function toggle_search() {
	var sf = document.getElementById("search_form");
	if (sf.style.display != "none")
		sf.style.display = "none";
	else
		sf.style.display = "inline";
}
function clear_search() {
	var ti = document.getElementById("search");
	if (ti.value != "") {
		ti.value = "";
		document.getElementById("search_form").submit();
	}
}

var sh = document.getElementById("search_hider");
sh.onclick = toggle_search;
sh.style.cursor = "pointer";

if (document.getElementById("search").value == "")
	toggle_search();

Array.filter(document.getElementsByClassName("othermail"), make_row_clickable);
//Array.filter(document.getElementsByClassName("previous").forEachmake_clickable);
//Array.filter(document.getElementsByClassName("next"), make_clickable);

