function EmbedTubeVideoT(YTPermalink, 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(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\/\watch\?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>');
}
}

function EmbedTubeVideo(YTPermalink, 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(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\/\watch\?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>');
}
}




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>');
	}
}
