
/**
 * Stores page data.  Can be used on every page.
 */
Page = function(){

    this.IE = false;
    this.IE6 = false;

    /*@if(true)
           this.IE = true;
      @end @*/
    if (this.IE && !window.XMLHttpRequest) {
        this.IE6 = true;
    }

    if (document.compatMode && document.compatMode == 'BackCompat') {
        this.quirksMode = true;
    }

    /**
     * Finds the position of the current user within the viewport.
     */
    this.getPagePosition = function() {
        this.windowX = document.body.scrollLeft || window.pageXOffset || document.documentElement.scrollLeft;
        this.windowY = document.body.scrollTop || window.pageYOffset  || document.documentElement.scrollTop;

        if (typeof window.innerWidth != 'undefined') {
            this.windowEdgeX = this.windowX + window.innerWidth;
            this.windowEdgeY = this.windowY + window.innerHeight;
        } else if (typeof document.body.offsetWidth != 'undefined') {
            this.windowEdgeX = this.windowX + document.body.offsetWidth;
            this.windowEdgeY = this.windowY + document.body.offsetHeight;
        }
        if (this.IE && !this.quirksMode) {
            this.windowEdgeX = document.documentElement.clientWidth;
            this.windowEdgeY = document.documentElement.clientHeight;
        }
    }
}

$(window).load(function() {
    thisPage = new Page();
});

