//disabling context menu
document.onkeydown = function (e) {
    if (e.ctrlKey &&
        (e.keyCode === 67 ||
            e.keyCode === 86 ||
            e.keyCode === 85 ||
            e.keyCode === 117)) {
        return false;
    } else {
        return true;
    }
};
$(document).keypress("u", function (e) {
    if (e.ctrlKey) {
        return false;
    }
    else {
        return true;
    }
});
document.addEventListener("contextmenu", function (e) {
    e.preventDefault();
}, false);

function stickyHeader() {
    if ($('.navigation_bar').length) {
        var strickyScrollPos = 100;
        if ($(window).scrollTop() > strickyScrollPos) {
            $('.navigation_bar').removeClass('fadeIn animated');
            $('.navigation_bar').addClass('stricky-fixed fadeInDown animated');
        } else if ($(this).scrollTop() <= strickyScrollPos) {
            $('.navigation_bar').removeClass('stricky-fixed fadeInDown animated');
            $('.navigation_bar').addClass('slideIn animated');
        }
    };
}

jQuery(window).on('scroll', function() {
    (function($) {
        stickyHeader();
    })(jQuery);
});


if ($('.navigation').length) {
    $('.navigation .navbar button').on('click', function() {
        $('.navigation .menu').slideToggle();
        return false;
    });
    $('.navigation .cs-submenu').children('a').append(function() {
        return '<button class="dropdown-expander"><i class="fa fa-chevron-down"></i></button>';
    });
    $('.navigation .menu .dropdown-expander').on('click', function() {
        $(this).parent().parent().children('.cs-dropdown').slideToggle();
        console.log($(this).parents('li'));
        return false;
    });
}

var sliderInit = $('.slick-slider-init');
$(document).ready(function() {
    sliderInit.slick({
        autoplay: true,
        autoplaySpeed: 2700,
        infinite: true
    });

    sliderInit.slickAnimation();
});

$(".results").slick({
    dots: true,
    infinite: true,
    autoplay: true,
    slidesToShow: 4,
    slidesToScroll: 1,
    responsive: [{
        breakpoint: 1024,
        settings: {
            slidesToShow: 4,
            slidesToScroll: 1,
            infinite: true,
            dots: true
        }
    }, {
        breakpoint: 600,
        settings: {
            slidesToShow: 2,
            slidesToScroll: 1
        }
    }, {
        breakpoint: 480,
        settings: {
            slidesToShow: 1,
            slidesToScroll: 1
        }
    }]
});


$(".wps_featured").slick({
    dots: false,
    infinite: true,
    autoplay: true,
    slidesToShow: 3,
    slidesToScroll: 1,
    responsive: [{
            breakpoint: 1024,
            settings: {
                slidesToShow: 3,
                slidesToScroll: 3,
                infinite: true,
                dots: true
            }
        },
        {
            breakpoint: 600,
            settings: {
                slidesToShow: 2,
                slidesToScroll: 2
            }
        },
        {
            breakpoint: 480,
            settings: {
                slidesToShow: 1,
                slidesToScroll: 1
            }
        }
    ]
});


$(".h_blog").slick({
    dots: true,
    infinite: true,
    arrows: false,
    autoplay: true,
    slidesToShow: 3,
    slidesToScroll: 1,
    responsive: [{
            breakpoint: 1024,
            settings: {
                slidesToShow: 3,
                slidesToScroll: 1,
                infinite: true,
                dots: true
            }
        },
        {
            breakpoint: 600,
            settings: {
                slidesToShow: 2,
                slidesToScroll: 2
            }
        },
        {
            breakpoint: 480,
            settings: {
                slidesToShow: 1,
                slidesToScroll: 1
            }
        }
    ]
});


$(".web-pulse-testimonials").slick({
    dots: false,
    infinite: true,
    autoplay: true,
    arrows: false,
    slidesToShow: 2,
    slidesToScroll: 1,
    responsive: [{
            breakpoint: 1024,
            settings: {
                slidesToShow: 2,
                slidesToScroll: 1,
                infinite: true,
                dots: true
            }
        },
        {
            breakpoint: 600,
            settings: {
                slidesToShow: 2,
                slidesToScroll: 2
            }
        },
        {
            breakpoint: 480,
            settings: {
                slidesToShow: 1,
                slidesToScroll: 1
            }
        }
    ]
});

$(".trade_partner").slick({
    dots: true,
    infinite: true,
    arrows: false,
    autoplay: true,
    slidesToShow: 5,
    slidesToScroll: 5,
    responsive: [{
            breakpoint: 1024,
            settings: {
                slidesToShow: 5,
                slidesToScroll: 5,
                infinite: true,
                dots: true
            }
        },
        {
            breakpoint: 650,
            settings: {
                slidesToShow: 2,
                slidesToScroll: 2
            }
        },
        {
            breakpoint: 480,
            settings: {
                slidesToShow: 2,
                slidesToScroll: 2
            }
        }
    ]
});


wow = new WOW({
    animateClass: 'animated',
    offset: 100,
    mobile: false
});
wow.init();
$(window).on('scroll', function() {
    if ($(this).scrollTop() > 100) {
        $('#web-pulse-scroll-up').fadeIn();
    } else {
        $('#web-pulse-scroll-up').fadeOut();
    }
});
$('#web-pulse-scroll-up').on('click', function() {
    $("html, body").animate({
        scrollTop: 0
    }, 600);
    return false;
});

jQuery(document).ready(function($) {
    $("#quick_form").validate({
        rules: {
            names: "required",
            messages: {
                required: true,

            },
            locations: {
                required: true,

            },
            emails: {
                required: true,

            },
            mobiles: {
                required: true,
                number: true,
                minlength: 10,
            }
        },
        messages: {
            names: "Please enter your name",
            messages: "Please enter message",
            emails: {
                required: "Please enter your email address"
            },
            locations: "Please enter your location",
            mobiles: {
                required: "Please enter your mobile no.",
                number: "Mobile No. contains only numbers",
                minlength: "Your Mobile No. must be at least 10 characters long",
            }
        },
    })
});
jQuery(document).ready(function($) {
    $("#quick_enquiry").validate({
        rules: {
            names: "required",
            messages: {
                required: true,

            },
            locations: {
                required: true,

            },
            emails: {
                required: true,

            },
            mobiles: {
                required: true,
                number: true,
                minlength: 10,
            }
        },
        messages: {
            names: "Please enter your name",
            messages: "Please enter message",
            emails: {
                required: "Please enter your email address"
            },
            locations: "Please enter your location",
            mobiles: {
                required: "Please enter your mobile no.",
                number: "Mobile No. contains only numbers",
                minlength: "Your Mobile No. must be at least 10 characters long",
            }
        },
    })
});


$(".product_slide").slick({
    dots: false,
    infinite: true,
    autoplay: false,
    arrows: true,
    slidesToShow: 1,
    slidesToScroll: 1
});

$(".feature_blog").slick({
    dots: true,
    infinite: true,
    autoplay: true,
    arrows: false,
    slidesToShow: 1,
    slidesToScroll: 1
});

function isNumberKey(evt) {
    //var e = evt || window.event;
    var charCode = (evt.which) ? evt.which : evt.keyCode
    if (charCode != 46 && charCode > 31 &&
        (charCode < 48 || charCode > 57))
        return false;
    return true;
}

function ValidateAlpha(evt) {
    var keyCode = (evt.which) ? evt.which : evt.keyCode
    if ((keyCode < 65 || keyCode > 90) && (keyCode < 97 || keyCode > 123) && keyCode != 32)

        return false;
    return true;
}

  