var SRBfpver = 9;
var SRBiewin = navigator.userAgent.indexOf('Win') && (document.all);
var SRBflag = false;

var SRBplugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

if (SRBplugin) {
    var SRBdesc = SRBplugin.description;
    SRBver = eval(SRBdesc.substring(SRBdesc.indexOf("Flash")+6, SRBdesc.indexOf("Flash")+9));
    SRBflag = SRBver >= SRBfpver;

} else if (SRBiewin) {
    document.write('<script language="VBScript"\> \n');
    document.write('on error resume next \n');
    document.write('SRBflag = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & SRBfpver )))\n');
    document.write('Function VBGetSwfVer(i) \n');
        document.write('Dim swControl , swVersion \n');
        document.write('swVersion=0 \n');
        document.write('set swControl=CreateObject("ShockwaveFlash.ShockwaveFlash."+CStr(i)) \n');
        document.write('if(IsObject(swControl))then \n');
        document.write('swVersion = swControl.GetVariable("$version") \n');
        document.write('end if \n');
        document.write('VBGetSwfVer=swVersion \n');
    document.write('End Function \n');
    document.write('</script\> \n');
}

function srbPutFlash(){

	if (SRBwidth == undefined) { var SRBwidth = 150 };
	if (SRBheight == undefined) { var SRBheight = 360 };
	if (SRBswfuri == undefined) { var SRBswfuri = 'http://i.yimg.jp/images/srank/blogparts/blogparts.swf'};
	var SRBaltHTML = '<!-- Adobe Flash Player  --><div align="left">検索ランキングブログパーツを表示するには、<br>JavaScriptに対応したブラウザとプレーヤーソフトウエアの<a href="http://www.adobe.com/go/getflashplayer_jp" target="_blank">Adobe Flash Player9以上（無料）</a>が必要です。</div><!-- /Adobe Flash Player  -->';

	if ( SRBflag ) {
	        document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	        document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"');
	        document.write(' id="aexternal" width="'+ SRBwidth +'" height="'+ SRBheight +'">');
	        document.write('<param name="movie" value="'+ SRBswfuri +'">');
	        document.write('<param name="allowScriptAccess" value="always" />');
	        document.write('<param name="loop" value="true">');
	        document.write('<param name="quality" value="high">');
	        document.write('<embed src="'+ SRBswfuri +'" loop="true"');
	        document.write(' quality="high" swLiveConnect="false"');
	        document.write(' width="'+ SRBwidth +'" height="'+ SRBheight +'"');
	        document.write(' type="application/x-shockwave-flash"');
	        document.write(' allowScriptAccess="always"');
	        document.write(' pluginspage="http://www.adobe.com/go/getflashplayer_jp">');
	        document.write('</embed>');
	        document.write('</object>');
	} else {
	        document.write(SRBaltHTML);
	}
}

function SRBerr() {
        return true;
}


srbPutFlash();
