     internal func PartsDonebtnPush(sender: UIButton){
         if Partsflg{
             Partsflg=false
+            Upperflg=false
             bottomBarOff(PartsView)
+            upperBarOff(UpperView)
         }
     }
     

        nailImg.image = selectedImage
        nailImg.tintColor = UIColor(red: 255/255, green: 225/255, blue: 230/255, alpha: 255/255)
        
    }
    
    //color button
    internal func BaseColorbtnPush(sender: UIButton){
        switch sender.tag {
        case 0:
            nailImg.tintColor = UIColor(red: 255/255, green: 82/255, blue: 46/255, alpha: 255/255)
        case 1:
            nailImg.tintColor = UIColor(red: 251/255, green: 221/255, blue: 64/255, alpha: 255/255)
        case 2:
            nailImg.tintColor = UIColor(red: 3/255, green: 243/255, blue: 194/255, alpha: 255/255)
        case 3:
            nailImg.tintColor = UIColor(red: 3/255, green: 77/255, blue: 111/255, alpha: 255/255)
        default:
            break // do nothing
        }
        
    }
    
    //select parts button
    internal func SelectPartsbtnPush(sender: UIButton){
        switch sender.tag {
        case 0:
            var iname: String = ""
            if _second == "g_oval.png"{iname = "oval01.png"}
            else if _second == "g_round.png"{iname = "round01.png"}
            else if _second == "g_square.png"{iname = "square01.png"}
            
            //setimageview
            //setPartsView = UIImageView(frame: CGRectMake(0,0,90, 200))
            setPartsView.image = UIImage(named: iname)
            let selectedImage: UIImage = setPartsView.image!.imageWithRenderingMode(.AlwaysTemplate)
            setPartsView.image = selectedImage
            setPartsView.tintColor = UIColor(red: 255/255, green: 0/255, blue: 0/255, alpha: 255/255)
            
            setPartsView.contentMode = UIViewContentMode.ScaleAspectFit
            
        case 1:
            nailImg.tintColor = UIColor(red: 251/255, green: 221/255, blue: 64/255, alpha: 255/255)
        case 2:
            nailImg.tintColor = UIColor(red: 3/255, green: 243/255, blue: 194/255, alpha: 255/255)
        default:
            break // do nothing
        }
    }
    
    //base button

        })
    }
    
    private func upperBarOn(iv:UIImageView){
        // アニメーション処理
        UpperView.hidden = false
        UIView.animateWithDuration(NSTimeInterval(CGFloat(0.5)),
            animations: {() -> Void in
                // 移動先の座標を指定する.
                iv.center = CGPoint(x: 0,y: 375);
            }, completion: {(Bool) -> Void in
        })
    }
    
    private func upperBarOff(iv:UIImageView){
        // アニメーション処理
        UIView.animateWithDuration(NSTimeInterval(CGFloat(0.5)),
            animations: {() -> Void in
                // 移動先の座標を指定する.
                iv.center = CGPoint(x: -420,y: 375);
            }, completion: {
                (Bool) -> Void in
        })
    }
    
}
