var gnurl = 'http://www.gurunet.com/';

function submitHandler(f_el,target,ts,p){
var val=f_el.s.value;
if (val && val.search(/\S/)!=-1) {
	if (location.pathname.indexOf("/answers/")==0) return true;
    if (val=="robots.txt"||val=="favicon.ico") val = '"'+val+'"';
	var func = typeof(encodeURIComponent) != "undefined" ? encodeURIComponent : escape;
	var url = location.protocol + "//" + (ts?ts:location.host) + "/" + func(val) + (p?"?"+p:"");
	if (target){window.open(url,target);}
	else location.href = url;
}
return false;
}

function setFocus() {
	if (document.getElementById)
		document.getElementById("s").focus();
	return 1;
}
// google websearch page functions
function setStatus(url){window.status = url; return true;}
function clearStatus(){window.status = '';}
function gotoURL(url){window.location = url; return true;}

function hideMenu(e) {
	if (!e) var e = window.event;
	var tg = (window.event) ? e.srcElement : e.target;
	if (tg.nodeName != 'DIV') return;
	var reltg = (e.relatedTarget) ? e.relatedTarget : e.toElement;
	while (reltg != tg && reltg.nodeName != 'BODY')
		reltg= reltg.parentNode
	if (reltg== tg) return;
	// Mouseout took place when mouse actually left layer
	showMenu(false);
}
function showMenu(show){
var menu = document.getElementById("resultMenu");
if (menu) menu.style.display = show ? "block" : "none";
}
