function CreateControl(DivID, inWidth, inHeight, inURL, inWmode, inQuality, inScale, inBorder, inBGColor)
{
    if (inWmode == "") {
        inWmode = "transparent";
    }
    if (inQuality == "") {
        inQuality = "high";
    }
    if (inScale == "") {
        inScale = "showall";
    }
    if (inBorder == "") {
        inBorder = "0";
    }
    if (inBGColor == "") {
        inBGColor = "FFFFFF";
    }
    flashCode = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" height=" + inHeight + " width=" + inWidth + " border=" + inBorder + ">";
    flashCode = flashCode + "<param NAME=\"movie\" VALUE=" + inURL + ">";
    flashCode = flashCode + "<param name=\"wmode\" value=\"" + inWmode +"\">";
    flashCode = flashCode + "<param NAME=\"quality\" VALUE=\"" + inQuality +"\">";		 
    flashCode = flashCode + "<param NAME=\"SCALE\" VALUE=\"" + inScale + "\">";
    flashCode = flashCode + "<param NAME=\"bgcolor\" VALUE=\"" + inBGColor + "\">";
    flashCode = flashCode + "<embed src=" + inURL +" wmode=\"" + inWmode + "\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"" + inWidth + "\" height=\"" + inHeight + "\" bgcolor=#\"" + inBGColor +"\"></embed>";
    flashCode = flashCode + "</object>";
    //flashCode = flashCode + "<BR>" + DivID + "<BR>" + inWidth + "<BR>" + inHeight + "<BR>" + inURL + "<BR>" + inWmode + "<BR>" + inQuality + "<BR>" + inScale + "<BR>" + inBorder + "<BR>" + inBGColor;
    
    if (document.all||document.getElementById){
      if (document.getElementById) {document.getElementById(DivID).innerHTML = flashCode}
         else {DivID.innerHTML = flashCode}
    }
}
function CreateControlWav(DivID, inURL, inAutostart, inLoop, inVisibility)
{
    if (inAutostart == "") {
        inAutostart = "TRUE";
    }
    if (inLoop == "") {
        inLoop = "FALSE";
    }
    if (inVisibility == "") {
        inVisibility = "False";
    }
    
    flashCode = "<embed src=\"" + inURL + "\" AUTOSTART=\"" + inAutostart + "\" LOOP=\"" + inLoop + "\" HIDDEN=\"" + inVisibility + "\"></embed>";
    
    if (document.all||document.getElementById){
      if (document.getElementById) {document.getElementById(DivID).innerHTML = flashCode}
         else {DivID.innerHTML = flashCode}
    }
}

function CreateControlMOV(DivID, inURL, inAutostart, inLoop, inScale, inController, inWidth, inHeight)
{
    if (inAutostart == "") {
        inAutostart = "TRUE";
    }
    if (inLoop == "") {
        inLoop = "FALSE";
    }
    if (inController == "") {
        inController = "TRUE";
    }
    if (inScale == "") {
        inScale = "tofit";
    }

    flashCode = "<embed src=\"" + inURL + "\" pluginspage=\"http://www.apple.com/quicktime/\" controller=\"" + inController + "\" loop=\"" + inLoop + "\" height=\"" + inHeight + "\" width=\"" + inWidth + "\" autoplay=\"" + inAutostart + "\" scale=\"" + inScale + "\"> </EMBED>";
    
    if (document.all||document.getElementById){
      if (document.getElementById) {document.getElementById(DivID).innerHTML = flashCode}
         else {DivID.innerHTML = flashCode}
    }
}

