function pluginDetection() {

	this.targetPlugName = "";
	this.targetVersion = 0;

	this.getPlugVersion = getPlugVersion;
	this.getAssessment = getAssessment;
	this.setTargetPlugName = setTargetPlugName;
	this.setTargetPlugVersion = setTargetPlugVersion;

	function setTargetPlugName(nm) {
		if (!!nm) this.targetPlugName = pluginNameConv(nm);
	}

	function setTargetPlugVersion(version) {
		if (!!version && version > 0) this.targetVersion = version;
	}

	function pluginNameConv() {
		if (arguments[0].indexOf("Shockwave",0) != -1 && arguments[0].indexOf("Flash",0) != -1 ) {
			if (document.all && navigator.userAgent.indexOf("Win",0) != -1 && navigator.userAgent.indexOf("Opera",0) == -1) return "ShockwaveFlash.ShockwaveFlash";
			else return "Shockwave Flash";
		} else {
			return arguments[0];
		}
	}

	function getPlugVersion() {
		if (document.all && navigator.userAgent.indexOf("Win",0) != -1 && navigator.userAgent.indexOf("Opera",0) == -1) {
			document.writeln('<script type="text/VBscript">');
			document.writeln('Function isPlugin(plugName, targetVer)');
			document.writeln('	Dim i, plg, range');
			document.writeln('	On Error Resume Next');
			document.writeln('	isPlugin = False');
			document.writeln('	range = targetVer * 5');
			document.writeln('	For i=range To 0 Step -1');
			document.writeln('		Set plg = CreateObject(plugName & "." & i)');
			document.writeln('		if IsObject(plg) Then');
			document.writeln('			isPlugin = CStr(i)');
			document.writeln('			Exit For');
			document.writeln('		End If');
			document.writeln('	Next');
			document.writeln('End Function');
			document.writeln('</sc'+ 'ript>');
		}

		function isTargetPlugin(pnm, pvn) {
			this.result = false;
			if (navigator.plugins) {
				if ( !!navigator.plugins[pnm] ) {
					for (this.i=0; this.i<=parseInt(pvn)*5; this.i++) {
						if ( navigator.plugins[pnm].description.indexOf(this.i+".0",0) != -1 ) this.result = this.i;
					}
				}
			}
			return this.result;
		}

		if (document.all && navigator.userAgent.indexOf("Win",0) != -1 && navigator.userAgent.indexOf("Opera",0) == -1) {
			return isPlugin( this.targetPlugName, this.targetVersion);
		} else {
			return isTargetPlugin( this.targetPlugName, this.targetVersion);
		}
	}

	function getAssessment() {
		if (parseInt(this.getPlugVersion()) >= this.targetVersion) return true;
		else if (document.all && navigator.userAgent.indexOf("Mac",0) != -1 && navigator.userAgent.indexOf("Opera",0) == -1) return false;
		else return false;
	}
}

function swfObject() {
	this.loc = "";
	this.width = "";
	this.height = "";
	this.bg = "#000000";
	this.alt = "";
	this.flashvars = "";
	this.playerVersion = "";
	
	this.wmodeNC = "";	
	this.wmodeIE = "";
	
	this.setObjectLocation = setObjectLocation;
	this.setObjectWidth = setObjectWidth;
	this.setObjectHeight = setObjectHeight;
	this.setObjectBgcolor = setObjectBgcolor;
	this.setObjectFlashvars = setObjectFlashvars;
	this.setAltObject = setAltObject;
	
	this.setElements = setElements;
	this.setAltElements = setAltElements;
	this.setPlayerVersion = setPlayerVersion;
	
	this.setWmodeNC = setWmodeNC;
	this.setWmodeIE = setWmodeIE;
	
	function setObjectLocation() {
		if (!!arguments[0]) this.loc = arguments[0];
	}

	function setObjectWidth() {
		if (!!arguments[0]) this.width = arguments[0];
	}

	function setObjectHeight() {
		if (!!arguments[0]) this.height = arguments[0];
	}

	function setObjectBgcolor() {
		if (!!arguments[0]) this.bg = arguments[0];
	}

	function setAltObject() {
		if (!!arguments[0]) this.alt = arguments[0];
	}
	
	function setObjectFlashvars() {
		if (!!arguments[0]) this.flashvars = arguments[0];
	}

	function setPlayerVersion() {
		if (!!arguments[0]) this.playerVersion = arguments[0];
	}
	
	function setWmodeNC() {
		if (!!arguments[0]) this.wmodeNC = arguments[0];		
	}
	
	function setWmodeIE() {
		if (!!arguments[0]) this.wmodeIE = arguments[0];		
	}
	
	function setElements() {
		
		if (!!this.loc && !!this.width && !!this.height) {
			if (document.getElementById || document.layers || (navigator.userAgent.indexOf("Win") != -1) ) {
				document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+ this.playerVersion + ',0,0,0" width="'+ this.width +'" height="'+ this.height +'">');
				document.write('<param name="movie" value="'+ this.loc +'" />'+this.wmodeIE+'<param name="flashvars" value="'+ this.flashvars +'" /><param name="quality" value="high" /><param name="bgcolor" value="'+ this.bg +'" /><param name="play" value="true" /><param name="menu" value="false" />');
			}
			document.write('<embed src="'+ this.loc +'" quality="high" devicefont="true" bgcolor="'+ this.bg +'" width="'+ this.width +'" '+this.wmodeNC+' height="'+ this.height +'" flashvars="'+ this.flashvars +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>');
			
			if (document.getElementById || document.layers || (navigator.userAgent.indexOf("Win") != -1) ) {
				document.write('</object>');
			}
		}
	}

	function setAltElements() {
		if (!!this.alt) document.write(this.alt);
	}
}

var plug = new pluginDetection();
plug.setTargetPlugName("Shockwave Flash");
plug.setTargetPlugVersion(7);
var movie = new Array();
var now = new Date();