﻿            function getPageScroll() {
                var xScroll, yScroll;
                if (self.pageYOffset) {
                    yScroll = self.pageYOffset;
                    xScroll = self.pageXOffset;
                } else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict
                    yScroll = document.documentElement.scrollTop;
                    xScroll = document.documentElement.scrollLeft;
                } else if (document.body) {// all other Explorers
                    yScroll = document.body.scrollTop;
                    xScroll = document.body.scrollLeft;
                }
                return new Array(xScroll, yScroll)
            }

            function getPageHeight() {
                var windowHeight
                if (self.innerHeight) {	// all except Explorer
                    windowHeight = self.innerHeight;
                } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
                    windowHeight = document.documentElement.clientHeight;
                } else if (document.body) { // other Explorers
                    windowHeight = document.body.clientHeight;
                }
                return windowHeight
            }
            
            function getPageWidth() {
                var windowWidth
                if (self.innerWidth) {	// all except Explorer
                    windowWidth = self.innerWidth;
                } else if (document.documentElement && document.documentElement.clientWidth) { // Explorer 6 Strict Mode
                    windowWidth = document.documentElement.clientWidth;
                } else if (document.body) { // other Explorers
                    windowWidth = document.body.clientWidth;
                }
                return windowWidth
            }
            
         function getElementTop(Elem) 
        {
            if(document.getElementById) 
            {   
                var elem = document.getElementById(Elem);
            } 
            else if (document.all) 
            {
                var elem = document.all[Elem];
            }
                yPos = elem.offsetTop;
                tempEl = elem.offsetParent;
            while (tempEl != null) 
            {
                yPos += tempEl.offsetTop;
                tempEl = tempEl.offsetParent;
            }
            return yPos;
        }
        
        function getElementLeft(Elem)
        { 
          var elem;
              if(document.getElementById) 
              {
                var elem = document.getElementById(Elem);
              } 
              else if (document.all)
              {
                var elem = document.all[Elem];
              }
                xPos = elem.offsetLeft;
                tempEl = elem.offsetParent;
              while (tempEl != null) 
              {
                    xPos += tempEl.offsetLeft;
                    tempEl = tempEl.offsetParent;
              }
            return xPos;
        } 