var iFlag;
var iPop;
function search() {
 var wPopupElements=document.all;
 if (wPopupElements.textcase.checked)
  {iFlag=4;}
 else
  {iFlag=0;}
 if (wPopupElements.searchtext.value==null || wPopupElements.searchtext.value=='')
  {
   alert("请输入您要查找的分类");
   return;
  }
 if (rng.findText(wPopupElements.searchtext.value,10000,iFlag)==true)
  {
   rng.select();
   rng.scrollIntoView();
   rng.moveStart("character");
  }
 else 
  {alert("文档搜索完毕！");}
}

function replace() {
 var wPopupElements=wPopup.document.all;
 if (wPopupElements.textcase.checked)
  {iFlag=4;}
 else
  {iFlag=0;}
 if (wPopupElements.searchtext.value==null || wPopupElements.searchtext.value=='')
  {
   alert("请输入您要查找的分类");
   return;
  }
 if (rng.findText(wPopupElements.searchtext.value,-10000,iFlag)==true)
  {
   rng.text = wPopupElements.replacetext.value;
  }
 else 
  {alert("文档搜索完毕！");}
}

function replaceall() {
 var rng = document.body.createTextRange();
 var wPopupElements=document.all;
 if (wPopupElements.textcase.checked)
  {iFlag=4;}
 else
  {iFlag=0;}
 if (wPopupElements.searchtext.value==null || wPopupElements.searchtext.value=='')
  {
   alert("请输入您要查找的分类");
   return;
  }
  for (i=0; rng.findText(wPopupElements.searchtext.value,10000,iFlag)!=false; i++)
  {
   rng.scrollIntoView();
   rng.text = wPopupElements.replacetext.value;
  }
  setTimeout('alert(i + " item(s) replaced!")',200);
}


function gofind() {
if(iPop=!iPop){document.getElementById("s").style.display="";}
else{document.getElementById("s").style.display="none";}
}
function closewin(){
iPop=!iPop;
document.getElementById("s").style.display="none";
}