 private var currentProductId = productsArray[0].id
 private var currentOwnerId = productsArray[0].userid
 private var currentIndex = 0
+private var currentImage = UIImage(named: "close")
 
 class BackgroundAnimationViewController: UIViewController, UIScrollViewDelegate {
 

        
        var i = 0
        
        while (productsArray[i].id != productsIDs[currentIndex]) {
            i+=1
        }
        
        productDetailsView = UIView(frame: CGRectMake(0, 0, view.frame.width, view.frame.height))
        productDetailsView.backgroundColor = UIColor.whiteColor()
        
        detailsPageControl = UIPageControl(frame: CGRectMake(0,0,view.frame.width, view.frame.width))
        configurePageControl()
        
        let leaveDetailsViewButton = UIButton(frame: CGRectMake(20,20,40,40))
        leaveDetailsViewButton.setBackgroundImage(UIImage(named: "down"), forState: .Normal)

            
            let image = UIImage(data: data)
            let imageView = UIImageView(image: image)
            currentImage = image
            imageView.contentMode = UIViewContentMode.ScaleAspectFill
            imageView.layer.cornerRadius = 15.0
            imageView.clipsToBounds = true