function CreateControlWMV(
    //DivID, inURL, inAutostart, inController, inWidth, inHeight, inAlign, inHspace, inVolume
    DivID,
    inURL,
    inShowControls, 
    inSendPlayStateChangeEvents, 
    inShowAudioControls, 
    inShowPositionControls,
    inShowTracker,
    inShowStatusBar,
    inAnimationatStart,
    inAutoSize,
    inAutoStart,
    inWidth,
    inHeight,
    inVolume,
    inshowcontrolsW,
    inShowAudioControlsW,
    inShowPositioncontrolsW,
    inShowTrackerW,
    inAutoStartW,
    inShowStatusBarW,
    inAnimationatStartW
    )
{
    /*if (inAutoStart == "") {
        inAutoStart = "1";
    }
    if (inShowControls == "") {
        inShowControls = "1";
    }*/
    

    flashCode = "<object \n";
    flashCode = flashCode + "name=\"Player\" \n";
    flashCode = flashCode + "classid=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6\" \n";
    //flashCode = flashCode + "classid=\"CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" \n";
    //flashCode = flashCode + "codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701\" \n";
    flashCode = flashCode + "type=\"application/x-oleobject\" \n";
    flashCode = flashCode + "align=\"center\" \n";
    flashCode = flashCode + "width=\"" + inWidth + "\" \n";
    flashCode = flashCode + "height=\"" + inHeight + "\"> \n";
    flashCode = flashCode + "<param name=\"URL\" value=\"" + inURL + "\"></param> \n";
    flashCode = flashCode + "<param name=\"ShowControls\" value=\"" + inShowControls + "\"></param> \n";
    flashCode = flashCode + "<param name=\"ShowAudioControls\" value=\"" + inShowAudioControls + "\"></param> \n";
    flashCode = flashCode + "<param name=\"ShowPositionControls\" value=\"" + inShowPositionControls + "\"></param> \n";
    flashCode = flashCode + "<param name=\"ShowTracker\" value=\"" + inShowTracker + "\"></param> \n";
    flashCode = flashCode + "<param name=\"ShowStatusBar\" value=\"" + inShowStatusBar + "\"></param> \n";
    flashCode = flashCode + "<param name=\"AnimationatStart\" value=\"" + inAnimationatStart + "\"></param> \n";
    flashCode = flashCode + "<param name=\"AutoStart\" value=\"" + inAutoStart + "\"></param> \n";
    flashCode = flashCode + "<param name=\"volume\" value=\"" + inVolume + "\"></param> \n";
    flashCode = flashCode + "<param name=\"SendPlayStateChangeEvents\" value=\"" + inSendPlayStateChangeEvents + "\"></param> \n";
    flashCode = flashCode + "<embed type=\"application/x-oleobject\" \n";
    flashCode = flashCode + "pluginspage=\"http://www.microsoft.com/windowsmedia/\" \n";
    flashCode = flashCode + "SRC=\"" + inURL + "\" \n";
    flashCode = flashCode + "showcontrols=\"" + inshowcontrolsW + "\"  \n";
    flashCode = flashCode + "SendPlayStateChangeEvents=\"" + inSendPlayStateChangeEvents + "\" \n";
    flashCode = flashCode + "showaudiocontrols=\"" + inShowAudioControlsW + "\"  \n";
    flashCode = flashCode + "showpositioncontrols=\"" + inShowPositioncontrolsW + "\"  \n";
    flashCode = flashCode + "showtracker=\"" + inShowTrackerW + "\" \n";
    flashCode = flashCode + "showstatusbar=\"" + inShowStatusBarW + "\"  \n";
    flashCode = flashCode + "animationatstart=\"" + inAnimationatStartW + "\"  \n";
    flashCode = flashCode + "autosize=\"" + inAutoSize + "\"  \n";
    flashCode = flashCode + "AUTOSTART=\"" + inAutoStartW + "\" \n";
    flashCode = flashCode + "width=\"" + inWidth + "\" \n";
    flashCode = flashCode + "height=\"" + inHeight + "\" \n";
    flashCode = flashCode + "name=\"MediaPlayer\" \n";
    flashCode = flashCode + "volume=\"" + inVolume + "\"> \n";
    flashCode = flashCode + "</embed> \n";
    flashCode = flashCode + "</object> \n";

    //flashCode = "<object NAME=\"Player\" showpositioncontrols=0 WIDTH=\"" + inWidth + "\" HEIGHT=\"" + inHeight + "\"  align=\"absmiddle\" type=\"application/x-oleobject\" volume=\"" + inVolume + "\" CLASSID=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6\">"
    //flashCode = flashCode + "<param NAME=\"URL\" VALUE=\"" + inURL + "\"><param><param name=\"showpositioncontrols\" value=0></param><param NAME=\"AUTOSTART\" VALUE=\"1\"><param NAME=\"VOLUME\" VALUE=\"" + inVolume + "\"></param><param name=\"showControls\" value=\"1\"></param><embed WIDTH=\"" + inWidth + "\" HEIGHT=\"" + inHeight + "\"  align=\"absmiddle\" SRC=\"" + inURL + "\" TYPE=\"application/x-oleobject\" AUTOSTART=\"1\"></embed></object>";

    if (document.all||document.getElementById){
      if (document.getElementById) {document.getElementById(DivID).innerHTML = flashCode}
         else {DivID.innerHTML = flashCode}
    }
    //document.tForm.tArea.value = flashCode;
}

