﻿function createFlashPlayer(id, file, width, height, quality, bgcolor, allowScriptAccess, align, showFullScreen){
    
    if(id == undefined || id == ""){
        var d = new Date();
        id = d.getFullYear() + '_' + d.getMonth() + '_' + d.getDate() + '_' + d.getHours() + '_' + d.getMinutes() + '_' + d.getSeconds() + '_' + d.getMilliseconds();
    }
    if(width == undefined || width == '') width = '415';
    if(height == undefined || height == '') height = '290';
    if(quality == undefined || quality == '') quality = 'high';
    if(bgcolor == undefined || bgcolor == '') quality = '#FFFFFF';
    if(allowScriptAccess == undefined || allowScriptAccess == '') allowScriptAccess = 'sameDomain';
    if(align == undefined || align == '') align = 'high';

    document.writeln('<div style="width:'+ width +';height:'+ height +';">');
    document.writeln('<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="' + width + '" height="' + height + '" id="' + id + '" align="' + align + '">');
    document.writeln('<param name="allowScriptAccess" value="' + allowScriptAccess + '" />');
    document.writeln('<param name="movie" value="../Movies/' + file + '" />');
    document.writeln('<param name="quality" value="' + quality + '" />');
    document.writeln('<param name="bgcolor" value="' + bgcolor + '" />');
    document.writeln('<embed src="' + file + '" quality="' + quality + '" bgcolor="' + bgcolor + '" width="' + width + '" height="' + height + '" name="' + id + '" align="' + align + '" allowScriptAccess="' + allowScriptAccess + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
    document.writeln('</object><br>');
    if(showFullScreen) 
        document.writeln('<a href="../Movies/'+ file +'" target=_blank>全屏播放</a>'); 
    document.writeln('</div>'); 
     
}

