Index: /trunk/ova.flowplayer/src/org/openvideoads/plugin/flowplayer/streamer/OpenAdStreamer.as
===================================================================
--- /trunk/ova.flowplayer/src/org/openvideoads/plugin/flowplayer/streamer/OpenAdStreamer.as	(revision 264)
+++ /trunk/ova.flowplayer/src/org/openvideoads/plugin/flowplayer/streamer/OpenAdStreamer.as	(revision 283)
@@ -71,5 +71,5 @@
      
         protected static var CONTROLBAR_HEIGHT:int = 29;   
-        public static var OAS_VERSION:String = "v0.5.2 (build 65)";
+        public static var OAS_VERSION:String = "v0.5.2 (build 66)";
         
         protected static var STREAMING_PROVIDERS:Object = {
Index: /trunk/ova.as3/src/org/openvideoads/vast/VASTController.as
===================================================================
--- /trunk/ova.as3/src/org/openvideoads/vast/VASTController.as	(revision 264)
+++ /trunk/ova.as3/src/org/openvideoads/vast/VASTController.as	(revision 283)
@@ -73,5 +73,5 @@
 		public static const RELATIVE_TO_CLIP:String = "relative-to-clip";
 		public static const CONTINUOUS:String = "continuous";
-		public static const VERSION:String = "v0.5.3 (build 69)";
+		public static const VERSION:String = "v0.5.3 (build 71)";
 		
 		protected var _streamSequence:StreamSequence = null;
@@ -202,4 +202,8 @@
 		public function get startStreamSafetyMargin():int {
 			return _startStreamSafetyMargin;
+		}
+		
+		public function get assessControlBarState():Boolean {
+			return _config.assessControlBarState;
 		}
 		
Index: /trunk/ova.as3/src/org/openvideoads/vast/config/Config.as
===================================================================
--- /trunk/ova.as3/src/org/openvideoads/vast/config/Config.as	(revision 219)
+++ /trunk/ova.as3/src/org/openvideoads/vast/config/Config.as	(revision 283)
@@ -42,4 +42,5 @@
 		protected var _playerSpecificConfig:PlayerConfigGroup = new PlayerConfigGroup();
 		protected var _onLoadedListener:ConfigLoadListener = null;
+		protected var _assessControlBarState:Boolean = true;
 				
 		public function Config(rawConfig:Object=null, onLoadedListener:ConfigLoadListener=null) {
@@ -64,4 +65,10 @@
 			if(config.debug != undefined) this.debug = config.debug;
 			if(config.player != undefined) this.player = config.player;
+			if(config.assessControlBarState != undefined) {
+				if(config.assessControlBarState is String) {
+					this.assessControlBarState = ((config.assessControlBarState.toUpperCase() == "TRUE") ? true : false);											
+				}
+				else this.assessControlBarState = config.assessControlBarState;					
+			}			
 			onOVAConfigLoaded();
 		}
@@ -99,4 +106,12 @@
 		public function get millisecondDelayOnCompanionInjection():int {
 			return _adsConfig.millisecondDelayOnCompanionInjection;
+		}
+		
+		public function set assessControlBarState(assessState:Boolean):void {
+			_assessControlBarState = assessState;
+		}
+		
+		public function get assessControlBarState():Boolean {
+			return _assessControlBarState;
 		}
 		
Index: /trunk/ova.jwplayer.4x/scripts/publish/templates/pages/ad-notice/index.html
===================================================================
--- /trunk/ova.jwplayer.4x/scripts/publish/templates/pages/ad-notice/index.html	(revision 71)
+++ /trunk/ova.jwplayer.4x/scripts/publish/templates/pages/ad-notice/index.html	(revision 283)
@@ -14,5 +14,4 @@
 <li><a href="example03.html">Turning off the Ad Notice</a></li>
 <li><a href="example04.html">Modifying the Linear Ad Clickthrough Message</a></li>
-<li>Test reposition of ad notice on hide of controls (not available for JW 4.x)</li>
 <li><a href="example06.html">Test disable/enable of the control bar during ad playback</a></li>
 <li><a href="example07.html">Using small text on the ad notice</a></li>
Index: /trunk/ova.jwplayer.4x/examples/pages/ad-notice/index.html
===================================================================
--- /trunk/ova.jwplayer.4x/examples/pages/ad-notice/index.html	(revision 184)
+++ /trunk/ova.jwplayer.4x/examples/pages/ad-notice/index.html	(revision 283)
@@ -14,5 +14,4 @@
 <li><a href="example03.html">Turning off the Ad Notice</a></li>
 <li><a href="example04.html">Modifying the Linear Ad Clickthrough Message</a></li>
-<li>Test reposition of ad notice on hide of controls (not available for JW 4.x)</li>
 <li><a href="example06.html">Test disable/enable of the control bar during ad playback</a></li>
 <li><a href="example07.html">Using small text on the ad notice</a></li>
Index: /trunk/ova.jwplayer.5x/scripts/publish/templates/pages/ad-notice/example05.html
===================================================================
--- /trunk/ova.jwplayer.5x/scripts/publish/templates/pages/ad-notice/example05.html	(revision 92)
+++ /trunk/ova.jwplayer.5x/scripts/publish/templates/pages/ad-notice/example05.html	(revision 283)
@@ -15,6 +15,15 @@
 <h2>Example 5 - Test reposition of ad notice on hide of controls</h2>
 <p class="example">
+In this example, a custom skin is used. The skin is 32 pixels high. In addition, a floating control bar
+is deployed via the "controlbar=over" option. This results in a player size of 300 which places the
+ad notice etc under the control bar when it's shown. To get around that, a bottom margin padding
+value is set for both the control bar on and off.
 </p>
-<script type="text/javascript">document.write(writePlayerEmbedCode(OVA_CONFIG, 2, 450, 300));</script>
+<p>
+"assessControlBarState" does not have to be set - it is true by default. It's specified here for
+illustrative purposes only. If it's defined as false, the repositioning will be blocked when the
+control bar shows and hides - this improves performance of the plugin.
+</p>
+<script type="text/javascript">document.write(writePlayerEmbedCode(OVA_CONFIG, 2, 450, 300, "&file=OVA_HTTP_SHOW_STREAM_1&duration=30&provider=video&skin=OVA_TEST_SKIN&controlbar=over"));</script>
 <p>
 The configuration for this example is:
@@ -23,5 +32,5 @@
 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap !important; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">
 <code>
-<script type="text/javascript">document.write(htmlEncode(writePlayerEmbedCode(OVA_CONFIG, 2, 450, 300)));</script>
+<script type="text/javascript">document.write(htmlEncode(writePlayerEmbedCode(OVA_CONFIG, 2, 450, 300, "&file=OVA_HTTP_SHOW_STREAM_1&duration=30&provider=video&skin=OVA_TEST_SKIN&controlbar=over")));</script>
 </code>
 </pre>
@@ -39,7 +48,14 @@
    &lt;ova.json&gt;
        {
+            "assessControlBarState": true,
+
             "debug": {
                 "debugger": "firebug",
                 "levels": "OVA_DEBUG"
+            },
+
+            "overlays": {
+                 "stagePaddingBottomWithControls": 35,
+                 "stagePaddingBottomNoControls": 2
             },
 
@@ -56,4 +72,10 @@
                       "zone": "5",
                       "position": "pre-roll"
+                    },
+                    {
+                       "zone": "28",
+                       "startTime": "00:00:03",
+                       "position": "auto:bottom",
+                       "duration": "recommended:10"
                     }
                 ]
