var comicdash_calendar_config;

function comicdash_calendar_display( comicdash_calendar_name, comicdash_calendar_profimage, comicdash_calendar_data ) {
    var comicdash_calendar_htmltag = '';
    comicdash_calendar_htmltag += '<div style="font-size: 10px; line-height: 12px; border: 1px solid #aad; background-color: #fff; width: ' + (comicdash_calendar_config.width -4) + 'px; margin: 4px 0px 4px 0px; padding: 2px;">' +
        '<div style="width: ' + (comicdash_calendar_config.width-6) + 'px; margin: 0px; padding: 2px 2px 2px 2px; font-size: 10px; line-height: 12px; word-break: break-all;">' + 
        '<a href="http://ckworks.jp/comicdash/profile/' + comicdash_calendar_name + '" target="_blank"><img src="' + comicdash_calendar_profimage + '" width="16" height="16" border="0" style="margin: 0px 0px -3px 0px;" /></a>' +
        '<span style="margin-left: 4px; color: #666;"><a href="http://ckworks.jp/comicdash/profile/' + comicdash_calendar_name + '" style="color: #44f; text-decoration: none;" target="_blank">' + comicdash_calendar_name + '</a>の新刊カレンダー</span><br /><span style="color: #666;">　　→ <a href="http://ckworks.jp/comicdash/calendar/' + comicdash_calendar_name + '" style="color: #44f; text-decoration: none;" target="_blank">すべて見る</a></span><br />' + 
        '</div>';
    var comicdash_disp_count = 0;
    for ( comicdash_calendar_loopnum = 0; comicdash_calendar_loopnum < comicdash_calendar_data.length; comicdash_calendar_loopnum ++ ) {
        comicdash_bgcolor_str = '#ffffff'; if ( comicdash_disp_count %2 == 1 ) { comicdash_bgcolor_str = '#f8f8ff'; }
        comicdash_calendar_htmltag += '<div style="width: ' + (comicdash_calendar_config.width-16) + 'px; margin: 0px; padding: 7px; font-size: 10px; line-height: 12px; border-top: 1px solid #dde; word-break: break-all; background-color: ' + comicdash_bgcolor_str + ';">' + 
            '<a href="http://www.amazon.co.jp/exec/obidos/ASIN/' + comicdash_calendar_data[comicdash_calendar_loopnum].asin + '/' + comicdash_calendar_config.amazonid + '/ref=nosim" style="text-decoration: none;" title="Amazon.co.jp で ' + comicdash_calendar_data[comicdash_calendar_loopnum].title + ' を見る" target="_blank"><img src="' + comicdash_calendar_data[comicdash_calendar_loopnum].image_s + '" width="25" height="35" border="0" align="left" style="border: 1px solid #ddd; padding: 2px; margin: 0px 10px 0px 0px;" /></a>' +
            '<span style="color: #666;">' + comicdash_calendar_data[comicdash_calendar_loopnum].pubdate + '</span> ' +
            '<a href="http://www.amazon.co.jp/exec/obidos/ASIN/' + comicdash_calendar_data[comicdash_calendar_loopnum].asin + '/' + comicdash_calendar_config.amazonid + '/ref=nosim" style="text-decoration: none;" title="Amazon.co.jp で ' + comicdash_calendar_data[comicdash_calendar_loopnum].title + ' を見る" target="_blank"><span style="color: #44f;">' + comicdash_calendar_data[comicdash_calendar_loopnum].title + '</span></a> ' +
            '<a href="http://ckworks.jp/comicdash/asin/s/' + comicdash_calendar_data[comicdash_calendar_loopnum].asin + '" style="text-decoration: none;" title=" コミックダッシュ！で ' + comicdash_calendar_data[comicdash_calendar_loopnum].title + ' を見る" target="_blank"><span style="color: #daa;">[ シリーズ情報 ]</span></a>' +
            '<br clear=left /></div>';
        comicdash_disp_count ++;
        if ( comicdash_disp_count >= comicdash_calendar_config.num ) { break; }
    }
    comicdash_calendar_htmltag += '<div style="font-size: 10px; line-height: 12px; width: ' + (comicdash_calendar_config.width-6) + 'px; margin: 0px; padding: 2px; border-top: 1px solid #dde; background-color: #fff;"><center><a href="http://ckworks.jp/comicdash/" style="color: #44f; text-decoration: none;" target="_blank">Powered by コミックダッシュ！</a></center></div>' +
        '</div>';

    document.write( comicdash_calendar_htmltag );
}
