﻿function GetWindowSize() {
    var width =
        window.innerWidth && window.innerWidth ||
        document.documentElement && document.documentElement.clientWidth ||
        document.body && document.body.clientWidth ||
        document.body && document.body.parentNode && document.body.parentNode.clientWidth ||
        0;

    var height =
        window.innerHeight && window.innerHeight ||
        document.documentElement && document.documentElement.clientHeight ||
        document.body && document.body.clientHeight ||
        document.body && document.body.parentNode && document.body.parentNode.clientHeight ||
        0;

    return { x: width, y: height };
}

function UrlEncode(inputString) {
    var encodedString = escape(inputString);
    encodedString = encodedString.replace("+", "%2B");
    encodedString = encodedString.replace("/", "%2F");
    return encodedString;
}