Index: /trunk/ova.jwplayer.5x/scripts/publish/templates/pages/ad-notice/index.html
===================================================================
--- /trunk/ova.jwplayer.5x/scripts/publish/templates/pages/ad-notice/index.html	(revision 92)
+++ /trunk/ova.jwplayer.5x/scripts/publish/templates/pages/ad-notice/index.html	(revision 283)
@@ -14,5 +14,5 @@
 <li><a href="example03.html">Turning off the Ad Notice</a></li>
 <li><a href="example04.html">Modifying the Linear Ad Clickthrough Message</a></li>
-<li>Test reposition of ad notice on hide of controls (not available for JW 4.x)</li>
+<li><a href="example05.html">Test reposition of ad notice on hide of controls</a></li>
 <li><a href="example06.html">Test disable/enable of the control bar during ad playback</a></li>
 <li><a href="example07.html">Using small text on the ad notice</a></li>
Index: /trunk/ova.jwplayer.5x/scripts/publish/templates/config/ad-notice/ova05.xml
===================================================================
--- /trunk/ova.jwplayer.5x/scripts/publish/templates/config/ad-notice/ova05.xml	(revision 92)
+++ /trunk/ova.jwplayer.5x/scripts/publish/templates/config/ad-notice/ova05.xml	(revision 283)
@@ -5,7 +5,14 @@
    <ova.json>
        {
+            "assessControlBarState": true,
+
             "debug": {
                 "debugger": "firebug",
                 "levels": "OVA_DEBUG"
+            },
+
+            "overlays": {
+                 "stagePaddingBottomWithControls": 35,
+                 "stagePaddingBottomNoControls": 2
             },
 
@@ -22,4 +29,10 @@
                       "zone": "5",
                       "position": "pre-roll"
+                    },
+                    {
+                       "zone": "28",
+                       "startTime": "00:00:03",
+                       "position": "auto:bottom",
+                       "duration": "recommended:10"
                     }
                 ]
