// camera slideshow v1.4.0 - 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(h,v){var n={alignment:"center",autoadvance:true,mobileautoadvance:true,bardirection:"lefttoright",barposition:"bottom",cols:6,easing:"easeinoutexpo",mobileeasing:"",fx:"random",mobilefx:"",griddifference:250,height:"50%",imagepath:"images/",hover:true,loader:"pie",loadercolor:"#eeeeee",loaderbgcolor:"#222222",loaderopacity:0.8,loaderpadding:2,loaderstroke:7,minheight:"200px",navigation:true,navigationhover:true,mobilenavhover:true,opacityongrid:false,overlayer:true,pagination:true,playpause:true,pauseonclick:true,piediameter:38,pieposition:"righttop",portrait:false,rows:4,slicedcols:12,slicedrows:8,slideon:"random",thumbnails:false,time:7000,transperiod:1500,onendtransition:function(){},onloaded:function(){},onstartloading:function(){},onstarttransition:function(){}};function l(){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}}a.support.borderradius=false;a.each(["borderradius","borderradius","mozborderradius","webkitborderradius","oborderradius","khtmlborderradius"],function(){if(document.body.style[this]!==undefined){a.support.borderradius=true}});var h=a.extend({},n,h);var ae=a(this).addclass("camera_wrap");ae.wrapinner('
').wrapinner('
');var d=a(".camera_fakehover",ae);var w=(".camera_fakehover",ae);d.append('
');if(h.overlayer==true){d.append('
')}d.append('
');var c;if(h.loader=="pie"&&!a.support.borderradius){c="bar"}else{c=h.loader}if(c=="pie"){d.append('
')}else{if(c=="bar"){d.append('
')}else{d.append('')}}if(h.playpause==true){d.append('
')}if(h.navigation==true){d.append('
').append('
')}if(h.thumbnails==true){ae.append('
')}if(h.thumbnails==true&&h.pagination!=true){a(".camera_thumbs_cont",ae).wrap("
").wrap('
').wrap("
").wrap('
')}if(h.pagination==true){ae.append('
')}ae.append('
');a(".camera_caption",ae).each(function(){a(this).wrapinner("
")});var q="pie_"+ae.index(),ag=a(".camera_src",ae),b=a(".camera_target",ae),s=a(".camera_target_content",ae),p=a(".camera_pie",ae),ah=a(".camera_bar",ae),am=a(".camera_prev",ae),r=a(".camera_next",ae),r=a(".camera_commands",ae),n=a(".camera_pag",ae),m=a(".camera_thumbs_cont",ae);var z,aj;var x=new array();a("> div",ag).each(function(){x.push(a(this).attr("data-src"))});var c=new array();a("> div",ag).each(function(){if(a(this).attr("data-link")){c.push(a(this).attr("data-link"))}else{c.push("")}});var m=new array();a("> div",ag).each(function(){if(a(this).attr("data-target")){m.push(a(this).attr("data-target"))}else{m.push("")}});var k=new array();a("> div",ag).each(function(){if(a(this).attr("data-portrait")){k.push(a(this).attr("data-portrait"))}else{k.push("")}});var o=new array();a("> div",ag).each(function(){if(a(this).attr("data-alignment")){o.push(a(this).attr("data-alignment"))}else{o.push("")}});var j=new array();a("> div",ag).each(function(){if(a(this).attr("data-thumb")){j.push(a(this).attr("data-thumb"))}else{j.push("")}});var y=x.length;a(s).append('
');var j;for(j=0;j');if(c[j]!=""){var t=a("> div ",ag).eq(j).attr("data-box");if(typeof t!=="undefined"&&t!==false&&t!=""){t='data-box="'+a("> div ",ag).eq(j).attr("data-box")+'"'}else{t=""}a(".camera_target_content .cameracontent:eq("+j+")",ae).append('')}}a(".camera_caption",ae).each(function(){var u=a(this).parent().index(),h=ae.find(".cameracontent").eq(u);a(this).appendto(h)});b.append('
');var f=a(".cameracont",ae);var e;for(e=0;e');var ak=a("> div:eq("+e+")",ag);b.find(".cameraslide_"+e).clone(ak)}function z(){var h=a(m).width();a("li",m).removeclass("camera_visthumb");a("li",m).each(function(){var au=a(this).position(),u=a("ul",m).outerwidth(),w=a("ul",m).offset().left,aq=a("> div",m).offset().left,at=aq-w;if(at>0){a(".camera_prevthumbs",u).removeclass("hidenav")}else{a(".camera_prevthumbs",u).addclass("hidenav")}if((u-at)>h){a(".camera_nextthumbs",u).removeclass("hidenav")}else{a(".camera_nextthumbs",u).addclass("hidenav")}var ar=au.left,ap=au.left+(a(this).width());if(ap-at<=h&&ar-at>=0){a(this).addclass("camera_visthumb")}})}a(window).bind("load resize pageshow",function(){i();z()});f.append('
'); var an;ae.show();var z=b.width();var aj=b.height();var ai;a(window).bind("resize pageshow",function(){if(an==true){v()}a("ul",m).animate({"margin-top":0},0,i);if(!ag.hasclass("paused")){ag.addclass("paused");if(a(".camera_stop",u).length){a(".camera_stop",u).hide();a(".camera_play",u).show();if(c!="none"){a("#"+q).hide()}}else{if(c!="none"){a("#"+q).hide()}}cleartimeout(ai);ai=settimeout(function(){ag.removeclass("paused");if(a(".camera_play",u).length){a(".camera_play",u).hide();a(".camera_stop",u).show();if(c!="none"){a("#"+q).fadein()}}else{if(c!="none"){a("#"+q).fadein()}}},1500)}});function v(){var h;function u(){z=ae.width();if(h.height.indexof("%")!=-1){var w=math.round(z/(100/parsefloat(h.height)));if(h.minheight!=""&&w');var e;var a=h.bardirection;var u=ae;a("iframe",d).each(function(){var h=a(this);var w=h.attr("src");h.attr("data-src",w);var u=h.parent().index(".camera_src > div");a(".camera_target_content .cameracontent:eq("+u+")",ae).append(h)});function af(){a("iframe",d).each(function(){a(".camera_caption",d).show();var w=a(this);var u=w.attr("data-src");w.attr("src",u);var aq=h.imagepath+"blank.gif";var h=new image();h.src=aq;if(h.height.indexof("%")!=-1){var ap=math.round(z/(100/parsefloat(h.height)));if(h.minheight!=""&&ap');a(".camera_bar_cont",ah).animate({opacity:h.loaderopacity},0).css({position:"absolute",left:0,right:0,top:0,bottom:0,"background-color":h.loaderbgcolor}).append('');a("#"+q).animate({opacity:0},0);var l=a("#"+q);l.css({position:"absolute","background-color":h.loadercolor});switch(h.barposition){case"left":ah.css({right:"auto",width:h.loaderstroke});break;case"right":ah.css({left:"auto",width:h.loaderstroke});break;case"top":ah.css({bottom:"auto",height:h.loaderstroke});break;case"bottom":ah.css({top:"auto",height:h.loaderstroke});break}switch(a){case"lefttoright":l.css({left:0,right:0,top:h.loaderpadding,bottom:h.loaderpadding});break;case"righttoleft":l.css({left:0,right:0,top:h.loaderpadding,bottom:h.loaderpadding});break;case"toptobottom":l.css({left:h.loaderpadding,right:h.loaderpadding,top:0,bottom:0});break;case"bottomtotop":l.css({left:h.loaderpadding,right:h.loaderpadding,top:0,bottom:0});break}}else{p.append('');var ad;var l=document.getelementbyid(q);l.setattribute("width",h.piediameter);l.setattribute("height",h.piediameter);var ao;switch(h.pieposition){case"lefttop":ao="left:0; top:0;";break;case"righttop":ao="right:0; top:0;";break;case"leftbottom":ao="left:0; bottom:0;";break;case"rightbottom":ao="right:0; bottom:0;";break}l.setattribute("style","position:absolute; z-index:1002; "+ao);var g;var f;if(l&&l.getcontext){var b=l.getcontext("2d");b.rotate(math.pi*(3/2));b.translate(-h.piediameter,0)}}if(c=="none"||d==false){a("#"+q).hide();a(".camera_canvas_wrap",u).hide()}if(a(n).length){a(n).append('
    ');var o;for(o=0;o'+o+"")}a(".camera_pag_ul li",ae).hover(function(){a(this).addclass("camera_hover");if(a(".camera_thumb",this).length){var u=a(".camera_thumb",this).outerwidth(),w=a(".camera_thumb",this).outerheight(),h=a(this).outerwidth();a(".camera_thumb",this).show().css({top:"-"+w+"px",left:"-"+(u-h)/2+"px"}).animate({opacity:1,"margin-top":"-3px"},200);a(".thumb_arrow",this).show().animate({opacity:1,"margin-top":"-3px"},200)}},function(){a(this).removeclass("camera_hover");a(".camera_thumb",this).animate({"margin-top":"-20px",opacity:0},200,function(){a(this).css({margintop:"5px"}).hide()});a(".thumb_arrow",this).animate({"margin-top":"-20px",opacity:0},200,function(){a(this).css({margintop:"5px"}).hide()})})}if(a(m).length){var al;if(!a(n).length){a(m).append("
    ");a(m).before('
    ').before('
    ');a("> div",m).append("
      ");a.each(j,function(h,w){if(a("> div",ag).eq(h).attr("data-thumb")!=""){var ap=a("> div",ag).eq(h).attr("data-thumb"),u=new image();u.src=ap;a("ul",m).append('
    • ');a("li.pix_thumb_"+h,m).append(a(u).attr("class","camera_thumb"))}})}else{a.each(j,function(h,w){if(a("> div",ag).eq(h).attr("data-thumb")!=""){var ap=a("> div",ag).eq(h).attr("data-thumb"),u=new image();u.src=ap;a("li.pag_nav_"+h,n).append(a(u).attr("class","camera_thumb").css({position:"absolute"}).animate({opacity:0},0));a("li.pag_nav_"+h+" > img",n).after('
      '); a("li.pag_nav_"+h+" > .thumb_arrow",n).animate({opacity:0},0)}});ae.css({marginbottom:a(n).outerheight()})}}else{if(!a(m).length&&a(n).length){ae.css({marginbottom:a(n).outerheight()})}}var g=true;function i(){if(a(m).length&&!a(n).length){var w=a(m).outerwidth(),ap=a("ul > li",m).outerwidth(),au=a("li.cameracurrent",m).length?a("li.cameracurrent",m).position():"",u=(a("ul > li",m).length*a("ul > li",m).outerwidth()),ar=a("ul",m).offset().left,at=a("> div",m).offset().left,h;if(ar<0){h="-"+(at-ar)}else{h=at-ar}if(g==true){a("ul",m).width(a("ul > li",m).length*a("ul > li",m).outerwidth());if(a(m).length&&!a(n).lenght){ae.css({marginbottom:a(m).outerheight()})}z();a("ul",m).width(a("ul > li",m).length*a("ul > li",m).outerwidth());if(a(m).length&&!a(n).lenght){ae.css({marginbottom:a(m).outerheight()})}}g=false;var aq=a("li.cameracurrent",m).length?au.left:"",av=a("li.cameracurrent",m).length?au.left+(a("li.cameracurrent",m).outerwidth()):"";if(aqw){if((aq+w)
      ').append('
      ');if(d==true){a(".camera_play",u).hide();a(".camera_stop",u).show()}else{a(".camera_stop",u).hide();a(".camera_play",u).show()}}function k(){g=0;var h=a(".camera_bar_cont",u).width(),u=a(".camera_bar_cont",u).height();if(c!="pie"){switch(a){case"lefttoright":a("#"+q).css({right:h});break;case"righttoleft":a("#"+q).css({left:h});break;case"toptobottom":a("#"+q).css({bottom:u});break;case"bottomtotop":a("#"+q).css({top:u});break}}else{b.clearrect(0,0,h.piediameter,h.piediameter)}}k();a(".movefromleft, .movefromright, .movefromtop, .movefrombottom, .fadein, .fadefromleft, .fadefromright, .fadefromtop, .fadefrombottom",d).each(function(){a(this).css("visibility","hidden")});h.onstartloading.call(this);t();function t(af){ag.addclass("camerasliding");s=false;var az=parsefloat(a("div.cameraslide.cameracurrent",b).index());if(af>0){var ak=af-1}else{if(az==y-1){var ak=0}else{var ak=az+1}}var u=a(".cameraslide:eq("+ak+")",b);var al=a(".cameraslide:eq("+(ak+1)+")",b).addclass("cameranext");if(az!=ak+1){al.hide()}a(".cameracontent",d).fadeout(600);a(".camera_caption",d).show();a(".camerarelative",u).append(a("> div ",ag).eq(ak).find("> div.camera_effected"));a(".camera_target_content .cameracontent:eq("+ak+")",ae).append(a("> div ",ag).eq(ak).find("> div"));if(!a(".imgloaded",u).length){var ac=x[ak];var aj=new image();aj.src=ac+"?"+new date().gettime();u.css("visibility","hidden");u.prepend(a(aj).attr("class","imgloaded").css("visibility","hidden"));var au,ar;if(!a(aj).get(0).complete||au=="0"||ar=="0"||typeof au==="undefined"||au===false||typeof ar==="undefined"||ar===false){a(".camera_loader",ae).delay(500).fadein(400);aj.onload=function(){au=aj.naturalwidth;ar=aj.naturalheight;a(aj).attr("data-alignment",o[ak]).attr("data-portrait",k[ak]);a(aj).attr("width",au);a(aj).attr("height",ar);b.find(".cameraslide_"+ak).hide().css("visibility","visible");v();t(ak+1)}}}else{if(x.length>(ak+1)&&!a(".imgloaded",al).length){var at=x[(ak+1)];var aa=new image();aa.src=at+"?"+new date().gettime();al.prepend(a(aa).attr("class","imgloaded").css("visibility","hidden"));aa.onload=function(){au=aa.naturalwidth;ar=aa.naturalheight;a(aa).attr("data-alignment",o[ak+1]).attr("data-portrait",k[ak+1]);a(aa).attr("width",au);a(aa).attr("height",ar);v()}}h.onloaded.call(this);if(a(".camera_loader",ae).is(":visible")){a(".camera_loader",ae).fadeout(400)}else{a(".camera_loader",ae).css({visibility:"hidden"});a(".camera_loader",ae).fadeout(400,function(){a(".camera_loader",ae).css({visibility:"visible"})})}var a0=h.rows,av=h.cols,aw=1,h=0,ad,ax,ai,ab,an,az=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(h.opacityongrid==true){opacityongrid=0}else{opacityongrid=1}var aw=a(" > div",ag).eq(ak).attr("data-fx");if(l()&&h.mobilefx!=""&&h.mobilefx!="default"){ab=h.mobilefx}else{if(typeof aw!=="undefined"&&aw!==false&&aw!=="default"){ab=aw}else{ab=h.fx}}if(ab=="random"){ab=q(az);ab=ab[0]}else{ab=ab;if(ab.indexof(",")>0){ab=ab.replace(/ /g,"");ab=ab.split(",");ab=q(ab);ab=ab[0]}}dataeasing=a(" > div",ag).eq(ak).attr("data-easing");mobileeasing=a(" > div",ag).eq(ak).attr("data-mobileeasing"); if(l()&&h.mobileeasing!=""&&h.mobileeasing!="default"){if(typeof mobileeasing!=="undefined"&&mobileeasing!==false&&mobileeasing!=="default"){an=mobileeasing}else{an=h.mobileeasing}}else{if(typeof dataeasing!=="undefined"&&dataeasing!==false&&dataeasing!=="default"){an=dataeasing}else{an=h.easing}}ad=a(" > div",ag).eq(ak).attr("data-slideon");if(typeof ad!=="undefined"&&ad!==false){at=ad}else{if(h.slideon=="random"){var at=new array("next","prev");at=q(at);at=at[0]}else{at=h.slideon}}var aq=a(" > div",ag).eq(ak).attr("data-time");if(typeof aq!=="undefined"&&aq!==false&&aq!==""){ax=parsefloat(aq)}else{ax=h.time}var ap=a(" > div",ag).eq(ak).attr("data-transperiod");if(typeof ap!=="undefined"&&ap!==false&&ap!==""){ai=parsefloat(ap)}else{ai=h.transperiod}if(!a(ag).hasclass("camerastarted")){ab="simplefade";at="next";an="";ai=400;a(ag).addclass("camerastarted")}switch(ab){case"simplefade":av=1;a0=1;break;case"curtaintopleft":if(h.slicedcols==0){av=h.cols}else{av=h.slicedcols}a0=1;break;case"curtaintopright":if(h.slicedcols==0){av=h.cols}else{av=h.slicedcols}a0=1;break;case"curtainbottomleft":if(h.slicedcols==0){av=h.cols}else{av=h.slicedcols}a0=1;break;case"curtainbottomright":if(h.slicedcols==0){av=h.cols}else{av=h.slicedcols}a0=1;break;case"curtainsliceleft":if(h.slicedcols==0){av=h.cols}else{av=h.slicedcols}a0=1;break;case"curtainsliceright":if(h.slicedcols==0){av=h.cols}else{av=h.slicedcols}a0=1;break;case"blindcurtaintopleft":if(h.slicedrows==0){a0=h.rows}else{a0=h.slicedrows}av=1;break;case"blindcurtaintopright":if(h.slicedrows==0){a0=h.rows}else{a0=h.slicedrows}av=1;break;case"blindcurtainbottomleft":if(h.slicedrows==0){a0=h.rows}else{a0=h.slicedrows}av=1;break;case"blindcurtainbottomright":if(h.slicedrows==0){a0=h.rows}else{a0=h.slicedrows}av=1;break;case"blindcurtainslicetop":if(h.slicedrows==0){a0=h.rows}else{a0=h.slicedrows}av=1;break;case"blindcurtainslicebottom":if(h.slicedrows==0){a0=h.rows}else{a0=h.slicedrows}av=1;break;case"stampede":h="-"+ai;break;case"mosaic":h=h.griddifference;break;case"mosaicreverse":h=h.griddifference;break;case"mosaicrandom":break;case"mosaicspiral":h=h.griddifference;aw=1.7;break;case"mosaicspiralreverse":h=h.griddifference;aw=1.7;break;case"topleftbottomright":h=h.griddifference;aw=6;break;case"bottomrighttopleft":h=h.griddifference;aw=6;break;case"bottomlefttopright":h=h.griddifference;aw=6;break;case"toprightbottomleft":h=h.griddifference;aw=6;break;case"scrollleft":av=1;a0=1;break;case"scrollright":av=1;a0=1;break;case"scrolltop":av=1;a0=1;break;case"scrollbottom":av=1;a0=1;break;case"scrollhorz":av=1;a0=1;break}var av=0;var a2=a0*av;var a1=z-(math.floor(z/av)*av);var w=aj-(math.floor(aj/a0)*a0);var ae;var am;var ag=0;var ap=0;var ay=new array();var ao=new array();var aq=new array();while(av