// mobile navigation js start here???????????????????
function openNav() {
  document.getElementById("mySidenav").style.width = "250px";
}

function closeNav() {
  document.getElementById("mySidenav").style.width = "0";
}
// mobile navigation js end here???????????????????


// video slider js start here???????????????????
// $(document).ready(function(){
//     $('.customer-logos').slick({
//         slidesToShow: 1,
//         slidesToScroll: 1,
//         autoplay: true,
//         autoplaySpeed: 1500,
//         arrows: false,
//         dots: false,
//         pauseOnHover: false,
//         responsive: [{
//             breakpoint: 768,
//             settings: {
//                 slidesToShow: 1
//             }
//         }, {
//             breakpoint: 520,
//             settings: {
//                 slidesToShow: 1
//             }
//         }]
//     });
// });
// video slider js end here???????????????????


// table popover js start here???????????????????
$(document).ready(function() {
  // $('[data-toggle="popover"]').popover();   
});
// table popover js end here???????????????????


// table slider js start here???????????????????
// $('.slide1').slick({
//    slidesToShow: 3,
//    slidesToScroll: 1,
//    dots: true,
//    responsive: [
//     {
//       breakpoint: 1024,
//       settings: {
//         slidesToShow: 3,
//         slidesToScroll: 1,
//         infinite: true,
//         dots: true
//       }
//     },
//     {
//       breakpoint: 600,
//       settings: {
//         slidesToShow: 2,
//         slidesToScroll: 1
//       }
//     },
//     {
//       breakpoint: 480,
//       settings: {
//         slidesToShow: 1,
//         slidesToScroll: 1
//       }
//     }
//     ]
//  });

// table slider js end here???????????????????
// poppp js end here???????????????????
function closePopUp_popup_8666_retrieve() {
  $("#popup_8666_retrieve").modal('hide');
  $('.modal-backdrop.fade.in').remove();
  $('.modal-backdrop.fade.show').remove()

}


// window.onload = function () {

// var chart = new CanvasJS.Chart("chartContainer", {
//   animationEnabled: true,
//   title: {
//     text: "Number of iPhones Sold in Different Quarters"
//   },
//   axisX: {
//     minimum: new Date(2015, 01, 25),
//     maximum: new Date(2017, 02, 15),
//     valueFormatString: "MMM YY"
//   },
//   axisY: {
//     title: "Number of Sales",
//     titleFontColor: "#4F81BC",
//     includeZero: true,
//     interval: 50
//     suffix: "mn"
//   },
//   data: [{
//     indexLabelFontColor: "darkSlateGray",
//     name: "views",
//     type: "area",
//     yValueFormatString: "#,##300",
//     dataPoints: [
//       { x: new Date(2015, 02, 1), y: 590.0, label: "Jan" },
//       { x: new Date(2015, 02, 1), y: 575.0, label: "Feb" },
//       { x: new Date(2015, 05, 1), y: 598.0, label: "Mar" },
//       { x: new Date(2015, 08, 1), y: 631.0, label: "Apr" },
//       { x: new Date(2015, 11, 1), y: 596.0, label: "May" },
//       { x: new Date(2016, 02, 1), y: 631.0, label: "Jun" },
//       { x: new Date(2016, 05, 1), y: 631.0, label: "Jul" },
//       { x: new Date(2016, 08, 1), y: 638.0, label: "Aug" },
//       { x: new Date(2016, 11, 1), y: 579.0, label: "Sep" },
//       { x: new Date(2016, 11, 1), y: 550.0, label: "Oct" },
//       { x: new Date(2016, 11, 1), y: 600.0, label: "Nov" },
//       { x: new Date(2020, 31, 12), y: 631.0, label: "Dec", indexLabel: "Highest", markerColor: "red" }
//     ]
//   }]
// });
// chart.render();

// }



//jQuery time
var current_fs, next_fs, previous_fs; //fieldsets
var left, opacity, scale; //fieldset properties which we will animate
var animating; //flag to prevent quick multi-click glitches

$(".next").click(function() {
  if (animating) return false;
  animating = true;

  current_fs = $(this).parent().parent();
  next_fs = $(this).parent().parent().next();
  console.log(current_fs, next_fs);
  //activate next step on progressbar using the index of next_fs
  $("#progressbar li").eq($("fieldset").index(next_fs)).addClass("active");

  //show the next fieldset
  next_fs.show();
  //hide the current fieldset with style
  current_fs.animate({
    opacity: 0
  }, {
    step: function(now, mx) {
      //as the opacity of current_fs reduces to 0 - stored in "now"
      //1. scale current_fs down to 80%
      scale = 1 - (1 - now) * 0.2;
      //2. bring next_fs from the right(50%)
      left = (now * 50) + "%";
      //3. increase opacity of next_fs to 1 as it moves in
      opacity = 1 - now;
      current_fs.css({
        // 'transform': 'scale('+scale+')',
        // 'position': 'absolute'
      });
      next_fs.css({
        'left': left,
        'opacity': opacity
      });
    },
    duration: 800,
    complete: function() {
      current_fs.hide();
      animating = false;
    },
    //this comes from the custom easing plugin
    easing: 'easeInOutBack'
  });
});

$(".previous").click(function() {
  if (animating) return false;
  animating = true;

  current_fs = $(this).parent().parent();
  previous_fs = $(this).parent().parent().prev();

  //de-activate current step on progressbar
  $("#progressbar li").eq($("fieldset").index(current_fs)).removeClass("active");

  //show the previous fieldset
  previous_fs.show();
  //hide the current fieldset with style
  current_fs.animate({
    opacity: 0
  }, {
    step: function(now, mx) {
      //as the opacity of current_fs reduces to 0 - stored in "now"
      //1. scale previous_fs from 80% to 100%
      scale = 0.8 + (1 - now) * 0.2;
      //2. take current_fs to the right(50%) - from 0%
      left = ((1 - now) * 50) + "%";
      //3. increase opacity of previous_fs to 1 as it moves in
      opacity = 1 - now;
      current_fs.css({
        'left': left
      });
      previous_fs.css({
        'opacity': opacity
      });
    },
    duration: 800,
    complete: function() {
      current_fs.hide();
      animating = false;
    },
    //this comes from the custom easing plugin
    easing: 'easeInOutBack'
  });
});

$(".submit").click(function() {
  return false;
})


$(document).ready(function() {
  $('.collapse').on('show.bs.collapse', function() {
    var id = $(this).attr('id');
    $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-faq');
    $('a[href="#' + id + '"] .panel-title span').html('<i class="glyphicon glyphicon-minus"></i>');
  });
  $('.collapse').on('hide.bs.collapse', function() {
    var id = $(this).attr('id');
    $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-faq');
    $('a[href="#' + id + '"] .panel-title span').html('<i class="glyphicon glyphicon-plus"></i>');
  });
});