// JS code for Google ads stuff
function google_afs_request_done(google_ads)
      {
      
          /*
           * Verify that there are actually ads to display.
           */
          var 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+='<a style="text-decoration:none" onmouseover="javascript:window.status=\'' +
                          google_ads[i].url + '\';return true;" ' +
                          'onmouseout="javascript:window.status=\'\';return true;" ' +
                          'href="' + google_ads[i].url + '">' +

                          '<span class="ad_line1">' + google_ads[i].line1 + '</span></a><br>' +
                          
                          '<span class="ad_text">' + google_ads[i].line2 + '</span><br>' +
                          
                          '<a style="text-decoration:none" onmouseover="javascript:window.status=\'' +
                          google_ads[i].url + '\';return true;" ' +
                          'onmouseout="javascript:window.status=\'\';return true;" ' +
                          'href="' + google_ads[i].url + '">' +
                          
                          '<span class="ad_url">' + google_ads[i].visible_url + '</span><br><br></a>';
              }

              else
              {
                  // render a narrow ad
                  narrowAds+='<div class="googleAds"><a style="text-decoration:none" onmouseover="javascript:window.status=\'' +
                          google_ads[i].url + '\';return true;" ' +
                          'onmouseout="javascript:window.status=\'\';return true;" ' +
                          'href="' + google_ads[i].url + '">' +

                          '<span class="ad_line1">' + google_ads[i].line1 + '</span></a><br>' +

                          '<span class="ad_text">' + google_ads[i].line2 + '</span><br>' +

                          '<span class="ad_text">' + google_ads[i].line3 + '</span><br>' +

                          '<a style="text-decoration:none" onmouseover="javascript:window.status=\'' +
                          google_ads[i].url + '\';return true;" ' +
                          'onmouseout="javascript:window.status=\'\';return true;" ' +
                          'href="' + google_ads[i].url + '">' +

                          '<span class="ad_url">' + google_ads[i].visible_url + '</span><br><br></a></div>';
              }
          }

          if (narrowAds != "")
          {
              narrowAds = '<a style="text-decoration:none" ' +
                          'href="http://services.google.com/feedback/online_hws_feedback">' +
                          '<span class="ad_header" style="text-align:left">Ads by Google</span><br><br></a>' + narrowAds;
          }

          if (wideAds != "")
          {
              wideAds = '<a style="text-decoration:none" ' +
                        'href="http://services.google.com/feedback/online_hws_feedback">' +
                        '<span class="ad_header" style="text-align:left">Ads by Google</span><br><br></a>' + wideAds;
          }
          document.write(narrowAds);
      }
      
      function google_ad_request_done(google_ads) 
      {        
      
        var s = '';
        var i;
        if (google_ads.length == 0) {
            return;
        }
        //currently removing flash and image ads.
        /*if (google_ads[0].type == "flash") {
            s += '<a href=\"' + 
            google_info.feedback_url + '\" style="color:000000">Ads by Google</a><br>' + 
            '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' +
            ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="' + 
            google_ad.image_width + '" HEIGHT="' + 
            google_ad.image_height + '"> <PARAM NAME="movie" VALUE="' + 
            google_ad.image_url + '">' + 
            '<PARAM NAME="quality" VALUE="high">' + 
            '<PARAM NAME="AllowScriptAccess" VALUE="never">' + 
            '<EMBED src="' + 
            google_ad.image_url + '" WIDTH="' + 
            google_ad.image_width + '" HEIGHT="' + 
            google_ad.image_height + 
            '" TYPE="application/x-shockwave-flash"' + 
            ' AllowScriptAccess="never" ' + 
            ' PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';
        } else if (google_ads[0].type == "image") {
            s += '<a href=\"' + 
            google_info.feedback_url + '\" style="color:000000">Ads by Google</a><br> <a href="' + 
            google_ads[0].url + '" target="_top" title="go to ' + 
            google_ads[0].visible_url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
            google_ads[0].visible_url + '\';return true"><img border="0" src="' + 
            google_ads[0].image_url + '"width="' + 
            google_ads[0].image_width + '"height="' + 
            google_ads[0].image_height + '"></a>';
        } else if (google_ads[0].type == "html") {
            s += google_ads[0].snippet;
        } else {*/
        if (google_ads.length == 1) {
            s += '<a href=\"' + 
            google_info.feedback_url + '\" style="color:000000">Ads by Google</a><br> <a style="text-decoration:none" href="' + 
            google_ads[0].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
            google_ads[0].visible_url + '\';return true"> <span style="text-decoration:underline;font-size:20pt"> <b>' + 
            google_ads[0].line1 + '</b><br></span></a> <span style="color:#000000;font-size:16pt">' +
            google_ads[0].line2 + '&nbsp;' +
            google_ads[0].line3 + '<br></span> <span><a style="color:#008000;font-size:14pt;text-decoration:none" href="' + 
            google_ads[0].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
            google_ads[0].visible_url + '\';return true">' + 
            google_ads[0].visible_url + '</span></a><br>';



        } else if (google_ads.length > 1) {

            s += '<a href=\"' + google_info.feedback_url + '\" style="color:000000">Ads by Google</a><br>' 
            for(i = 0; i < google_ads.length; ++i) {
                s += '<div class="googleJDPHorizontal">';
                s += '<br><a style="text-decoration:none" href="' + 
                google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
                google_ads[i].visible_url + '\';return true"> <span style="text-decoration:underline"> <b>' + 
                google_ads[i].line1 + '</b><br></span></a> <span style="color:#000000">' +
                google_ads[i].line2 + '<br>' +
                google_ads[i].line3 + '<br></span> <span><a style="color:#008000;text-decoration:none" href="' + 
                google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
                google_ads[i].visible_url + '\';return true">' + 
                google_ads[i].visible_url + '</span></a><br>';
                s += '</div>';
            } // end for loop
        } // end else if
        //} // end bigger else

        document.write(s);
        return;
    } // end function
    
    -->


