getBoundaryInformation = function( range, start )
					{
						// Creates a collapsed range at the requested boundary.
						range = range.duplicate();
						range.collapse( start );

						// Gets the element that encloses the range entirely.
						var parent = range.parentElement();
						var siblings = parent.childNodes;

						var testRange;

						for ( var i = 0 ; i < siblings.length ; i++ )
						{
							var child = siblings[ i ];
							if ( child.nodeType == 1 )
							{
								testRange = range.duplicate();

								testRange.moveToElementText( child );

								var comparisonStart = testRange.compareEndPoints( 'StartToStart', range ),
									comparisonEnd = testRange.compareEndPoints( 'EndToStart', range );

								testRange.collapse();

								if ( comparisonStart > 0 )
									break;
								// When selection stay at the side of certain self-closing elements, e.g. BR,
								// our comparison will never shows an equality. (#4824)
								else if ( !comparisonStart
									|| comparisonEnd == 1 && comparisonStart == -1 )
									return { container : parent, offset : i };
								else if ( !comparisonEnd )
									return { container : parent, offset : i + 1 };

								testRange = null;
							}
						}

						if ( !testRange )
						{
							testRange = range.duplicate();
							testRange.moveToElementText( parent );
							testRange.collapse( false );
						}

						testRange.setEndPoint( 'StartToStart', range );
						// IE report line break as CRLF with range.text but
						// only LF with textnode.nodeValue, normalize them to avoid
						// breaking character counting logic below. (#3949)
						var distance = testRange.text.replace( /(\r\n|\r)/g, '\n' ).length;

						try
						{
							while ( distance > 0 )
								distance -= siblings[ --i ].nodeValue.length;
						}
						// Measurement in IE could be somtimes wrong because of <select> element. (#4611)
						catch( e )
						{
							distance = 0;
						}


						if ( distance === 0 )
						{
							return {
								container : parent,
								offset : i
							};
						}
						else
						{
							return {
								container : siblings[ i ],
								offset : -distance
							};
						}
					}
Gets the type of the current selection. The following values are
available:
<ul>
		<li>{@link CKEDITOR.SELECTION_NONE} (1): No selection.</li>
		<li>{@link CKEDITOR.SELECTION_TEXT} (2): Text is selected or
			collapsed selection.</li>
		<li>{@link CKEDITOR.SELECTION_ELEMENT} (3): A element
			selection.</li>
</ul>
@function
@returns {Number} One of the following constant values:
		{@link CKEDITOR.SELECTION_NONE}, {@link CKEDITOR.SELECTION_TEXT} or
		{@link CKEDITOR.SELECTION_ELEMENT}.
@example
if ( editor.getSelection().<b>getType()</b> == CKEDITOR.SELECTION_TEXT )
    alert( 'Text is selected' );