/* Copyright (C) YOOtheme GmbH, YOOtheme Proprietary Use License (http://www.yootheme.com/license) */

(function($){$widgetkit.lazyloaders["gallery-slider"]=function(element,options){var ul=element.find(".slides:first"),items=ul.children(),totalW=options.total_width=="auto"?element.width():options.total_width>element.width()?element.width():options.total_width,min=totalW/items.length-options.spacing,width=options.width,height=options.height;if(options.total_width=="auto"||options.total_width>=totalW){var ratio=options.width/(totalW/2),ratio_height=options.height/ratio;width=options.width/ratio;height=options.height/ratio;items.css("background-size",width+"px "+height+"px")}items.css({width:min,"margin-right":options.spacing});ul.width(items.eq(0).width()*items.length*2);element.css({width:totalW,height:height});$widgetkit.load(WIDGETKIT_URL+"/widgets/gallery/js/slider.js").done(function(){element.galleryslider(options)})}})(jQuery);