(function($) { $(function() { var jcarousel = $('.jcarousel'); jcarousel .on('jcarousel:reload jcarousel:create', function () { var carousel = $(this), width = carousel.innerWidth(); var xs=1; var sm=2.1; var md=3.2; var lg=4.3; if(jQuery(this).attr('id')=='inspection-type'){ xs=1; sm=2.1; md=2.1; lg=3.2; } if (width >=1100) { width = width / lg; } else if (width >= 768) { width = width / md; } else if (width >= 500) { width = width / sm; } else if (width >= 350) { width = width / xs; } carousel.jcarousel('items').css('width', Math.ceil(width) + 'px'); }) .jcarousel({ wrap: 'circular' }); try{ $('.jcarousel-control-prev') .jcarouselControl({ target: '-=1' }); $('.jcarousel-control-next') .jcarouselControl({ target: '+=1' }); $('.jcarousel-pagination') .on('jcarouselpagination:active', 'a', function() { $(this).addClass('active'); }) .on('jcarouselpagination:inactive', 'a', function() { $(this).removeClass('active'); }) .on('click', function(e) { e.preventDefault(); }) .jcarouselPagination({ perPage: 1, item: function(page) { return '' + page + ''; } }); }catch(e){} }); })(jQuery); $(document).ready(function() { $('.carousel').carousel(); var url=window.location.href; try{document.getElementById(url.replace(/www./,'')).className = "active";}catch(e){} try{document.getElementById("bc_"+url.replace(/www./,'')).className = "active";}catch(e){} }); $(document).ready(function() { $('#media').carousel({ pause: true, interval: false, }); }); (function(window, document, undefined){ window.onload = init; function init(){ $('#sidebar ul.nav li.dropdown').hover(function() { $(this).find('#sidebar .dropdown-menu').stop(true, true).delay(200).fadeIn(500); }, function() { $(this).find('#sidebar .dropdown-menu').stop(true, true).delay(200).fadeOut(500); }); } })(window, document, undefined);