/*
 * [関数名] CreateWindowsMediaPlayerObj
 * [機　能] Windows Media Player のWebページ埋め込みタグ生成
 * [説　明] JavaScriptでOBJECTタグ、EMBEDタグを生成し、生成した埋め込みタグを書き出す
 *　　　　　ムービーサイズ、自動再生の有無、コントロール表示・非表示を指定可
 * [引　数]
 * @param fpass ムービーへのパス（相対パス可）
 * @param width ムービーの幅
 * @param height ムービーの高さ
 * @param f_control コントロール表示の有無 "true" | "false"
 * @param f_auto 自動再生の有無 "true" | "false"
 * @param f_status ステータスバー表示の有無 "true" | "false"
*/
function CreateWindowsMediaPlayerObj(fpass,width,height,f_control,f_auto,f_status) {
    html="";
    if(f_control=="true"){ // コントロール表示の場合はコントロールの高さ(45px)をプラス
        height=eval(height+45);
    }
    if(f_status=="true"){ // ステータスバー表示の場合はステータスバーの高さ(24px)をプラス
        height=eval(height+24);
    }
    //OBJECT TAG
    html+="<object id='player'";
    html+=" width='"+ width +"' height='" + height + "'";
    html+=" class='clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6'>\n";
    html+="  <param name='autostart' value='" + f_auto + "'>\n";
    html+="  <param name='showstatusbar' value='" + f_status + "'>\n";
    html+="  <param name='showcontrols' value='" + f_control + "'>\n";
    html+="  <param name='URL' value='" + fpass + "'>\n";
    //EMBED TAG
    html+="  <embed name='WMP'";
    html+="    width='" + width + "' height='" + height +"'\n";
    html+="    autostart='"+((f_auto=="true")?1:0)+"'\n";
    html+="    showstatusbar='"+((f_status=="true")?1:0)+"'\n";
    html+="    showcontrols='"+((f_control=="true")?1:0)+"'\n";
    html+="    src='" + fpass + "'\n";
    html+="    type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/'>\n";
    html+="  </embed>\n";
    html+="</object>\n";
    document.write(html);
}


