﻿// JScript File
var slPlugin;

function createSilverlight()
{  
    Silverlight.createObject(
        "/tools/sl/Scoreboard2.xaml",                  // Source property value.
        parentElement,                  // DOM reference to hosting DIV tag.
        "SilverlightScoreboard",         // Unique plug-in ID value.
        {                               // Per-instance properties.
            width:'100%',                // Width of rectangular region of 
                                        // plug-in area in pixels.
            height:'100%',               // Height of rectangular region of 
                                        // plug-in area in pixels.
            inplaceInstallPrompt:true, // Determines whether to display 
                                        // in-place install prompt if 
                                        // invalid version detected.
            background:'#000000',       // Background color of plug-in.
            isWindowless:'true',       // Determines whether to display plug-in 
                                        // in Windowless mode.
            framerate:'30',             // MaxFrameRate property value.
            version:'1.0'               // Silverlight version to use.
        },
        {
            onError:null,               // OnError property value -- 
                                        // event handler function name.
            onLoad:null                 // OnLoad property value -- 
                                        // event handler function name.

        },
        null);                          // Context value -- event handler function name.
}



function mainCanvasLoaded(s) {

	//alert("main loaded")
		
	main=s.findName("mainCanvas")
	plugin = s.getHost()	
	
	plugin.content.onResize = reSizeMe
	plugin.content.onFullScreenChange = reSizeMe
	
	reSizeMe(s)
	
}

function onFullScreenChanged(s, args)
{
    reSizeMe(s)
}

function reSizeMe(s) {
	
   	s.findName("ST").scaleX=plugin.content.actualWidth/100
   	s.findName("ST").scaleY=plugin.content.actualHeight/75
   	   	
}

function toggle_fullScreen(s, args)
{
    var silverlightPlugin = s.getHost();
    silverlightPlugin.content.fullScreen = !silverlightPlugin.content.fullScreen;  
   
}



