
/**
* These functions are used to write the flash and other object tags into the HTML document. 
* This avoids IE requiring users to click the flash to ativate the content. 

* Note: If IE's debug options are turned on, this may not work. Microsoft has a patch that 
* fixes the problem. 
*/

function writeFlash(movie, className, id, name) {
	var classString = "";
	if (className != undefined && className != null) {
		classString = " class=\"" + className + "\"";
	}
	var idString = "";
	if (id != undefined && id != null) {
		idString = " id=\"" + id + "\"";
	}
	var nameString = "";
	if (name != undefined && name != null) {
		nameString = " name=\"" + name + "\"";
	}
	document.writeln(
		"<OBJECT " + 
		classString +  
		idString + 
		nameString + 
		" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"" + 
		" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\">");
	document.writeln(
		"<PARAM NAME=movie VALUE=\"" + movie + "\">" +
		"<PARAM NAME=menu VALUE=false>" + 
		"<PARAM NAME=allowScriptAccess value=always>" +
		"<PARAM NAME=wmode VALUE=transparent>" +  
		"<PARAM NAME=quality VALUE=high>");
	document.writeln(	
		"<EMBED " + 
		classString + 
		idString +
		nameString + 
		" src=\"" + movie + "\"" + 
		" quality=high" + 
		" TYPE=\"application/x-shockwave-flash\"" +
		" menu=false" + 
		" allowScriptAccess=always" + 
		" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\">" + 
		"</EMBED>");
	document.writeln("</OBJECT>");
}

function writeBetterFlash(movie, className, id, width, height) {
	//alert("starting");
	var classString = "";
	if (className != undefined && className != null) {
		classString = " class=\"" + className + "\"";
	}
	var idString = "";
	if (id != undefined && id != null) {
		idString = " id=\"" + id + "\"";
	}
	document.writeln(
		"<OBJECT " + 
		classString +  
		idString + 
		" width=" + width + 
		" height=" + height + 
		" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"" + 
		" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\">");
	document.writeln(
	    "<PARAM NAME=movie VALUE=\"" + movie + "\">" +
		"<PARAM NAME=menu VALUE=false>" + 
		"<PARAM NAME=allowFullScreen value=false>" +
		"<PARAM NAME=allowScriptAccess value=sameDomain>" +
		"<PARAM NAME=wmode VALUE=transparent>" +  
		"<PARAM NAME=scale value=exactfit>" +
		"<PARAM NAME=quality VALUE=best>"); 
	document.writeln(	
		"<EMBED " + 
		classString + 
		idString +
		" width=" + width +
		" height=" + height + 
		" src=\"" + movie + "\"" +  
		" scale=exactfit" + 
		" quality=best" + 
		" TYPE=\"application/x-shockwave-flash\"" +
		" menu=false" + 
		" allowScriptAccess=always" + 
		" wmode=transparent" +
		" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\">" + 
		"</EMBED>");
	document.writeln("</OBJECT>");
	//alert("done");
}


function writePlayerFlash(movie, className, id) {
	//alert("starting");
	var classString = "";
	if (className != undefined && className != null) {
		classString = " class=\"" + className + "\"";
	}
	var idString = "";
	if (id != undefined && id != null) {
		idString = " id=\"" + id + "\"";
	}
	document.writeln(
		"<OBJECT " + 
		classString +  
		idString + 
		" width=100%" + 
		" height=100%" + 
		" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"" + 
		" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\">");
	document.writeln(
		"<PARAM NAME=movie VALUE=\"" + movie + "\">" +
		"<PARAM NAME=menu VALUE=false>" + 
		"<PARAM NAME=allowFullScreen value=true>" +
		"<PARAM NAME=allowScriptAccess value=sameDomain>" +
		"<PARAM NAME=wmode VALUE=transparent>" +  
		"<PARAM NAME=scale value=exactfit>" +  
		"<PARAM NAME=quality VALUE=best>"); 
	document.writeln(	
		"<EMBED " + 
		classString + 
		idString +
		" width=100%" +
		" height=100%" + 
		" src=\"" + movie + "\"" +  
		" scale=exactfit" + 
		" quality=best" + 
		" TYPE=\"application/x-shockwave-flash\"" +
		" menu=false" + 
		" allowScriptAccess=always" + 
		" wmode=transparent" +
		" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\">" + 
		"</EMBED>");
	document.writeln("</OBJECT>");
	//alert("done");
}


function writeQuicktime(movie, className, id) {
	var classString = "";
	if (className != undefined && className != null) {
		classString = " class=\"" + className + "\"";
	}
	var idString = "";
	if (id != undefined && id != null) {
		idString = " id=\"" + id + "\"";
	}
	document.writeln(
		"<OBJECT " + 
		classString +  
		idString + 
		" CLASSID=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\"" + 
		" codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\">");
	document.writeln(
		"<PARAM NAME=SRC VALUE=\"" + movie + "\">" +
		"<PARAM NAME=AUTOPLAY VALUE=true>" + 
		"<PARAM NAME=SCALE VALUE=aspect>" + 
		"<PARAM NAME=CONTROLLER VALUE=true>"); 
	document.writeln(	
		"<EMBED " + 
		classString + 
		idString +
		" src=\"" + movie + "\"" + 
		" AUTOPLAY=true" + 
		" CONTROLLER=true" + 
		" SCALE=aspect" + 
		" PLUGINSPAGE=\"http://www.apple.com/quicktime/download/\">" + 
		"</EMBED>");
	document.writeln("</OBJECT>");

}
	
