﻿// JScript 文件
//获取浏览界面的高
function GetScrollY()
{        
    if (typeof window.pageYOffset == 'number')
    {
        return window.pageYOffset;
    }

    var CompatMode = window.document.compatMode;
    var DocumentElement = window.document.documentElement;

    if ((typeof CompatMode == 'string') && (CompatMode.indexOf('CSS') >= 0) && (DocumentElement) && (typeof DocumentElement.getAttribute("scrollTop") == 'number'))
    {
        return DocumentElement.getAttribute("scrollTop");
     } 

    var Body = window.document.body ;

    if ((Body) && (typeof Body.getAttribute("scrollTop") == 'number'))
    {
        return Body.getAttribute("scrollTop");
    }

    return 0;
}

//获取浏览界面的宽
function GetScrollX()
{
    var CompatMode = window.document.compatMode;
    var DocumentElement = window.document.documentElement;

    if ((typeof CompatMode == 'string') && (CompatMode.indexOf('CSS') >= 0) && (DocumentElement) && (typeof DocumentElement.getAttribute("clientWidth") == 'number'))
    {
        return DocumentElement.getAttribute("clientWidth");
     } 

    var Body = window.document.body ;

    if ((Body) && (typeof Body.getAttribute("clientWidth") == 'number'))
    {
        return Body.getAttribute("clientWidth");
    }

    return 1024;
}
