// var BurstQuery;
// var BeginDate;
// var EndDate;
// var EmbedWidth;
// var EmbedHeight;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
var plugin_show = false;
function showAD(){
    if ( plugin ) {
        // フラッシュ表示部分
        insertSwfTag(BurstQuery, BeginDate, EndDate, EmbedWidth, EmbedHeight);
        plugin_show = true;
    } else {
        // 画像表示部分
        //showGIF();
        showGIF(200, 120);
    }
}

function insertSwfTag(query, from, to, width, height)
{
    var tag = [
        '<div id="burst_image">',
        '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="',width,'" height="',height,'" id="home">',
        '<param name="movie" value="http://i.yimg.jp/images/blog-search/swf/frq070314.swf" />',
        '<param name="FlashVars" value="',query,'&args=&begin=',from,'&end=',to,'" />',
        '<param name="quality" value="high" />',
        '<param name="wmode" value="transparent" />',
        '<param name="menu" value="false" />',
        '<param name="bgcolor" value="#fff" />',
        '<param name="allowScriptAccess" value="always" />',
        '<embed src="http://i.yimg.jp/images/blog-search/swf/frq070314.swf" FlashVars="',query,'&args=&begin=',from,'&end=',to,'" quality="high" bgcolor="#fff" width="',width,'" height="',height,'" name="home" type="application/x-shockwave-flash" allowScriptAccess="always" wmode="transparent" menu="false" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>',
        '</div>'
    ].join("");
    document.getElementById('burst_result').innerHTML = tag;
}

function showGIF (width, height){
    var tag = '<a href="http://help.yahoo.co.jp/help/jp/blog-search/blog-search-04.html" target="_blank"><img src="http://i.yimg.jp/images/blog-search/noflash_8.gif" alt="キーワードの注目度" style="margin-left:88px;" width="'+width+'" height="'+height+'" border="0"></a>';
    document.getElementById('burst_result').innerHTML = tag;
}

if ( plugin ) {
    plugin = plugin.description.match(/[\d\.]{2,}/) >= 8;
} else {
    document.write('<SCRIPT LANGUAGE=VBScript\> \n');
    document.write('on error resume next \n');
    document.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8")))\n');
    document.write('</SCRIPT\> \n');
}
showAD();
