Index: /CKEditor/branches/prototype/_source/core/dom/window.js
===================================================================
--- /CKEditor/branches/prototype/_source/core/dom/window.js	(revision 2447)
+++ /CKEditor/branches/prototype/_source/core/dom/window.js	(revision 2448)
@@ -56,40 +56,62 @@
 		/**
 		 * Gets the width and height of this window's viewable area.
+		 * @returns {Object} An object with the "width" and "height"
+		 *		properties containing the size.
 		 * @example
 		 * var win = new CKEDITOR.dom.window( window );
 		 * var size = <b>win.getViewPaneSize()</b>;
+		 * alert( size.width );
+		 * alert( size.height );
 		 */
 		getViewPaneSize : function()
 		{
-			if ( 'innerWidth' in this.$ )
+			var $ = this.$;
+
+			if ( 'innerWidth' in $ )
+			{
 				return {
-					width : this.$.innerWidth || 0,
-					height : this.$.innerHeight || 0
+					width : $.innerWidth || 0,
+					height : $.innerHeight || 0
 				};
+			}
 			else
+			{
+				var doc = $.document;
 				return {
-					width : this.$.document.documentElement.clientWidth || this.$.document.body.clientWidth || 0,
-					height : this.$.document.documentElement.clientHeight || this.$.document.body.clientHeight || 0
+					width : doc.documentElement.clientWidth || doc.body.clientWidth || 0,
+					height : doc.documentElement.clientHeight || doc.body.clientHeight || 0
 				};
+			}
 		},
 
 		/**
 		 * Gets the current position of the window's scroll.
+		 * @returns {Object} An object with the "x" and "y" properties
+		 *		containing the scroll position.
 		 * @example
 		 * var win = new CKEDITOR.dom.window( window );
-		 * var size = <b>win.getScrollPosition()</b>;
+		 * var pos = <b>win.getScrollPosition()</b>;
+		 * alert( pos.x );
+		 * alert( pos.y );
 		 */
 		getScrollPosition : function()
 		{
-			if ( 'pageXOffset' in this.$ )
+			var $ = this.$;
+
+			if ( 'pageXOffset' in $ )
+			{
 				return {
-					x : this.$.pageXOffset || 0,
-					y : this.$.pageYOffset || 0
+					x : $.pageXOffset || 0,
+					y : $.pageYOffset || 0
 				};
+			}
 			else
+			{
+				var doc = $.document;
 				return {
-					x : this.$.document.documentElement.scrollLeft || this.$.document.body.scrollLeft || 0,
-					y : this.$.document.documentElement.scrollTop || this.$.document.body.scrollTop || 0
+					x : doc.documentElement.scrollLeft || doc.body.scrollLeft || 0,
+					y : doc.documentElement.scrollTop || doc.body.scrollTop || 0
 				};
+			}
 		}
 	});
