# File ads/ad_sense.rb, line 53
      def getAdByPage

        @@userId=request.env['HTTP_USERID'] 
        if (@@userId.nil?)
          @@userId="101"
        end

        adArgs= SequencedHash.new
        adArgs["ad_type"]="text"
        adArgs["channel"]="8618723264"
        adArgs["client"]="pub-0061196910475770" 
        adArgs["format"]="mobile_single"
        adArgs["host"]=request.host
        adArgs["ip"]=request.remote_ip
        adArgs["markup"]="xhtml"
        adArgs["output"]="xhtml"
        adArgs["oe"]="utf8"
        adArgs["ref"]=request.referer
        adArgs["url"]="http://"+request.env["HTTP_HOST"]+request.env["REQUEST_URI"]
        #adArgs["useragent"]=request.user_agent  
        adArgs["eip"]=Digest::SHA1.hexdigest(@@userId)[0..20]  # oneway hashed userid  

        # now built the URL to call out to based upon the base URL and ad hash
        adURL=@@adServer + "?"
        first=1 # dont put ampersand on first one
        adArgs.each_key do |x|
          if adArgs[x]
            (adURL=adURL+"&") unless first
            first=nil # start putting in &s
            adURL = adURL + x + "=" + adArgs[x]   
          end
        end
        # ok, now call google's mobile adSense service and get back the full ad 
        @pagead=open(adURL).read   
     
      end