
function ranking_flash( type, cat, subcat, rank, hpath, ipath )
{
    var url;
    var fvars;
    
   // ----- タイプによってＵＲＬを設定
    if( type == 'souba' ) {
       url = "/swf/souba.swf";
       ht  = "334";
       id  = "souba";
    } else if( type == 'ranking' ) {
       url = "/swf/ranking.swf";
       ht  = "387";
       id  = "dynamic";
    } else {
       document.write('type error');
       return;
    }
    
   // ----- パラメータ
    fvars = 'category_code=' + cat + '&subcategory_code=' + subcat + '&ranking_code=' + rank + '&home_path=' + hpath + '&image_path=' + ipath ;
    
   // ----- 正式なＵＲＬ
    url += "?" + fvars;
    
    document.write( '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="709" height="' + ht + ' id="' + id + '" valign="top">' );
    document.write( '   <param name="allowScriptAccess" value="sameDomain" /> ');
    document.write( '   <param name="movie"    value="' + url + '" /> ' );
    document.write( '   <param name="quality"  value="high" /> ' );
    document.write( '   <param name="bgcolor"  value="#ffffff" /> ' );
    document.write( '   <PARAM NAME="FlashVars" VALUE="' + fvars + '" />' );
    document.write( '   <embed src = "' + url + '"  ' );
    document.write( '          FlashVars = "' + fvars + '"  ' );
    document.write( '          quality="high"  ' );
    document.write( '          bgcolor="#ffffff"  ' );
    document.write( '          width="709"  ' );
    document.write( '          height="' + ht +'"  ' );
    document.write( '          name="ranking"  ' );
    document.write( '          align="middle"  ' );
    document.write( '          allowScriptAccess="sameDomain"  ' );
    document.write( '          type="application/x-shockwave-flash"  ' );
    document.write( '          pluginspage="http://www.macromedia.com/go/getflashplayer"  ' );
    document.write( '   /> ' );
    document.write( '</object> ' );
    
}
