/* コールバック関数 */
var google_ad_request_done = function(google_ads) {
    if (google_ads.length == 0) {
        return;
    }

    var s = '<div style="margin: 0px auto; font-size: 10pt">';

    /* 広告本体 */
    if (google_ads[0].type == "image") {
        /* 画像 */
        s += '<div class="gImg">';
        s += '<a href="' + google_ads[0].url + '" target="_blank" '
           + '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>';
        s += '</div>';

        /* タイトル */
        s += google_ad_create_title();
    } else if (google_ads[0].type == "flash") {
        /* Flash */
        s += '<div class="gFlash">';
        s += '<object id="google_adsense" 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>';
        s += '</div>';

        /* タイトル */
        s += google_ad_create_title();
    } else if (google_ads[0].type == "html") {
        /* html */
        s += google_ads[0].snippet;

        /* タイトル */
        s += google_ad_create_title();
    } else if (google_ads[0].type == "text") {
        /* text */
        s += '<div class="list1" style="text-align: left; padding: 5px; border: 1px solid #87c800">';
        for (var i = 0; i < google_ads.length; i++) {
            s += '<div onclick="popup_ad_site(\'' + google_ads[i].url + '\')" '
               + 'target="_blank" '
               + 'style="text-decoration: none" '
               + 'onmouseout="window.status=\'\'; this.style.cursor=\'pointer\';" '
               + 'onmouseover="window.status=\'go to ' + google_ads[i].visible_url + '\';return true;" '
               + '>'
               + '<a href="javascript:void(0)" style="font-weight: bold">'
               + google_ads[i].line1
               + '</a><br>'
               + '<span style="color: black; font-size: 90%;">'
               + google_ads[i].line2 + '&nbsp;' + google_ads[i].line3
               + '</span></a><br><br>'
               + '</div>';
        }

        /* タイトル */
        s += google_ad_create_title();
        s += '</div>';
    }

    s += '</div>';
    s += '<br>';
    s += '<br>';

    document.write(s);
};

/* タイトル作成用関数 */
var google_ad_create_title = function() {
    return '<div class="genreBAR1"><div class="genreBAR1-head"><p style="text-align: right; font-weight: bold">'
         + '<a href="' + google_info.feedback_url + '">Ads by Google</a>'
         + '</p></div></div>';
};

/* 広告を表示 */
var popup_ad_site = function(url) {
    window.open(url, "_blank");
};


/* 取得する Google 広告の設定 */
google_ad_client = 'ca-rakuten-blog_js';
google_ad_channel = 'thm_left';
google_ad_output = 'js';
google_max_num_ads = 3;
google_encoding = 'euc-jp';
google_language = 'ja';
google_safe = 'medium';
google_skip = '3';
google_image_size = '160x600';
google_ad_type = 'text,image,flash,html';
google_feedback = 'on';

/* Google 表示スクリプトを書き出し */
document.write('<scr' + 'ipt type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></scr' + 'ipt>');
