function sbox_box(){
document.writeln("<form style=\"margin:0\" name=\"srhform\" method=\"get\" onsubmit=\"setSearchAction(this); return false;\">");
document.writeln("<input type=\"hidden\" name=\"dest\" value=\"\">");
document.writeln("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"style1\">");
document.writeln("<tr align=\"left\" bgcolor=\"#FFE5EF\">");
document.writeln("<td width=\"13\" align=\"left\"><img src=\"i/search_bar1.gif\" width=\"13\" height=\"32\" /></td>");
document.writeln("<td><span class=\"style1\"><input name=\"t\" type=\"radio\" value=\"herblog\" id=\"herblog\" checked=\"true\" />私日記部落格<input name=\"t\" type=\"radio\" value=\"dse_hercafe\" id=\"dse_hercafe\" />網站<input name=\"t\" type=\"radio\" value=\"site_hercafe\" id=\"site_hercafe\" />本站</span>&nbsp;</td>");
document.writeln("<td><input name=\"k\" type=\"text\" class=\"style1\" size=\"12\" /> <img src=\"http://y.yam.com/spacer.gif\" width=\"1\" height=\"8\" /> </td>");
document.writeln("<td><input type=\"image\" src=\"i/bt_search1.gif\"></td>");
document.writeln("<td><img src=\"http://y.yam.com/spacer.gif\" width=\"10\" height=\"1\" /></td>");
document.writeln("<td width=\"13\" align=\"right\"><img src=\"i/search_bar2.gif\" width=\"13\" height=\"32\" /></td>");
document.writeln("</tr>");
document.writeln("</table>");
document.writeln("</form>");
}

function setSearchAction(f) {
  q = f.k.value.trim();
  if(q.isEmpty()) {
    alert("請輸入您想要查詢的資料！");
    f.k.focus();
    return;
  }
 
  if(f.t[0].checked ||f.t[1].checked || f.t[2].checked|| f.t[3].checked) {
	  if(f.t[0].checked ){
         f.dest.value = '';
		 f.action = "/blog/search.php";
    	 f.submit();
  	   }else if(f.t[3].checked ){
		 f.dest.value = "http://shoppingsearch.yam.com/bin/search.dll";
		 f.action = "/blog/search_big5.php";
    	 f.submit();
	   }else{
		 f.dest.value = "http://search.yam.com/dir";
		 f.action = "/blog/search_big5.php";
    	 f.submit();
	   }

  } else {
    alert("請選擇您想要查詢的資料！");
    f.t[0].focus();
    return;
  }
}

