PageSourceSearch

https://sams.ac.uk/t4-media/sams/admin-assets/js/custom.js

js sams.ac.uk collected 2026-10-02 02:54:39 UTC 38,187 bytes, 1,379 lines download raw bytes

1/*
2
3Template:  The Corps - Responsive Multi-purpose HTML5 Template
4Author: potenzaglobalsolutions.com
5Version: 2.0
6Design and Developed by: potenzaglobalsolutions.com
7
8NOTE:  
9
10*/
11
12
13/*================================================
14[  Table of contents  ]
15================================================
16 
17:: Preloader
18:: Contact popup
19:: Search
20:: Login
21:: Mega menu
22:: Owl carousel
23:: Tooltip
24:: Our skills
25:: Socialstream
26:: Side menu
27:: Isotope
28:: Back to top
29:: Accordion
30:: Sliderbar menu
31:: Audio video
32:: Tabs
33:: Rain
34:: Skills 2
35:: Countdown
36:: Ripple
37:: Placeholder
38:: wow
39:: Raindrops
40:: Parallax banner
41:: Mobile slider
42 
43======================================
44[ End table content ]
45======================================*/
46
47
48/*************************
49       preloader
50*************************/
51
52 $(window).load(function() {
53      //preloader
54     $("#load").fadeOut();
55     $('#preloader').delay(2000).fadeOut('slow');
56  });
57 
58
59/*************************
60       typer
61*************************/
62
63if($(".image-holder-2-bg").length != 0) {
64    var win = $(window),
65    foo = $('#typer');
66    foo.typer(['<h2>UX/UI Designer / Web Developer </h2>', '<h2>frontend developer</h2>' ]);
67    
68      win.resize(function(){
69         var fontSize = Math.max(Math.min(win.width() / (1 * 10), parseFloat(Number.POSITIVE_INFINITY)), parseFloat(Number.NEGATIVE_INFINITY));
70            foo.css({
71               fontSize: fontSize * .3 + 'px'
72             });
73        }).resize();
74      } 
75
76
77/*************************
78    contact popup
79*************************/
80
81  $('#contact-btn').click(function() {
82    $(this).next().toggle('slow');
83    return false;
84  });
85
86
87/*************************
88       search
89*************************/
90
91$(".search-close").click(function(){
92        $(".search-open").fadeOut(500);
93    });
94$(".search").click(function(){
95    $(".search-open").fadeIn(500);
96}); 
97$('.search').click(function() {
98       $('body').addClass('top-search-open')
99});
100$('.search-close').click(function() {
101       $('body').removeClass('top-search-open')
102});
103
104// search 2
105$(".search-2-close").click(function(){
106        $(".search-2-open").fadeOut(500);
107    });
108$(".search-2").click(function(){
109    $(".search-2-open").fadeIn(500);
110});
111
112// search-3
113  if (jQuery('.search-3').size() > 0) {
114       jQuery('.search-btn').on("click", function () {
115           jQuery('.search-3').toggleClass("search-3-open");
116             return false;
117            });
118         jQuery("html, body").on('click', function (e) {
119          if (!jQuery(e.target).hasClass("not-click")) {
120               jQuery('.search-3').removeClass("search-3-open");
121           }
122       });
123      }
124// search-4
125 $(".search-4 a").click(function() {
126  $(this).parent(".search-4").toggleClass("collapsed");
127});
128
129  
130/*************************
131       login
132*************************/ 
133
134$(document).ready(function() {
135    $(".login").click(function(e) {
136        $(".login-open").fadeToggle();
137        e.stopPropagation();
138    });
139    $(document).click(function(e) {
140        if (!$(e.target).is('.login-open, .login-open *')) {
141            $(".login-open").hide();
142        }
143    });
144});
145
146/*************************
147       mega menu
148*************************/
149    
150        jQuery(document).ready(function () {
151            jQuery('#menu-1').megaMenu({
152                // DESKTOP MODE SETTINGS
153                logo_align          : 'left',         // align the logo left or right. options (left) or (right)
154                links_align         : 'left',        // align the links left or right. options (left) or (right)
155                socialBar_align     : 'left',    // align the socialBar left or right. options (left) or (right)
156                searchBar_align     : 'right',   // align the search bar left or right. options (left) or (right)
157                trigger             : 'hover',           // show drop down using click or hover. options (hover) or (click)
158                effect              : 'fade',             // drop down effects. options (fade), (scale), (expand-top), (expand-bottom), (expand-left), (expand-right)
159                effect_speed        : 400,          // drop down show speed in milliseconds
160                sibling             : true,              // hide the others showing drop downs if this option true. this option works on if the trigger option is "click". options (true) or (false)
161                outside_click_close : true,  // hide the showing drop downs when user click outside the menu. this option works if the trigger option is "click". options (true) or (false)
162                top_fixed           : false,           // fixed the menu top of the screen. options (true) or (false)
163                sticky_header       : true,       // menu fixed on top when scroll down down. options (true) or (false)
164                sticky_header_height: 250,  // sticky header height top of the screen. activate sticky header when meet the height. option change the height in px value.
165                menu_position       : 'horizontal',    // change the menu position. options (horizontal), (vertical-left) or (vertical-right)
166                full_width          : false,           // make menu full width. options (true) or (false)
167                // MOBILE MODE SETTINGS
168                mobile_settings     : {
169                    collapse            : true,    // collapse the menu on click. options (true) or (false)
170                    sibling             : true,      // hide the others showing drop downs when click on current drop down. options (true) or (false)
171                    scrollBar           : true,    // enable the scroll bar. options (true) or (false)
172                    scrollBar_height    : 450,  // scroll bar height in px value. this option works if the scrollBar option true.
173                    top_fixed           : false,       // fixed menu top of the screen. options (true) or (false)
174                    sticky_header       : false,   // menu fixed on top when scroll down down. options (true) or (false)
175                    sticky_header_height: 200   // sticky header height top of the screen. activate sticky header when meet the height. option change the height in px value.
176                }
177            });
178        }); 
179// menu-2
180   jQuery(document).ready(function () {
181       jQuery('#menu-2').megaMenu({
182          sticky_header       : true,       // menu fixed on top when scroll down down. options (true) or (false)
183          sticky_header_height: 1000,  // sticky header height top of the screen. activate sticky header when meet the height. option change the height in px value.
184          // MOBILE MODE SETTINGS
185          mobile_settings     : {
186          collapse            : true    // collapse the menu on click. options (true) or (false)
187          }
188       });
189    }); 
190// menu-3
191/*************************
192       mega menu
193*************************/
194    
195        jQuery(document).ready(function () {
196            jQuery('#menu-5').megaMenu({
197                // DESKTOP MODE SETTINGS
198                logo_align          : 'left',         // align the logo left or right. options (left) or (right)
199                links_align         : 'left',        // align the links left or right. options (left) or (right)
200                socialBar_align     : 'left',    // align the socialBar left or right. options (left) or (right)
201                searchBar_align     : 'right',   // align the search bar left or right. options (left) or (right)
202                trigger             : 'hover',           // show drop down using click or hover. options (hover) or (click)
203                effect              : 'fade',             // drop down effects. options (fade), (scale), (expand-top), (expand-bottom), (expand-left), (expand-right)
204                effect_speed        : 400,          // drop down show speed in milliseconds
205                sibling             : true,              // hide the others showing drop downs if this option true. this option works on if the trigger option is "click". options (true) or (false)
206                outside_click_close : true,  // hide the showing drop downs when user click outside the menu. this option works if the trigger option is "click". options (true) or (false)
207                top_fixed           : false,           // fixed the menu top of the screen. options (true) or (false)
208                sticky_header       : false,       // menu fixed on top when scroll down down. options (true) or (false)
209                sticky_header_height: 250,  // sticky header height top of the screen. activate sticky header when meet the height. option change the height in px value.
210                menu_position       : 'horizontal',    // change the menu position. options (horizontal), (vertical-left) or (vertical-right)
211                full_width          : false,           // make menu full width. options (true) or (false)
212                // MOBILE MODE SETTINGS
213                mobile_settings     : {
214                    collapse            : true,    // collapse the menu on click. options (true) or (false)
215                    sibling             : true,      // hide the others showing drop downs when click on current drop down. options (true) or (false)
216                    scrollBar           : true,    // enable the scroll bar. options (true) or (false)
217                    scrollBar_height    : 400,  // scroll bar height in px value. this option works if the scrollBar option true.
218                    top_fixed           : false,       // fixed menu top of the screen. options (true) or (false)
219                    sticky_header       : false,   // menu fixed on top when scroll down down. options (true) or (false)
220                    sticky_header_height: 200   // sticky header height top of the screen. activate sticky header when meet the height. option change the height in px value.
221                }
222            });
223        }); 
224
225
226 // vertical-left
227   jQuery(document).ready(function () {
228     jQuery('#menu-3').megaMenu({
229         menu_position:'vertical-left',
230         effect : 'expand-left'
231      });
232   });
233
234 // vertical-left
235   jQuery(document).ready(function () {
236     jQuery('#menu-4').megaMenu({
237         menu_position:'vertical-right',
238         effect : 'expand-right'
239      });
240   });
241
242
243/*************************
244      owl-carousel
245*************************/
246 
247$('.owl-carousel-1').owlCarousel({
248	 items:1,
249     loop:true,
250     animateOut: 'fadeOut',
251     autoplay:false,
252     autoplayTimeout:1000,
253     autoplayHoverPause:true, 
254     dots:false,
255     nav:true,
256      navText:[
257            "<i class='fa fa-angle-left fa-2x'></i>",
258            "<i class='fa fa-angle-right fa-2x'></i>"
259        ]
260    });
261
262$('.owl-carousel-2').owlCarousel({
263	 items:1,
264     loop:true,
265     autoplay:false,
266     autoplayTimeout:2000,
267     autoplayHoverPause:true, 
268     dots:false,
269     nav:true,
270      navText:[
271            "<i class='fa fa-long-arrow-left fa-2x'></i>",
272            "<i class='fa fa-long-arrow-right fa-2x'></i>"
273        ]
274        
275    });
276
277$('.owl-carousel-3').owlCarousel({
278     items:3,
279      responsive:{
280        0:{
281            items:1
282        },
283        600:{
284            items:2
285        },
286        1000:{
287            items:3
288        }
289    },
290     margin:20,
291     loop:true,
292     autoplay:false,
293     autoplayTimeout:2000,
294     autoplayHoverPause:true, 
295     dots:false,
296     nav:true,
297     navText:[
298            "<i class='fa fa-angle-left fa-2x'></i>",
299            "<i class='fa fa-angle-right fa-2x'></i>"
300        ]
301    });
302
303 $('.owl-carousel-4').owlCarousel({
304     items:1,
305     loop:true,
306     autoplay:false,
307     autoplayTimeout:3000,
308     autoplayHoverPause:true, 
309     dots:false,
310     smartSpeed:1000,
311     nav:true,
312     navText:[
313            "<i class='fa fa-long-arrow-right fa-2x'></i>",
314            "<i class='fa fa-long-arrow-left fa-2x'></i>"
315        ]
316    });
317
318 $('.owl-carousel-5').owlCarousel({
319     items:4,
320     loop:true,
321     autoplay:false,
322     autoplayTimeout:2500,
323     smartSpeed:1000,
324     autoplayHoverPause:true, 
325     dots:false,
326     nav:false,
327     responsive:{
328        0:{
329            items:1
330        },
331        600:{
332            items:3
333        },
334        1000:{
335            items:4
336        }
337     }
338    });
339
340
341  $('.owl-carousel-6').owlCarousel({
342     items:1,
343     loop:true,
344     autoplay:true,
345     autoplayTimeout:2000, 
346     autoplayHoverPause:true, 
347     dots:false,
348     autoHeight:true,
349     nav:true,
350     navText:[
351            "<i class='fa fa-long-arrow-left fa-2x'></i>",
352            "<i class='fa fa-long-arrow-right fa-2x'></i>"
353        ]
354    });
355 
356  $('.owl-carousel-7').owlCarousel({
357     items:4,
358     responsive:{
359        0:{
360            items:1
361        },
362        600:{
363            items:2
364        },
365        1000:{
366            items:4
367        }
368    },
369     loop:true,
370     autoplay:true,
371     autoplayTimeout:2000,
372     autoplayHoverPause:true, 
373     dots:false,
374     autoHeight:true,
375     nav:true,
376     navText:[
377            "<i class='fa fa-angle-right fa-2x'></i>",
378            "<i class='fa fa-angle-left fa-2x'></i>"
379        ]
380    });
381 
382
383   $('.owl-carousel-8').owlCarousel({
384     items:5,
385     responsive:{
386        0:{
387            items:1
388        },
389        600:{
390            items:2
391        },
392        1000:{
393            items:5
394        }
395    },
396     loop:true,
397     autoplay:true,
398     autoplayTimeout:2000,
399     autoplayHoverPause:true, 
400     dots:false,
401     autoHeight:true,
402     nav:true,
403     navText:[
404            "<i class='fa fa-long-arrow-right fa-2x'></i>",
405            "<i class='fa fa-long-arrow-left fa-2x'></i>"
406        ]
407    });
408
409
410  $('.owl-carousel-9').owlCarousel({
411     items:1,
412     loop:true,
413     autoplay:true,
414     autoplayTimeout:3000,
415     autoplayHoverPause:true,  
416     smartSpeed:1000,
417     dots:false,
418     autoHeight:true,
419     nav:true,
420     navText:[
421            "<i class='fa fa-long-arrow-right fa-2x'></i>",
422            "<i class='fa fa-long-arrow-left fa-2x'></i>"
423        ]
424    });
425 
426 $('.owl-carousel-10').owlCarousel({
427     items:4,
428     responsive:{
429        0:{
430            items:1
431        },
432        600:{
433            items:2     
434        },
435        1000:{
436            items:4
437        }
438    },
439    dots:false,
440    loop:true,
441    autoplay:true,
442    autoplayTimeout:6500,
443    smartSpeed:2000,
444    autoplayHoverPause:true   
445    });
446
447  
448  $('.owl-carousel-11').owlCarousel({
449     items:4,
450     margin:25,
451     responsive:{
452        0:{
453            items:1
454        },
455        600:{
456            items:2
457        },
458        1000:{
459            items:4
460        }
461    },
462     loop:true,
463     autoplay:true,
464     autoplayTimeout:2500, 
465     smartSpeed:1000,
466     autoplayHoverPause:true,  
467     dots:false,
468     autoHeight:true,
469     nav:true,
470     navText:[
471            "<i class='fa fa-angle-right fa-2x'></i>",
472            "<i class='fa fa-angle-left fa-2x'></i>"
473        ]
474    });
475 
476 $('.owl-carousel-12').owlCarousel({
477    items:1,
478     loop:true,
479     autoplay:true,
480     autoplayTimeout:2500,
481     smartSpeed:1000,
482     autoplayHoverPause:true,  
483     dots:true,
484     autoHeight:true,
485     nav:false
486    });
487
488 $('.owl-carousel-13').owlCarousel({
489     items:3,
490     responsive:{
491        0:{
492            items:1
493        },
494        600:{
495            items:2
496        },
497        1000:{
498            items:3
499        }
500    },
501     autoplay:true,
502     autoplayTimeout:2000,
503     autoplayHoverPause:true,
504     dots:false,
505     autoHeight:true,
506     nav:true,
507     navText:[
508            "<i class='fa fa-angle-right fa-2x'></i>",
509            "<i class='fa fa-angle-left fa-2x'></i>"
510        ]
511    });
512$('.owl-carousel-14').owlCarousel({
513     items:1,
514     loop:true,
515     autoplay:true,
516     autoplayTimeout:3000,
517     autoplayHoverPause:true,  
518     dots:false,
519     autoHeight:true,
520     nav:false
521    });
522$('.owl-carousel-15').owlCarousel({
523    loop:true,
524    margin:10,
525    autoplay:true,
526    autoplayTimeout:4000,
527    autoplayHoverPause:true,
528    nav:false,
529    responsive:{
530        0:{
531            items:1
532        },
533        600:{
534            items:3
535        },
536        1000:{
537            items:5
538        }
539    }
540})
541
542$('.owl-carousel-16').owlCarousel({
543    loop:true,
544    margin:10,
545    autoplay:true,
546    autoplayTimeout:1000,
547    autoplayHoverPause:true,
548    nav:false, 
549    responsive:{
550        0:{
551            items:1
552        },
553        600:{
554            items:2
555        },
556        1000:{
557            items:3
558        }
559    }
560})
561
562$('.owl-carousel-17').owlCarousel({
563  loop:true,
564  items:4,
565    margin:10,
566    autoplay:true,
567    autoplayTimeout:8000,
568    smartSpeed:2000,
569    autoplayHoverPause:true,
570    nav:false,
571    dots:false  
572});  
573
574
575$('.owl-carousel-18').owlCarousel({
576   items:1,
577   loop:true,
578    margin:10,
579    autoHeight:true,
580    autoplay:true,
581    autoplayTimeout:1500,
582    autoplayHoverPause:true,
583    nav:false
584});
585 
586 $('.owl-carousel-19').owlCarousel({
587   items:1,
588   loop:true,
589    margin:10,
590    autoHeight:true,
591    autoplay:true,
592    autoplayTimeout:5500,
593    smartSpeed:2000,
594    autoplayHoverPause:true,
595    nav:true,
596    dots:true
597});
598 
599  $('.owl-carousel-20').owlCarousel({
600   items:1,
601   loop:true,
602    margin:10,
603    autoHeight:true,
604    autoplay:true,
605    autoplayTimeout:1500,
606    smartSpeed:2000,
607    autoplayHoverPause:true,
608    nav:false,
609    dots:true
610});
611 
612$('.owl-carousel-45').owlCarousel({
613  items:2,
614    loop:true,
615    margin:10,
616    autoplay:false,
617    autoplayTimeout:4000,
618    autoplayHoverPause:true,
619    nav:false,
620    responsive:{
621        0:{
622            items:1
623        },
624        600:{
625            items:3
626        },
627        1000:{
628            items:5
629        }
630    }
631})
632
633/*************************
634     php contact form 
635*************************/
636
637$(document).ready(function(){
638  $( "#contactform" ).submit(function( event ) {
639    $("#ajaxloader").show();
640    $("#contactform").hide();
641    $.ajax({
642      url:'php/contact-form.php',
643      data:$(this).serialize(),
644      type:'post',
645      success:function(response){
646        $("#ajaxloader").hide();
647        $("#contactform").show();
648        $("#contactform").find("input, textarea").val("");
649        $("#formmessage").html(response).show().delay(2000).fadeOut('slow');
650      }
651    });
652    event.preventDefault();
653  });
654});
655// contactform-2
656$(document).ready(function(){
657  $( "#contactform-2" ).submit(function( event ) {
658    $("#ajaxloader-2").show();
659    $("#contactform-2").hide();
660    $.ajax({
661      url:'php/contact-form-2.php',
662      data:$(this).serialize(),
663      type:'post',
664      success:function(response){
665        $("#ajaxloader-2").hide();
666        $("#contactform-2").show();
667        $("#contactform-2").find("input, textarea").val("");
668        $("#formmessage-2").html(response).show().delay(2000).fadeOut('slow');
669      }
670    });
671    event.preventDefault();
672  });
673});
674 
675
676/*************************
677      tooltip
678*************************/
679
680 $(document).ready(function(){
681    $('[data-toggle="tooltip"]').tooltip({
682    });
683});
684
685 
686/*************************
687         counter
688*************************/
689
690function count(options) {
691	 var $this = $(this);
692	 options = $.extend({}, options || {}, $this.data('countToOptions') || {});
693	 $this.countTo(options);
694 }
695 if($(".counter-main").length != 0) {
696	  $(document).ready(function () { 
697		 $('.counter-main').appear(function() {
698		   $('.timer').each(count)
699		 }, {
700		  offset: 500
701		 });
702      });
703	}
704 
705/*************************
706      our-skills
707*************************/
708
709 if($(".our-skills").length != 0) {
710 	 $('.our-skills').appear(function() { 
711       $('#bar-9').jqbar({ label: 'css3', barColor: '#00a9da', value: 50, orientation: 'v' });
712       $('#bar-10').jqbar({ label: 'HTML5', barColor: '#00a9da', value: 90, orientation: 'v' });
713       $('#bar-11').jqbar({ label: 'Wordpress', barColor: '#00a9da', value: 70, orientation: 'v' });
714       $('#bar-12').jqbar({ label: 'SEO', barColor: '#00a9da', value: 50, orientation: 'v' });
715   }, {
716  offset: 200
717  });
718 }
719
720/*************************
721      socialstream
722*************************/
723 
724if($(".instagram-feed").length != 0) {
725 $('.instagram-feed').socialstream({
726    socialnetwork: 'instagram',
727    limit: 6,
728    username: 'andreasmhansen'
729 })
730}
731
732 if($(".flickr-feed").length != 0) {
733    $('.flickr-feed').socialstream({
734        socialnetwork: 'flickr',
735         limit: 6,
736         username: 'andreasmhansen'
737    })
738}
739
740if($(".pinterest-feed").length != 0) {
741 $('.pinterest-feed').socialstream({
742    socialnetwork: 'pinterest',
743    limit: 6,
744    username: 'fromupnorth'
745  })
746}
747
748if($(".deviant-feed").length != 0) {
749 $('.deviant-feed').socialstream({
750     socialnetwork: 'deviantart',
751     limit: 6,
752     username: 'neo-innov'
753 })
754}
755
756if($(".newsfeed-feed").length != 0) { 
757  $('.newsfeed').socialstream({
758     socialnetwork: 'newsfeed',
759      limit: 6,
760      username: 'http://feeds.feedburner.com/vectips'
761   })
762}
763/*************************
764      side menu
765*************************/
766
767$(document).ready(function(){
768  $('#menu-icon').click(function(){
769    $(this).toggleClass('open');
770    $('#menu,#menu-toggle,#page-content,#menu-overlay').toggleClass('open');
771    $('#menu li,.submenu-toggle').removeClass('open');
772  });
773});
774 
775
776/*************************
777         isotope
778*************************/
779 
780 if($(".isotope").length != 0) {
781 jQuery(window).on("load resize",function(e){
782  var $container = $('.isotope'),
783  colWidth = function () {
784    var w = $container.width(), 
785    columnNum = 1,
786    columnWidth = 0;
787return columnWidth;
788  },
789  isotope = function () {
790    $container.isotope({
791      resizable: true,
792      itemSelector: '.grid-item',
793      masonry: {
794        columnWidth: colWidth(),
795        gutterWidth: 10
796      }
797    });
798  };
799  isotope(); 
800  // bind filter button click
801  $('.isotope-filters').on( 'click', 'button', function() {
802    var filterValue = $( this ).attr('data-filter');
803    $container.isotope({ filter: filterValue });
804  });
805  // change active class on buttons
806  $('.isotope-filters').each( function( i, buttonGroup ) {
807    var $buttonGroup = $( buttonGroup );
808    $buttonGroup.on( 'click', 'button', function() {
809      $buttonGroup.find('.active').removeClass('active');
810      $( this ).addClass('active');
811    });
812  }); 
813  // bind filter button click
814  $('.isotope-filters-3').on( 'click', 'button', function() {
815    var filterValue = $( this ).attr('data-filter');
816    $container.isotope({ filter: filterValue });
817  });
818  // change active class on buttons
819  $('.isotope-filters-3').each( function( i, buttonGroup ) {
820    var $buttonGroup = $( buttonGroup );
821    $buttonGroup.on( 'click', 'button', function() {
822      $buttonGroup.find('.active').removeClass('active');
823      $( this ).addClass('active');
824    });
825  }); 
826
827});
828}
829
830// masonry
831
832 if($(".isotope-2").length != 0) {
833  jQuery(window).on("load resize",function(e){
834  var $container = $('.masonry-main .isotope-2'),
835  colWidth = function () {
836    var w = $container.width(), 
837    columnNum = 1,
838    columnWidth = 0;
839return columnWidth;
840  },
841  isotope = function () {
842    $container.isotope({
843      resizable: true,
844      itemSelector: '.masonry-main .masonry-item',
845      masonry: {
846        columnWidth: colWidth(),
847        gutterWidth: 10
848      }
849    });
850  };
851  isotope(); 
852  // bind filter button click
853$('.masonry-main .isotope-filters-2').on( 'click', 'button', function() {
854    var filterValue = $( this ).attr('data-filter');
855    $container.isotope({ filter: filterValue });
856  });
857  // change active class on buttons
858  $('.masonry-main .isotope-filters-2').each( function( i, buttonGroup ) {
859    var $buttonGroup = $( buttonGroup );
860    $buttonGroup.on( 'click', 'button', function() {
861      $buttonGroup.find('.active').removeClass('active');
862      $( this ).addClass('active');
863    });
864  }); 
865
866});
867}
868
869// packetry
870 if($(".isotope-3").length != 0) {
871 jQuery(window).on("load resize",function(e){
872  var $container = $('.isotope-3'),
873  colWidth = function () {
874    var w = $container.width(), 
875    columnNum = 1,
876    columnWidth = 0;
877  //Select what will be your porjects columns according to container widht
878  if (w > 1040)     { columnNum  = 6; }  
879  else if (w > 850) { columnNum  = 6; }  
880  else if (w > 768) { columnNum  = 6; }  
881  else if (w > 480) { columnNum  = 6; }
882  else if (w > 300) { columnNum  = 1; }
883  columnWidth = Math.floor(w/columnNum);
884  //Default item width and height
885  $container.find('.item').each(function() {
886    var $item = $(this), 
887    width = columnWidth,
888    height = columnWidth;
889    $item.css({ width: width, height: height });
890  }); 
891  //2x width item width and height
892  $container.find('.width2').each(function() {
893    var $item = $(this), 
894    width = columnWidth*2,
895    height = columnWidth;
896    $item.css({ width: width, height: height });
897  }); 
898  //2x height item width and height
899  $container.find('.height2').each(function() {
900    var $item = $(this), 
901    width = columnWidth,
902    height = columnWidth*2;
903    $item.css({ width: width, height: height });
904  }); 
905  //2x item width and height
906  $container.find('.width2.height2').each(function() {
907    var $item = $(this), 
908    width = columnWidth*1,
909    height = columnWidth*2;
910    $item.css({ width: width, height: height });
911  }); 
912  return columnWidth;
913  },
914  isotope = function () {
915    $container.isotope({
916      resizable: true,
917      itemSelector: '.item',
918      masonry: {
919        columnWidth: colWidth(),
920        gutterWidth: 10
921      }
922    });
923  };
924  isotope(); 
925  // bind filter button click
926  $('.isotope-filters').on( 'click', 'button', function() {
927    var filterValue = $( this ).attr('data-filter');
928    $container.isotope({ filter: filterValue });
929  });
930  // change active class on buttons
931  $('.isotope-filters').each( function( i, buttonGroup ) {
932    var $buttonGroup = $( buttonGroup );
933    $buttonGroup.on( 'click', 'button', function() {
934      $buttonGroup.find('.active').removeClass('active');
935      $( this ).addClass('active');
936    });
937  }); 
938
939});
940}
941 
942// portfolio scroll
943 if($(".snap-scrolling-example").length != 0) {
944    (function($){
945            $(window).load(function(){                
946                /* 
947                get snap amount programmatically or just set it directly (e.g. "273") 
948                in this example, the snap amount is list item's (li) outer-width (width+margins)
949                */
950                var amount=Math.max.apply(Math,$("#portfolio-scroll li").map(function(){return $(this).outerWidth(true);}).get());
951                
952                $("#portfolio-scroll").mCustomScrollbar({
953                    axis:"x",
954                    theme:"inset",
955                    advanced:{
956                        autoExpandHorizontalScroll:true
957                    },
958                    scrollButtons:{
959                        enable:true,
960                        scrollType:"stepped"
961                    },
962                    keyboard:{scrollType:"stepped"},
963                    snapAmount:amount,
964                    mouseWheel:{scrollAmount:amount},
965                    mouseWheel:{ enable: false }
966                });
967                
968            });
969        })(jQuery);
970 }    
971
972 if($(".hover-direction").length != 0) {
973
974 $(window).load(function() {
975        $('.portfolio-item').directionalHover();
976      });
977}
978
979 // popup-gallery
980  if($(".popup-gallery").length != 0) {
981    $(document).ready(function() {
982    $('.popup-gallery').magnificPopup({
983        delegate: 'a.portfolio-img',
984        type: 'image',
985        tLoading: 'Loading image #%curr%...',
986        mainClass: 'mfp-img-mobile',
987        gallery: {
988            enabled: true,
989            navigateByImgClick: true,
990            preload: [0,1] // Will preload 0 - before current, and 1 after the current image
991        },
992        image: {
993            tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
994            titleSrc: function(item) {
995                return item.el.attr('title') + '<small>by Marsel Van Oosten</small>';
996            }
997        }
998    });
999  });
1000
1001 // popup
1002
1003    $(document).ready(function() {
1004    $('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({
1005        disableOn: 700,
1006        type: 'iframe',
1007        mainClass: 'mfp-fade',
1008        removalDelay: 160,
1009        preloader: false,
1010
1011        fixedContentPos: false
1012
1013    });
1014});
1015
1016// youtube
1017$.extend(true, $.magnificPopup.defaults, {  
1018    iframe: {
1019        patterns: {
1020           youtube: {
1021              index: 'youtube.com/', 
1022              id: 'v=', 
1023              src: 'http://www.youtube.com/embed/%id%?autoplay=1' 
1024          }
1025        }
1026    }
1027});
1028
1029// vimeo
1030$.extend(true, $.magnificPopup.defaults, {  
1031    iframe: {
1032        patterns: {
1033           vimeo: {
1034              index: 'vimeo.com/',
1035              id: '/',
1036              src: 'http://player.vimeo.com/video/%id%?autoplay=1'
1037            },
1038        }
1039    }
1040});
1041}
1042
1043 
1044/*************************
1045         back-to-top
1046*************************/
1047
1048  $(document).ready(function(){
1049    $("#back-to-top").hide();
1050       $(window).scroll(function(){
1051             if ($(window).scrollTop()>100){
1052               $("#back-to-top").fadeIn(1500);
1053                 }
1054                 else
1055                  {
1056                   $("#back-to-top").fadeOut(1500);
1057                  }
1058              });
1059              //back to top
1060               $("#back-to-top").click(function(){
1061                $('body,html').animate({scrollTop:0},1000);
1062                 return false;
1063                });
1064            });
1065
1066
1067  /*************************
1068      accordion
1069 *************************/
1070
1071 var allPanels = $(".accordion > .accordion-content").hide();
1072    allPanels.first().slideDown("easeOutExpo");
1073        $(".accordion > .accordion-title > a").first().addClass("active");
1074        $(".accordion > .accordion-title > a").click(function(){
1075            var current = $(this).parent().next(".accordion-content");
1076            $(".accordion > .accordion-title > a").removeClass("active");
1077            $(this).addClass("active");
1078            allPanels.not(current).slideUp("easeInExpo");
1079            $(this).parent().next().slideDown("easeOutExpo");
1080            return false;
1081  });
1082 
1083 var allToggles = $(".accordion-2 .accordion-2-content").hide();
1084  $(".accordion-2 .accordion-2-title a").click(function(){
1085      if ($(this).hasClass("active")) {
1086         $(this).parent().next().slideUp("easeOutExpo");
1087         $(this).removeClass("active");
1088        }
1089   else {
1090        var current = $(this).parent().next(".accordion-2-content");
1091        $(this).addClass("active");
1092        $(this).parent().next().slideDown("easeOutExpo");
1093      }
1094     return false;
1095    });
1096
1097 var allPanels = $(".accordion-3 > .accordion-3-content").hide();
1098        $(".accordion-3 > .accordion-3-title > a").first().addClass("active");
1099        $(".accordion-3 > .accordion-3-title > a").click(function(){
1100            var current = $(this).parent().next(".accordion-3-content");
1101            $(".accordion-3 > .accordion-3-title > a").removeClass("active");
1102            $(this).addClass("active");
1103            allPanels.not(current).slideUp("easeInExpo");
1104            $(this).parent().next().slideDown("easeOutExpo");
1105            return false;
1106  });
1107 
1108/*************************
1109        sliderbar menu
1110*************************/
1111
1112$('.widget-menu > ul > li > a').click(function() {
1113  var checkElement = $(this).next();
1114  $('.widget-menu li').removeClass('active');
1115  $(this).closest('li').addClass('active');
1116  if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
1117    $(this).closest('li').removeClass('active');
1118    checkElement.slideUp('normal');
1119  }
1120  if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
1121    $('.widget-menu ul ul:visible').slideUp('normal');
1122    checkElement.slideDown('normal');
1123  }
1124  if($(this).closest('li').find('ul').children().length == 0) {
1125    return true;
1126  } else {
1127    return false;
1128  }
1129});
1130
1131/*************************
1132     audio video
1133*************************/
1134 
1135if($(".audio-video").length != 0) {
1136  $('audio,video').mediaelementplayer();
1137}
1138
1139/*************************
1140          tabs
1141*************************/
1142
1143 $(function(e) {
1144  $('.tabcontent').hide().filter(':first').show();
1145  $('#tabs li[data-tabs]').on('click', function () {
1146    $('#tabs li[data-tabs]').removeClass('active');
1147    $('.tabcontent').hide();
1148    var tab = $(this).data('tabs');
1149    $(this).addClass('active');
1150    $('#' + tab).fadeIn().show();
1151  });
1152  $(".tabs li").click(function(){
1153      var  cur =$(".tabs li").index(this);
1154    var elm = $('.tabcontent:eq('+cur+')');
1155      elm.addClass("pulse");
1156      setTimeout(function() {
1157            elm.removeClass("pulse");
1158      }, 220);
1159   });
1160}); 
1161 
1162/*************************
1163          rain
1164*************************/
1165 
1166function run() {
1167        var image = document.getElementById('background');
1168        image.onload = function() {
1169          var engine = new RainyDay({
1170            image: this
1171          });
1172          engine.rain([ [0, 2, 200], [3, 3, 1] ], 100);
1173        };
1174        image.crossOrigin = 'anonymous';
1175              image.src = 'images/bg/09.jpg';
1176  }
1177
1178/*************************
1179          skills-2
1180*************************/
1181 
1182if($(".skills-2").length != 0) {
1183$('.skills-2').appear(function() {
1184		 $( ".bar" ).each( function() {
1185			  var $bar = $( this ),
1186			 $pct = $bar.find( ".pct" ),
1187			 data = $bar.data( "bar" );
1188		  setTimeout( function() {
1189				 $bar
1190				 .css( "background-color", data.color )
1191				 .prop( "title", data.width )
1192				 .animate({
1193				 "width": $pct.html()
1194		   }, 3000, function() {
1195		  $pct.css({
1196			 "color": data.color,
1197			 "opacity": 1
1198		 });
1199		 });
1200		 }, data.delay || 0 );   
1201	 });
1202 }, {
1203  offset: 400
1204});
1205}
1206 
1207/*************************
1208         countdown
1209*************************/
1210
1211  $(document).ready(function(){
1212    if($(".countdown").length != 0) {
1213      $('.maintenance-progress-bar').appear(function() {
1214       $('.countdown').downCount({
1215            date: '10/05/2016 12:00:00',
1216            offset: +10
1217        }, function () {
1218            // alert('WOOT WOOT, done!');
1219        });
1220        $(".progress-bar").loading();
1221    $('input').on('click', function () {
1222       $(".progress-bar").loading();
1223    });
1224
1225     }, {
1226  offset: 400
1227});
1228}
1229});
1230
1231/*************************
1232         ripple
1233*************************/
1234 
1235 $(".nav-tabs2 li").hover(function(e) {
1236  /* Add the slider movement */
1237  // what tab was pressed
1238  var whatTab = $(this).index();
1239  // Work out how far the slider needs to go
1240  var howFar = 160 * whatTab;
1241  /* Add the ripple */
1242  // Remove olds ones
1243  $(".ripple").remove();
1244  // Setup
1245  var posX = $(this).offset().left,
1246      posY = $(this).offset().top,
1247      buttonWidth = $(this).width(),
1248      buttonHeight = $(this).height();
1249  // Add the element
1250  $(this).prepend("<span class='ripple'></span>");
1251  // Make it round!
1252  if (buttonWidth >= buttonHeight) {
1253    buttonHeight = buttonWidth;
1254  } else {
1255    buttonWidth = buttonHeight;
1256  }
1257  // Get the center of the element
1258  var x = e.pageX - posX - buttonWidth / 2;
1259  var y = e.pageY - posY - buttonHeight / 2;
1260  // Add the ripples CSS and start the animation
1261  $(".ripple").css({
1262    width: buttonWidth,
1263    height: buttonHeight,
1264    top: y + 'px',
1265    left: x + 'px'
1266  }).addClass("rippleEffect");
1267});
1268
1269
1270/*************************
1271         placeholder
1272*************************/ 
1273 
1274$('[placeholder]').focus(function() {
1275  var input = $(this);
1276  if (input.val() == input.attr('placeholder')) {
1277    input.val('');
1278    input.removeClass('placeholder');
1279  }
1280}).blur(function() {
1281  var input = $(this);
1282  if (input.val() == '' || input.val() == input.attr('placeholder')) {
1283    input.addClass('placeholder');
1284    input.val(input.attr('placeholder'));
1285  }
1286}).blur().parents('form').submit(function() {
1287  $(this).find('[placeholder]').each(function() {
1288    var input = $(this);
1289    if (input.val() == input.attr('placeholder')) {
1290      input.val('');
1291    }
1292  })
1293});
1294
1295/*********************************
1296    Wow animation on scroll
1297*********************************/
1298
1299if($(".wow").length != 0) {
1300wow = new WOW({
1301 animateClass: 'animated',
1302 offset: 100,
1303 mobile: false
1304});
1305wow.init();
1306} 
1307
1308/*********************************
1309             Raindrops
1310*********************************/
1311if($(".raindrops").length != 0) {
1312 jQuery('#raindrops').raindrops(
1313 {color:'#46BFDE',
1314 canvasHeight:200});
1315}
1316
1317if($(".raindrops2").length != 0) {
1318 jQuery('#raindrops2').raindrops(
1319 {color:'#46BFDE',
1320 canvasHeight:100});
1321}
1322 
1323/*********************************
1324        Parallax banner
1325*********************************/
1326if($(".parallax-banner").length != 0) {
1327    $('#scene').parallax();
1328 }
1329
1330/*********************************
1331         Mobile slider
1332*********************************/
1333if($(".mobile-slider-main").length != 0) {
1334       $('#mobile-slider').zenith({
1335          layout: 'mobile-slider' , 
1336          slideSpeed: 450, 
1337          autoplaySpeed: 2000
1338      });
1339 }
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.