﻿function Screen() 
{
  	this._Width = 0;
  	this._Height = 0;
  	this._ScrollTop = 0;
  	this._ScrollLeft = 0;
  	
  	this.Current = function()
  	{  	
	    //size
	    if( typeof( window.innerWidth ) == 'number' ) 
	    {
            //Non-IE
            this._Width = window.innerWidth;
            this._Height = window.innerHeight;
        } 
        else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
        {
            //IE 6+ in 'standards compliant mode'
            this._Width = document.documentElement.clientWidth;
            this._Height = document.documentElement.clientHeight;
        } 
        else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
        {
            //IE 4 compatible
            this._Width = document.body.clientWidth;
            this._Height = document.body.clientHeight;
        }
        
        //scrolling
        if( typeof( window.pageYOffset ) == 'number' ) 
        {
            //Netscape compliant
            this._ScrollTop = window.pageYOffset;
            this._ScrollLeft = window.pageXOffset;
        } 
        else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) 
        {
            //DOM compliant
            this._ScrollTop = document.body.scrollTop;
            this._ScrollLeft = document.body.scrollLeft;            
        } 
        else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) 
        {
            //IE6 standards compliant mode
            this._ScrollTop = document.documentElement.scrollTop;
            this._ScrollLeft = document.documentElement.scrollLeft;
            
        }
    }
    
    this.Width = function()
    {
        return this._Width;
    }
    
    this.Height = function()
    {
        return this._Height;
    }
    
    this.Top = function()
    {
        return this._ScrollTop;
    }
    
    this.Left = function()
    {
        return this._ScrollLeft;
    }
    
    this.Current();
}