function sbox_box() {
document.writeln('<!-- search_Box -->');
document.writeln('<form style="margin:0" name="srhform" method="get" onsubmit="setSearchAction(this); return false;">');
document.writeln('<input type="hidden" name="dest" value="http://search.yam.com/wps">');
document.writeln('<input type="hidden" name="utf8" value="1">');
document.writeln('<table width="538" border="0" cellspacing="0" cellpadding="0">');
document.writeln('<tr><td height="30" colspan="2">&nbsp;</td></tr><tr>');

document.writeln('<td align="center"><span class="menubar_t_12">');
document.writeln('<input name="t" type="radio" value="news" checked="true" />');
document.writeln('新聞');
document.writeln('<input name="t" type="radio" value="wps" />');
document.writeln('網站');
document.writeln('<input name="t" type="radio" value="images" />');
document.writeln('圖片</span>');
document.writeln('<input name="k" type="text" class="search" size="25" id="k" /><input type="image" src="http://n.yam.com/msnews/i/header/y_t_b01.gif" width="51" height="21" align="absmiddle" /></td>');
document.writeln('<td width="139" align="center"></td>');

document.writeln('</tr>');
document.writeln('</table>');
document.writeln('</form>');
document.writeln('<!-- search_Box -->');

document.getElementById("k").focus();
}

function setSearchAction(f) {
  q = f.k.value.trim();
  if(q.isEmpty()) {
    alert("請輸入您想要查詢的資料！"); f.k.focus(); return;
  }
  if(f.t[0].checked) {
    f.action = action1; f.target = target1; f.submit();
  } else if(f.t[1].checked) {
    f.action = action1; f.target = target0; f.submit();
  }else if(f.t[2].checked) {
    f.action = action1; f.target = target0; f.submit();
  } else {
    alert("請選擇您想要查詢的資料！"); f.t[0].focus();
    return;
  }
}
