// camera slideshow v1.3.4 - 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(b,c){function e(){if(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)){return true}}function h(){var b=a(s).width();a("li",s).removeclass("camera_visthumb");a("li",s).each(function(){var c=a(this).position(),d=a("ul",s).outerwidth(),e=a("ul",s).offset().left,f=a("> div",s).offset().left,g=f-e;if(g>0){a(".camera_prevthumbs",v).removeclass("hidenav")}else{a(".camera_prevthumbs",v).addclass("hidenav")}if(d-g>b){a(".camera_nextthumbs",v).removeclass("hidenav")}else{a(".camera_nextthumbs",v).addclass("hidenav")}var h=c.left,i=c.left+a(this).width();if(i-g<=b&&h-g>=0){a(this).addclass("camera_visthumb")}})}function k(){function d(){t=f.width();if(b.height.indexof("%")!=-1){var c=math.round(t/(100/parsefloat(b.height)));if(b.minheight!=""&&c li",s).outerwidth(),d=a("li.cameracurrent",s).length?a("li.cameracurrent",s).position():"",e=a("ul > li",s).length*a("ul > li",s).outerwidth(),g=a("ul",s).offset().left,h=a("> div",s).offset().left,i;if(g<0){i="-"+(h-g)}else{i=h-g}if(gb==true){a("ul",s).width(a("ul > li",s).length*a("ul > li",s).outerwidth());if(a(s).length&&!a(r).lenght){f.css({marginbottom:a(s).outerheight()})}h();a("ul",s).width(a("ul > li",s).length*a("ul > li",s).outerwidth());if(a(s).length&&!a(r).lenght){f.css({marginbottom:a(s).outerheight()})}}gb=false;var j=a("li.cameracurrent",s).length?d.left:"",k=a("li.cameracurrent",s).length?d.left+a("li.cameracurrent",s).outerwidth():"";if(jb){if(j+b0){var l=c-1}else if(d==b-1){var l=0}else{var l=d+1}var m=a(".cameraslide:eq("+l+")",k);var n=a(".cameraslide:eq("+(l+1)+")",k).addclass("cameranext");if(d!=l+1){n.hide()}a(".cameracontent",g).fadeout(600);a(".camera_caption",g).show();a(".camerarelative",m).append(a("> div ",j).eq(l).find("> div.camera_effected"));a(".camera_target_content .cameracontent:eq("+l+")",f).append(a("> div ",j).eq(l).find("> div"));if(!a(".imgloaded",m).length){var o=v[l];var p=new image;p.src=o+"?"+(new date).gettime();m.css("visibility","hidden");m.prepend(a(p).attr("class","imgloaded").css("visibility","hidden"));var q,w;if(!a(p).get(0).complete||q=="0"||w=="0"||typeof q==="undefined"||q===false||typeof w==="undefined"||w===false){a(".camera_loader",f).delay(500).fadein(400);p.onload=function(){q=p.naturalwidth;w=p.naturalheight;a(p).attr("data-alignment",z[l]).attr("data-portrait",y[l]);a(p).attr("width",q);a(p).attr("height",w);k.find(".cameraslide_"+l).hide().css("visibility","visible");k();jb(l+1)}}}else{if(v.length>l+1&&!a(".imgloaded",n).length){var x=v[l+1];var a=new image;a.src=x+"?"+(new date).gettime();n.prepend(a(a).attr("class","imgloaded").css("visibility","hidden"));a.onload=function(){q=a.naturalwidth;w=a.naturalheight;a(a).attr("data-alignment",z[l+1]).attr("data-portrait",y[l+1]);a(a).attr("width",q);a(a).attr("height",w);k()}}b.onloaded.call(this);if(a(".camera_loader",f).is(":visible")){a(".camera_loader",f).fadeout(400)}else{a(".camera_loader",f).css({visibility:"hidden"});a(".camera_loader",f).fadeout(400,function(){a(".camera_loader",f).css({visibility:"visible"})})}var c=b.rows,d=b.cols,f=1,g=0,h,i,j,n,o,p=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;if(b.opacityongrid==true){opacityongrid=0}else{opacityongrid=1}var q=a(" > div",j).eq(l).attr("data-fx");if(e()&&b.mobilefx!=""&&b.mobilefx!="default"){n=b.mobilefx}else{if(typeof q!=="undefined"&&q!==false&&q!=="default"){n=q}else{n=b.fx}}if(n=="random"){n=x(p);n=n[0]}else{n=n;if(n.indexof(",")>0){n=n.replace(/ /g,"");n=n.split(",");n=x(n);n=n[0]}}dataeasing=a(" > div",j).eq(l).attr("data-easing");mobileeasing=a(" > div",j).eq(l).attr("data-mobileeasing");if(e()&&b.mobileeasing!=""&&b.mobileeasing!="default"){if(typeof mobileeasing!=="undefined"&&mobileeasing!==false&&mobileeasing!=="default"){o=mobileeasing}else{o=b.mobileeasing}}else{if(typeof dataeasing!=="undefined"&&dataeasing!==false&&dataeasing!=="default"){o=dataeasing}else{o=b.easing}}h=a(" > div",j).eq(l).attr("data-slideon");if(typeof h!=="undefined"&&h!==false){t=h}else{if(b.slideon=="random"){var t=new array("next","prev");t=x(t);t=t[0]}else{t=b.slideon}}var y=a(" > div",j).eq(l).attr("data-time");if(typeof y!=="undefined"&&y!==false&&y!==""){i=parsefloat(y)}else{i=b.time}var z=a(" > div",j).eq(l).attr("data-transperiod");if(typeof z!=="undefined"&&z!==false&&z!==""){j=parsefloat(z)}else{j=b.transperiod}if(!a(j).hasclass("camerastarted")){n="simplefade";t="next";o="";j=400;a(j).addclass("camerastarted")}switch(n){case"simplefade":d=1;c=1;break;case"curtaintopleft":if(b.slicedcols==0){d=b.cols}else{d=b.slicedcols}c=1;break;case"curtaintopright":if(b.slicedcols==0){d=b.cols}else{d=b.slicedcols}c=1;break;case"curtainbottomleft":if(b.slicedcols==0){d=b.cols}else{d=b.slicedcols}c=1;break;case"curtainbottomright":if(b.slicedcols==0){d=b.cols}else{d=b.slicedcols}c=1;break;case"curtainsliceleft":if(b.slicedcols==0){d=b.cols}else{d=b.slicedcols}c=1;break;case"curtainsliceright":if(b.slicedcols==0){d=b.cols}else{d=b.slicedcols}c=1;break;case"blindcurtaintopleft":if(b.slicedrows==0){c=b.rows}else{c=b.slicedrows}d=1;break;case"blindcurtaintopright":if(b.slicedrows==0){c=b.rows}else{c=b.slicedrows}d=1;break;case"blindcurtainbottomleft":if(b.slicedrows==0){c=b.rows}else{c=b.slicedrows}d=1;break;case"blindcurtainbottomright":if(b.slicedrows==0){c=b.rows}else{c=b.slicedrows}d=1;break;case"blindcurtainslicetop":if(b.slicedrows==0){c=b.rows}else{c=b.slicedrows}d=1;break;case"blindcurtainslicebottom":if(b.slicedrows==0){c=b.rows}else{c=b.slicedrows}d=1;break;case"stampede":g="-"+j;break;case"mosaic":g=b.griddifference;break;case"mosaicreverse":g=b.griddifference;break;case"mosaicrandom":break;case"mosaicspiral":g=b.griddifference;f=1.7;break;case"mosaicspiralreverse":g=b.griddifference;f=1.7;break;case"topleftbottomright":g=b.griddifference;f=6;break;case"bottomrighttopleft":g=b.griddifference;f=6;break;case"bottomlefttopright":g=b.griddifference;f=6;break;case"toprightbottomleft":g=b.griddifference;f=6;break;case"scrollleft":d=1;c=1;break;case"scrollright":d=1;c=1;break;case"scrolltop":d=1;c=1;break;case"scrollbottom":d=1;c=1;break;case"scrollhorz":d=1;c=1;break}var _=0;var ab=c*d;var eb=t-math.floor(t/d)*d;var fb=u-math.floor(u/c)*c;var gb;var kb;var lb=0;var mb=0;var nb=new array;var ob=new array;var pb=new array;while(_