<%
response.charset="gb2312"

keyword=request.QueryString("keyword")
sp=request.QueryString("sp")

select case sp

case "google"
	response.Redirect "http://www.google.com.hk/search?q="&keyword&"&client=aff-1616dh&channel=1616"
case "sougou"
	response.Redirect "http://www.sogou.com/sogou?ie=gb2312&query="&keyword&"&pid=AQ9DA"
case "baidu"
	response.Redirect "http://www.baidu.com/s?wd="&keyword&""

case "mp3-baidu"
	response.Redirect "http://mp3.baidu.com/m?ct=134217728&word="&keyword&""
case "mp3-xunlei"
	response.Redirect "http://mp3.gougou.com/search?search="&keyword&"&id=1018524"
case "mp3-google"
	response.Redirect "http://www.google.cn/music/search?q="&URLEncode(keyword)&""
case "mp3-sougou"
	response.Redirect "http://mp3.sogou.com/music.so?ie=gb2312&query="&keyword&"&pid=AQ9DA"
	
case "tv-xunlei"
	response.Redirect "http://movie.gougou.com/search?search="&keyword&"&id=1018524"
case "tv-youku"
	response.Redirect "http://www.soku.com/search_video/q_"&keyword&""
	
case "mov-xunlei"
	response.Redirect "http://video.gougou.com/search?search="&keyword&"&id=1018524"
case "mov-google"
	response.Redirect "http://www.google.com.hk/search?q="&URLEncode(keyword)&""
case "mov-baidu"
	response.Redirect "http://video.baidu.com/v?ct=134217728&word="&keyword&""
	
case "pic-baidu"
	response.Redirect "http://image.baidu.com/i?ct=201326592&lm=-1&word="&keyword&""
case "pic-google"
	response.Redirect "http://www.google.com.hk/images?q="&URLEncode(keyword)&""
	
case "tieba-baidu"
	response.Redirect "http://tieba.baidu.com/f?kw="&keyword&""
case "tieba-laiba"
	response.Redirect "http://laiba.tianya.cn/searchGroup.jsp?isFromStock=false&searchType=0&nameOrStockCode="&URLEncode(keyword)&""

case "bbs"
	response.Redirect bbsUrl&"/search.php?mod=forum&searchid=1&srchtxt="&keyword&""

case else
	response.Redirect "http://www.baidu.com/s?wd="&keyword&""
end select


Function URLEncode(url)
	Dim oneChar, result
	Dim oneAsc 

	If url = "" Then
		URLEncode = url
		Exit Function
	End If
	For i = 1 To Len(url)
		oneChar = Mid(url,i, 1)
		oneAsc = AscW(oneChar)
		If oneAsc < 0 Then oneAsc = oneAsc + 65536
		If (oneAsc And &HFF80) = 0 Then
   If (oneAsc >= 65 And oneAsc <= 90) Or (oneAsc >= 97 And oneAsc <= 122) Or (oneAsc >= 48 And oneAsc <= 57) Or oneAsc = 45 Or oneAsc = 46 Or oneAsc = 95 Then 
		 result = result & oneChar 
	  Else 
		 result = result & "%" & Hex(oneAsc) 
   End If 
		Else
			If (oneAsc And &HF000) = 0 Then
				uch = "%" & Hex(((oneAsc \ 2 ^ 6)) Or &HC0) & Hex(oneAsc And &H3F Or &H80)
				result = result & uch
			Else
				uch = "%" & Hex((oneAsc \ 2 ^ 12) Or &HE0) & "%" & _
				Hex((oneAsc \ 2 ^ 6) And &H3F Or &H80) & "%" & _
				Hex(oneAsc And &H3F Or &H80)
				result = result & uch
			End If
		End If
	Next 

	URLEncode = result
End Function 
%>