﻿ function createSilverlight()
		            {
		            //alert(Silverlight.isInstalled("1.0"));
		            if (Silverlight.isInstalled("1.0") == false){
		                //alert("geen SL");
		                return;
		            }
		            
			            var scene = new koophulp.Page();
			            Silverlight.createObjectEx({
				            source: "./XAML/koophulp.xaml",
				            parentElement: document.getElementById("koophulpInvoerBG"),
				            id: "SilverlightControl",
				            properties: {
					            width: "420",
					            height: "254",
					            version: "1.0",
					            background: "#00000000",
					            isWindowless: "true"
				            },
				            events: {
					            onLoad: Silverlight.createDelegate(scene, scene.handleLoad),
					            onError: function(sender, args) {
						            var errorDiv = document.getElementById("errorLocation");
						            if (errorDiv != null) {
							            var errorText = args.errorType + "- " + args.errorMessage;
            									
							            if (args.ErrorType == "ParserError") {
								            errorText += "<br>File: " + args.xamlFile;
								            errorText += ", line " + args.lineNumber;
								            errorText += " character " + args.charPosition;
							            }
							            else if (args.ErrorType == "RuntimeError") {
								            errorText += "<br>line " + args.lineNumber;
								            errorText += " character " +  args.charPosition;
							            }
							            errorDiv.innerHTML = errorText;
						            }	
					            }
				            }
			            });
		            }


		            if (!window.Silverlight) 
			            Silverlight = {};

		            Silverlight.createDelegate = function(instance, method) {
			            return function() {
				            return method.apply(instance, arguments);
			            }
		            }
if (!window.koophulp)
	koophulp = {};

koophulp.Page = function() 
{
}

koophulp.Page.prototype =
{
	handleLoad: function(control, userContext, rootElement) 
	{
		this.control = control;			
	}		
}