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');
        }
    };
}

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;
}
// Function to accept only numeric values
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;
}
jQuery(window).on('scroll', function() {
    (function($) {
        stickyHeader();
    })(jQuery);
});

if ($(".navigation").length) {
    $(".navigation .navbar button").on("click", function() {
        $(".navigation .menu").slideToggle();
        $(this).toggleClass('open');
        return false;
    });
    $(".navigation .cs-submenu").children("a").append(function() {
        return '<button class="dropdown-expander"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/></svg></button>';
    });

}

if (document.documentElement.clientWidth < 1023) {
    $(".navigation .menu .dropdown-expander").on("click", function() {
        $(this).parent().parent().children(".cs-dropdown").slideToggle();
        console.log($(this).parents("li"));
        console.log($(this).parents().children(".dropdown-expander").toggleClass("rotated"));
        return false
    })
    $(document).click(function(e) {
        if (!$(e.target).closest('.navigation .navbar button').length) {
            $('.navigation .menu').stop(true).slideUp();
            $(".navigation .navbar button").removeClass('open');

        }
    });
}

jQuery(document).ready(function($) {
    $("#contact_form").validate({
        rules: {
            names: "required",
            messages: "required",
            locations: "required",
            emails: {
                required: true,
                emails: true
            },
            mobiles: {
                required: true,
                number: true,
                minlength: 7,
                maxlength: 12
            }
        },
        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 7-12 digits long",
                maxlength: "Your Mobile No. must be at least 7-12 digits long",
            }
        },
    })
});

jQuery(document).ready(function($) {
    $("#quick_form").validate({
        rules: {
            names: "required",
            messages: "required",
            locations: "required",
            emails: {
                required: true,
                emails: true
            },
            mobiles: {
                required: true,
                number: true,
                minlength: 7,
                maxlength: 12
            }
        },
        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 7-12 digits long",
                maxlength: "Your Mobile No. must be at least 7-12 digits long",
            }
        },
    })
});



jQuery(document).ready(function($) {
    $("#product_pop_form2").validate({
        rules: {
            unames: "required",
            umessages: "required",
            ulocations: "required",
            uemails: {
                required: true,
                uemails: true
            },
            umobiles: {
                required: true,
                number: true,
                minlength: 7,
                maxlength: 12
            }
        },
        umessages: {
            unames: "Please enter your name",
            umessages: "Please enter message",
            uemails: {
                required: "Please enter your email address"
            },
            ulocations: "Please enter your location",
            umobiles: {
                required: "Please enter your mobile no.",
                number: "Mobile No. contains only numbers",
                minlength: "Your Mobile No. must be at least 7-12 digits long",
                maxlength: "Your Mobile No. must be at least 7-12 digits long",
            }
        },
    })
});

var homeSlider = $("#slider");
homeSlider.owlCarousel({
    loop: true,
    margin: 0,
    navSpeed: 500,
    nav: true,
    navText: ['<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"/></svg>', '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/></svg>'],
    autoplay: true,
    dots: false,
    animateOut: "fadeOut",
    items: 1
});

var products = $("#products");
products.owlCarousel({
    loop: true,
    margin: 10,
    navSpeed: 500,
    nav: true,
    navText: ['<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"/></svg>', '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/></svg>'],
    autoplay: false,
    dots: false,
    items: 4,
    responsiveClass: true,
    responsive: {
        0: {
            items: 1
        },
        600: {
            items: 1,
        },
        768: {
            items: 2,
        },
        650: {
            items: 1,
        },
        1024: {
            items: 4
        },
        1100: {
            items: 4
        }
    }
});

var testimonials = $("#testimonials");
testimonials.owlCarousel({
    loop: true,
    margin: 15,
    navSpeed: 500,
    nav: false,
    navText: ['<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"/></svg>', '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/></svg>'],
    autoplay: false,
    dots: false,
    items: 1,
    responsiveClass: true,
    responsive: {
        0: {
            items: 1
        },
        600: {
            items: 1,
        },
        1024: {
            items: 2
        },
        1100: {
            items: 2
        }
    }
});
var clients = $("#clients");
clients.owlCarousel({
    loop: true,
    margin: 10,
    navSpeed: 500,
    nav: false,
    navText: ['<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"/></svg>', '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/></svg>'],
    autoplay: false,
    dots: true,
    items: 6,
    responsiveClass: true,
    responsive: {
        0: {
            items: 2
        },
        600: {
            items: 3,
        },
        1024: {
            items: 5
        },
        1100: {
            items: 6
        }
    }
});
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;
});
  //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);