
function google_ad_wrap_a(google_ad, text, cls)
{
  return '<a class='+cls+' href="' + google_ad.url + '" onmouseover="window.status=\''
         + google_ad.visible_url + '\'; return true;" onmouseout="window.status=\'\'" >' +
         text + '</a>';
}

function google_ad_request_done(google_ads) 
{
  if (google_ads.length < 1)
    return;

  var elt = document.getElementById(ad_unit_target);
    
  document.getElementById('a').style.width='';

  var txt = '<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">';
  
  if (google_info.feedback_url) 
    txt += ('<tr><td class="google_link_cell"><A href="'+
      google_info.feedback_url+
      '">Ads by Google</A></td></tr>');

  if (google_ads[0].type == 'text') 
  {
    for(i = 0; i < google_ads.length; ++i) 
    {
      if (google_ads.length < 4 && i > 0)
        txt += "<tr><td style='height:20px'></td></tr>";
      
      txt += "<tr><td class='ad_links' ";
      
      if (google_ads.length == 1)
        txt += 'style="height:240px; vertical-align:middle"';
      if (google_ads.length == 2)
        txt += 'style="height:110px; vertical-align:middle"';
      
      var lrg = google_ads.length<3?'_lrg':'';
        
      txt += " >" + 
        google_ad_wrap_a(google_ads[i], google_ads[i].line1, 'main_link'+lrg) +
        google_ad_wrap_a(google_ads[i],
          google_ads[i].line2 + " " +
          google_ads[i].line3, 'description_link'+lrg) + 
        google_ad_wrap_a(google_ads[i], google_ads[i].visible_url, 'visible_url'+lrg) + 
        "</td></tr>";
      //document.write('<tr><td class="ad_links"><ul><li>' +
      //  google_ad_wrap_a(google_ads[i], google_ads[i].line1, 'main_link') + '</li></ul>' +
      //  google_ad_wrap_a(google_ads[i],
      //  google_ads[i].line2 + " " +
      //  google_ads[i].line3, 'description_link') + "</td></tr>");
    }
  }
  
  txt += "</table>";
  
  elt.innerHTML = txt;  
}
