﻿function checkPlugin()
{
    document.getElementById('silverlightControlHost').innerText = "";
    if (Silverlight.ua.Browser != 'Unsupported')
	{		
		//если браузер поддерживает Silverlight 1.0
		if (!Silverlight.isInstalled('1.0'))
		{
			//если не установлен плагин
			document.getElementById('container').className = 'SLnotInstalled';
			document.getElementById('silverlightControlHost').className = 'SLHostnotInstalled';
			document.getElementById('footer').className = 'hidden';
			window.setTimeout('checkInstall()', 3000);
		}
		else
		{
			document.getElementById('container').className = 'SLInstalled';
			document.getElementById('silverlightControlHost').className = 'SLHostInstalled';
			document.getElementById('footer').className = 'visible';
		}
		createSilverlight();
	}
	else
	{
		document.getElementById('container').className = 'unsupportedBrowser';
		document.getElementById('footer').className = 'hidden';
	}
}

function checkInstall()
{
	try
	{
		//обновим список установленных плагинов в Firefox/Safari 
		navigator.plugins.refresh();
	}
	catch(e)
	{
		//IE такой конструкции не знает
	}
	
	if (Silverlight.isInstalled('1.0'))
	{
		//если установился плагин, то создадим SL-объект заново
		checkPlugin();
	}
	else
	{
		window.setTimeout('checkInstall()', 3000);
	}
}

