function createSilverlight()
{  
	var scene = new TestProject.Page();
	Silverlight.createObjectEx({
		source: "slloader.aspx",
		parentElement: document.getElementById("SilverlightControlHost"),
		id: "SilverlightControl",
		properties: {
			width: "100%",
			height: "100%",
			version: "1.0"
		},
		events: {
			onLoad: Silverlight.createDelegate(scene, scene.handleLoad), onError:null
		}
	});
}


if (!window.Silverlight) 
	window.Silverlight = {};

Silverlight.createDelegate = function(instance, method) {
	return function() {
		return method.apply(instance, arguments);
	}
}

if (!window.TestProject)
	window.TestProject = {};

TestProject.Page = function() 
{
}

TestProject.Page.prototype =
{
	handleLoad: function(control, userContext, rootElement) 
	{
		this.control = control;
		rootElement.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.handleMouseDown));

        // Retrieve a reference to the plug-in.
        var plugin = document.getElementById("SilverlightControl");

        // Retrieve the EnableFramerateCounter property.
        plugin.settings.enableFramerateCounter = true;


	},
	
	handleMouseDown: function(sender, eventArgs) 
	{
	}
	

}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=460,height=384');");
}
function popUp2(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,width=500,height=400');");
}

    function NavigateExternal(src)
    {
        var b=false;
        try
        { window.open(src);
          b=true;
        }
        catch (ex)
        {
            b=false;
        }
        if (!b) alert("Unable to navigate to : " + src);
    }

function dlClick(sender, mouseEventArgs)
    {
       popUp2("http://mobilewares.net/ab/dlsb.htm");
    }

function lnClick(sender, mouseEventArgs)
    {
       popUp('http://mobilewares.net/ab/abmedia.aspx?');
    }

