function OvertureAd() {
    this.initialize.apply(this, arguments);
}

OvertureAd.prototype = {
    initialize: function() {
        this.id = (new Array("f_laffblo_01", "f_laffblo_02", "f_laffblo_03", "f_laffblo_04", "f_laffblo_05", "f_laffblo_06", "f_laffblo_07", "f_laffblo_08", "high_laffblo_01", "high_laffblo_02"))[Math.floor(Math.random() * 10)];
        this.url = 'http://' + window.location.host + window.location.pathname;
    },

    render: function(id, offset, count) {
        if (typeof(zSr) === 'undefined') {
            document.write('<script src="http://im.ov.yahoo.co.jp/js_flat/?source=yoshimoto_jp_laff_im&type=lafftypepad&ctxtId=' + this.id + '&ctxtUrl=' + encodeURIComponent(this.url) + '&outputCharEnc=utf8&maxCount=4" type="text/javascript" language="javascript"></script>');
            var that  = this;
            var timer = setInterval(function(){
                                        if (typeof(zSr) === 'object') {
                                            clearInterval(timer);
                                            that._render(id, offset, count);
                                        }
                                    }, 30);
        }
        else {
            this._render(id, offset, count);
        }
    },

    renderEntryAd: function(id) {
        this.render(id, 1, 3);
    },

    renderSidebarAd: function(id) {
        this.render(id, 4, 1);
    },

    _render: function(id, offset, count) {
        var html = '';
        if (zSr instanceof Array) {
            var index = 6;
            if (zSr.length >= index * (offset + count)) {
                html += '<div style="margin: 0px 0px 10px;">'
                     +  '<div style="margin: 0pt 0pt 10px; padding: 0px 20px 0px 0px; overflow: hidden; background-image: none; font-size: 12px; line-height:1.2; text-align: left; display: block; clear: both; width: 100%;">';
                var i = index * offset;
                while (i < index * (offset + count)) {
                    var desc = zSr[i++]; i++;
                    var url = zSr[i++];
                    var title = zSr[i++];
                    var fqdn = zSr[i++]; i++;
                    html += '<a href="' + url + '" target="_top" style="text-decoration: none; display: block; cursor: pointer;">'
                         +  '<dl onmouseover="this.style.backgroundImage=\'url(http://images.laff.jp/adback.png)\';" onmouseout="this.style.backgroundImage=\'\';" style="margin: 0pt; width: 100%; padding: 7px 10px;">'
                         +  '<dt onmouseover="this.style.textDecoration=\'none\'" onmouseout="this.style.textDecoration=\'underline\'" style="margin: 0pt; float: left; font: bold /1.25em; font-weight: bold; text-decoration: underline;">' + title + '</dt>'
                         +  '<dd onmouseover="this.style.textDecoration=\'none\'" onmouseout="this.style.textDecoration=\'underline\'" style="float: left; margin-top: 0em; margin-left: 1.5em; padding-top: 0em; text-decoration: underline;">' + fqdn + '</dd>'
                         +  '<dd style="margin: 0pt; padding: 0px; clear: both; font-size: 85%; color: #999;">' + desc + '</dd>'
                         +  '</dl>'
                         +  '</a>';
                }
                html += '<p style="margin: 0; padding: 7px 0px 2px 15px; display: block; text-align: left; color: #999;">'
                     +  '<a class="blog_IMp" href="http://listing.yahoo.co.jp/service/int/index.html?o=IM0028" style="text-decoration: none;">インタレストマッチ - <span onmouseover="this.style.textDecoration=\'none\'" onmouseout="this.style.textDecoration=\'underline\'" style="text-decoration: underline;">広告の掲載について </span>'
                     +  '</a>'
                     +  '</p>'
                     +  '</div>'
                     +  '</div>';
            }
        }
        var div = document.getElementById(id);
        div.innerHTML = html;
    }
};

if (typeof(TCSP) == 'undefined') {
    document.write('<script type="text/javascript" src="/.shared-asp24/js/sp.js"></script>');
}

