function EmbedFlash(URL, width, height, menu, quality, bg, bg2){
	//Checks if the menu constant is entered (correctly)
	if(menu != true && menu != false && menu != "true" && menu != "false"){
		menu = true; //Replace with default. Default = true.
	}
	//Checks if the quality constant is entered (correctly)
	if(quality != "high" && quality != "normal" && quality != "low"){
		quality = "high";	//Replace with default. Defautl = high.
	}
	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 + '" />');
		if (bg == null){
		document.writeln('<param name="wmode" value="transparent" />');
		document.writeln('<param name="play" value="true" />');
		document.writeln('<embed bgcolor="'+ bg2 +'" wmode="transparent" width="' +  width + '" height="' + height + '" src="' + URL + '" menu="' + menu + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" play="true"></embed></object>');
		}else{
		document.writeln('<param name="bgcolor" value="' + bg + '" />');
		document.writeln('<param name="play" value="true" />');
		document.writeln('<embed wmode="transparent" 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 EmbedGvidT(URL, width, height, menu, quality, bg, bg2){
	//Checks if the menu constant is entered (correctly)
	if(menu != true && menu != false && menu != "true" && menu != "false"){
		menu = true; //Replace with default. Default = true.
	}
	//Checks if the quality constant is entered (correctly)
	if(quality != "high" && quality != "normal" && quality != "low"){
		quality = "high";	//Replace with default. Default = 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" style="width:' + width + 'px; height:' + height + 'px;" align="left" type="application/x-shockwave-flash" value="' + URL + '">');
		document.writeln('<param name="movie" value="' + URL + '"/>'); 
		document.writeln('<param name="wmode" value="trasparent" ></param>'); 
		document.writeln('<embed src="' + URL + '" type="application/x-shockwave-flash" wmode="transparent" width="' + width + '" height="' + height + '"></embed>');  
		document.writeln('</object><br>');
	}
}

function EmbedMp3T(URL, width, height, menu, quality, bg, bg2){
	//Checks if the menu constant is entered (correctly)
	if(menu != true && menu != false && menu != "true" && menu != "false"){
		menu = true; //Replace with default. Default = true.
	}
	//Checks if the quality constant 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://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + width + '" height="' + height + '" id="movie" data="dewplayer.swf?son=' + URL + '">');
		document.writeln('<param name="movie" value="dewplayer.swf?son=' + URL + '"/>');
		//document.writeln('<param name="bgcolor" value="000066" />'); 
		document.writeln('<param name="wmode" value="trasparent" ></param>'); 
		document.writeln('<embed src="dewplayer.swf?son=' + URL + '" quality=high bgcolor=#000066 type="application/x-shockwave-flash" wmode="transparent" width="' + width + '" height="' + height + '"></embed>');  
		document.writeln('</object><br />');
	}
}

function EmbedQuicktime(URL, width, height, autoplay){
	if(autoplay != true && autoplay != "true" && autoplay != "1" && autoplay != 1){
		autoplay = 0; //Replace with default. Default = 0 (false).
		}else{
		autoplay = 1; //Replace with 1, being zero.
	}//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 != "true" && autostart != "1" && autostart != 1){
		autostart = 0; //Replace with default. Default = 0 (false).
		}else{
		autostart = 1; //Replace with 1, being zero.
	}//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 != "true" && autostart != "1" && autostart != 1){
		autostart = 0; //Replace with default. Default = 0 (false).
		}else{
		autostart = 1; //Replace with 1, being zero.
	}//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="' +  width + '" HEIGHT="' +  height + '" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ');
		document.writeln('STANDBY="Attendere il caricamento dei componenti di Windows Media Player.." TYPE="application/x-oleobject" />');
		document.writeln('<PARAM NAME="FileName" VALUE="' + URL + '" />');
		document.writeln('<PARAM name="autostart" VALUE="'+ autostart +'" />');
		document.writeln('<PARAM name="volume" VALUE="80" />');
		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="true" />');
		document.writeln('<embed type="application/x-mplayer2" id="MediaPlayer" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" displaysize="4" width="' +  width + '" height="' +  height + '" src="' + URL + '" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" 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 constant is entered (correctly)
	if(menu != true && menu != false && menu != "true" && menu != "false"){
		menu = true; //Replace with default. Default = true.
	}
	//Checks if the quality constant 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 != "true" && autoplay != "1" && autoplay != 1){
		autoplay = 0; //Replace with default. Default = 0 (false).
		}else{
		autoplay = 1; //Replace with 1, being zero.
	}//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 != "true" && autostart != "1" && autostart != 1){
		autostart = 0; //Replace with default. Default = 0 (false).
		}else{
		autostart = 1; //Replace with 1, being zero.
	}//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 != "true" && autostart != "1" && autostart != 1){
		autostart = 0; //Replace with default. Default = 0 (false).
		}else{
		autostart = 1; //Replace with 1, being zero.
	}//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="MEDIAPLAYER" WIDTH="' +  width + '" HEIGHT="' +  height + '" 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="VOLUME" VALUE="50" />');
		document.writeln('<PARAM name="SHOWCONTROLS" VALUE="TRUE" />');
		document.writeln('<param name="SHOWSTATUSBAR" value="TRUE" />');
		document.writeln('<param name="STRETCHTOFIT" 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 AUTOSIZE="TRUE" SHOWDISPLAY=0></EMBED></OBJECT>');
	}
}
function EmbedTubeVideoT(YTPermalink, width, height, autostart) {   
	if(YTPermalink == null || YTPermalink == "illegal"){
		//Nope, we can't.
		document.writeln(" error: illegal use of video tag! ");
	}else{
		//Add the code to the document.
		genCode = YTPermalink.replace(new RegExp(/http\:\/\/www\.youtube\.com\/\?v\=/g), ""); 
		//document.writeln("gencode-"+genCode);
		document.writeln('<object width="' + width + '" height="' + height + '"><param name="movie" value="http://www.youtube.com/v/' + genCode + '"></param>');
		document.writeln('<embed src="http://www.youtube.com/v/' + genCode + '" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed></object>');
	}
}


