﻿
      //Begin Get Coordinates
      var myWidth = 0, myHeight = 0;
      var scrollX = 0, scrollY = 0;
        
      function sstchur_SmartScroller_GetCoords()
      {
        
        if (document.all)
        {
           if (!document.documentElement.scrollLeft)
              scrollX = document.body.scrollLeft;
           else
              scrollX = document.documentElement.scrollLeft;
                 
           if (!document.documentElement.scrollTop)
              scrollY = document.body.scrollTop;
           else
              scrollY = document.documentElement.scrollTop;
        }   
        else
        {
           scrollX = window.pageXOffset;
           scrollY = window.pageYOffset;
        }
     
          
          if( typeof( window.innerWidth ) == 'number' ) {
            //Non-IE
            myWidth = window.innerWidth;
            myHeight = window.innerHeight;
          } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
            //IE 6+ in 'standards compliant mode'
            myWidth = document.documentElement.clientWidth;
            myHeight = document.documentElement.clientHeight;
          } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
            //IE 4 compatible
            myWidth = document.body.clientWidth;
            myHeight = document.body.clientHeight;
          }
        

     }
     
    function f_clientWidth() {
      return f_filterResults (
	      window.innerWidth ? window.innerWidth : 0,
	      document.documentElement ? document.documentElement.clientWidth : 0,
	      document.body ? document.body.clientWidth : 0
      );
    }
    function f_clientHeight() {
      return f_filterResults (
	      window.innerHeight ? window.innerHeight : 0,
	      document.documentElement ? document.documentElement.clientHeight : 0,
	      document.body ? document.body.clientHeight : 0
      );
    }

    function f_filterResults(n_win, n_docel, n_body) {
	    var n_result = n_win ? n_win : 0;
	    if (n_docel && (!n_result || (n_result > n_docel)))
		    n_result = n_docel;
	    return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
    }

