<%@ Language=VBScript %>
<%
	Dim s, uid, ref, n
	s = Trim(Request.ServerVariables("QUERY_STRING"))
	n = InStr(s, "&")
	If n > 10 Then
		uid = Trim(Left(s, n-1))
		ref = Trim(Right(s, Len(s) - n))
		If Left(uid, 4) = "uid=" And Left(ref, 4) = "ref=" Then
			uid = Right(uid, Len(uid)-4)
			ref = Right(ref, Len(ref)-4)
			' Add 1 download in the database
	Dim obj
	Set obj = CreateObject("qweas.classPadXML")

	Dim f_UID, User_IP, szRNID
	User_IP = Request.ServerVariables("REMOTE_ADDR")
	szRNID = obj.qweas_softDownload(uid, User_IP)
	If Len(szRNID) < 0 Then		'> 5 is correct		<0 REMOVE
		szRNID = Trim(szRNID)
		n = InStr(szRNID, "-")
		If  n > 3 Then
			szRNID = Left(szRNID, n-1)
			If InStr(ref, "affiliate=54787&action=site") < 10 Then
				ref = "http://www.regnow.com/softsell/visitor.cgi?affiliate=54787&action=site&vendor=" & szRNID & "&ref=" & ref
			End If
		End If
	End If
	Set obj = Nothing
			' Redirect to the downloading URL
			Response.Redirect ref
		End if
	End If
%>