function setutf(fx){
	bkup=document.charset;
	document.charset="UTF-8";
	displayx(fx);
	document.charset=bkup;
}

function seteuc(fx){
	bkup=document.charset;
	document.charset="euc-jp";
	displayx(fx);
	document.charset=bkup;
}

function setsjis(fx){
	bkup=document.charset;
	document.charset="shift_jis";
	displayx(fx);
	document.charset=bkup;
}

function displayx(formx) {
	category_root=window.open("","category_root","");
	formx.target="category_root";
	formx.submit(); category_root.focus();
}

function fcs_set() {
var d=document.forms["fm"];
if (d == null){
	alert('check form fm')
}
//	document.forms["fm"].txt.select();
	document.forms["fm"].txt.focus();
}

function searchEngiPrpject(eng) {
//alert(eng);
	q=document.fm.txt.value;
	if(q=="") return;
	if(eng=="google") { fw=document.fEN_google; fw.q.value=q; setsjis(fw); }
	if(eng=="gn") { fw=document.fEN_g_n; fw.q.value=q; setsjis(fw); }
	if(eng=="goo") { fw=document.fEN_goo; fw.MT.value=q; setsjis(fw); }
	if(eng=="msn") { fw=document.fEN_msn; fw.q.value=q; setsjis(fw); }
	if(eng=="yahoo") { fw=document.fEN_yahoo; fw.p.value=q; fw.action="http://search.yahoo.co.jp/search"; seteuc(fw); }
	if(eng=="yahoon") { fw=document.fEN_yahoo_n; fw.p.value=q; seteuc(fw); }
	if(eng=="yahoosoft") { fw=document.fEN_yahoo; fw.p.value=q; fw.action="http://search.download.yahoo.co.jp/bin/v_searchf"; seteuc(fw); }
	if(eng=="yahootel") { fw=document.fEN_yahoo; fw.p.value=q; fw.action="http://search.phonebook.yahoo.co.jp/bin/search"; seteuc(fw); }
	if(eng=="yahoopost") { fw=document.fEN_yahoo; fw.p.value=q; fw.action="http://local.search.yahoo.co.jp/postal/search"; seteuc(fw); }
	if(eng=="yahoomap") { fw=document.fEN_yahoo; fw.p.value=q; fw.action="http://search.map.yahoo.co.jp/search"; seteuc(fw); }
	if(eng=="googlemap") { fw=document.fEN_gmap; fw.q.value=q; setutf(fw); }

	if(eng=="all") { fw=document.fEN_allab; fw.qs.value=q; setsjis(fw); }
	if(eng=="eyen") { fw=document.fEN_eyen; fw.kw.value=q; setsjis(fw); }
	if(eng=="goon") { fw=document.fEN_goon; fw.MT.value=q; seteuc(fw); }
	if(eng=="googlei") { fw=document.fEN_googlei; fw.q.value=q; setsjis(fw); }
	if(eng=="gooi") { fw=document.fEN_gooi; fw.MT.value=q; seteuc(fw); }
	if(eng=="yahimg") { fw=document.fEN_yah_img; fw.p.value=q; seteuc(fw); }
	if(eng=="mado") { fw=document.fEN_mado; fw.query.value=q; setsjis(fw); }
	if(eng=="imps") { fw=document.fEN_imps; fw.keyword.value=q; setsjis(fw); }
	if(eng=="infot") { fw=document.fEN_infot; fw.indata.value=q; seteuc(fw); }
	if(eng=="wikip") { fw=document.fEN_g_wikip; fw.q.value=q; setsjis(fw); }
	if(eng=="yahhdic") { fw=document.fEN_yah_dic; fw.p.value=q; seteuc(fw); }
	if(eng=="gooko") { fw=document.fEN_goodic; fw.MT.value=q; fw.kind.value="jn"; seteuc(fw); }
	if(eng=="gookej") { fw=document.fEN_goodic; fw.MT.value=q; fw.kind.value="ej"; seteuc(fw); }
	if(eng=="gookje") { fw=document.fEN_goodic; fw.MT.value=q; fw.kind.value="je"; seteuc(fw); }
	if(eng=="infok") { fw=document.fEN_infodic; fw.qt.value=q; fw.pg.value="result_kn.html"; fw.col.value="KN"; fw.action="http://jiten.www.infoseek.co.jp/Katakana"; seteuc(fw); }
	if(eng=="ewords") { fw=document.fEN_ewords; fw.w.value=q; setsjis(fw); }
	if(eng=="ykatei") { fw=document.fEN_y_katei; fw.p.value=q; seteuc(fw); }
	if(eng=="goomn") { fw=document.fEN_goom; fw.n.value=q; fw.t.value='2'; seteuc(fw); }
	if(eng=="gooat") { fw=document.fEN_goom; fw.n.value=q; fw.t.value='1'; seteuc(fw); }
	if(eng=="yahoomus") { fw=document.fEN_ymus; fw.cp.value=q; seteuc(fw); }
	if(eng=="total") { fw=document.fEN_total; fw.word.value=q; setsjis(fw); }
	if(eng=="yahoosho") { fw=document.fEN_yahoo; fw.p.value=q; fw.action="http://shopping.yahoo.co.jp/search"; seteuc(fw); }
	if(eng=="goosho") { fw=document.fEN_goosho; fw._d.value=q; seteuc(fw); }
	if(eng=="msnsho") { fw=document.fEN_msnsho; fw.searchtext.value=q; setutf(fw); }
	if(eng=="rekusho") { fw=document.fEN_rekuten; fw.sitem.value=q; fw.sv.value="2"; seteuc(fw); }
	if(eng=="kinokuni") { fw=document.fEN_kinokuni; fw.KEYWORD.value=q; setsjis(fw); }
	if(eng=="asahiya") { fw=document.fEN_asahiya; fw.ANDWORD.value=q; setsjis(fw); }
	if(eng=="yahok") { fw=document.fEN_yahok; fw.p.value=q; seteuc(fw); }
	if(eng=="bidd") { fw=document.fEN_bidd; fw.keyword.value=q; fw.action="http://list.bidders.co.jp/dap/sv/list1"; setsjis(fw); }
	if(eng=="rekuoku") { fw=document.fEN_rekuten; fw.sitem.value=q; fw.sv.value="4"; seteuc(fw); }

	if(eng=="jawiki") { fw=document.fEN_jawiki; fw.title.value=q; setutf(fw); }
	if(eng=="hongwan") { fw=document.fEN_hongwan; fw.q.value=q; setutf(fw); }
	if(eng=="dharma") { fw=document.fEN_dharma; fw.title.value=q; setutf(fw); }
	if(eng=="seiten") { fw=document.fEN_seiten; fw.title.value=q; setutf(fw); }
}

function pholiotImageOpen(uri,width,height,close){
	newwin = window.open("", "pholiotimg", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=no,width="+width+",height="+height);
	newwin.window.focus();
	newwin.document.open();
	newwin.document.write('<html><head><title>Pholiot</title></head><body style="margin:0px;padding:0px">');
	if (close) {
		newwin.document.write('<a href="javascript:window.close()">');
	}
	newwin.document.write('<img src="'+uri+'" width="'+width+'" height="'+height+'" style="border:none" />');
	if (close) {
		newwin.document.write('</a>');
	}
	newwin.document.write('</body></html>');
	newwin.document.close();
}

