         public function clearCookies()
         {
           //if we dont have a webview, make one and put it in the background
+          this.createBrowser()
+          //clear the webviews cookies
+          childWebView.clearCookies();
+          childWebView.stage = null;
+          //childWebView.dispose();
+          //childWebView = null;
+        }
+
+        private function createBrowser()
+        {
           if (childWebView == null) 
           {
               childWebView = new QNXStageWebView("ChildBrowser");
               childWebView.stage = webView.stage;
               childWebView.viewPort = new Rectangle(0,50,webView.stage.stageWidth,browserHeight);
               childWebView.zOrder = -1;
+              this.isVisible = true
+              // events
+              webView.stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, onOrientationChange);
           }
-          //clear the webviews cookies
-          childWebView.clearCookies();
+        }
+
+        public function loadURL(url:String)
+        {
+            var self = this;
+            browserHeight = webView.stage.stageHeight - 50;
+            //if we dont have a webview, make one and put it in the background
+            this.createBrowser();
+            //put webview behind stage
+            webView.zOrder = -1;
+            //load this url
+            childWebView.loadURL(url);
+            this.initBG();
+        }
+
+        private function onOrientationChange(event:StageOrientationEvent)
+        {
+           var self = this
+           this.removeUI();
+           this.initBG()
+           childWebView.viewPort = new Rectangle(0,50,bgshape.width,bgshape.height - 50);
+        }
+
+        public function getLocation():String
+        {
+            return childWebView.location;
+        }
+
+        public function forward()
+        {
+            childWebView.historyForward();
+        }
+
+        public function back()
+        {
+            childWebView.historyBack();
+        }
+
+        public function refresh()
+        {
+            childWebView.reload();
+        }
+
+        public function close()
+        {
           childWebView.stage = null;
           childWebView.dispose();
-        }
-
-        public function loadURL(url:String)
-        {
-            var self = this;
-            browserHeight = webView.stage.stageHeight - 50;
-            //only ever create one web view
-            childWebView = new QNXStageWebView("ChildBrowser");
-            childWebView.zOrder = -100;
-            webView.zOrder = -1;
-            childWebView.viewPort = new Rectangle(0,50,webView.stage.stageWidth,browserHeight);
-            //load this url
-            childWebView.loadURL(url);
-            // events
-            //webView.stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, onOrientationChange);
-            //childWebView.addEventListener(WebViewEvent.DOCUMENT_LOAD_FINISHED, loaded);
-            this.initBG();
-        }
-
-
-        private function onOrientationChange(event:StageOrientationEvent)
-        {
-            //var self = this
-            //this.removeUI();
-            //this.initBG()
-            //this.initUI()
-            //childWebView.viewPort = new Rectangle(0,50,webView.stage.stageWidth,browserHeight);
-        }
-
-        private function clearWindow()
-        {
-            childWebView.loadURL("about:blank");
-        }
-
-        public function getLocation():String
-        {
-            return childWebView.location;
-        }
-
-        public function forward()
-        {
-            childWebView.historyForward();
-        }
-
-        public function back()
-        {
-            childWebView.historyBack();
-        }
-
-        public function refresh()
-        {
-            childWebView.reload();
-        }
-
-        public function close()
-        {
-          childWebView.stage = null;
-          childWebView.dispose();
+          childWebView = null;
 
           Tweener.addTween(webViewUI, {
             y: webView.stage.stageHeight,

    import flash.events.MouseEvent;
    import flash.display.Sprite;
    import flash.events.StageOrientationEvent;
    import flash.display.Bitmap;
    import flash.utils.setTimeout;

    import caurina.transitions.Tweener;

    // qnx 
    import qnx.media.QNXStageWebView;
    import qnx.events.WebViewEvent;
    import qnx.ui.buttons.IconButton;
    import qnx.ui.skins.buttons.OutlineButtonSkinBlack;

    // webworks
    import webworks.extension.DefaultExtension;


    public class ChildBrowser extends DefaultExtension
    {

          return this.isVisible; 
        }

        // our own addChild implementation
        // maps back to stage of WebWorkAppTemplate.as
        private function addChild(obj)
