// Camera slideshow v1.3.3 - a jQuery slideshow with many effects, transitions, easy to customize, using canvas and mobile ready, based on jQuery 1.4+ // Copyright (c) 2012 by Manuel Masia - www.pixedelic.com // Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php !function(a){a.fn.camera=function(e){function t(){return navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i)?!0:void 0}function i(){var e=a(L).width();a("li",L).removeClass("camera_visThumb"),a("li",L).each(function(){var t=a(this).position(),i=a("ul",L).outerWidth(),r=a("ul",L).offset().left,o=a("> div",L).offset().left,s=o-r;s>0?a(".camera_prevThumbs",V).removeClass("hideNav"):a(".camera_prevThumbs",V).addClass("hideNav"),i-s>e?a(".camera_nextThumbs",V).removeClass("hideNav"):a(".camera_nextThumbs",V).addClass("hideNav");var n=t.left,c=t.left+a(this).width();e>=c-s&&n-s>=0&&a(this).addClass("camera_visThumb")})}function r(){function t(){if(f=m.width(),-1!=e.height.indexOf("%")){var t=Math.round(f/(100/parseFloat(e.height)));g=""!=e.minHeight&&to/s){var l=f/o,d=.5*Math.abs(g-s*l);switch(n){case"topLeft":t=0;break;case"topCenter":t=0;break;case"topRight":t=0;break;case"centerLeft":t="-"+d+"px";break;case"center":t="-"+d+"px";break;case"centerRight":t="-"+d+"px";break;case"bottomLeft":t="-"+2*d+"px";break;case"bottomCenter":t="-"+2*d+"px";break;case"bottomRight":t="-"+2*d+"px"}r.css({height:s*l,"margin-left":0,"margin-top":t,position:"absolute",visibility:"visible",width:f})}else{var l=g/s,d=.5*Math.abs(f-o*l);switch(n){case"topLeft":i=0;break;case"topCenter":i="-"+d+"px";break;case"topRight":i="-"+2*d+"px";break;case"centerLeft":i=0;break;case"center":i="-"+d+"px";break;case"centerRight":i="-"+2*d+"px";break;case"bottomLeft":i=0;break;case"bottomCenter":i="-"+d+"px";break;case"bottomRight":i="-"+2*d+"px"}r.css({height:g,"margin-left":i,"margin-top":0,position:"absolute",visibility:"visible",width:o*l})}else if(f/g>o/s){var l=g/s,d=.5*Math.abs(f-o*l);switch(n){case"topLeft":i=0;break;case"topCenter":i=d+"px";break;case"topRight":i=2*d+"px";break;case"centerLeft":i=0;break;case"center":i=d+"px";break;case"centerRight":i=2*d+"px";break;case"bottomLeft":i=0;break;case"bottomCenter":i=d+"px";break;case"bottomRight":i=2*d+"px"}r.css({height:g,"margin-left":i,"margin-top":0,position:"absolute",visibility:"visible",width:o*l})}else{var l=f/o,d=.5*Math.abs(g-s*l);switch(n){case"topLeft":t=0;break;case"topCenter":t=0;break;case"topRight":t=0;break;case"centerLeft":t=d+"px";break;case"center":t=d+"px";break;case"centerRight":t=d+"px";break;case"bottomLeft":t=2*d+"px";break;case"bottomCenter":t=2*d+"px";break;case"bottomRight":t=2*d+"px"}r.css({height:s*l,"margin-left":0,"margin-top":t,position:"absolute",visibility:"visible",width:f})}})}var i;1==W?(clearTimeout(i),i=setTimeout(t,200)):t(),W=!0}function o(){a("iframe",h).each(function(){a(".camera_caption",h).show();var t=a(this),i=t.attr("data-src");t.attr("src",i);var r=e.imagePath+"blank.gif",o=new Image;if(o.src=r,-1!=e.height.indexOf("%")){var s=Math.round(f/(100/parseFloat(e.height)));g=""!=e.minHeight&&s li",L).outerWidth(),a("li.cameracurrent",L).length?a("li.cameracurrent",L).position():""),o=a("ul > li",L).length*a("ul > li",L).outerWidth(),s=a("ul",L).offset().left,n=a("> div",L).offset().left;e=0>s?"-"+(n-s):n-s,1==te&&(a("ul",L).width(a("ul > li",L).length*a("ul > li",L).outerWidth()),a(L).length&&!a(T).lenght&&m.css({marginBottom:a(L).outerHeight()}),i(),a("ul",L).width(a("ul > li",L).length*a("ul > li",L).outerWidth()),a(L).length&&!a(T).lenght&&m.css({marginBottom:a(L).outerHeight()})),te=!1;var c=a("li.cameracurrent",L).length?r.left:"",l=a("li.cameracurrent",L).length?r.left+a("li.cameracurrent",L).outerWidth():"";ct?o>c+t?a("ul",L).animate({"margin-left":"-"+c+"px"},500,i):a("ul",L).animate({"margin-left":"-"+(a("ul",L).outerWidth()-t)+"px"},500,i):0>c-e?a("ul",L).animate({"margin-left":"-"+c+"px"},500,i):(a("ul",L).css({"margin-left":"auto","margin-right":"auto"}),setTimeout(i,100))}}function c(){Z=0;var t=a(".camera_bar_cont",V).width(),i=a(".camera_bar_cont",V).height();if("pie"!=p)switch(U){case"leftToRight":a("#"+u).css({right:t});break;case"rightToLeft":a("#"+u).css({left:t});break;case"topToBottom":a("#"+u).css({bottom:i});break;case"bottomToTop":a("#"+u).css({top:i})}else ae.clearRect(0,0,e.pieDiameter,e.pieDiameter)}function l(i){v.addClass("camerasliding"),J=!1;var d=parseFloat(a("div.cameraSlide.cameracurrent",b).index());if(i>0)var y=i-1;else if(d==O-1)var y=0;else var y=d+1;var _=a(".cameraSlide:eq("+y+")",b),w=a(".cameraSlide:eq("+(y+1)+")",b).addClass("cameranext");if(d!=y+1&&w.hide(),a(".cameraContent",h).fadeOut(600),a(".camera_caption",h).show(),a(".camerarelative",_).append(a("> div ",v).eq(y).find("> div.camera_effected")),a(".camera_target_content .cameraContent:eq("+y+")",m).append(a("> div ",v).eq(y).find("> div")),a(".imgLoaded",_).length){if(R.length>y+1&&!a(".imgLoaded",w).length){var k=R[y+1],x=new Image;x.src=k+"?"+(new Date).getTime(),w.prepend(a(x).attr("class","imgLoaded").css("visibility","hidden")),x.onload=function(){ye=x.naturalWidth,_e=x.naturalHeight,a(x).attr("data-alignment",B[y+1]).attr("data-portrait",M[y+1]),a(x).attr("width",ye),a(x).attr("height",_e),r()}}e.onLoaded.call(this),a(".camera_loader",m).is(":visible")?a(".camera_loader",m).fadeOut(400):(a(".camera_loader",m).css({visibility:"hidden"}),a(".camera_loader",m).fadeOut(400,function(){a(".camera_loader",m).css({visibility:"visible"})}));var C,F,S,q,I,P=e.rows,H=e.cols,D=1,W=0,E=new Array("simpleFade","curtainTopLeft","curtainTopRight","curtainBottomLeft","curtainBottomRight","curtainSliceLeft","curtainSliceRight","blindCurtainTopLeft","blindCurtainTopRight","blindCurtainBottomLeft","blindCurtainBottomRight","blindCurtainSliceBottom","blindCurtainSliceTop","stampede","mosaic","mosaicReverse","mosaicRandom","mosaicSpiral","mosaicSpiralReverse","topLeftBottomRight","bottomRightTopLeft","bottomLeftTopRight","topRightBottomLeft","scrollLeft","scrollRight","scrollTop","scrollBottom","scrollHorz");marginLeft=0,marginTop=0,opacityOnGrid=0,opacityOnGrid=1==e.opacityOnGrid?0:1;var G=a(" > div",v).eq(y).attr("data-fx");if(q=t()&&""!=e.mobileFx&&"default"!=e.mobileFx?e.mobileFx:"undefined"!=typeof G&&G!==!1&&"default"!==G?G:e.fx,"random"==q?(q=s(E),q=q[0]):(q=q,q.indexOf(",")>0&&(q=q.replace(/ /g,""),q=q.split(","),q=s(q),q=q[0])),dataEasing=a(" > div",v).eq(y).attr("data-easing"),mobileEasing=a(" > div",v).eq(y).attr("data-mobileEasing"),I=t()&&""!=e.mobileEasing&&"default"!=e.mobileEasing?"undefined"!=typeof mobileEasing&&mobileEasing!==!1&&"default"!==mobileEasing?mobileEasing:e.mobileEasing:"undefined"!=typeof dataEasing&&dataEasing!==!1&&"default"!==dataEasing?dataEasing:e.easing,C=a(" > div",v).eq(y).attr("data-slideOn"),"undefined"!=typeof C&&C!==!1)j=C;else if("random"==e.slideOn){var j=new Array("next","prev");j=s(j),j=j[0]}else j=e.slideOn;var Q=a(" > div",v).eq(y).attr("data-time");F="undefined"!=typeof Q&&Q!==!1&&""!==Q?parseFloat(Q):e.time;var X=a(" > div",v).eq(y).attr("data-transPeriod");switch(S="undefined"!=typeof X&&X!==!1&&""!==X?parseFloat(X):e.transPeriod,a(v).hasClass("camerastarted")||(q="simpleFade",j="next",I="",S=400,a(v).addClass("camerastarted")),q){case"simpleFade":H=1,P=1;break;case"curtainTopLeft":H=0==e.slicedCols?e.cols:e.slicedCols,P=1;break;case"curtainTopRight":H=0==e.slicedCols?e.cols:e.slicedCols,P=1;break;case"curtainBottomLeft":H=0==e.slicedCols?e.cols:e.slicedCols,P=1;break;case"curtainBottomRight":H=0==e.slicedCols?e.cols:e.slicedCols,P=1;break;case"curtainSliceLeft":H=0==e.slicedCols?e.cols:e.slicedCols,P=1;break;case"curtainSliceRight":H=0==e.slicedCols?e.cols:e.slicedCols,P=1;break;case"blindCurtainTopLeft":P=0==e.slicedRows?e.rows:e.slicedRows,H=1;break;case"blindCurtainTopRight":P=0==e.slicedRows?e.rows:e.slicedRows,H=1;break;case"blindCurtainBottomLeft":P=0==e.slicedRows?e.rows:e.slicedRows,H=1;break;case"blindCurtainBottomRight":P=0==e.slicedRows?e.rows:e.slicedRows,H=1;break;case"blindCurtainSliceTop":P=0==e.slicedRows?e.rows:e.slicedRows,H=1;break;case"blindCurtainSliceBottom":P=0==e.slicedRows?e.rows:e.slicedRows,H=1;break;case"stampede":W="-"+S;break;case"mosaic":W=e.gridDifference;break;case"mosaicReverse":W=e.gridDifference;break;case"mosaicRandom":break;case"mosaicSpiral":W=e.gridDifference,D=1.7;break;case"mosaicSpiralReverse":W=e.gridDifference,D=1.7;break;case"topLeftBottomRight":W=e.gridDifference,D=6;break;case"bottomRightTopLeft":W=e.gridDifference,D=6;break;case"bottomLeftTopRight":W=e.gridDifference,D=6;break;case"topRightBottomLeft":W=e.gridDifference,D=6;break;case"scrollLeft":H=1,P=1;break;case"scrollRight":H=1,P=1;break;case"scrollTop":H=1,P=1;break;case"scrollBottom":H=1,P=1;break;case"scrollHorz":H=1,P=1}for(var Y,ee,te=0,ie=P*H,re=f-Math.floor(f/H)*H,oe=g-Math.floor(g/P)*P,se=0,ne=0,ce=new Array,le=new Array,de=new Array;ie>te;){ce.push(te),le.push(te),A.append('