// This contains the script functions needed to dynamic add Active X controls to the page to address the IE issue on having to manually activate page active X components


// Flash loader

//Definition of variables passed to the function

// divID - the ID name of the div tag into which the code will be written
// swfID - the ID name to be given to the Flash swf file
// swfWidth - the width of the Flash movie
// swfHeight - the height of the Flash movie
// swfURL - the URL to the Flash file
// windowMode - [Window | Opaque | Transparent] used to indicate the mode of the window in which the Flash file is displayed
// scriptAccess - [always | never | samedomain]  - used to indicate what level of scripting the Flash file should be allowed to process
// swfBGColor - Hex value of the Flash movie background

function wmxFlashLoader(divID, swfID, swfWidth, swfHeight, swfURL, windowMode, scriptAccess, swfBGColor)
{
	//Private variables
  	var flashCode = document.getElementById(divID);
  	
	flashCode.innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="' + location.protocol + '//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" id=' + swfID + ' width=' + swfWidth + ' height=' + swfHeight + '><param name="URL" value=' + swfURL + ' /><param name="movie" value=' + swfURL + ' /><param name="wmode" value=' + windowMode + ' /><param name="allowScriptAccess" value=' + scriptAccess + ' /><param name="quality" value="high" /><param name="bgcolor" value=' + swfBGColor + ' /><embed src=' + swfURL + ' wmode=' + windowMode + ' width=' + swfWidth + ' height=' + swfHeight + ' name=' + swfID + ' allowScriptAccess=' + scriptAccess+ ' quality="high" bgcolor=' + swfBGColor + ' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>';
}


// QuickTime loader

//Definition of variables passed to the function

// divID - the ID name of the div tag into which the code will be written
// qwtWidth - the width of the movie
// qwtHeight - the height of the movie
// qwtURL - the URL to the file
// autoplay [true | false] - indicates if the movie should autostart or require interaction first.
// loop [true | false] - used to indicate if the medai should loop
// controller [true | false] - used to enable or disable the controller

function wmxQuickTimeLoader(divID, qwtWidth, qwtHeight, qwtURL, autoplay, loop, controller)
{
	//Private variables
  	var quickTimeCode = document.getElementById(divID);
  	
	quickTimeCode.innerHTML = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width=' + qwtWidth + ' height=' + qwtHeight + '><param name="src" value=' + qwtURL + ' /><param name="autoplay" value=' + autoplay + ' /><param name="loop" value=' + loop + ' /><param name="controller" value=' + controller + ' /><embed src=' + qwtURL + ' autoplay=' + autoplay + ' loop=' + loop + ' controller=' + controller + ' width=' + qwtWidth + ' height=' + qwtHeight + ' pluginspage="http://www.apple.com/quicktime/download/"></embed></object>';
}


// RealMedia loader

//Definition of variables passed to the function

// divID - the ID name of the div tag into which the code will be written
// realWidth - the width of the movie
// realHeight - the height of the movie
// realURL - the URL to the file
// autostart [true | false] - indicates if the movie should autostart or require interaction first.
// loop [true | false] - used to indicate if the media should loop
// controls [true | false] - used to indicate the type of controls

function wmxRealMediaLoader(divID, realWidth, realHeight, realURL, autostart, loop, controller)
{
	//Private variables
  	var realMediaCode = document.getElementById(divID);
  	if (controller == "true") {
	realMediaCode.innerHTML = '<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width=' + realWidth + ' height=' + realHeight + '><param name="src" value=' + realURL + ' /><param name="autostart" value=' + autostart + ' /><param name="loop" value=' + loop + '/><param name="controls" value="imagewindow" /><param name="console" value="video" /><embed src=' + realURL + ' type="audio/x-pn-realaudio-plugin" autostart=' + autostart + ' loop=' + loop + ' controls="imagewindow" console="video" width=' + realWidth + ' height=' + realHeight + '></embed></object><br><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width=' + realWidth + ' height="30"><param name="src" value=' + realURL + ' /><param name="autostart" value=' + autostart + '/><param name="loop" value=' + loop + ' /><param name="controls" value="ControlPanel" /><param name="console" value="video" /><embed src=' + realURL + ' type="audio/x-pn-realaudio-plugin" autostart=' + autostart + ' loop=' + loop + ' controls="ControlPanel" console="video" width=' + realWidth + ' height="30"></embed></object>';
} else {
	realMediaCode.innerHTML = '<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width=' + realWidth + ' height=' + realHeight + '><param name="src" value=' + realURL + ' /><param name="autostart" value=' + autostart + ' /><param name="loop" value=' + loop + '/><param name="controls" value="imagewindow" /><param name="console" value="video" /><embed src=' + realURL + ' type="audio/x-pn-realaudio-plugin" autostart=' + autostart + ' loop=' + loop + ' controls="imagewindow" console="video" width=' + realWidth + ' height=' + realHeight + '></embed></object>';
}
}

// Windows Media loader

//Definition of variables passed to the function

// divID - the ID name of the div tag into which the code will be written
// winWidth - the width of the movie
// winHeight - the height of the movie
// winURL - the URL to the file
// autoStart [true | false] - indicates if the movie should autostart or require interaction first.
// showControls [true | false] - used to turn on controls
// loop [true | false] - used to indicate if the media should loop

function wmxWinMediaLoader(divID, winWidth, winHeight, winURL, autoStart, showControls, loop)
{
	//Private variables
  	var winMediaCode = document.getElementById(divID);
  	
	winMediaCode.innerHTML = '<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" width=' + winWidth + ' height=' + winHeight + '><param name="fileName" value=' + winURL + ' /><param name="animationatStart" value="true" /><param name="transparentatStart" value="true" /><param name="autoStart" value=' + autoStart + ' /><param name="showControls" value=' + showControls + ' /><param name="loop" value=' + loop + ' /><embed src=' + winURL + ' type="application/x-mplayer2" pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" displaysize="4" autosize="-1" showcontrols=' + showControls + ' showtracker="-1" showdisplay="0" showstatusbar="-1" videoborder3d="-1" autostart=' + autoStart + ' designtimesp="5311" loop=' + loop + ' width=' + winWidth + ' height=' + winHeight + '"></embed></object>';
}