
//--------------------------------------------------------------------------------
// video
/*
autoplay is true because we usually access it via videoClicked (below)
like so:

<div id="myVideo"; style="position:absolute; padding: 0 0 0 0; margin: 0 0 0 0; left:0px; top:0px; width:400px; height:300px;">
<img src="images/myVideo.jpg"; onclick="videoClicked ('myVideo', 'myVideo.flv', '400', '300', 'video/')"; />
</div>

*/
//--------------------------------------------------------------------------------
function videoObject (video, width, height, folder)
{
    var text
         = '<object codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"';
    text += ' width=';
    text += width;
    text += ' height=';
    text += height;
    text += ' data="';
    text += folder;
    text += 'flvplayer.swf?video=';
    text += video;
    text += '&autoplay=true&allowfullscreen=true">';
    text += '<param name="allowScriptAccess" value="sameDomain" />';
    text += '<param name="movie" value="';
    text += folder;
    text += 'flvplayer.swf" />';
    text += '<param name="quality" value="high" />';
    text += '<param name="bgcolor" value="#000000" />';
    text += '<param name="scale" value="noscale" />';
    text += '<param name="salign" value="lt" />';
    text += '<param name="src" value=';
    text += folder;
    text += video;
    text += ' />';
    text += '<embed src="';
    text += folder;
    text += 'flvplayer.swf?video=';
    text += video;
    text += '&autoplay=true&allowfullscreen=false"';
    text += ' width=';
    text += width;
    text += ' height=';
    text += height;
    text += ' align="middle" quality="high" bgcolor="#000000" scale="noscale" salign="lt"'; 
    text += ' allowScriptAccess="sameDomain" type="application/x-shockwave-flash"'; 
    text += ' pluginspage="http://www.macromedia.com/go/getflashplayer" />';
    text += '</object>';

    return text;
}

//--------------------------------------------------------------------------------
// video
//--------------------------------------------------------------------------------
function videoClicked (id, video, width, height, folder)
{
    var theDiv = document.getElementById (id);
    if (theDiv != null)
        theDiv.innerHTML=videoObject (video, width, height, folder);
}