Index: /trunk/ova.jwplayer.5x/src/org/openvideoads/plugin/jwplayer/streamer/OpenAdStreamer.as
===================================================================
--- /trunk/ova.jwplayer.5x/src/org/openvideoads/plugin/jwplayer/streamer/OpenAdStreamer.as	(revision 264)
+++ /trunk/ova.jwplayer.5x/src/org/openvideoads/plugin/jwplayer/streamer/OpenAdStreamer.as	(revision 283)
@@ -63,7 +63,8 @@
 		protected var _splashImage:String = null;
 		protected var _justStarted:Boolean = true;
+		protected var _lastVisibilityStateForControls:Boolean = true;
 	    
 		public var config:Object = {
-			build: "OVA for JW 5.x - v0.4.4 (build 69)",
+			build: "OVA for JW 5.x - v0.4.4 (build 71)",
 			json: null
 		};
@@ -80,26 +81,4 @@
 
 	   	public function get id():String { return "ova"; }
-
-   		public function resize(width:Number, height:Number):void {
-			if(_vastController != null) {
-				// if we haven't already stored the original dimensions, do so now
-				if(_originalWidth < 0) _originalWidth = width;
-				if(_originalHeight < 0) _originalHeight = height; 
-				
-				if(_vastController.hasStageDimensions()) {
-					_vastController.resizeOverlays(
-							new DisplayProperties(
-									this, 
-									width,
-									height,
-									_vastController.stageDimensions.withControlsPaddingBottom, 
-									_originalWidth, 
-									_originalHeight							
-							)
-					);					
-				}
-			}			
-			//doLog("*** ova.resize() w:" + width + " h:" + height + "  original - w:" + _originalWidth + " h:" + _originalHeight, Debuggable.DEBUG_DISPLAY_EVENTS);
-   		}		
 
 		public function initializePlugin():void {
@@ -239,4 +218,41 @@
 		}
 		
