/*
Template Name: Elitehospital Admin
Author: Themedesigner
Email: niravjoshi87@gmail.com
File: js
*/
"use strict";

// This is for Vertical carousel
$('.vcarousel').carousel({
        interval: 3000
    })
    // This is for Morris-chart
Morris.Area({
    element: 'morris-area-chart'
    , data: [{
            period: '2010'
            , iphone: 50
            , ipad: 80
            , itouch: 20
        }, {
            period: '2011'
            , iphone: 130
            , ipad: 100
            , itouch: 80
        }, {
            period: '2012'
            , iphone: 80
            , ipad: 60
            , itouch: 70
        }, {
            period: '2013'
            , iphone: 70
            , ipad: 200
            , itouch: 140
        }, {
            period: '2014'
            , iphone: 180
            , ipad: 150
            , itouch: 140
        }, {
            period: '2015'
            , iphone: 105
            , ipad: 100
            , itouch: 80
        }
        , {
            period: '2016'
            , iphone: 250
            , ipad: 150
            , itouch: 200
        }]
    , xkey: 'period'
    , ykeys: ['iphone', 'ipad', 'itouch']
    , labels: ['iPhone', 'iPad', 'iPod Touch']
    , pointSize: 3
    , fillOpacity: 0
    , pointStrokeColors: ['#00bfc7', '#fdc006', '#9675ce']
    , behaveLikeLine: true
    , gridLineColor: '#e0e0e0'
    , lineWidth: 3
    , hideHover: 'auto'
    , lineColors: ['#00bfc7', '#fdc006', '#9675ce']
    , resize: true
});
// This is for Morris-chart-2
Morris.Area({
    element: 'morris-area-chart2'
    , data: [{
            period: '2010'
            , SiteA: 0
            , SiteB: 0
        , }, {
            period: '2011'
            , SiteA: 130
            , SiteB: 100
        , }, {
            period: '2012'
            , SiteA: 80
            , SiteB: 60
        , }, {
            period: '2013'
            , SiteA: 70
            , SiteB: 200
        , }, {
            period: '2014'
            , SiteA: 180
            , SiteB: 150
        , }, {
            period: '2015'
            , SiteA: 105
            , SiteB: 90
        , }
        , {
            period: '2016'
            , SiteA: 250
            , SiteB: 150
        , }]
    , xkey: 'period'
    , ykeys: ['SiteA', 'SiteB']
    , labels: ['Site A', 'Site B']
    , pointSize: 0
    , fillOpacity: 0.4
    , pointStrokeColors: ['#b4becb', '#01c0c8']
    , behaveLikeLine: true
    , gridLineColor: '#e0e0e0'
    , lineWidth: 0
    , smooth: false
    , hideHover: 'auto'
    , lineColors: ['#b4becb', '#01c0c8']
    , resize: true
});
// This is for Counter
$(".counter").counterUp({
    delay: 100
    , time: 1200
});
// This is for Sparkline-chart
var sparklineLogin = function () {
    $("#sparkline1dash").sparkline([0, 23, 43, 35, 44, 45, 56, 37, 40, 45, 56, 7, 10], {
        type: 'line'
        , width: '100%'
        , height: '70'
        , lineColor: '#fff'
        , fillColor: 'transparent'
        , spotColor: '#fff'
        , minSpotColor: undefined
        , maxSpotColor: undefined
        , highlightSpotColor: undefined
        , highlightLineColor: undefined
    });
    $('#sparkline2dash').sparkline([10, 12, 9, 6, 10, 9, 11, 9, 10, 12, 9, 11, 9, 10, 12, ], {
        type: 'bar'
        , height: '70'
        , barWidth: '5'
        , resize: true
        , barSpacing: '10'
        , barColor: '#fff'
    });
    $("#sparkline3dash").sparkline([0, 23, 43, 35, 44, 45, 56, 37, 40, 45, 56, 7, 10], {
        type: 'line'
        , width: '100%'
        , height: '70'
        , lineColor: '#fff'
        , fillColor: 'transparent'
        , spotColor: '#fff'
        , minSpotColor: undefined
        , maxSpotColor: undefined
        , highlightSpotColor: undefined
        , highlightLineColor: undefined
    });
    $('#sparkline4dash').sparkline([10, 12, 9, 6, 10, 9, 11, 9, 10, 12, 9, 11, 9, 10, 12, ], {
        type: 'bar'
        , height: '70'
        , barWidth: '5'
        , resize: true
        , barSpacing: '10'
        , barColor: '#fff'
    });
    $('#sales1').sparkline([20, 40, 30], {
        type: 'pie'
        , height: '100'
        , resize: true
        , sliceColors: ['#808f8f', '#fecd36', '#f1f2f7']
    });
    $('#sales2').sparkline([6, 10, 9, 11, 9, 10, 12], {
        type: 'bar'
        , height: '154'
        , barWidth: '4'
        , resize: true
        , barSpacing: '10'
        , barColor: '#25a6f7'
    });
    $("#sparkline8").sparkline([2, 4, 4, 6, 8, 5, 6, 4, 8, 6, 6, 2], {
        type: 'line'
        , width: '100%'
        , height: '50'
        , lineColor: '#99d683'
        , fillColor: '#99d683'
        , maxSpotColor: '#99d683'
        , highlightLineColor: 'rgba(0, 0, 0, 0.2)'
        , highlightSpotColor: '#99d683'
    });
    $("#sparkline9").sparkline([0, 2, 8, 6, 8, 5, 6, 4, 8, 6, 6, 2], {
        type: 'line'
        , width: '100%'
        , height: '50'
        , lineColor: '#13dafe'
        , fillColor: '#13dafe'
        , minSpotColor: '#13dafe'
        , maxSpotColor: '#13dafe'
        , highlightLineColor: 'rgba(0, 0, 0, 0.2)'
        , highlightSpotColor: '#13dafe'
    });
    $("#sparkline10").sparkline([2, 4, 4, 6, 8, 5, 6, 4, 8, 6, 6, 2], {
        type: 'line'
        , width: '100%'
        , height: '50'
        , lineColor: '#ffdb4a'
        , fillColor: '#ffdb4a'
        , maxSpotColor: '#ffdb4a'
        , highlightLineColor: 'rgba(0, 0, 0, 0.2)'
        , highlightSpotColor: '#ffdb4a'
    });
}
var sparkResize;
$(window).resize(function (e) {
    clearTimeout(sparkResize);
    sparkResize = setTimeout(sparklineLogin, 100);
});
sparklineLogin();
var icons = new Skycons({
        "color": "#2b2b2b"
    })
    , list = [
            "clear-day", "clear-night", "partly-cloudy-day"
            , "partly-cloudy-night", "cloudy", "rain", "sleet", "snow", "wind"
            , "fog"
          ]
    , i;
for (i = list.length; i--;) {
    var weatherType = list[i]
        , elements = document.getElementsByClassName(weatherType);
    for (e = elements.length; e--;) {
        icons.set(elements[e], weatherType);
    }
}
icons.play();