﻿   
    function Vaihda(el, w) {
        switch (w) {
            case 1: el.style.color = "Red"; break;
            case 0: el.style.color = "#FFFFFF"; break;
        }
    }

    function EvalSound(soundobj) {
        var thissound = document.getElementById(soundobj);
        if (ss == 0) {
            thissound.Play();
            ss = 1;
        }
        else {
            thissound.Stop();
            ss = 0;
        }
    }

    function Avaa() {

        var sound = document.createElement('embed');
        sound.id = "aani";
        sound.src="images/Money.mid";
        sound.autostart = "true";
        sound.hidden = "true";
        // WIDTH=144 HEIGHT=60 LOOP=1>

        document.body.appendChild(sound);
    }

    function handleDiv() {

        if (si == 0) {
            var inf = document.getElementById("info");
            inf.style.visibility = "visible";
            return 1;
            var divTag = document.createElement("div");

            divTag.id = "info";
            divTag.className = "info";
            divTag.innerHTML = "Tässä jotain informatiivistä tekstiä a la Jarmo.";
            document.body.appendChild(divTag);
            return 1;
        }
        else {

            var el = document.getElementById("info");
            el.style.visibility = "hidden";
            return 0;
            el.parentNode.removeChild(el);
            return 0;
        }
    }

    function Maximize() {
        window.innerWidth = screen.width;
        window.innerHeight = screen.height;
        window.screenX = 0;
        window.screenY = 0;
        alwaysLowered = false;
    }

    function SucceededCallback(result) {
        try {
            __doPostBack('<%= Lisaa.ClientID %>', '');
        }
        catch (err) {
            alert("Virhe : " + err.description);
        }
    }

    function FailedCallback(error) {
        alert(error);
    }

    function Hash() {
        this.length = 0;
        this.items = new Array();
        for (var i = 0; i < arguments.length; i += 2) {
            if (typeof (arguments[i + 1]) != 'undefined') {
                this.items[arguments[i]] = arguments[i + 1];
                this.length++;
            }
        }

        this.removeItem = function(in_key) {
            var tmp_previous;
            if (typeof (this.items[in_key]) != 'undefined') {
                this.length--;
                var tmp_previous = this.items[in_key];
                delete this.items[in_key];
            }

            return tmp_previous;
        }

        this.getItem = function(in_key) {
            return this.items[in_key];
        }

        this.setItem = function(in_key, in_value) {
            var tmp_previous;
            if (typeof (in_value) != 'undefined') {
                if (typeof (this.items[in_key]) == 'undefined') {
                    this.length++;
                }
                else {
                    tmp_previous = this.items[in_key];
                }

                this.items[in_key] = in_value;
            }

            return tmp_previous;
        }

        this.hasItem = function(in_key) {
            return typeof (this.items[in_key]) != 'undefined';
        }

        this.clear = function() {
            for (var i in this.items) {
                delete this.items[i];
            }

            this.length = 0;
        }
    }