+   		public function resize(width:Number, height:Number):void {
+			if(_vastController != null) {
+				// if we haven't already stored the original dimensions, do so now
+				if(_originalWidth < 0) _originalWidth = width;
+				if(_originalHeight < 0) _originalHeight = height; 
+				
+				if(_vastController.hasStageDimensions()) {
+					_vastController.resizeOverlays(
+							new DisplayProperties(
+									this, 
+									(width < _originalWidth) ? _originalWidth : width,     // these two conditions deal with a bug
+									(height < _originalHeight) ? _originalHeight : height, // where the dimensions provided after fullscreen restore are incorrect
+									_vastController.stageDimensions.withControlsPaddingBottom, 
+									_originalWidth, 
+									_originalHeight							
+							)
+					);					
+				}
+			}			
+			//doLog("*** ova.resize() w:" + width + " h:" + height + "  original - w:" + _originalWidth + " h:" + _originalHeight, Debuggable.DEBUG_DISPLAY_EVENTS);
+   		}		
+   		
+		protected function resizeWithHiddenControls():void {
+			if(_originalHeight > -1 && _originalWidth > -1) {
+				_vastController.resizeOverlays(
+						new DisplayProperties(
+								this, 
+								_player.config.width,
+								_player.config.height,
+								_vastController.stageDimensions.noControlsPaddingBottom,
+	            				_originalWidth, 
+		        				_originalHeight
+						)
+				);				
+			}
+		}   		
+		
 		protected function hasSplashImage():Boolean {
 			return _splashImage != null;
@@ -315,6 +331,27 @@
 		// Time point handler
 		
+		private function assessControlBarState():void {
+		    var cb:IControlbarComponent = _player.controls.controlbar;
+		    var visibilityState:Boolean = _lastVisibilityStateForControls;
+		    
+		    if(cb is ControlbarComponentV4) {
+		    	visibilityState = ControlbarComponentV4(cb).visible;
+		    }
+			else if(cb is ControlbarComponent) {
+		    	visibilityState = ControlbarComponent(cb).visible;
+			}
+			
+	        if(visibilityState != _lastVisibilityStateForControls) {
+        		if(visibilityState) {
+        			resize(width, height);
+        		}
+        		else resizeWithHiddenControls();
+        		_lastVisibilityStateForControls = ControlbarComponent(cb).visible;
+			}
+		}
+		
 		private function timeHandler(evt:MediaEvent):void {
 			if(evt.position > 0) {
+				if(_vastController.assessControlBarState) assessControlBarState();
 				if(_needToDoStartPreProcessing) {
 					// used to enforce impression sending where needed for empty Ad slots
Index: /trunk/ova.jwplayer.5x/examples/pages/ad-notice/example05.html
===================================================================
--- /trunk/ova.jwplayer.5x/examples/pages/ad-notice/example05.html	(revision 93)
+++ /trunk/ova.jwplayer.5x/examples/pages/ad-notice/example05.html	(revision 283)
@@ -15,6 +15,15 @@
 <h2>Example 5 - Test reposition of ad notice on hide of controls</h2>
 <p class="example">
+In this example, a custom skin is used. The skin is 32 pixels high. In addition, a floating control bar
+is deployed via the "controlbar=over" option. This results in a player size of 300 which places the
+ad notice etc under the control bar when it's shown. To get around that, a bottom margin padding
+value is set for both the control bar on and off.
 </p>
-<script type="text/javascript">document.write(writePlayerEmbedCode(OVA_CONFIG, 2, 450, 300));</script>
+<p>
+"assessControlBarState" does not have to be set - it is true by default. It's specified here for
+illustrative purposes only. If it's defined as false, the repositioning will be blocked when the
+control bar shows and hides - this improves performance of the plugin.
+</p>
+<script type="text/javascript">document.write(writePlayerEmbedCode(OVA_CONFIG, 2, 450, 300, "&file=http://streaming.openvideoads.org/shows/the-black-hole.mp4&duration=30&provider=video&skin=http://www.longtailvideo.com/files/skins/lulu/5/lulu.zip&controlbar=over"));</script>
 <p>
 The configuration for this example is:
@@ -23,5 +32,5 @@
 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap !important; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">
 <code>
-<script type="text/javascript">document.write(htmlEncode(writePlayerEmbedCode(OVA_CONFIG, 2, 450, 300)));</script>
+<script type="text/javascript">document.write(htmlEncode(writePlayerEmbedCode(OVA_CONFIG, 2, 450, 300, "&file=http://streaming.openvideoads.org/shows/the-black-hole.mp4&duration=30&provider=video&skin=http://www.longtailvideo.com/files/skins/lulu/5/lulu.zip&controlbar=over")));</script>
 </code>
 </pre>
@@ -39,7 +48,14 @@
    &lt;ova.json&gt;
        {
+            "assessControlBarState": true,
+
             "debug": {
                 "debugger": "firebug",
                 "levels": "fatal, config, vast_template"
+            },
+
+            "overlays": {
+                 "stagePaddingBottomWithControls": 35,
+                 "stagePaddingBottomNoControls": 2
             },
 
@@ -56,4 +72,10 @@
                       "zone": "5",
                       "position": "pre-roll"
+                    },
+                    {
+                       "zone": "28",
+                       "startTime": "00:00:03",
+                       "position": "auto:bottom",
+                       "duration": "recommended:10"
                     }
                 ]
Index: /trunk/ova.jwplayer.5x/examples/pages/ad-notice/index.html
===================================================================
--- /trunk/ova.jwplayer.5x/examples/pages/ad-notice/index.html	(revision 181)
+++ /trunk/ova.jwplayer.5x/examples/pages/ad-notice/index.html	(revision 283)
@@ -14,5 +14,5 @@
 <li><a href="example03.html">Turning off the Ad Notice</a></li>
 <li><a href="example04.html">Modifying the Linear Ad Clickthrough Message</a></li>
-<li>Test reposition of ad notice on hide of controls (not available for JW 4.x)</li>
+<li><a href="example05.html">Test reposition of ad notice on hide of controls</a></li>
 <li><a href="example06.html">Test disable/enable of the control bar during ad playback</a></li>
 <li><a href="example07.html">Using small text on the ad notice</a></li>
Index: /trunk/ova.jwplayer.5x/examples/config/ad-notice/ova05.xml
===================================================================
--- /trunk/ova.jwplayer.5x/examples/config/ad-notice/ova05.xml	(revision 69)
+++ /trunk/ova.jwplayer.5x/examples/config/ad-notice/ova05.xml	(revision 283)
@@ -5,7 +5,14 @@
    <ova.json>
        {
+            "assessControlBarState": true,
+
             "debug": {
                 "debugger": "firebug",
                 "levels": "fatal, config, vast_template"
+            },
+
+            "overlays": {
+                 "stagePaddingBottomWithControls": 35,
+                 "stagePaddingBottomNoControls": 2
             },
 
@@ -22,4 +29,10 @@
                       "zone": "5",
                       "position": "pre-roll"
+                    },
+                    {
+                       "zone": "28",
+                       "startTime": "00:00:03",
+                       "position": "auto:bottom",
+                       "duration": "recommended:10"
                     }
                 ]
