﻿
        function showOrientationMask() {
            var Element = document.getElementById('Message');
            var Elements = document.getElementById('Screen');
            Elements.style.top = 0;

            Element.style.width = getWidth();
            Element.style.height = getHeight();

            Elements.style.width = getWidth();
            Elements.style.height = getHeight();

            Element.style.display = 'block';
            Elements.style.display = 'block';
        }
        var dontShowOrientation = (productRCookie('dontshoworientationanymore') == 'true');
        var oldMessageLeft;
        var oldMessageTop;

        function productRCookie(name) {
            if (name)
                name = name.toLowerCase();
            var cookie = String(document.cookie.toLowerCase());
            var pos = cookie.indexOf(name + "=");
            if (pos != -1) {
                var end = cookie.indexOf("; ", pos);
                return cookie.substring(pos + name.length + 1, end == -1 ? cookie.length : end);
            }
            return "";
        }
        function getWidth() {
            var strWidth, clientWidth, bodyWidth;
            clientWidth = document.documentElement.clientWidth;
            bodyWidth = document.body.scrollWidth;
            if (bodyWidth > clientWidth) {
                strWidth = bodyWidth;
            }
            else {
                strWidth = clientWidth;
            }
            return strWidth;
        }

        function getHeight() {
            var strHeight, clientHeight, bodyHeight;
            clientHeight = document.documentElement.clientHeight;
            bodyHeight = document.body.scrollHeight;
            if (bodyHeight > clientHeight) {
                strHeight = bodyHeight
            }
            else {
                strHeight = clientHeight;
            }
            return strHeight;
        }


        function closeTour(tmpVal) {
            tmpVal = String(tmpVal).toLowerCase();
            var Element = document.getElementById('Message');
            var Elements = document.getElementById('Screen');
            Element.innerHTML = '';
            Element.style.display = 'none';
            Elements.style.display = 'none';
            if (navigator.userAgent.indexOf('MSIE 6') > 0)
                jQuery('select').css('visibility', 'visible');
        }


        function hideOrientationMask(setCookie) {
            closeTour();
            window.showingOrientation = false;
            jQuery("#Message").css("left", oldMessageLeft).css("top", oldMessageTop);
        }

