<!--
function GetUnity (objectId) {
	if (navigator.appVersion.indexOf("MSIE") != -1 && navigator.appVersion.toLowerCase().indexOf("win") != -1)
		return document.getElementById(objectId + "IE");
	else if (navigator.appVersion.toLowerCase().indexOf("safari") != -1)
		return document.getElementById(objectId + "IE");
	else
		return document.getElementById(objectId + "NOTIE");
};
function DetectUnityWebPlayerActiveX2(){
	var installed = true;
	var playerobj;
	try{
		playerobj = new ActiveXObject("UnityWebPlayer.UnityWebPlayer.1");
	}catch(e){
		installed = false;
		playerobj = null;
	}
	return installed;
};
function DetectUnityWebPlayer() {
	var tInstalled = false;
	if (navigator.appVersion.indexOf("MSIE") != -1 && navigator.appVersion.toLowerCase().indexOf("win") != -1) {
		tInstalled = DetectUnityWebPlayerActiveX2();
	}
	else {
		if (navigator.mimeTypes && navigator.mimeTypes["application/vnd.unity"]) {
			if (navigator.mimeTypes["application/vnd.unity"].enabledPlugin && navigator.plugins && navigator.plugins["Unity Player"]) {
                tInstalled = true;	
            }
        }	
	}
	return tInstalled;	
};
function AutomaticReload () {
	navigator.plugins.refresh();
	if (DetectUnityWebPlayer()){
		window.location.reload();
	}
	setTimeout('AutomaticReload()', 500);
};
function GetInstallerPath () {
    var tDownloadURL = "";
	var hasXpi = navigator.userAgent.toLowerCase().indexOf( "firefox" ) != -1;
    // Use standalone installer
    if (1)
    {
		if (navigator.platform == "MacIntel")
			tDownloadURL = "http://webplayer.unity3d.com/download_webplayer-2.x/webplayer-i386.dmg";
		else if (navigator.platform == "MacPPC")
			tDownloadURL = "http://webplayer.unity3d.com/download_webplayer-2.x/webplayer-ppc.dmg";
		else if (navigator.platform.toLowerCase().indexOf("win") != -1)
			tDownloadURL = "http://webplayer.unity3d.com/download_webplayer-2.x/UnityWebPlayer.exe";
		return tDownloadURL;
    }
    // Use XPI installer
	else
	{
		if (navigator.platform == "MacIntel")
			tDownloadURL = "http://webplayer.unity3d.com/download_webplayer-2.x/UnityWebPlayerOSX.xpi";
		else if (navigator.platform == "MacPPC")
			tDownloadURL = "http://webplayer.unity3d.com/download_webplayer-2.x/UnityWebPlayerOSX.xpi";
		else if (navigator.platform.toLowerCase().indexOf("win") != -1)
			tDownloadURL = "http://webplayer.unity3d.com/download_webplayer-2.x/UnityWebPlayerWin32.xpi";
		return tDownloadURL;
	}    			
};
function doInstall(objectId, width, height){
	var unitycontainer = document.getElementById(objectId);
	var installerPath = GetInstallerPath();
	if (installerPath != "") {
		// Place a link to the right installer depending on the platform we are on. The iframe is very important! Our goals are:
		// 1. Don't have to popup new page
		// 2. This page still remains active, so our automatic reload script will refresh the page when the plugin is installed
		unitycontainer.innerHTML += '<div align="center" id="UnityPrompt" style="height:'+ height +';width:'+ width +';"><a href= ' + installerPath + '><img src="http://webplayer.unity3d.com/installation/getunity.png" border="0"/></a></div>';
		unitycontainer.innerHTML += '';
		unitycontainer.innerHTML += '';
		// By default disable ActiveX cab installation, because we can't make a nice Install Now button
		//if (navigator.appVersion.indexOf("MSIE") != -1 && navigator.appVersion.toLowerCase().indexOf("win") != -1)
		if (0)
		{	
			unitycontainer.innerHTML += '<div id="InnerUnityPrompt" style="height:'+ height +';width:'+ width +';"> <p>Title</p>';
			unitycontainer.innerHTML += '<p> Contents</p>';
			unitycontainer.innerHTML += '<object id="UnityInstallerObject" classid="clsid:444785F1-DE89-4295-863A-D46C3A781394" width="320" height="50" codebase="http://webplayer.unity3d.com/download_webplayer-2.x/UnityWebPlayer.cab#version=2,0,0,0"></object>'
			unitycontainer.innerHTML += '</div>';
		}
		unitycontainer.innerHTML += '<iframe name="InstallerFrame" height="0" width="0" frameborder="0">';
	}
	else {
		unitycontainer.innerHTML += '<div align="center" id="UnityPrompt" style="height:'+ height +';width:'+ width +';">';
		unitycontainer.innerHTML += '<a href="javascript: window.open("http://www.unity3d.com/unity-web-player-2.x"); "><img src="http://webplayer.unity3d.com/installation/getunity.png" border="0"/></a>';
		unitycontainer.innerHTML += '</div>';
	}
	AutomaticReload();
}
-->