﻿        function getBrowserType() {
            var browser = navigator.appName;
            if (browser == "Microsoft Internet Explorer")
                if (navigator.userAgent.indexOf("MSIE 9.0") > -1)
                    return "IE9";
                else
                    return "IE";
            else
                return "Netscape";
        }

        function WindowHeight() {
            var theHeight;
            if (window.innerHeight) {
                theHeight = window.innerHeight;
            }
            else if (document.documentElement && document.documentElement.clientHeight) {
                theHeight = document.documentElement.clientHeight;
            }
            else if (document.body) {
                theHeight = document.body.clientHeight;
            }
            return theHeight;
        }

        function onBodyLoad() {
            var frame = document.getElementById("body_div");

            // initialize to shortest window
            frame.style.minHeight = "50px";

            var htmlheight = document.body.parentNode.offsetHeight;
            var windowheight = WindowHeight();
            var indent = 130;


            if (htmlheight > windowheight) {
                frame.style.minHeight = htmlheight - indent + "px";
            }
            else {
                frame.style.minHeight = windowheight - indent + "px";
            }

        }

        function OnEnterClick($FormControl, $char, $mozChar) {
            if ($mozChar != null) { // Look for a Mozilla-compatible browser
                if ($mozChar == 13) {
                    __doPostBack($FormControl, '');
                    return false;
                }
                else return true;
            }
            else { // Must be an IE-compatible Browser
                if ($char == 13) {
                    __doPostBack($FormControl, '');
                    return false;
                }
                else return true;
            }
        }

        function IsInputKey($FormControl, $char, $mozChar) {
            if ($mozChar != null) { // Look for a Mozilla-compatible browser
                if ($mozChar == 13) {
                    return false;
                }
                else return true;
            }
            else { // Must be an IE-compatible Browser
                if ($char == 13) {
                    return false;
                }
                else return true;
            }
        }

        function MenuOn(tdObj, linkID) {

            links = document.getElementById(linkID);
            tdObj.style.backgroundColor = "#dae2e8";
            tdObj.style.cursor = 'hand'
            links.style.color = "#5c7a92";
        }

        function MenuOff(tdObj, linkID) {
            links = document.getElementById(linkID);
            tdObj.style.backgroundColor = "transparent";
            links.style.color = "#fff";
        }

        function ClickControl(controlID) {
            var oControl = document.getElementById(controlID);

            if (oControl != null) {
                oControl.click();
            }
            else {
                alert("Control: " + controlID + " not found!");
            }
        }

        function ChangeControlValue(controlID, NewValue) {
            $find(controlID).set_html(decodeURIComponent(NewValue).replace(/\+/ig, " "));

        }

        function openBrWindow(theURL, winName, features) { //v2.0
            window.open(theURL, winName, "scrollbars=yes,resizable=yes," + features);
        }

        var ResizeTarget;
        if (document.body)
            ResizeTarget = document.body;
        else
            ResizeTarget = window;

        ResizeTarget.onresize = function() {
            onBodyLoad(false);
        }


        function StopMovie() {
            if (so != null) {
                player.sendEvent("STOP");
                so = null;
                player = null;
            }
        }
