﻿    function createSilverlight() {
        var scene = new UntitledProject3.Page();
        Silverlight.createObjectEx({
            source: "Page.xaml",
            parentElement: document.getElementById("silverlightControlHost"),
            id: "SilverlightControl",
            properties: {
                width: "100%",
                height: "100%",
                version: "1.0"
            },
            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);
        }
    }
    var newwindow;
    function sizedwindow(url) {
        newwindow = window.open(url, 'name', 'height=768,width=1024,left=362,status=no,location=no,resizable=yes');
        if (window.focus) { newwindow.focus() }
    }
    var id
    var color
    function fontcolor(id, color) {
        document.getElementById(id).style.color = color;
    }
    function message() {
        alert("All games tonight cancelled");
    } 
    function list(id) {
        document.getElementById(id).style.visibility = "";
    }
    function closelist(id) {
        document.getElementById(id).style.visibility = "hidden";
    }
    function link(address) {
        window.location = address;
    }
    function nwlink(address) {
        window.open(address, 'Picture', 'width=325,height=276,scrollbars=no,location=no,status=no,toolbar=no,dependent=yes');
    }
    function show_pics() {
        document.getElementById('pics').style.display = '';
        document.getElementById('filter').style.display = '';
    }
    function hide_pics()
    {
        document.getElementById('pics').style.display = 'none';
        document.getElementById('filter').style.display = 'none';
    }
    function show_latest() {
        document.getElementById('latest').style.display = '';
        document.getElementById('filter').style.display = '';
    }
    function hide_latest()
    {
        document.getElementById('latest').style.display = 'none';
        document.getElementById('filter').style.display = 'none';
    }
    function show_table() {
        document.getElementById('table').style.display = '';
        document.getElementById('filter').style.display = '';
    }
    function hide_table()
    {
        document.getElementById('table').style.display = 'none';
        document.getElementById('filter').style.display = 'none';
    }