jQuery.fn.crossSlide=function(a,c){var f=this,b=this.width(),e=this.height();function g(h){for(var j=1;j<arguments.length;j++){h=h.replace(new RegExp("\\{"+(j-1)+"}","g"),arguments[j])}return h}function d(){arguments[0]="crossSlide: "+arguments[0];throw g.apply(null,arguments)}(function(h){var j=0;function i(l,k){k.onload=function(m){j++;c[l].width=k.width;c[l].height=k.height;if(j==c.length){h()}};k.src=c[l].src;if(l+1<c.length){i(l+1,new Image())}}i(0,new Image())})(function(){function w(p){var i=1;var z=p.replace(/^\s*|\s*$/g,"").split(/\s+/);if(z.length>3){throw new Error()}if(z[0]=="center"){if(z.length==1){z=["center","center"]}else{if(z.length==2&&z[1].match(/^[\d.]+x$/i)){z=["center","center",z[1]]}}}if(z.length==3){i=parseFloat(z[2].match(/^([\d.]+)x$/i)[1])}var y=z[0]+" "+z[1];if(y=="left top"||y=="top left"){return{xrel:0,yrel:0,zoom:i}}if(y=="left center"||y=="center left"){return{xrel:0,yrel:0.5,zoom:i}}if(y=="left bottom"||y=="bottom left"){return{xrel:0,yrel:1,zoom:i}}if(y=="center top"||y=="top center"){return{xrel:0.5,yrel:0,zoom:i}}if(y=="center center"){return{xrel:0.5,yrel:0.5,zoom:i}}if(y=="center bottom"||y=="bottom center"){return{xrel:0.5,yrel:1,zoom:i}}if(y=="right top"||y=="top right"){return{xrel:1,yrel:0,zoom:i}}if(y=="right center"||y=="center right"){return{xrel:1,yrel:0.5,zoom:i}}if(y=="right bottom"||y=="bottom right"){return{xrel:1,yrel:1,zoom:i}}return{xrel:parseInt(z[0].match(/^(\d+)%$/)[1])/100,yrel:parseInt(z[1].match(/^(\d+)%$/)[1])/100,zoom:i}}function q(z,y){switch(y){case 1:var i=0;break;case 2:var i=s/(z.time_ms+2*s);break;case 3:var i=1-s/(z.time_ms+2*s);break;case 4:var i=1;break}return{left:Math.round(z.from.left+i*(z.to.left-z.from.left)),top:Math.round(z.from.top+i*(z.to.top-z.from.top)),width:Math.round(z.from.width+i*(z.to.width-z.from.width)),height:Math.round(z.from.height+i*(z.to.height-z.from.height))}}if(!a.fade){d("missing fade parameter.")}if(a.speed&&a.sleep){d("you cannot set both speed and sleep at the same time.")}var s=Math.round(a.fade*1000);if(a.sleep){var u=Math.round(a.sleep*1000)}if(a.speed){var l=a.speed/1000,j=Math.round(s*l)}f.empty().css({overflow:"hidden",padding:0});if(!/^(absolute|relative|fixed)$/.test(f.css("position"))){f.css({position:"relative"})}if(!f.width()||!f.height()){d("container element does not have its own width and height")}if(a.shuffle){c.sort(function(){return Math.random()-0.5})}for(var h=0;h<c.length;++h){var r=c[h];if(!r.src){d("missing src parameter in picture {0}.",h+1)}if(l){switch(r.dir){case"up":r.from={xrel:0.5,yrel:0,zoom:1};r.to={xrel:0.5,yrel:1,zoom:1};var k=r.height-e-2*j;break;case"down":r.from={xrel:0.5,yrel:1,zoom:1};r.to={xrel:0.5,yrel:0,zoom:1};var k=r.height-e-2*j;break;case"left":r.from={xrel:0,yrel:0.5,zoom:1};r.to={xrel:1,yrel:0.5,zoom:1};var k=r.width-b-2*j;break;case"right":r.from={xrel:1,yrel:0.5,zoom:1};r.to={xrel:0,yrel:0.5,zoom:1};var k=r.width-b-2*j;break;default:d('missing or malformed "dir" parameter in picture {0}.',h+1)}if(k<=0){d("picture number {0} is too short for the desired fade duration.",h+1)}r.time_ms=Math.round(k/l)}else{if(!u){if(!r.from||!r.to||!r.time){d("missing either speed/sleep option, or from/to/time params in picture {0}.",h+1)}try{r.from=w(r.from)}catch(o){d('malformed "from" parameter in picture {0}.',h+1)}try{r.to=w(r.to)}catch(o){d('malformed "to" parameter in picture {0}.',h+1)}if(!r.time){d('missing "time" parameter in picture {0}.',h+1)}r.time_ms=Math.round(r.time*1000)}}if(r.from){jQuery.each([r.from,r.to],function(y,p){p.width=Math.round(r.width*p.zoom);p.height=Math.round(r.height*p.zoom);p.left=Math.round((b-p.width)*p.xrel);p.top=Math.round((e-p.height)*p.yrel)})}var v;if(r.href){v=jQuery(g('<a href="{0}"><img src="{1}"/></a>',r.href,r.src))}else{v=jQuery(g('<img src="{0}"/>',r.src))}if(r.onclick){v.click(r.onclick)}if(r.alt){v.find("img").attr("alt",r.alt)}v.appendTo(f)}l=undefined;var t=f.find("img").css({position:"absolute",visibility:"hidden",top:0,left:0,border:0});t.eq(0).css({visibility:"visible"});if(!u){t.eq(0).css(q(c[0],2))}var n=a.loop;function m(E,K){if(E%2==0){if(u){var N=E/2,I=(N-1+c.length)%c.length,G=t.eq(N),J=t.eq(I);var D=function(){J.css("visibility","hidden");setTimeout(K,u)}}else{var F=E/2,I=(F-1+c.length)%c.length,M=t.eq(F),J=t.eq(I),y=c[F].time_ms,A=q(c[F],3);var D=function(){J.css("visibility","hidden");M.animate(A,y,"linear",K)}}}else{if(u){var L=Math.floor(E/2),z=Math.ceil(E/2)%c.length,B=t.eq(L),p=t.eq(z),O={},P={visibility:"visible"},H={};if(z>L){P.opacity=0;H.opacity=1}else{O.opacity=0}var D=function(){p.css(P);if(O.opacity!=undefined){B.animate(O,s,"linear",K)}else{p.animate(H,s,"linear",K)}}}else{var L=Math.floor(E/2),z=Math.ceil(E/2)%c.length,B=t.eq(L),p=t.eq(z),O=q(c[L],4),P=q(c[z],1),H=q(c[z],2);if(z>L){P.opacity=0;H.opacity=1}else{O.opacity=0}P.visibility="visible";var D=function(){B.animate(O,s,"linear");p.css(P);p.animate(H,s,"linear",K)}}}if(a.loop&&E==c.length*2-2){var C=D;D=function(){if(--n){C()}}}if(E>0){return m(E-1,D)}else{return D}}var x=m(c.length*2-1,function(){return x()});x()});return f};
