var google_adnum = 0;

function google_ad_request_done(google_ads) {

    if (google_ads.length < 1 ) return; // Proceed only if we have ads to display!
    
    var s = '';

    s += '<table cellpadding="2" cellspacing="0" border="0" width="100%" style="border:#ECECEC solid 1px;">';
    s += '<tr><td align="left" style="background:#ECECEC; color:#666;">';
    s += '<div style="float:left"><a href="' + google_info.feedback_url + '">'+google_feedback_text+'</a></div>';
    s += '<div style="float:right"><a href="http://pagead2.googlesyndication.com/pagead/pageclick?type=7&redir_url=https%3A//adwords.google.com/select/OnsiteSignupLandingPage%3Fclient%3Dca-pub-9107944072945632%26referringUrl%3Dhttp%3A//www.radioblogclub.com/">'+google_advertise_text+'</a></div>';
    s += '</td></tr>';
    
    // IMAGE ADS
    if (google_ads[0].type == "image") {
        s += '<tr><td align="center"><a href="' + google_ads[0].url +
        '" target="_top" title="go to ' + google_ads[0].visible_url +
        '"><img style="border:none;" src="' + google_ads[0].image_url +
        '"width="' + google_ads[0].image_width +
        '"height="' + google_ads[0].image_height + '"/></a></td></tr>';
    }
    
    // TEXT ADS
    else {
        if (google_ads.length == 1) {
            i = 0;
            s += '<tr><td style="cursor:pointer;padding:2px 10px 2px 10px;" onclick="javascript:top.location.href=\''+google_ads[i].url+'\'" onmouseover="this.style.backgroundColor=\'#F9F9F9\';"  onmouseout="this.style.backgroundColor=\'#FFFFFF\';" style="text-align:left;">'
            +'<a style="cursor:pointer;cursor:hand; text-decoration:none" onclick="javascript:top.location.href=\''+google_ads[i].url+'\'" onmouseover="window.status=\'go to ' + google_ads[i].visible_url + '\'" onmouseout="window.status=\'\'">' 
            +'<span style="color:#000000; font-size:18pt; font-weight: bold;">'+google_ads[i].line1+'<br></span>'
            +'<span style="color:#666666; font-size:14pt;">'+ google_ads[i].line2 + '&nbsp;'+google_ads[i].line3+'<br></span>' 
            +'<span style="color:#FF005C; font-size:12pt">'+ google_ads[i].visible_url 
            +'</span></a><br></td></tr>';
        }
        else if (google_ads.length > 1) {
            for(i = 0; i < google_ads.length; ++i) {
                s += '<tr><td style="cursor:pointer;padding:2px 10px 2px 10px;" onclick="javascript:top.location.href=\''+google_ads[i].url+'\'" onmouseover="this.style.backgroundColor=\'#F9F9F9\';"  onmouseout="this.style.backgroundColor=\'#FFFFFF\';" style="text-align:left;">'
                +'<a style="cursor:pointer;cursor:hand; text-decoration:none" onclick="javascript:top.location.href=\''+google_ads[i].url+'\'" onmouseover="window.status=\'go to ' + google_ads[i].visible_url + '\'" onmouseout="window.status=\'\'">' 
                +'<span style="color:#000000; text-decoration:underline; font-weight: bold;">'+google_ads[i].line1+'<br></span>'
                +'<span style="color:#666666;">' + google_ads[i].line2 + '&nbsp;'+google_ads[i].line3+'<br></span>' 
                +'<span style="color:#FF005C;">' + google_ads[i].visible_url 
                +'</span></a><br></td></tr>';
            }
        } 

        if (google_ads[0].bidtype == "CPC") google_adnum = google_adnum + google_ads.length;
    }

    // Finish up anything that needs finishing up
    s += '</table>';
    
    document.write(s);
    
    return;
}
