function UCheck() {
	var documentUrl = document.referrer;

	if (top.location != self.location) {
		top.location.replace(document.location);
	}
}

function getVer() {

	var UNDEF = "undefined",
		OBJECT = "object",
		SHOCKWAVE = "Shockwave for Director",
		SHOCKWAVE_AX = "SWCtl.SWCtl",
		SHOCKWAVE_MIME_TYPE = "application/x-director",
		nav = navigator,
		playerVersion = [0, 0, 0],
		d = null;

	if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE] == OBJECT) {
		d = nav.plugins[SHOCKWAVE].description;
		if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[SHOCKWAVE_MIME_TYPE] && !nav.mimeTypes[SHOCKWAVE_MIME_TYPE].enabledPlugin)) {
			d = d.replace(/^\D+(.*$)/, "$1");
			playerVersion[0] = parseInt(d.replace(/^(\d+).*/, "$1"), 10);
			playerVersion[1] = parseInt(d.replace(/^\d+\.(\d+).*/, "$1"), 10);
			x = d.replace(/^\d+\.\d+\.(\d+).*/, "$1");
			(x == d) ? playerVersion[2] = 0 : playerVersion[2] = parseInt(x, 10);
		}
	} else if (typeof window.ActiveXObject != UNDEF) {
		try {
			var a = new ActiveXObject(SHOCKWAVE_AX);
			if (a) { // a will return null when ActiveX is disabled
				d = a.ShockwaveVersion("");
				if (d) {
					d = d.split(".");
					playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
				}
			}
		}
		catch(e) {}
	}
	return (playerVersion);
}

function InsertShockwave(swID, swWidth, swHeight, swFile, sw1) {

	var cv = getVer();
	if (cv[0] == 11 && cv[1] == 5 && cv[2] == 2) {
		var str = "<H2>NOTE!</H2>There's currently a problem with the latest Shockwave plug-in that you are using.<BR>";
		str += 'You will need to wait until Adobe releases a fixed update, or you can install the previous version.<BR>';
		str += 'Links to the previous version: <A HREF="sw601/Shockwave_Installer_Full.exe">Windows</A> - <A HREF="sw601/Shockwave_Installer_Full.dmg">Mac</A><BR>';
		str += 'Remember to uninstall your current version first, and <A HREF="http://go.adobe.com/kb/ts_tn_16683_en-us" target="_blank">disable the auto-update feature</A> after installation.<BR><BR>'; 
	} else {

	var str = '<!--[if IE]>\n<OBJECT classid="clsid:233C1507-6A77-46A4-9443-F871F945D258"';
	if (document.cookie.indexOf("__utma=") < 0) { var snd = "0.0"; var sne=0; } else { var sna = document.cookie.split("__utma=")[1].split(";")[0].split("."); var snd = sna[1]+'.'+sna[2]; var sne= parseInt(sna[4])-parseInt(sna[2]); }
	str += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=11,5,0,496"';
	str += ' id="' + swID + '" width="' + swWidth + '" height="' + swHeight + '">\n';
	str += '<param name=src value="' + swFile + '" />\n';

	str += '<![endif]-->\n<!--[if !IE]>-->\n';
	str += '<object type="application/x-director" data="' + swFile + '" width="' + swWidth + '" height="' + swHeight + '">';
	str += '<!--<![endif]-->\n';

	str += '<param name=logo value=true />\n';
	str += '<param name=PlayerVersion value=11 />\n';
	str += '<param name=swInstallType value=full />\n';
	str += '<param name=progress value=true />\n';
	str += '<param name=swStretchStyle value=fill />\n';
	str += '<param name=bgColor VALUE=#A1BECE />\n';
	str += '<param name=sw1 value="' + sw1 + '" />\n';
	str += '<param name=sw2 value="' + snd + '" />\n';
	str += '<param name=sw3 value="' + sne + '" />\n';
	str += '<param name=sw4 value="' + navigator.userAgent + '" />\n';
	str += '<param name=swRemote value="';
	str += "swSaveEnabled='false' swVolume='true' swRestart='false' swPausePlay='false' swFastForward='false' swContextMenu='true' ";
	str += '" />\n';

	// Alt content
	str += '<center><a href="http://get.adobe.com/shockwave" target="_blank" border="0"><H1>NOTE!</H1><H2>You need to install the Shockwave plugin to play</H2><BR><img align=middle hspace=250 vspace=200 src="http://www.adobe.com/macromedia/style_guide/images/160x41_Get_Shockwave.jpg"></a></center><br><br>';

	str += '</object>';
}
	document.write(str);

	UCheck();
}