var engine = "Yahoo";

function changeengine(obj) {
    i = obj.SITE.selectedIndex;
    engine = obj.SITE.options[i].value;
}

function fetch() {
//  alert(document.SearchForm.SITE.selectedIndex);
  i = document.SearchForm.SITE.selectedIndex;
  engine = document.SearchForm.SITE.options[i].value;
	tmp = document.SearchForm.Search.value;
	stmp = "";
	for (i=0 ; i <= tmp.length ; i++) {
		if (tmp.charAt(i) == " ") {
			stmp = stmp + "+"; 
		} else {
			stmp = stmp + tmp.charAt(i); 
		}
	}
	
	if (engine == "Yahoo") {
		top.location.href = "http://search.yahoo.com/bin/search?p=" + document.SearchForm.Search.value
	}

	if (engine == "Chinese Yahoo") {
		top.location.href = "http://cn.websearch.yahoo.com/search/web_cn?p=" + document.SearchForm.Search.value
	}
	
	if (engine == "HK Yahoo") {
		top.location.href = "http://search.yahoo.com.hk/search/hk?p=" + document.SearchForm.Search.value
	}
	if (engine == "Google") {
		top.location.href = "http://www.google.com/search?lr=lang_zh-TW&cr=&hl=ch-tw&ie=big5&oe=big5&q=" + document.SearchForm.Search.value
	}
	if (engine == "AltaVista") {
		top.location.href = "http://altavista.digital.com/cgi-bin/query?pg=q&what=web&fmt=.&q=" + document.SearchForm.Search.value
	}

	if (engine == "Lycos") {
		top.location.href = "http://www.lycos.com/cgi-bin/pursuit?adv=%26adv%3B&cat=lycos&matchmode=and&query=" + document.SearchForm.Search.value + "&x=35&y=2"
	}

	if (engine == "Excite") {
		top.location.href = "http://www.excite.com/search.gw?c=web&search=" + document.SearchForm.Search.value + "&trace=a&x=31&y=20"
	}

	if (engine == "Infoseek") {
		top.location.href = "http://www.infoseek.com/Titles?qt=" + document.SearchForm.Search.value + "&col=WW&sv=IS&lk=noframes&nh=10"
	}

	if (engine == "Whatsite") {
		top.location.href = "http://www.whatsite.com/main/search.cgi?keyword=" + document.SearchForm.Search.value + "&REXP=OR&start=0&REXP=OR&x=50&y=16"
	}

	if (engine == "Yam") {
		top.location.href = "http://www.yam.com.tw/b5/search?k=+" + document.SearchForm.Search.value + "&x=0&y=0"
	}

	if (engine == "Msn") {
		top.location.href = "http://search.msn.com/results.asp?ba=20.0&FORM=MSNH&RS=CHECKED&b=1&q=" + document.SearchForm.Search.value + "&sc=73&v=0"
	}

	if (engine == "Kimo") {
		top.location.href = "http://search.kimo.com.tw/srchcgi/srchfz.pl?query=" + document.SearchForm.Search.value
	}

  if (engine == "MacEZ") {
  	top.location.href = "http://www.cyberctm.com/macez?CatID=&KeyWords=" + document.SearchForm.Search.value
	}
  
	return false;
}