
function popup_search(){
  document.write('<table cellpadding="1" cellspacing="0" border="0" class="popup-search-t1" id="popup-search">');
  document.write('<tr><td>');
  document.write('<table cellpadding="0" cellspacing="0" border="0" width="100%" class="popup-search-t2">');
  document.write('<tr valign="middle"><td width="100%">');
  document.write('<form action="http://popup-search.com/" name="popup-search-form">');
  document.write('<input type="hidden" name="src" value="blogparts" />');
  document.write('<input type="hidden" name="enc" value="" />');
  document.write('<input type="text" name="kw" value="" onFocus="popup_search_focus();" onBlur="popup_search_blur();" /></form></td>');
  document.write('<td><img src="http://popup-search.com/tool/blogparts/popup-search.gif" width="16" height="16" alt="POPUP-SEARCH" onClick="popup_search_go();" /></td>');
  document.write('</tr>');
  document.write('</table></td>');
  document.write('</tr>');
  document.write('</table>');

  document.write('<style>');
  document.write('<!--');
  document.write('.popup-search-t1 { background-color:#0054a8; }');
  document.write('.popup-search-t2 { background-color:#e5eef6; padding-left:3px; }');
  document.write('.popup-search-t2 tr td img { margin:3px 2px; }');
  document.write('.popup-search-t2 tr td form input { background-color:#e5eef6; border-width:0px; width:100%; color:#444444; }');
  document.write('-->');
  document.write('</style>');

  fobj = document.forms["popup-search-form"];
  fobj.elements["enc"].value = popup_search_enc;

  if (document.all){
    tobj = document.all("popup-search");
  } else if (document.getElementById){
    tobj = document.getElementById("popup-search");
  }
  tobj.style.width = popup_search_width + "px";
  tobj.style.marginTop = popup_search_margin_top + "px";
  tobj.style.marginBottom = popup_search_margin_bottom + "px";

  popup_search_blur();
}


dmsg = "POPUP-SEARCHで検索";

function popup_search_focus(){
  fobj.elements["kw"].value = "";
}

function popup_search_blur(){
  if (fobj.elements["kw"].value == ""){
    fobj.elements["kw"].value = dmsg;
  }
}

function popup_search_go(){
  if (fobj.elements["kw"].value != dmsg){
    fobj.submit();
  }
}

