﻿var CFLiewin = navigator.userAgent.indexOf('Win') && (document.all);
var CFLflag = false;
var CFLfpver = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if (plugin) {
    CFLflag = parseInt(plugin.description.match(/\d+\.\d+/)) >= CFLfpver;
    //CFLflag = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= CFLfpver;
} else if (CFLiewin) {
    document.write('<script language="VBScript"\> \n');
    document.write('on error resume next \n');
    document.write('CFLflag = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & CFLfpver )))\n');
    document.write('</script\> \n');
}

var CFLaltHTML = '<a href="http://widgets.yahoo.co.jp/gallery/" target="_blank"><img src="http://i.yimg.jp/images/widgets/badge/nonflash.gif" border="0" alt="天気情報やカレンダーをデスクトップに表示する便利なツール（無料）"></a>';

var script = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="150" height="150" align="middle" id="widgets"><param name="movie" value="http://i.yimg.jp/images/widgets/badge/ywb.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="sameDomain" /><param name="FlashVars" value="bc=0x' + bc + '&id=' + id + '&p=' + p + '&n=' + n + '" /><embed src="http://i.yimg.jp/images/widgets/badge/ywb.swf?bc=0x' + bc + ' + &id=' + id + '&p=' + p + '&n=' + n + '" quality="high" wmode="transparent" width="150" height="150" name="widgets" align="middle" allowScriptAccess="sameDomain"  type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';

if( CFLflag )
{
    document.write( script );
}
else
{
    document.write( CFLaltHTML );
}

