﻿// JScript source code
function createSilverlightControl(pSource, pHostId, pControlId, pWidth, pHeight, pParams, pOnLoad)
{
	Silverlight.createObjectEx({
		source: pSource,
		parentElement: document.getElementById(pHostId),
		id: pControlId,
		properties: {
			width: pWidth,
			height: pHeight,
			version: "1.1",
			enableHtmlAccess: "true"
		},
		events: {
		//onError: onErr,
        onLoad: pOnLoad},
		initParams: pParams
	});
	   
	// Give the keyboard focus to the Silverlight control by default
    document.body.onload = function() {
      var silverlightControl = document.getElementById(pControlId);
    }
}

function onErr(sender, args)
{
    //alert(sender.ImageUrl);
} 
