% on error resume next function sw(str) i = instr(1,str," ",1) if i>0 then str = trim(mid(str,1,i)) sw = server.URLEncode(str) end function %>