function EmbedFlash(URL, width, height, menu, quality, bg, bg2){

	//Checks if the menu constance is entered (correctly)
	if(menu != true && menu != false && menu != "true" && menu != "false"){
		menu = true; //Replace with default. Default = true.
	}
	
	//Checks if the quality constance is entered (correctly)
	if(quality != "high" && quality != "normal" && quality != "low"){
		quality = "high";	//Replace with default. Defautl = high.
	}
	
	//See if we can continue.	
	if(URL == null || width == null || height == null){
		//Nope, we can't.
		document.writeln("No URL, width or height entered");
	}else{
		//Add the code to the document.
		document.writeln('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="6,0,0,0" width="' +  width + '" height="' + height + '">');
		document.writeln('<param name="movie" value="' + URL + '" />');
		document.writeln('<param name="quality" value="' + quality + '" />');
		document.writeln('<param name="menu" value="' + menu + '" />');
		document.writeln('<param name="bgcolor" value="' + bg + '" />');
		document.writeln('<param name="play" value="true" />');
		document.writeln('<embed bgcolor="'+ bg2 +'" width="' +  width + '" height="' + height + '" src="' + URL + '" menu="' + menu + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="best" play="true"></embed></object>');
	}
}


function EmbedQuicktime(URL, width, height, autoplay){
	if(autoplay != true && autoplay != false && autoplay != "true" && autoplay != "false"){
		autoplay = false; //Replace with default. Default = false.
	}//See if we can continue.	
	if(URL == null || width == null || height == null){
		//Nope, we can't.
		document.writeln("No URL, width or height entered");
	}else{
		//Add the code to the document.
		document.writeln('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" TYPE="video/quicktime" width="' +  width + '" height="' + height + '">');
		document.writeln('<param name="src" value="' + URL + '" />');
		document.writeln('<param name="volume" value="25" />');
		document.writeln('<param name="autoplay" value="'+ autoplay +'" />');
		document.writeln('<param name="autohref" value="'+ autoplay +'" />');
		document.writeln('<param name="cache" value="true" />');
		document.writeln('<param name="scale" value="aspect" />');
		document.writeln('<embed width="' +  width + '" height="' + height + '" src="' + URL + '" pluginspage="http://www.apple.com/quicktime/download/" type="video/quicktime" cahce="true" scale="aspect" autohref="' + autoplay + '" AUTOPLAY="' + autoplay + '" volume="25"></embed></object>');
	}
}

function EmbedWMAudio(URL, autostart){
	if(autostart != true && autostart != false && autostart != "true" && autostart != "false"){
		autostart = false; //Replace with default. Default = false.
	}//See if we can continue.	
	if(URL == null){
		//Nope, we can't.
		document.writeln("No URL entered");
	}else{
		//Add the code to the document.
		document.writeln('<OBJECT ID="MediaPlayer" WIDTH="360" HEIGHT="70" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ');
		document.writeln('STANDBY="Please wait while the Windows Media Player components load" TYPE="application/x-oleobject" />');
		document.writeln('<PARAM NAME="FileName" VALUE="' + URL + '" />');
		document.writeln('<PARAM name="autostart" VALUE="'+ autostart +'" />');
		document.writeln('<PARAM name="ShowControls" VALUE="true" />');
		document.writeln('<PARAM name="volume" VALUE="50" />');
		document.writeln('<param name="SHOWTRACKER" value="true" />');
		document.writeln('<param name="ShowStatusBar" value="true" />');
		document.writeln('<PARAM name="ShowDisplay" VALUE="false" />');
		document.writeln('<embed width="360" height="70" src="' + URL + '" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" type="application/x-mplayer2" autostart="'+ autostart +'" transparentstart="1" loop="0" controller="true" showstatusbar=1 showdisplay=0></embed></object>');
	}
}

function EmbedWMVideo(URL, width, height, autostart){
	if(autostart != true && autostart != false && autostart != "true" && autostart != "false"){
	autostart = false; //Replace with default. Default = false.
	}//See if we can continue.	
	if(URL == null){
		//Nope, we can't.
		document.writeln("No URL entered");
	}else{
		//Add the code to the document.
		//OLD document.writeln('<OBJECT ID="MediaPlayer" WIDTH="' +  width + '" HEIGHT="' +  height + '" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ');
		document.writeln('<OBJECT ID="VIDEO" CLASSID="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6" ');
		document.writeln('STANDBY="Please wait while the Windows Media Player components load" TYPE="application/x-oleobject" />');
		document.writeln('<PARAM NAME="FileName" VALUE="' + URL + '" />');
		document.writeln('<PARAM name="autostart" VALUE="'+ autostart +'" />');
		document.writeln('<PARAM name="volume" VALUE="50" />');
		document.writeln('<PARAM name="ShowControls" VALUE="true" />');
		document.writeln('<param name="ShowStatusBar" value="true" />');
		document.writeln('<param name="SHOWTRACKER" value="true" />');
		document.writeln('<PARAM name="ShowDisplay" VALUE="false" />');
		document.writeln('<embed width="' +  width + '" height="' +  height + '" src="' + URL + '" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" type="application/x-mplayer2" autostart="'+ autostart +'" transparentstart="1" loop="0" ShowControls=1 controller="true" SHOWTRACKER=1 showstatusbar=1 showdisplay=0></embed></object>');
	}
}

function EmbedFlashT(URL, width, height, menu, quality, bg, bg2){

	//Checks if the menu constance is entered (correctly)
	if(menu != true && menu != false && menu != "true" && menu != "false"){
		menu = true; //Replace with default. Default = true.
	}
	
	//Checks if the quality constance is entered (correctly)
	if(quality != "high" && quality != "normal" && quality != "low"){
		quality = "high";	//Replace with default. Defautl = high.
	}
	
	//See if we can continue.	
	if(URL == null || URL == "illegal" || width == null || height == null){
		//Nope, we can't.
		document.writeln("&nbsp;error: illegal use of flash tag!&nbsp;");
	}else{
		//Add the code to the document.
		document.writeln('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="6,0,0,0" width="' +  width + '" height="' + height + '">');
		document.writeln('<param name="movie" value="' + URL + '" />');
		document.writeln('<param name="quality" value="' + quality + '" />');
		document.writeln('<param name="menu" value="' + menu + '" />');
		document.writeln('<param name="bgcolor" value="' + bg + '" />');
		document.writeln('<param name="play" value="true" />');
		document.writeln('<embed bgcolor="'+ bg2 +'" width="' +  width + '" height="' + height + '" src="' + URL + '" menu="' + menu + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="best" play="true"></embed></object>');
	}
}


function EmbedQuicktimeT(URL, width, height, autoplay){
	if(autoplay != true && autoplay != false && autoplay != "true" && autoplay != "false"){
		autoplay = false; //Replace with default. Default = false.
	}//See if we can continue.	
	if(URL == null || URL == "illegal"){
		//Nope, we can't.
		document.writeln("&nbsp;error: illegal use of quicktime tag!&nbsp;");
	}else{
		//Add the code to the document.
		document.writeln('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" TYPE="video/quicktime" width="' +  width + '" height="' + height + '">');
		document.writeln('<param name="src" value="qtposter.jpg" />');
		document.writeln('<param name="href" value="' + URL + '" />');
		document.writeln('<param name="volume" value="25" />');
		document.writeln('<param name="autoplay" value="'+ autoplay +'" />');
		document.writeln('<param name="autohref" value="false" />');
		document.writeln('<param name="cache" value="true" />');
		document.writeln('<param name="scale" value="aspect" />');
		document.writeln('<param name="target" value="myself" />');
		document.writeln('<embed width="' +  width + '" height="' + height + '" src="qtposter.jpg" href="' + URL + '" pluginspage="http://www.apple.com/quicktime/download/" type="video/quicktime" cache="true" scale="aspect" autohref="false" AUTOPLAY="' + autoplay + '" volume="25" TARGET="myself"></embed></object>');
	}
}

function EmbedWMAudioT(URL, autostart){
	if(autostart != true && autostart != false && autostart != "true" && autostart != "false"){
		autostart = false; //Replace with default. Default = false.
	}//See if we can continue.	
	if(URL == null || URL == "illegal"){
		//Nope, we can't.
		document.writeln("&nbsp;error: illegal use of audio tag!&nbsp;");
	}else{
		//Add the code to the document.
		document.writeln('<OBJECT ID="MediaPlayer" WIDTH="360" HEIGHT="70" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ');
		document.writeln('STANDBY="Please wait while the Windows Media Player components load" TYPE="application/x-oleobject" />');
		document.writeln('<PARAM NAME="FileName" VALUE="' + URL + '" />');
		document.writeln('<PARAM name="autostart" VALUE="'+ autostart +'" />');
		document.writeln('<PARAM name="ShowControls" VALUE="true" />');
		document.writeln('<PARAM name="volume" VALUE="50" />');
		document.writeln('<param name="SHOWTRACKER" value="true" />');
		document.writeln('<param name="ShowStatusBar" value="true" />');
		document.writeln('<PARAM name="ShowDisplay" VALUE="false" />');
		document.writeln('<embed width="360" height="74" src="' + URL + '" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" type="application/x-mplayer2" autostart="'+ autostart +'" transparentstart="1" loop="0" controller="true" showstatusbar=1 showdisplay=0></embed></object>');
	}
}

function EmbedWMVideoT(URL, width, height, autostart){
	if(autostart != true && autostart != false && autostart != "true" && autostart != "false"){
	autostart = false; //Replace with default. Default = false.
	}//See if we can continue.	
	if(URL == null || URL == "illegal"){
		//Nope, we can't.
		document.writeln("&nbsp;error: illegal use of video tag!&nbsp;");
	}else{
		//Add the code to the document.
		document.writeln('<object id="WindowsMediaPlayer" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" width="340" height="300" 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"> ');
		document.writeln('  <param name="FileName" value="' + URL + '" /> ');
		document.writeln('  <param name="ControlType" value="1"> ');
		document.writeln('  <param name="AutoStart" value="true"> ');
		document.writeln('  <param name="AnimationAtStart" value="True"> ');
		document.writeln('  <param name="ClickToPlay" value="true"> ');
		document.writeln('  <embed type="application/x-mplayer2" width="340" height="300" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" src="' + URL + '" name="WindowsMediaPlayer" controltype="1" showdisplay="0" showstatusbar="0" clicktoplay="true" autostart="true"> ');
		document.writeln('</object> ');
	}
}