var screenWidth, screenHeight;
var boxWidth = 700;
var boxHeight = 300;

function MoveImage(x, y)
{
	document.getElementById("message").style.left = x + "px";
	document.getElementById("message").style.top = y + "px";
	document.getElementById("box-text").innerHTML = "<h4>Silverlight Installation Notification</h4><div style=\"float: right; margin: 0px 0px 10px 10px;\"><img src=\"graphics/silverlight.png\" alt=\"Silverlight Download Message\" /></div>You do not currently have Silverlight&trade; installed.  In order to create a better web experience for our visitors, Merchants Information Solutions, Inc. has utilized a new technology from Microsoft<sup>&reg;</sup> called Silverlight&trade; that is similar to Adobe<sup>&reg;</sup> Flash.  In order to view the full potential of the Merchants website, we ask that you download and install the new Microsoft<sup>&reg;</sup> Silverlight&trade; application by clicking the &quot;Get Microsoft<sup>&reg;</sup> Silverlight&trade;&quot; button that appears as pictured to the right. Installation is quick and easy. However, you may be required to refresh or close and restart your browser after installation. Firefox user's may also need to clear their cache before refreshing the browser after installation.<br /><br />Should you choose not to download Silverlight&trade;, please be advised that you will not be able to view all of the images and text on our home page and your experience will not be what we have intended.<br /><br />Thank you.<div align=\"center\"><span class=\"button2\"><a href=\"#\" onclick=\"hideme();\">Close Message</a></span></div>";
}

function getSize()
{
	if (parseInt(navigator.appVersion)>3) {
	 screenW = screen.width;
	 screenH = screen.height;
	}
	else if (navigator.appName == "Netscape" 
		&& parseInt(navigator.appVersion)==3
		&& navigator.javaEnabled()
	   ) 
	{
	 var jToolkit = java.awt.Toolkit.getDefaultToolkit();
	 var jScreenSize = jToolkit.getScreenSize();
	 screenW = jScreenSize.width;
	 screenH = jScreenSize.height;
	}
	
	screenWidth = (screenW - boxWidth)/2;
	screenHeight = (screenH - boxHeight)/2 -100;
	MoveImage(screenWidth, screenHeight);
}

function hideme()
{
	document.getElementById("message").style.display = "none";
	document.getElementById("cover").style.display = "none";
}

function showme()
{
	document.getElementById("message").style.display = "block";
	document.getElementById("cover").style.display = "block";
}

function createSilverlight()
{
	Silverlight.createObjectEx({
		source: "../scripts/rotator.xaml",
		parentElement: document.getElementById("SilverlightControlHost"),
		id: "SilverlightControl",
		properties: {
			inplaceInstallPrompt: true,
			width: "100%",
			height: "100%",
			version: "1.0"
		},
		events: {}
	});

	if ( !Silverlight.isInstalled("1.0") )
	{
		getSize();
		showme();
	}
}