

// MMenu Init

if($(window).width() <= 1023){

	$("#menu").mmenu({
    "offCanvas": {
      "position": "left" 
  }
	});
}



// Animation

AOS.init({

  disable: function() {

    var maxWidth = 1023;

    return window.innerWidth < maxWidth;

  }

});



 

 // Header Fixed   

 $(window).scroll(function () {

 	var height = $(window).scrollTop();

 	if (height >100) {

 		$('header').addClass('header-fixed');

 	}

 	else if (height == 0) {

 		$('header').removeClass('header-fixed');

 	}

 }); 



// Menu Active 

jQuery(document).ready(function($){

    var path = window.location.pathname.split("/").pop();

  

    // Account for home page with empty path

    if ( path == '' ) {

      path = 'index.html';

    }

     

    var target = $('#menu li a[href="'+path+'"]');

    // Add active class to target link

    target.parents("li").addClass('active');

    target.parents("li").parent("li").addClass('active');

});





 /*

* This is the plugin

*/

(function(a){a.createModal=function(b){defaults={title:"",message:"Your Message Goes Here!",closeButton:true,scrollable:false};var b=a.extend({},defaults,b);var c=(b.scrollable===true)?'style="max-height: 420px;overflow-y: auto;"':"";html='<div class="modal fade" id="myModal">';html+='<div class="modal-dialog">';html+='<div class="modal-content">';html+='<div class="modal-header">';html+='<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>';if(b.title.length>0){html+='<h4 class="modal-title">'+b.title+"</h4>"}html+="</div>";html+='<div class="modal-body" '+c+">";html+=b.message;html+="</div>";html+='<div class="modal-footer">';if(b.closeButton===true){html+='<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>'}html+="</div>";html+="</div>";html+="</div>";html+="</div>";a("body").prepend(html);a("#myModal").modal().on("hidden.bs.modal",function(){a(this).remove()})}})(jQuery);



/*

* Here is how you use it

*/

$(function(){    

    $('.view-pdf').on('click',function(){

		var $this = $(this),

        pdf_link = $this.attr('href'),

        title = $this.data('report'),

        iframe = '<div class="iframe-container"><iframe src="'+pdf_link+'"></iframe></div>'

        $.createModal({

			title: title,

			message: iframe,

			closeButton:true,

			scrollable:false

        });

        return false;        

    });    

})