var ISBfpver = 8;

var ISBver =0;
var ISBiewin = navigator.userAgent.indexOf('Win') && (document.all);
var ISBflag = false;
var ISBvarflag = false;

var ISBplugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

if (ISBplugin) {
    var ISBdesc = ISBplugin.description;
    ISBver = eval(ISBdesc.substring(ISBdesc.indexOf("Flash")+6, ISBdesc.indexOf("Flash")+9));
    ISBflag = ISBver >= ISBfpver;

} else if (ISBiewin) {
    document.write('<script language="VBScript"\> \n');
    document.write('on error resume next \n');
    document.write('ISBflag = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & ISBfpver )))\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 isbPutFlash(ISBcolor,ISBflag){

    var ISBwidth = 150;
    var ISBheight = 370;
    var ISBswfuri = 'http://i.yimg.jp/images/image-search/blogparts/p1/blogparts_p1_v2.swf';
    var ISBaltHTML = '';
    
    var ISBVars = ISBcolor;
        
    if ( ISBflag ) {
        document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"');
        document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"');
        document.write(' id="aexternal" width="'+ ISBwidth +'" height="'+ ISBheight +'">');
        document.write('<param name="movie" value="' + ISBswfuri + '">');
        document.write('<param name="flashVars" value="' + 'color=' + ISBVars +'">');
        document.write('<param name="wmode" value="transparent">');
        document.write('<param name="loop" value="true">');
        document.write('<param name="quality" value="high">');
        document.write('<param name="allowScriptAccess" value="always">');
        document.write('<embed src="' + ISBswfuri + '" loop="true" wmode="transparent" flashVars="' + 'color=' + ISBVars + '" allowScriptAccess="always"');
        document.write(' quality="high" swLiveConnect="false"');
        document.write(' width="'+ ISBwidth +'" height="'+ ISBheight +'"');
        document.write(' type="application/x-shockwave-flash"');
        document.write(' pluginspage="http://www.macromedia.com/go/getflashplayer">');
        document.write('</embed>');
        document.write('</object>');
    } else {
        document.write(ISBaltHTML);
    }
}

function isbJsCrawl(ISBflag){
    var ISBjs = document.getElementsByTagName("script");
    for (var i=0; i<ISBjs.length; i++) {
        if(ISBjs[i].src.indexOf("http://image-search.yahoo.co.jp/promo/js/") != -1){
            var ISBcolor = ISBjs[i].src.split("?");
            isbPutFlash(ISBcolor[1],ISBflag);
            ISBjs[i].src = "";
        }
    }
}
isbJsCrawl(ISBflag);

