         
         super.layoutSubviews()
     }
+    
+    override func config(model:MHomeItem)
+    {
+        self.model = model as! MHomeItemAccess
+        hover()
+    }
+    
+    //MARK: private
+    
+    private func hover()
+    {
+        switch model.access
+        {
+            case FDatabaseModelRoom.Access.invitationOnly:
+                
+                showInvitationOnly()
+                
+                break
+                
+            case FDatabaseModelRoom.Access.freeJoin:
+     
+                showFreeJoin()
+                
+                break
+        }
+    }
+    
+    private func showInvitationOnly()
+    {
+        buttonInvitationOnly.backgroundColor = UIColor.main()
+        buttonInvitationOnly.imageView!.tintColor = UIColor.white
+        buttonFreeJoin.backgroundColor = UIColor.clear
+        buttonFreeJoin.imageView!.tintColor = colorNotSelected
+    }
+    
+    private func showFreeJoin()
+    {
+        buttonInvitationOnly.backgroundColor = UIColor.clear
+        buttonInvitationOnly.imageView!.tintColor = colorNotSelected
+        buttonFreeJoin.backgroundColor = UIColor.main()
+        buttonFreeJoin.imageView!.tintColor = UIColor.white
+    }
 }

        let buttonFreeJoin:UIButton = UIButton()
        buttonFreeJoin.translatesAutoresizingMaskIntoConstraints = false
        buttonFreeJoin.clipsToBounds = true
        buttonFreeJoin.setImage(#imageLiteral(resourceName: "roomAccessFreeJoin"), for:UIControlState.normal)
        buttonFreeJoin.imageView!.contentMode = UIViewContentMode.center
        buttonFreeJoin.imageView!.clipsToBounds = true
        buttonFreeJoin.layer.cornerRadius = kCornerRadius

    weak var buttonFreeJoin:UIButton!
    weak var model:MHomeItemAccess!
    weak var layoutButtonsLeft:NSLayoutConstraint!
    private let colorNotSelected:UIColor
    private let buttonsTotalWidth:CGFloat
    private let kLabelsHeight:CGFloat = 20
    private let kLabelsWidth:CGFloat = 105
