function createSilverlightBannerPlugin()
{  
    Silverlight.createObject(
        "Banner.xaml",                  // Source property value.
        parentElement,                  // DOM reference to hosting DIV tag.
        "SilverlightBannerPlugin",         // Unique plug-in ID value.
        {                               // Per-instance properties.
            width:'760',                // Width of rectangular region of 
                                        // plug-in area in pixels.
            height:'200',               // 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:'white',         // Background color of plug-in.
            isWindowless:'true',        // Determines whether to display plug-in 
                                        // in Windowless mode.
            framerate:'24',             // 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 showBanner1(sender, args)
{
    sender.findName("ShowBanner1").begin();
}

function showBanner2(sender, args)
{
    sender.findName("ShowBanner2").begin();
}

function showBanner3(sender, args)
{
    sender.findName("ShowBanner3").begin();
}

function goToLink1(sender, args)
{
    window.location = "ProductsServicesHE.aspx";
}

function goToLink2(sender, args)
{
    window.location = "ProductsServicesCon.aspx";
}

function goToLink3(sender, args)
{
    window.location = "ProductsServicesPipe.aspx";
}

function ChangeZIndex1(sender, args)
{
    var refSilverlightControl = sender.getHost();
    var refRoot = refSilverlightControl.Content.Root; 
    refRoot.findName("Banner1TextA").SetValue("Canvas.ZIndex", 4);
    refRoot.findName("Banner1TextB").SetValue("Canvas.ZIndex", 4);
    refRoot.findName("Banner1TextC").SetValue("Canvas.ZIndex", 4);
    refRoot.findName("Banner2TextA").SetValue("Canvas.ZIndex", 3);
    refRoot.findName("Banner2TextB").SetValue("Canvas.ZIndex", 3);
    refRoot.findName("Banner2TextC").SetValue("Canvas.ZIndex", 3);
    refRoot.findName("Banner3TextA").SetValue("Canvas.ZIndex", 3);
    refRoot.findName("Banner3TextB").SetValue("Canvas.ZIndex", 3);
    refRoot.findName("Banner3TextC").SetValue("Canvas.ZIndex", 3);
}

function ChangeZIndex2(sender, args)
{
    var refSilverlightControl = sender.getHost();
    var refRoot = refSilverlightControl.Content.Root; 
    refRoot.findName("Banner1TextA").SetValue("Canvas.ZIndex", 3);
    refRoot.findName("Banner1TextB").SetValue("Canvas.ZIndex", 3);
    refRoot.findName("Banner1TextC").SetValue("Canvas.ZIndex", 3);
    refRoot.findName("Banner2TextA").SetValue("Canvas.ZIndex", 4);
    refRoot.findName("Banner2TextB").SetValue("Canvas.ZIndex", 4);
    refRoot.findName("Banner2TextC").SetValue("Canvas.ZIndex", 4);
    refRoot.findName("Banner3TextA").SetValue("Canvas.ZIndex", 3);
    refRoot.findName("Banner3TextB").SetValue("Canvas.ZIndex", 3);
    refRoot.findName("Banner3TextC").SetValue("Canvas.ZIndex", 3);
}

function ChangeZIndex3(sender, args)
{
    var refSilverlightControl = sender.getHost();
    var refRoot = refSilverlightControl.Content.Root; 
    refRoot.findName("Banner1TextA").SetValue("Canvas.ZIndex", 3);
    refRoot.findName("Banner1TextB").SetValue("Canvas.ZIndex", 3);
    refRoot.findName("Banner1TextC").SetValue("Canvas.ZIndex", 3);
    refRoot.findName("Banner2TextA").SetValue("Canvas.ZIndex", 3);
    refRoot.findName("Banner2TextB").SetValue("Canvas.ZIndex", 3);
    refRoot.findName("Banner2TextC").SetValue("Canvas.ZIndex", 3);
    refRoot.findName("Banner3TextA").SetValue("Canvas.ZIndex", 4);
    refRoot.findName("Banner3TextB").SetValue("Canvas.ZIndex", 4);
    refRoot.findName("Banner3TextC").SetValue("Canvas.ZIndex", 4);
}