      /*
       * This function is required. It processes the google_ads JavaScript object,
       * which contains AFS ads relevant to the user's search query. The name of
       * this function <i>must</i> be <b>google_afs_request_done</b>. If this
       * function is not named correctly, your page will not display AFS ads.
       */

      function google_afs_request_done(google_ads)
      {
          var google_num_ads = google_ads.length;
          //google_num_ads = google_ads.length;
          if (google_num_ads <= 0)
          {
              return;
          }

          var wideAds = "";   // wide ad unit html text
          var narrowAds = "";   // narrow ad unit html text

          for(i = 0; i < google_num_ads; i++)
          {
              if (google_ads[i].type=="text/wide")
              {
                  // render a wide ad
                  wideAds+='<div class="width336box">'; 
                  wideAds+='<span><a onmouseover="javascript:window.status=\'' +
                          google_ads[i].url + '\';return true;" ' +
                          'onmouseout="javascript:window.status=\'\';return true;" ' +
                          'href="' + google_ads[i].url + '"><font color="#CC6633">' +
                          google_ads[i].line1 + '</font></span></a><p>' +
                          google_ads[i].line2 + '<br>' +
                          google_ads[i].line3 + '</p>' +
                          '<a class="linkwprd" onmouseover="javascript:window.status=\'' +
                          google_ads[i].url + '\';return true;" ' +
                          'onmouseout="javascript:window.status=\'\';return true;" ' +
                          'href="' + google_ads[i].url + '">' +
                          google_ads[i].visible_url + '<br><br></a></div>';
              }

              else
              {
                  // render a narrow ad
                  narrowAds+='<div class="width336box">';
                  narrowAds+='<span><a onmouseover="javascript:window.status=\'' +
                          google_ads[i].url + '\';return true;" ' +
                          'onmouseout="javascript:window.status=\'\';return true;" ' +
                          'href="' + google_ads[i].url + '"><font color="#CC6633">' +
                          google_ads[i].line1 + '</font></span></a><p>' +
                          google_ads[i].line2 + '<br>' +
                          google_ads[i].line3 + '</p>' +
                          '<a class="linkwprd" onmouseover="javascript:window.status=\'' +
                          google_ads[i].url + '\';return true;" ' +
                          'onmouseout="javascript:window.status=\'\';return true;" ' +
                          'href="' + google_ads[i].url + '">' +
                          google_ads[i].visible_url + '<br><br></a></div>';
              }
          }

          if (narrowAds != "")
          {
              narrowAds = '<div class="google468">' +
                          '<a href="http://services.google.com/feedback/online_hws_feedback">' +
                          '<span class="ad_header" style="text-align:left"><font color="#cccccc">Ads by Google</font></div></a>' + narrowAds;
          }

          if (wideAds != "")
          {
              wideAds = '<div class="google468">' +
                        '<a href="http://services.google.com/feedback/online_hws_feedback">' +
                        '<span class="ad_header" style="text-align:left"><font color="#cccccc">Ads by Google</font></div></a>' + wideAds;
          }

          // Write HTML for wide and narrow ads to the proper <div> elements
          document.getElementById("wide_ad_unit").innerHTML = wideAds;
          document.getElementById("narrow_ad_unit").innerHTML = narrowAds;
          
          
      }

