Bug 419277 - Splitter should not lay out with sash outside of the viewport.
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/globalSearch/globalSearch.css b/bundles/org.eclipse.orion.client.ui/web/orion/globalSearch/globalSearch.css
index 8d828cd..dc37a98 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/globalSearch/globalSearch.css
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/globalSearch/globalSearch.css
@@ -61,7 +61,7 @@
 	z-index: 50;
 	height: 4px;
 	cursor: n-resize;
-	background: #efefef;
+	background: #dedede !important;
 	overflow: hidden;
 	visibility: visible; 
 }
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/webui/splitter.js b/bundles/org.eclipse.orion.client.ui/web/orion/webui/splitter.js
index c81d094..f2c0e87 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/webui/splitter.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/webui/splitter.js
@@ -130,11 +130,16 @@
 				this._closed = this._closeByDefault;
 			}
 
+			var parentRect = lib.bounds(this.$node.parentNode);
+			var rect = lib.bounds(this.$node);
 			var pos;
 			if (this._vertical) {
 				pos = localStorage.getItem(this._prefix+"/yPosition"); //$NON-NLS-0$
 				if (pos) {
 					this._splitTop = parseInt(pos, 10);
+					if(this._splitTop > (parentRect.top + parentRect.height - rect.height)){
+						this._splitTop = parentRect.top + parentRect.height / 2.0;
+					}
 				} else if (this._closeByDefault) {
 					this._initialSplit = this._getSplitPosition();
 					this._splitTop = 0;
@@ -143,6 +148,9 @@
 				pos = localStorage.getItem(this._prefix+"/xPosition"); //$NON-NLS-0$
 				if (pos) {
 					this._splitLeft = parseInt(pos, 10);
+					if(this._splitLeft > (parentRect.left + parentRect.width - rect.width)){
+						this._splitLeft = parentRect.left + parentRect.width / 2.0;
+					}
 				} else if (this._closeByDefault) {
 					this._initialSplit = this._getSplitPosition();
 					this._splitLeft = 0;