jQuery.noConflict();
jQuery(function(a){function k(c){$bb.css("background-image","url("+slides[c].image+")");a("div",$next).add($next).css("background-image","");h(0,0);l();$next.css({"-webkit-transform":"scale(1)","-moz-transform":"scale(1)","-o-transform":"scale(1)",opacity:1});m(c)}function j(c){clearTimeout(timeout);prevSlideIndex=currentSlideIndex;currentSlideIndex=c;$bb.css("background-image","url("+slides[prevSlideIndex].image+")");callback=function(){k(currentSlideIndex);timeout=setTimeout(function(){j(slides[currentSlideIndex+1]==
null?0:currentSlideIndex+1)},slides[currentSlideIndex].delay)};a("#uds-billboard-paginator a").removeClass("current");a("#uds-billboard-paginator a:eq("+currentSlideIndex+")").addClass("current");$descr=a("#uds-billboard-description");if($descr.hasClass("stripe-left"))$descr.stop().animate({left:-$descr.outerWidth()},{duration:200,easing:"easeOutExpo"});else $descr.hasClass("stripe-right")?$descr.css({left:width-$descr.outerWidth()+"px",bottom:"0px"}).stop().animate({left:width+"px"},{duration:400,
easing:"easeOutExpo"}):$descr.stop().animate({bottom:-$descr.outerHeight()},{duration:200,easing:"easeOutExpo"});n(slides[currentSlideIndex].transition)(prevSlideIndex,currentSlideIndex,callback)}function o(c){$controls.append(a("<div id='uds-billboard-paginator'></div>"));for(var b=0;b<totalImages;b++){var d=a("<a class='"+(b==c?"current":"")+"'></a>");a("#uds-billboard-paginator").append(d)}a("#uds-billboard-paginator a").click(function(){if(a(this).index()!=currentSlideIndex){a("div",$next).add($next).is(":animated")&&
k(currentSlideIndex);clearInterval(timeout);j(a(this).index())}})}function m(c){$descr=a("#uds-billboard-description");if($descr.size()===0){$controls.append(a("<div id='uds-billboard-description' class=''></div>"));$descr=a("#uds-billboard-description")}$descr.attr("class","").addClass(slides[c].layout).html(slides[c].description);if($descr.hasClass("stripe-left"))$descr.css({left:-$descr.outerWidth()+"px",bottom:"0px"}).stop().animate({left:"0px"},{duration:400,easing:"easeOutExpo"});else if($descr.hasClass("stripe-right")){c=
$descr.outerWidth()!==0?$descr.outerWidth():350;$descr.css({left:width+"px",bottom:"0px"}).stop().animate({left:width-c+"px"},{duration:400,easing:"easeOutExpo"})}else $descr.css({left:"0px",bottom:-$descr.outerHeight()+"px"}).stop().animate({bottom:"0px"},{duration:400,easing:"easeOutExpo"})}function p(){if(squareSize<30)squareSize=30;var c=Math.ceil(width/squareSize)*Math.ceil(height/squareSize);for(i=0;i<c;i++){var b=document.createElement("div");a(b).attr("id","square"+i).addClass("square");$next.append(b)}h(0,
0);a(".square",$next).css({opacity:"0",width:squareSize+"px",height:squareSize+"px"})}function h(c,b){var d=Math.ceil(height/squareSize),g=Math.ceil(width/squareSize),f=0;for(y=0;y<d;y++)for(x=0;x<g;x++){a("#square"+f).css({"background-position":-x*squareSize+"px "+-y*squareSize+"px",left:x*squareSize+c+"px",top:y*squareSize+b+"px"});++f}}function q(){for(var c=Math.ceil(width/columnWidth),b=0;b<c;b++){var d=document.createElement("div");a(d).attr("id","column"+b).addClass("column");$next.append(d)}l();
a(".column",$next).css({opacity:0,width:columnWidth+"px",height:height+"px"})}function l(){for(var c=Math.ceil(width/columnWidth),b=0;b<c;b++)a("#column"+b).css({"background-position":-b*columnWidth+"px 0px",left:b*columnWidth+"px",top:"0px",width:columnWidth+"px"})}function n(c){switch(c){case "scaleTop":return animationScaleTop;case "scaleCenter":return animationScaleCenter;case "scaleBottom":return animationScaleBottom;case "scaleRight":return animationScaleRight;case "scaleLeft":return animationScaleLeft;
case "squaresRandom":return animationSquaresRandom;case "squaresRows":return animationSquaresRows;case "squaresCols":return animationSquaresCols;case "squaresMoveIn":return animationSquaresMoveIn;case "squaresMoveOut":return animationSquaresMoveOut;case "columnWave":return animationColumnWave;case "curtainRight":return animationCurtainRight;case "curtainLeft":return animationCurtainLeft;case "curtainRotateLeft":return animationCurtainRotateLeft;case "curtainRotateRight":return animationCurtainRotateRight;
case "interweaveLeft":return animationInterweaveLeft;case "interweaveRight":return animationInterweaveRight;case "random":c=[animationScaleTop,animationScaleCenter,animationScaleBottom,animationScaleRight,animationScaleLeft,animationSquaresRandom,animationSquaresRows,animationSquaresCols,animationSquaresMoveIn,animationSquaresMoveOut,animationColumnWave,animationCurtainRight,animationCurtainLeft,animationCurtainRotateLeft,animationCurtainRotateRight,animationInterweaveLeft,animationInterweaveRight];
return c[Math.floor(Math.random()*c.length)];default:return animationFade}}$wrapper=a("#uds-billboard-wrapper");$bb=a("#uds-billboard");$loader=a("#uds-loader");$controls=a("#uds-billboard-controls");$next=a("#uds-next-slide");slides=[];prevSlideIndex=currentSlideIndex=0;totalImages=a(".uds-slide",$bb).length;totalImagesLoaded=0;timeout=null;squareSize=100;columnWidth=50;width=940;height=380;a(".uds-slide",$bb).each(function(){var c={delay:parseInt(a("input[name=uds-billboard-delay]",this).val(),
10),transition:a("input[name=uds-billboard-transition]",this).val(),layout:a("input[name=uds-billboard-layout]",this).val(),image:a(">img",this).attr("src"),description:a(".uds-descr-wrapper",this).html()};slides.push(c);a(this).remove();$bb.hide();$controls.hide();a("<img>").load(function(){++totalImagesLoaded;$loader.animate({"background-position-x":-160+160*(totalImagesLoaded/totalImages)+"px"},{duration:100});if(totalImages==totalImagesLoaded){$bb.css("background-image","url("+slides[0].image+
")");o(0);m(0);p();q();$bb.fadeIn();$controls.fadeIn();totalImages<2||(timeout=setTimeout(function(){j(currentSlideIndex+1)},slides[0].delay))}}).attr("src",c.image)});animationFade=function(c,b,d){$next.css({backgroundImage:"url("+slides[b].image+")",opacity:0}).animate({opacity:1},{duration:1E3,complete:d,easing:"easeOutExpo"})};animationScaleTop=function(c,b,d){$next.css({"background-image":"url("+slides[b].image+")","-webkit-transform":"scale(0)","-moz-transform":"scale(0)","-o-transform":"scale(0)",
"-webkit-transform-origin":"50% 0%","-moz-transform-origin":"50% 0%","-o-transform-origin":"50% 0%",opacity:0}).animate({opacity:1},{duration:1E3,complete:d,step:function(g,f){var e=(new Date).getTime();e=a.easing.swing(null,e-f.startTime,0,1,f.options.duration);a(f.elem).css({opacity:e,"-o-transform":"scale("+e+")","-moz-transform":"scale("+e+")","-webkit-transform":"scale("+e+")"})}})};animationScaleCenter=function(c,b,d){$next.css({"background-image":"url("+slides[b].image+")","-webkit-transform":"scale(0)",
"-moz-transform":"scale(0)","-o-transform":"scale(0)","-webkit-transform-origin":"50% 50%","-moz-transform-origin":"50% 50%","-o-transform-origin":"50% 50%",opacity:0}).animate({opacity:1},{duration:1E3,complete:d,step:function(g,f){var e=(new Date).getTime();e=a.easing.swing(null,e-f.startTime,0,1,f.options.duration);a(f.elem).css({opacity:e,"-o-transform":"scale("+e+")","-moz-transform":"scale("+e+")","-webkit-transform":"scale("+e+")"})}})};animationScaleBottom=function(c,b,d){$next.css({"background-image":"url("+
slides[b].image+")","-webkit-transform":"scale(0)","-moz-transform":"scale(0)","-o-transform":"scale(0)","-webkit-transform-origin":"50% 100%","-moz-transform-origin":"50% 100%","-o-transform-origin":"50% 100%",opacity:0}).animate({opacity:1},{duration:1E3,complete:d,step:function(g,f){var e=(new Date).getTime();e=a.easing.swing(null,e-f.startTime,0,1,f.options.duration);a(f.elem).css({opacity:e,"-o-transform":"scale("+e+")","-moz-transform":"scale("+e+")","-webkit-transform":"scale("+e+")"})}})};
animationScaleRight=function(c,b,d){$next.css({"background-image":"url("+slides[b].image+")","-webkit-transform":"scaleX(0)","-moz-transform":"scaleX(0)","-o-transform":"scaleX(0)","-webkit-transform-origin":"100% 50%","-moz-transform-origin":"100% 50%","-o-transform-origin":"100% 50%",opacity:0}).animate({opacity:1},{duration:1E3,complete:d,step:function(g,f){var e=(new Date).getTime();e=a.easing.swing(null,e-f.startTime,0,1,f.options.duration);a(f.elem).css({opacity:e,"-o-transform":"scaleX("+e+
")","-moz-transform":"scaleX("+e+")","-webkit-transform":"scaleX("+e+")"})}})};animationScaleLeft=function(c,b,d){$next.css({"background-image":"url("+slides[b].image+")","-webkit-transform":"scaleX(0)","-moz-transform":"scaleX(0)","-o-transform":"scaleX(0)","-webkit-transform-origin":"0% 50%","-moz-transform-origin":"0% 50%","-o-transform-origin":"0% 50%",opacity:0}).animate({opacity:1},{duration:1E3,complete:d,step:function(g,f){var e=(new Date).getTime();e=a.easing.swing(null,e-f.startTime,0,1,
f.options.duration);a(f.elem).css({opacity:e,"-o-transform":"scaleX("+e+")","-moz-transform":"scaleX("+e+")","-webkit-transform":"scaleX("+e+")"})}})};animationSquaresRandom=function(c,b,d){$squares=a(".square",$next);$squares.css({"background-image":"url("+slides[b].image+")",opacity:0});$squares.each(function(){a(this).stop().delay(Math.round(Math.random()*500)).animate({opacity:1},{duration:600})});setTimeout(d,1550)};animationSquaresRows=function(c,b,d){$squares=a(".square",$next);$squares.css({"background-image":"url("+
slides[b].image+")",opacity:0});$squares.each(function(g){a(this).stop().delay(60*g).animate({opacity:1},{duration:1E3})});setTimeout(d,1550)};animationSquaresCols=function(c,b,d){$squares=a(".square",$next);$squares.css({"background-image":"url("+slides[b].image+")",opacity:0});var g=Math.ceil(width/squareSize);$squares.each(function(f){a(this).stop().delay(100*(f%g)).animate({opacity:1},{duration:600})});setTimeout(d,1550)};animationSquaresMoveOut=function(c,b,d){$squares=a(".square",$next);$next.css("background-image",
"url("+slides[b].image+")");$squares.css({"background-image":"url("+slides[c].image+")",opacity:1});c=Math.ceil(height/squareSize);b=Math.ceil(width/squareSize);var g=0;for(y=0;y<c;y++)for(x=0;x<b;x++){a("#square"+g).stop().delay(100*(x+y)).animate({opacity:0,left:x*squareSize-20+"px",top:y*squareSize-20+"px"},400);++g}setTimeout(d,1550)};animationSquaresMoveIn=function(c,b,d){$squares=a(".square",$next);$squares.css({"background-image":"url("+slides[b].image+")",opacity:0});h(-20,-20);c=Math.ceil(height/
squareSize);b=Math.ceil(width/squareSize);var g=0;for(y=0;y<c;y++)for(x=0;x<b;x++){a("#square"+g).stop().delay(100*(c-y+b-x)).animate({opacity:1,left:x*squareSize+"px",top:y*squareSize+"px"},400);++g}setTimeout(d,1550)};animationColumnWave=function(c,b,d){$columns=a(".column",$next);$columns.css({"background-image":"url("+slides[b].image+")",opacity:0,top:"-30px"});c=Math.ceil(width/columnWidth);for(i=0;i<c;i++)a("#column"+i).stop().delay(30*i).animate({opacity:1,top:"0px"},{duration:1E3,specialEasing:{opacity:"easeOutSine",
top:"easeOutElastic"}});setTimeout(d,1550)};animationCurtainRight=function(c,b,d){$columns=a(".column",$next);$columns.css({"background-image":"url("+slides[b].image+")",opacity:0,height:"0px"});c=Math.ceil(width/columnWidth);for(i=0;i<c;i++)a("#column"+i).stop().delay(50*i).animate({opacity:1,height:height+"px"},{duration:300,specialEasing:{opacity:"easeInSine",height:"linear"}});setTimeout(d,1350)};animationCurtainLeft=function(c,b,d){$columns=a(".column",$next);$columns.css({"background-image":"url("+
slides[b].image+")",opacity:0,height:"0px"});c=Math.ceil(width/columnWidth);for(i=0;i<c;i++)a("#column"+i).stop().delay(50*(c-i)).animate({opacity:1,height:height+"px"},{duration:300,specialEasing:{opacity:"easeInSine",height:"linear"}});setTimeout(d,1350)};animationCurtainRotateRight=function(c,b,d){$columns=a(".column",$next);$columns.css({"background-image":"url("+slides[b].image+")",opacity:0,width:"0px"});c=Math.ceil(width/columnWidth);for(i=0;i<c;i++)a("#column"+i).stop().delay(50*i).animate({opacity:1,
width:columnWidth+"px"},{duration:300,specialEasing:{opacity:"easeInSine",width:"linear"}});setTimeout(d,1550)};animationCurtainRotateLeft=function(c,b,d){$columns=a(".column",$next);$columns.css({"background-image":"url("+slides[b].image+")",opacity:0,width:"0px"});c=Math.ceil(width/columnWidth);for(i=0;i<c;i++)a("#column"+i).stop().delay(50*(c-i)).animate({opacity:1,width:columnWidth+"px"},{duration:300,specialEasing:{opacity:"easeInSine",width:"linear"}});setTimeout(d,1550)};animationInterweaveLeft=
function(c,b,d){$columns=a(".column",$next);$columns.css({"background-image":"url("+slides[b].image+")",opacity:0});a(".column:even",$next).css("top",-height+"px");a(".column:odd",$next).css("top",height+"px");c=Math.ceil(width/columnWidth);for(b=0;b<c;b++)a("#column"+b).stop().delay(50*(c-b)).animate({opacity:1,top:"0px"},{duration:300,specialEasing:{opacity:"easeInSine",top:"easeOutExpo"}});setTimeout(d,1550)};animationInterweaveRight=function(c,b,d){$columns=a(".column",$next);$columns.css({"background-image":"url("+
slides[b].image+")",opacity:0});a(".column:even",$next).css("top",-height+"px");a(".column:odd",$next).css("top",height+"px");c=Math.ceil(width/columnWidth);for(b=0;b<c;b++)a("#column"+b).stop().delay(50*b).animate({opacity:1,top:"0px"},{duration:300,specialEasing:{opacity:"easeInSine",top:"easeOutExpo"}});setTimeout(d,1550)}});
