﻿// JScript File

function createMySilverlightPlugin() {
    var xamlPath = "showXAML.aspx?illusid=" + illusID + "&zoom=" + zoomLevel + "&src=" + illusSource + "&admin=0&IE=.xaml";
    //alert(xamlPath);
    Silverlight.createObject(
        xamlPath,                  // Source property value.
        //"978-1-60406-081-2c006_f001a.xaml",
        parentElement,                  // DOM reference to hosting DIV tag.
        "slIllustration",         // Unique plug-in ID value.
        {                               // Per-instance properties.
            width:'650',                // Width of rectangular region of 
                                        // plug-in area in pixels.
            height:'650',               // 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:'#FFFFFF',       // Background color of plug-in.
            isWindowless:'false',       // Determines whether to display plug-in 
                                        // in Windowless mode.
            framerate:'24',             // MaxFrameRate property value.
            version:slVersion               // Silverlight version to use.
        },
        {
            onError:null,               // OnError property value -- 
                                        // event handler function name.
            onLoad:loadStudy                 // OnLoad property value -- 
                                        // event handler function name.
        },
        null);                          // Context value -- event handler function name.
}

function createAdminSilverlightPlugin()
{  
    Silverlight.createObject(
        "../showXAML.aspx?illusid="+illusID+"&zoom="+zoomLevel+"&admin=1&langid=" + langID + "&src=0&IE=.xaml",                  // Source property value.
        //"978-1-60406-081-2c006_f001a.xaml",
        parentElement,                  // DOM reference to hosting DIV tag.
        "slIllustration",         // Unique plug-in ID value.
        {                               // Per-instance properties.
            width:'700',                // Width of rectangular region of 
                                        // plug-in area in pixels.
            height:'700',               // 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:'#FFFFFF',       // Background color of plug-in.
            isWindowless:'false',       // Determines whether to display plug-in 
                                        // in Windowless mode.
            framerate:'24',             // MaxFrameRate property value.
            version:slVersion               // 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 createTestResultSilverlightPlugin() {
        var xamlPath = "showXAML.aspx?illusid=" + illusID + "&zoom=" + zoomLevel + "&src=" + illusSource + "&admin=0&tr=true&IE=.xaml";
        //alert(xamlPath);
        Silverlight.createObject(
        xamlPath,                  // Source property value.
        //"978-1-60406-081-2c006_f001a.xaml",
        parentElement,                  // DOM reference to hosting DIV tag.
        "slIllustration",         // Unique plug-in ID value.
        {                               // Per-instance properties.
        width: '650',                // Width of rectangular region of 
        // plug-in area in pixels.
        height: '650',               // 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: '#FFFFFF',       // Background color of plug-in.
        isWindowless: 'false',       // Determines whether to display plug-in 
        // in Windowless mode.
        framerate: '24',             // MaxFrameRate property value.
        version: slVersion               // Silverlight version to use.
    },
        {
            onError: null,               // OnError property value -- 
            // event handler function name.
            onLoad: loadStudy                 // OnLoad property value -- 
            // event handler function name.
        },
        null);                          // Context value -- event handler function name.
}

