/*
 * [関数名] CreateWindowsMediaPlayerObj
 * [機　能] Windows Media Player のウェブ埋め込みタグ生成
 * [説　明] JavaScriptでOBJECTタグ、EMBEDタグを生成し、生成した埋め込みタグを書き出す
 *　　　　　ムービーサイズ、自動再生の有無、コントロール表示・非表示を指定可
 * [引　数]
 * @param fpas ムービーへのパス（相対パス可）
 * @param width ムービーの幅
 * @param height ムービーの高さ
 * @param f_controll コントロール表示の有無 "true" | "false"
 * @param f_auto 自動再生の有無 "true" | "false"
 * @param f_audiocontroll 音声調節表示の有無 "true" | "false"
 * @param f_positioncontroll 巻戻し・早送り・スキップボタン表示の有無 "true" | "false"
 * @param f_trackerl 再生位置調節表示の有無 "true" | "false"
 * @param f_displayl ディスプレイ表示の有無 "true" | "false"
 * @param f_status ステータスバー表示の有無 "true" | "false"
 * @param f_transparent 背景透過の有無 "true" | "false"
*/
function CreateWindowsMediaPlayerObj(fpass,width,height,f_controll,f_auto,f_autorewind,f_audiocontroll,f_positioncontroll,f_tracker,f_display,f_status,f_transparent){
    htm="";
    if(f_controll=="true"){ // コントロール表示の場合はコントロールの高さ(45px)をプラス
        height=eval(height+45);
    }
    if(f_status=="true"){ // ステータスバー表示の場合はステータスバーの高さ(24px)をプラス
        height=eval(height+24);
    }
    //OBJECT TAG
    htm+="<object style='background-image:url(img/mcc/d05.jpg)'";
    htm+=" id='WMP'";
    htm+=" width='"+width+"' height='"+height+"'";
    htm+=" classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95'";
    htm+=" codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715'";
    htm+=" standby='Loading MicrosoftR WindowsR Media Player components...'";
    htm+=" type='application/x-oleobject'>\n";
    htm+="<param name='FileName' value='"+fpass+"'>\n";
    htm+="<param name='ShowControls' value='"+f_controll+"'>\n";
    htm+="<param name='AutoStart' value='"+f_auto+"'>\n";
    htm+="<param name='AutoRewind' value='"+f_autorewind+"'>\n";
    htm+="<param name='ShowAudioControls' value='"+f_audiocontroll+"'>\n";
    htm+="<param name='ShowPositionControls' value='"+f_positioncontroll+"'>\n";
    htm+="<param name='ShowTracker' value='"+f_tracker+"'>\n";
    htm+="<param name='ShowDisplay' value='"+f_display+"'>\n";
    htm+="<param name='ShowStatusBar' value='"+f_status+"'>\n";
    htm+="<param name='TransparentAtStart' value='"+f_transparent+"'>\n";
    //EMBED TAG
    htm+="<embed name='WMP' type='application/x-mplayer2'";
    htm+=" pluginspage='http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&'";
    htm+=" src='"+fpass+"'";
    htm+=" width='"+width+"' height='"+height+"'";
    htm+=" showcontrols='"+((f_controll=="true")?1:0)+"'";
    htm+=" autostart='"+((f_auto=="true")?1:0)+"'";
    htm+=" autorewind='"+((f_autorewind=="true")?1:0)+"'";
    htm+=" showaudiocontrols='"+((f_audiocontroll=="true")?1:0)+"'";
    htm+=" showpositioncontrols='"+((f_positioncontroll=="true")?1:0)+"'";
    htm+=" showtracker='"+((f_tracker=="true")?1:0)+"'";
    htm+=" showdisplay='"+((f_display=="true")?1:0)+"'";
    htm+=" showstatusbar='"+((f_status=="true")?1:0)+"'>\n";
    //htm+=" transparentatstart='"+((f_transparent=="true")?1:0)+"'>\n";
    htm+="</embed>\n";
    htm+="</object>\n";
    document.write(htm);
}