// Copyright 2006 SearchAvenue.com, Inc.

var active1="<img src=\"http://www.searchavenue.com/images/sa_gold_star.jpg\"  width=\"32\" height=\"34\" border=\"0\"><br><font color=purple><strong>";
var active2="</font></strong>" ;
var ref1 = "<br><a href=#>" ;
var ref2 = "</a>" ;
var active="Web" ;
var otherForm="&nbsp;<input name=keyword onChange=\"keywords(document.f)\" style=\"width:98%\" value=\"\">" ;

function changeMenuTo(switchTo) {
	menu = document.getElementById(active) ;
	menu.innerHTML = ref1 + active + ref2 ;
	active=switchTo ;
	menu = document.getElementById(switchTo) ;
	menu.innerHTML = active1 + switchTo + active2 ;
	if (switchTo=="Web")
		document.f.action = "http://iqe.searchavenue.com/search/sa/Webkids" ;
	else if (switchTo=="Health")
		document.f.action = "http://iqe.searchavenue.com/search/sa/Healthkids" ;
	else
		document.f.action = "http://iqe.searchavenue.com/search/sa/" + switchTo ;
	menu = document.getElementById("searchBox") ;
	menu.innerHTML = otherForm ;
	document.f.keyword.focus() ;
	document.f.keyword.select() ;
}

function goToAdvanced() {
	lower = active.toLowerCase() ;
	if (lower=="web")
		location.replace("http://kids.searchavenue.com/webkids/advanced.htm") ;
	else if (lower=="health")
		location.replace("http://kidshealth.searchavenue.com/healthkids/advanced.htm") ;
	else if (lower=="images")
		location.replace("http://kidsimages.searchavenue.com/imageskids/advanced.htm") ;
	else
		location.replace("http://" + lower + ".searchavenue.com/" + lower + "/advanced.htm") ;
}

function setType() {
	host = window.location.hostname ;
	//alert(host) ;
	if (host.length==0) return ;
	x = host.indexOf(".") ;
	type = host.substr(0,x) ;
	if (type=="kids") type="Web" ;
	else if (type=="kidshealth") type="Health" ;
	else if (type=="kidsimages") type="Images" ;
	else
	  type = type.charAt(0).toUpperCase() + type.substr(1) ;
	changeMenuTo(type) ;
}

