﻿function Search()
    document.form1.action ="http://auto.remai.com/search/searchnews.aspx?keyword=" + urlencoding(document.getElementById("txtSearch").value)
    document.form1.method="post" 
    document.form1.target="_blank"
    document.form1.submit()
end function
  function   urlencoding(vstrin)   
  dim   i,strreturn   
          strreturn   =   ""   
          for   i   =   1   to   len(vstrin)   
                  thischr   =   mid(vstrin,i,1)   
                  if   abs(asc(thischr))   <   &hff   then   
                          strreturn   =   strreturn   &   thischr   
                  else   
                          innercode   =   asc(thischr)   
                          if   innercode   <   0   then   
                                  innercode   =   innercode   +   &h10000   
                          end   if   
                          hight8   =   (innercode     and   &hff00)\   &hff   
                          low8   =   innercode   and   &hff   
                          strreturn   =   strreturn   &   "%"   &   hex(hight8)   &     "%"   &   hex(low8)   
                  end   if   
          next   
          urlencoding   =   strreturn   
  end   function  