﻿
function createSilverlight()
{
    var h = getActualHeight();

	if(h <= 660)
    Silverlight.createObjectEx({
        source: "interface.xaml",
        parentElement: document.getElementById("SilverlightControlHost"),
        id: "SilverlightControl",
        properties: {
            width: "100%",
            height: "660",
            background:"#000000",
            inplaceInstallPrompt: "true",
            isWindowless: "true",
            framerate:"30",
            version: "1.0",
            enableHtmlAccess: "true"
        },
        events: { //onLoad: handleLoad
        }
    });
	
    if(h > 660)
    Silverlight.createObjectEx({
        source: "interface.xaml",
        parentElement: document.getElementById("SilverlightControlHost"),
        id: "SilverlightControl",
        properties: {
            width: "100%",
            height: "100%",
            background:"#000000",
            inplaceInstallPrompt: "true",
            isWindowless: "true",
            framerate:"30",
            version: "1.0",
            enableHtmlAccess: "true"
        },
        events: { //onLoad: handleLoad
        }
    });
	
    
    if(h >= 720)
    Silverlight.createObjectEx({
        source: "interface.xaml",
        parentElement: document.getElementById("SilverlightControlHost"),
        id: "SilverlightControl",
        properties: {
            width: "100%",
            height: "100%",
            background:"#000000",
            inplaceInstallPrompt: "true",
            isWindowless: "true",
            framerate:"30",
            version: "1.0",
            enableHtmlAccess: "true"
        },
        events: { //onLoad: handleLoad
        }
    });
    
  
}

if (!window.Silverlight) 
	window.Silverlight = {};

Silverlight.createDelegate = function(instance, method) {
	return function() {
		return method.apply(instance, arguments);
	}
}



function getActualHeight(){
         if( typeof( window.innerHeight ) == 'number' ) {
            //Non-IE            
            return window.innerHeight;
          } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
            //IE 6+ in 'standards compliant mode'
            return document.documentElement.clientHeight;
          } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
            //IE 4 compatible
            return document.body.clientHeight;
          }
    }
    
     function getActualWidth(){
         if( typeof( window.innerWidth ) == 'number' ) {
            //Non-IE           
            return window.innerWidth;
          } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
            //IE 6+ in 'standards compliant mode'
            return document.documentElement.clientWidth;            
          } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
            //IE 4 compatible
            return document.body.clientWidth;            
          }
    }