     webView.scalesPageToFit = true
 
     // Setup NavigationBar
-    let screenRect = UIScreen.main.bounds
-    let orientation = UIApplication.shared.statusBarOrientation
-    if UIDevice.current.userInterfaceIdiom == .phone {
-      let size = CGFloat.maximum(screenRect.size.height, screenRect.size.width)
-      if size > 568.0 {
-        // Navbar for iPhone 6 & 6 Plus
-        let image: UIImage
-        if UIInterfaceOrientationIsPortrait(orientation) {
-          image = #imageLiteral(resourceName: "kmwb-navbar-Portrait.png")
-        } else {
-          image = #imageLiteral(resourceName: "kmwb-navbar-Landscape-568h.png")
-        }
-        let bgImg = image.resizableImage(
-          withCapInsets: UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0), resizingMode: .stretch)
-        navBar.setBackgroundImage(bgImg, for: UIBarMetrics.default)
-      } else if size == 568 {
-        // Navbar for iPhone and iPod Touch with 4" Display
-        navBar.setBackgroundImage(#imageLiteral(resourceName: "kmwb-navbar-Portrait.png"),
-                                  for: UIBarMetrics.default)
-        navBar.setBackgroundImage(#imageLiteral(resourceName: "kmwb-navbar-Landscape-568h.png"),
-                                  for: UIBarMetrics.compact)
-      } else if size < 568.0 {
-        // Navbar for iPhone and iPod Touch with 3.5" Display
-        navBar.setBackgroundImage(#imageLiteral(resourceName: "kmwb-navbar-Portrait.png"),
-                                  for: UIBarMetrics.default)
-        navBar.setBackgroundImage(#imageLiteral(resourceName: "kmwb-navbar-Landscape.png"),
-                                  for: UIBarMetrics.compact)
-      }
-    } else {
-      // Navbar for iPad
-      if UIInterfaceOrientationIsPortrait(orientation) {
-        navBar.setBackgroundImage(#imageLiteral(resourceName: "kmwb-navbar-Portrait.png"), for: UIBarMetrics.default)
-      } else {
-        navBar.setBackgroundImage(#imageLiteral(resourceName: "kmwb-navbar-Landscape.png"), for: UIBarMetrics.default)
-      }
-    }
+    navbarBackground = KMNavigationBarBackgroundView()
+    navbarBackground.hideLogo()
+    navbarBackground.addToNavbar(navBar)
+    navbarBackground.setOrientation(UIApplication.shared.statusBarOrientation)
 
     // Setup address field
     let addressFrame = CGRect(x: 10, y: 4.0, width: navBar.frame.size.width - 20, height: 28)

  @IBOutlet var globeButton: UIBarButtonItem!
  @IBOutlet var closeButton: UIBarButtonItem!

  var fontFamily = UIFont.systemFont(ofSize: UIFont.systemFontSize).fontName
  private var newFontFamily = ""


  }

  override func willRotate(to toInterfaceOrientation: UIInterfaceOrientation, duration: TimeInterval) {
    if let navbarBackground = navbarBackground {
      navbarBackground.setOrientation(toInterfaceOrientation)
    }
  }

