

var cvi_tween=new Object();cvi_tween.linear=function(s,c){return(1/s)*c;}
cvi_tween.sineEaseIn=function(s,c){return-1*Math.cos(c/s*(Math.PI/2))+1;}
cvi_tween.sineEaseOut=function(s,c){return Math.sin(c/s*(Math.PI/2));}
cvi_tween.sineEaseInOut=function(s,c){return-1/2*(Math.cos(Math.PI*c/s)-1);}
cvi_tween.quadEaseIn=function(s,c){return(c/=s)*c;}
cvi_tween.quadEaseOut=function(s,c){return-1*(c/=s)*(c-2);}
cvi_tween.quadEaseInOut=function(s,c){if((c/=s/2)<1){return 1/2*c*c;}return-1/2*((--c)*(c-2)-1);}
cvi_tween.cubicEaseIn=function(s,c){return(c/=s)*c*c;}
cvi_tween.cubicEaseOut=function(s,c){return((c=c/s-1)*c*c+1);}
cvi_tween.cubicEaseInOut=function(s,c){if((c/=s/2)<1){return 1/2*c*c*c;}return 1/2*((c-=2)*c*c+2);}
cvi_tween.quartEaseIn=function(s,c){return(c/=s)*c*c*c;}
cvi_tween.quartEaseOut=function(s,c){return-1*((c=c/s-1)*c*c*c-1);}
cvi_tween.quartEaseInOut=function(s,c){if((c/=s/2)<1){return 1/2*c*c*c*c;}return-1/2*((c-=2)*c*c*c-2);}
cvi_tween.quintEaseIn=function(s,c){return(c/=s)*c*c*c*c;}
cvi_tween.quintEaseOut=function(s,c){return((c=c/s-1)*c*c*c*c+1);}
cvi_tween.quintEaseInOut=function(s,c){if((c/=s/2)<1){return 1/2*c*c*c*c*c;}return 1/2*((c-=2)*c*c*c*c+2);}
cvi_tween.expoEaseIn=function(s,c){return(c==0)?0:Math.pow(2,10*(c/s-1));}
cvi_tween.expoEaseOut=function(s,c){return(c==s)?1:(-Math.pow(2,-10*c/s)+1);}
cvi_tween.expoEaseInOut=function(s,c){if(c==0){return 0;}if(c==s){return 1;}if((c/=s/2)<1){return 1/2*Math.pow(2,10*(c-1));}return 1/2*(-Math.pow(2,-10*--c)+2);}
cvi_tween.circEaseIn=function(s,c){return-1*(Math.sqrt(1-(c/=s)*c)-1);}
cvi_tween.circEaseOut=function(s,c){return Math.sqrt(1-(c=c/s-1)*c);}
cvi_tween.circEaseInOut=function(s,c){if((c/=s/2)<1){return-1/2*(Math.sqrt(1-c*c)-1);}return 1/2*(Math.sqrt(1-(c-=2)*c)+1);}
cvi_tween.bounceEaseIn=function(s,c){return 1-cvi_tween.bounceEaseOut(s,s-c);}
cvi_tween.bounceEaseOut=function(s,c){var k=7.5625;if((c/=s)<(1/2.75)){return(k*c*c);}else if(c<(2/2.75)){return(k*(c-=(1.5/2.75))*c+.75);}else if(c<(2.5/2.75)){return(k*(c-=(2.25/2.75))*c+.9375);}else{return(k*(c-=(2.625/2.75))*c+.984375);}}
cvi_tween.bounceEaseInOut=function(s,c){if(c<s/2){return cvi_tween.bounceEaseIn(s,c*2)*.5;}else{return cvi_tween.bounceEaseOut(s,c*2-s)*.5+1*.5;}}
cvi_tween.backEaseIn=function(s,c){var k=1.70158;return(c/=s)*c*((k+1)*c-k);}
cvi_tween.backEaseOut=function(s,c){var k=1.70158;return((c=c/s-1)*c*((k+1)*c+k)+1);}
cvi_tween.backEaseInOut=function(s,c){var k=1.70158;if((c/=s/2)<1){return 1/2*(c*c*(((k*=(1.525))+1)*c-k));}return 1/2*((c-=2)*c*(((k*=(1.525))+1)*c+k)+2);}
cvi_tween.elasticEaseIn=function(s,c,p,a,z){if(c==0){return 0;}if((c/=s)==1){return 1;}if(!z){z=s*.3;}if(!a||a<1){a=1;var k=z/4;}else{var k=z/(2*Math.PI)*Math.asin(1/a);}return-(a*Math.pow(2,10*(c-=1))*Math.sin((c*s-k)*(2*Math.PI)/z));}
cvi_tween.elasticEaseOut=function(s,c,p,a,z){if(c==0){return 0;}if((c/=s)==1){return 1;}if(!z){z=s*.3;}if(!a||a<1){a=1;var k=z/4;}else{var k=z/(2*Math.PI)*Math.asin(1/a);}return(a*Math.pow(2,-10*c)*Math.sin((c*s-k)*(2*Math.PI)/z)+1);}
cvi_tween.elasticEaseInOut=function(s,c,p,a,z){if(c==0){return 0;}if((c/=s/2)==2){return 1;}if(!z){z=s*(.3*1.5);}if(!a||a<1){a=1;var k=z/4;}else{var k=z/(2*Math.PI)*Math.asin(1/a);}if(c<1){return-.5*(a*Math.pow(2,10*(c-=1))*Math.sin((c*s-k)*(2*Math.PI)/z));}return a*Math.pow(2,-10*(c-=1))*Math.sin((c*s-k)*(2*Math.PI)/z)*.5+1;}
cvi_tween.cubicBezierCurve=function(s,c,p,d){var t=(1/s)*c,ax=0,bx=0,cx=0,ay=0,by=0,cy=0;d=d||50;function sCX(t){return((ax*t+bx)*t+cx)*t;};function sCY(t){return((ay*t+by)*t+cy)*t;};function sCDX(t){return(3*ax*t+2*bx)*t+cx;};function sE(d){return 1/(200*d);};function sv(x,e){return sCY(svCX(x,e));};function fa(n){return(n>=0?n:0-n);};function svCX(x,e){var t0,t1,t2,x2,d2,i;for(t2=x,i=0;i<8;i++){x2=sCX(t2)-x;if(fa(x2)<e){return t2;}d2=sCDX(t2);if(fa(d2)<1e-6){break;}t2=t2-x2/d2;}t0=0;t1=1;t2=x;if(t2<t0){return t0;}if(t2>t1){return t1;}while(t0<t1){x2=sCX(t2);if(fa(x2-x)<e){return t2;}if(x>x2){t0=t2;}else{t1=t2;}t2=(t1-t0)*.5+t0;}return t2;};cx=3*p[0];bx=3*(p[2]-p[0])-cx;ax=1-cx-bx;cy=3*p[1];by=3*(p[3]-p[1])-cy;ay=1-cy-by;return sv(t,sE(d));}
var cvi_ease=new Object();cvi_ease.linear=[0.0,0.0,1.0,1.0];cvi_ease.wkitDef=[0.25,0.1,0.25,1.0];cvi_ease.wkitIn=[0.42,0.0,1.0,1.0];cvi_ease.wkitOut=[0.0,0.58,1.0,1.0];cvi_ease.wkitInOut=[0.42,0.58,1.0,1.0];cvi_ease.wkitOutIn=[0.0,0.42,1.0,0.58];cvi_ease.sineIn=[0.25,0.0,1.0,1.0];cvi_ease.sineOut=[0.0,0.25,1.0,1.0];cvi_ease.sineInOut=[0.25,0.0,0.75,1.0];cvi_ease.sineOutIn=[0.0,0.25,1.0,0.75];cvi_ease.medIn=[0.5,0.0,1.0,1.0];cvi_ease.medOut=[0.0,0.5,1.0,1.0];cvi_ease.medInOut=[0.5,0.0,0.5,1.0];cvi_ease.medOutIn=[0.0,0.5,1.0,0.5];cvi_ease.maxIn=[1.0,0.0,1.0,1.0];cvi_ease.maxOut=[0.0,1.0,1.0,1.0];cvi_ease.maxInOut=[1.0,0.0,0.0,1.0];cvi_ease.maxOutIn=[0.0,1.0,1.0,0.0];var cvi_tfx=new Object();cvi_tfx.alpha={val:0,min:0,max:3,fail:"fade",tween:"linear",buffer:1,mask:1,alpha:1};cvi_tfx.barn_horizontal_in=cvi_tfx.barn_vertical_in=cvi_tfx.barn_horizontal_out=cvi_tfx.barn_vertical_out={tween:"quadEaseOut",buffer:1,mask:0,alpha:0};cvi_tfx.blinds_left=cvi_tfx.blinds_right=cvi_tfx.blinds_up=cvi_tfx.blinds_down={val:8,min:1,max:100,tween:"quadEaseIn",buffer:1,mask:0,alpha:0};cvi_tfx.checkerboard_left=cvi_tfx.checkerboard_up=cvi_tfx.checkerboard_right=cvi_tfx.checkerboard_down={val:8,min:2,max:100,tween:"linear",buffer:1,mask:0,alpha:0};cvi_tfx.circles_in=cvi_tfx.circles_out={val:8,min:1,max:50,fail:"checkerboard_right",tween:"linear",buffer:1,mask:0,alpha:0};cvi_tfx.copy_right={fail:"gradientwipe_right",tween:"linear",buffer:1,mask:0,alpha:0};cvi_tfx.copy_left={fail:"gradientwipe_left",tween:"linear",buffer:1,mask:0,alpha:0};cvi_tfx.copy_up={fail:"gradientwipe_up",tween:"linear",buffer:1,mask:0,alpha:0};cvi_tfx.copy_down={fail:"gradientwipe_down",tween:"linear",buffer:1,mask:0,alpha:0};cvi_tfx.corner_lefttop_in=cvi_tfx.corner_righttop_in=cvi_tfx.corner_leftbottom_in=cvi_tfx.corner_rightbottom_in={fail:"radialwipe_radial",tween:"bounceEaseOut",buffer:0,mask:0,alpha:0};cvi_tfx.corner_lefttop_out=cvi_tfx.corner_righttop_out=cvi_tfx.corner_leftbottom_out=cvi_tfx.corner_rightbottom_out={fail:"radialwipe_radial",tween:"backEaseInOut",buffer:0,mask:0,alpha:0};cvi_tfx.curl_horizontal={val:6,min:2,max:10,fail:"gradientwipe_left",tween:"sineEaseOut",buffer:1,mask:0,alpha:0};cvi_tfx.curl_vertical={val:6,min:2,max:10,fail:"gradientwipe_up",tween:"sineEaseOut",buffer:1,mask:0,alpha:0};cvi_tfx.cut={buffer:0,mask:0,alpha:0};cvi_tfx.fade={val:100,min:0,max:100,tween:"linear",buffer:1,mask:0,alpha:0};cvi_tfx.flash={fail:"fade",tween:"linear",buffer:0,mask:0,alpha:0};cvi_tfx.gradientwipe_left=cvi_tfx.gradientwipe_right=cvi_tfx.gradientwipe_up=cvi_tfx.gradientwipe_down={val:25,min:5,max:100,tween:"sineEaseInOut",buffer:1,mask:0,alpha:0};cvi_tfx.inset_leftup=cvi_tfx.inset_rightup=cvi_tfx.inset_leftdown=cvi_tfx.inset_rightdown={fail:"inset_rightdown",tween:"cubicEaseInOut",buffer:0,mask:0,alpha:0};cvi_tfx.iris_cross_in=cvi_tfx.iris_plus_in=cvi_tfx.iris_square_in=cvi_tfx.iris_circle_in=cvi_tfx.iris_diamond_in=cvi_tfx.iris_star_in={tween:"sineEaseIn",buffer:1,mask:0,alpha:0};cvi_tfx.iris_cross_out=cvi_tfx.iris_plus_out=cvi_tfx.iris_diamond_out=cvi_tfx.iris_star_out=cvi_tfx.iris_square_out=cvi_tfx.iris_circle_out={tween:"sineEaseOut",buffer:1,mask:0,alpha:0};cvi_tfx.pixelate={val:40,min:10,max:50,tween:"linear",buffer:1,mask:0,alpha:0};cvi_tfx.pull_left=cvi_tfx.pull_right=cvi_tfx.pull_up=cvi_tfx.pull_down={fail:"slide_hide",tween:"backEaseOut",buffer:0,mask:0,alpha:0};cvi_tfx.push_left=cvi_tfx.push_right=cvi_tfx.push_up=cvi_tfx.push_down={fail:"slide_push",tween:"cubicEaseOut",buffer:0,mask:0,alpha:0};cvi_tfx.radialgradient={fail:"fade",tween:"linear",buffer:1,mask:0,alpha:0};cvi_tfx.radialwipe_clock=cvi_tfx.radialwipe_wedge=cvi_tfx.radialwipe_radial={tween:"sineEaseInOut",buffer:1,mask:0,alpha:0};cvi_tfx.randombars_horizontal=cvi_tfx.randombars_vertical={buffer:1,mask:1,alpha:0};cvi_tfx.randomdissolve={val:2,min:1,max:16,buffer:1,mask:1,alpha:0};cvi_tfx.reveal_left=cvi_tfx.reveal_right=cvi_tfx.reveal_up=cvi_tfx.reveal_down={fail:"slide_hide",tween:"backEaseIn",buffer:0,mask:0,alpha:0};cvi_tfx.rotate_in={fail:"iris_circle_out",tween:"backEaseIn",buffer:1,mask:0,alpha:0};cvi_tfx.rotate_out={fail:"iris_circle_in",tween:"backEaseOut",buffer:1,mask:0,alpha:0};cvi_tfx.scale_in={fail:"iris_square_out",tween:"backEaseIn",buffer:1,mask:0,alpha:0};cvi_tfx.scale_out={fail:"iris_square_in",tween:"backEaseOut",buffer:1,mask:0,alpha:0};cvi_tfx.slide_swap=cvi_tfx.slide_push=cvi_tfx.slide_hide={val:1,min:1,max:100,tween:"sineEaseInOut",buffer:0,mask:0,alpha:0};cvi_tfx.spiral={val:8,min:1,max:100,buffer:1,mask:1,alpha:0};cvi_tfx.split_horizontal_in={fail:"barn_vertical_in",tween:"quadEaseOut",buffer:0,mask:0,alpha:0};cvi_tfx.split_vertical_in={fail:"barn_horizontal_in",tween:"quadEaseOut",buffer:0,mask:0,alpha:0};cvi_tfx.split_horizontal_out={fail:"barn_vertical_out",tween:"quadEaseOut",buffer:0,mask:0,alpha:0};cvi_tfx.split_vertical_out={fail:"barn_horizontal_out",tween:"quadEaseOut",buffer:0,mask:0,alpha:0};cvi_tfx.smudge={fail:"gradientwipe_down",tween:"circEaseInOut",buffer:1,mask:0,alpha:0};cvi_tfx.squares_in=cvi_tfx.squares_out={val:8,min:1,max:50,fail:"checkerboard_right",tween:"linear",buffer:1,mask:0,alpha:0};cvi_tfx.stretch_hide_right=cvi_tfx.stretch_hide_left=cvi_tfx.stretch_hide_up=cvi_tfx.stretch_hide_down={fail:"stretch_hide_right",tween:"backEaseOut",buffer:0,mask:0,alpha:0};cvi_tfx.stretch_push_up=cvi_tfx.stretch_push_down=cvi_tfx.stretch_push_left=cvi_tfx.stretch_push_right={fail:"stretch_push_right",tween:"backEaseOut",buffer:0,mask:0,alpha:0};cvi_tfx.stretch_vertical_out=cvi_tfx.stretch_horizontal_out=cvi_tfx.stretch_vertical_in=cvi_tfx.stretch_horizontal_in={fail:"stretch_horizontal_in",tween:"backEaseOut",buffer:0,mask:0,alpha:0};cvi_tfx.strips_leftup=cvi_tfx.strips_rightup=cvi_tfx.strips_leftdown=cvi_tfx.strips_rightdown={tween:"cubicEaseInOut",buffer:1,mask:0,alpha:0};cvi_tfx.turn_horizontal_down={val:4,min:2,max:12,fail:"blinds_down",tween:"bounceEaseOut",buffer:0,mask:0,alpha:0};cvi_tfx.turn_horizontal_up={val:4,min:2,max:12,fail:"blinds_up",tween:"bounceEaseOut",buffer:0,mask:0,alpha:0};cvi_tfx.turn_vertical_right={val:4,min:2,max:12,fail:"blinds_right",tween:"bounceEaseOut",buffer:0,mask:0,alpha:0};cvi_tfx.turn_vertical_left={val:4,min:2,max:12,fail:"blinds_left",tween:"bounceEaseOut",buffer:0,mask:0,alpha:0};cvi_tfx.wheel={val:4,min:2,max:20,tween:"sineEaseInOut",buffer:1,mask:0,alpha:0};cvi_tfx.wrench_horizontal=cvi_tfx.wrench_vertical={fail:"pixelate",tween:"linear",buffer:1,mask:0,alpha:0};cvi_tfx.zigzag={val:8,min:1,max:100,buffer:1,mask:1,alpha:0};cvi_tfx.zoom_in=cvi_tfx.zoom_out={fail:"fade",tween:"linear",buffer:1,mask:0,alpha:0};var cvi_i,cvi_c=0,cvi_rfx=new Array();for(cvi_i in cvi_tfx){cvi_rfx[cvi_c]=cvi_i;cvi_c++;};if(typeof cvi_tween!=='object'){var cvi_tween=new Object();cvi_tween.linear=function(s,c){return(1/s)*c;};}
var cvi_trans={version:1.0,released:'2009-12-21 18:53:00',duration:2.0,fps:30,vml:!window.opera&&document.all&&document.namespaces?1:0,play:function(callback,canvas,img_a,img_b,alpha,layer,opt1,opt2,trans,tween,cpa,dur,fps){Array.prototype.shuffle=shuffle;function shuffle(){var t,r,i;for(i=0;i!=this.length;i++){r=Math.floor(Math.random()*this.length);t=this[i];this[i]=this[r];this[r]=t;}};function log(v,e){if(window.console){window.console.log(v+e);}else if(window.opera){opera.postError(v+e);}else{window.document.title=v+e;}return false;};function getInt(o,v,t){return(Math.min(Math.max(o||v,cvi_tfx[t].min),cvi_tfx[t].max)||cvi_tfx[t].val);};if(canvas&&!canvas.TLbusy){if(trans==='random'){trans=cvi_rfx[Math.floor(Math.random()*cvi_rfx.length)];}trans=(typeof cvi_tfx[trans]==='object'?trans:'fade');if(cvi_trans.vml&&cvi_tfx[trans].fail){trans=cvi_tfx[trans].fail;}dur=Math.min(Math.max(parseFloat(dur)||cvi_trans.duration,0.5),5.0)||cvi_trans.duration;var efx=trans.split("_")||['fade'];var timer={d:null,t:null,start:function(){timer.d=new Date();timer.t=timer.d.getTime();},stop:function(){timer.d=new Date();return(timer.d.getTime()-timer.t);}};if(cvi_trans.vml){var filter=null,ftrans=null,w=parseInt(canvas.style.width),h=parseInt(canvas.style.height);try{canvas.TLbusy=true;canvas.TLerror=null;if(efx[0]=="barn"){var pos=efx[1]||"horizontal",dir=efx[2]||"out";canvas.TLfilter=filter="DXImageTransform.Microsoft.Barn";ftrans="progid:"+filter+"(duration="+dur+",motion="+dir+",orientation="+pos+")";}
else if(efx[0]=="blinds"){var dir=efx[1]||"down",o=parseInt(getInt(opt1,8,trans),10);canvas.TLfilter=filter="DXImageTransform.Microsoft.Blinds";ftrans="progid:"+filter+"(duration="+dur+",direction="+dir+",bands="+o+")";}
else if(efx[0]=="checkerboard"){var dir=efx[1]||"right",x=parseInt(getInt(opt1,8,trans),10),y=parseInt(getInt(opt2,x,trans),10);canvas.TLfilter=filter="DXImageTransform.Microsoft.CheckerBoard";ftrans="progid:"+filter+"(duration="+dur+",squaresX="+x+",squaresY="+y+",Direction="+dir+")";}
else if(efx[0]=="cut"){canvas.TLfilter=filter="DXImageTransform.Microsoft.Fade";ftrans="progid:"+filter+"(duration=0.01,overlap=1.0)";}
else if(efx[0]=="fade"){var o=parseFloat(getInt(opt1,100,trans)/100);canvas.TLfilter=filter="DXImageTransform.Microsoft.Fade";ftrans="progid:"+filter+"(duration="+dur+",overlap="+o+")";}
else if(efx[0]=="gradientwipe"){var dir=efx[1]||"right",o=parseFloat(getInt(opt1,25,trans)/100),v=(dir=='left'||dir=='right'?0:1),r=(dir=='left'||dir=='up'?'reverse':'forward');canvas.TLfilter=filter="DXImageTransform.Microsoft.GradientWipe";ftrans="progid:"+filter+"(duration="+dur+",gradientSize="+o+",motion="+r+",WipeStyle="+v+")";}
else if(efx[0]=="inset"){canvas.TLfilter=filter="DXImageTransform.Microsoft.Inset";ftrans="progid:"+filter+"(duration="+dur+")";}
else if(efx[0]=="iris"){var typ=efx[1].toUpperCase()||"PLUS",dir=efx[2]||"out";canvas.TLfilter=filter="DXImageTransform.Microsoft.Iris";ftrans="progid:"+filter+"(duration="+dur+",irisStyle="+typ+",motion="+dir+")";}
else if(efx[0]=="pixelate"){var o=parseInt(getInt(opt1,40,trans),10);canvas.TLfilter=filter="DXImageTransform.Microsoft.Pixelate";ftrans="progid:"+filter+"(duration="+dur+",maxSquare="+o+")";}
else if(efx[0]=="radialwipe"){var typ=efx[1].toUpperCase()||"CLOCK";canvas.TLfilter=filter="DXImageTransform.Microsoft.RadialWipe";ftrans="progid:"+filter+"(duration="+dur+",wipeStyle="+typ+")";}
else if(efx[0]=="randombars"){var typ=efx[1]||"horizontal";canvas.TLfilter=filter="DXImageTransform.Microsoft.RandomBars";ftrans="progid:"+filter+"(duration="+dur+",orientation="+typ+")";}
else if(efx[0]=="randomdissolve"){canvas.TLfilter=filter="DXImageTransform.Microsoft.RandomDissolve";ftrans="progid:"+filter+"(duration="+dur+")";}
else if(efx[0]=="slide"){var typ=efx[1].toUpperCase()||"HIDE",o=parseInt(getInt(opt1,1,trans),10);canvas.TLfilter=filter="DXImageTransform.Microsoft.Slide";ftrans="progid:"+filter+"(duration="+dur+",slideStyle="+typ+",bands="+o+")";}
else if(efx[0]=="spiral"){var x=parseInt(getInt(opt1,8,trans),10),y=parseInt(getInt(opt2,x,trans),10);canvas.TLfilter=filter="DXImageTransform.Microsoft.Spiral";ftrans="progid:"+filter+"(duration="+dur+",gridsizex="+x+",gridsizey="+y+")";}
else if(efx[0]=="stretch"){var typ=efx[1].toUpperCase()||"HIDE";typ=typ=='VERTICAL'||typ=='HORIZONTAL'?'SPIN':typ;canvas.TLfilter=filter="DXImageTransform.Microsoft.Stretch";ftrans="progid:"+filter+"(duration="+dur+",stretchStyle="+typ+")";}
else if(efx[0]=="strips"){var typ=efx[1]||"leftdown";canvas.TLfilter=filter="DXImageTransform.Microsoft.Strips";ftrans="progid:"+filter+"(duration="+dur+",motion="+typ+")";}
else if(efx[0]=="wheel"){var o=parseInt(getInt(opt1,4,trans),10);canvas.TLfilter=filter="DXImageTransform.Microsoft.Wheel";ftrans="progid:"+filter+"(duration="+dur+",spokes="+o+")";}
else if(efx[0]=="zigzag"){var x=parseInt(getInt(opt1,8,trans),10),y=parseInt(getInt(opt2,x,trans),10);canvas.TLfilter=filter="DXImageTransform.Microsoft.Zigzag";ftrans="progid:"+filter+"(duration="+dur+",gridsizex="+x+",gridsizey="+y+")";}
if(efx[0]!=""&&filter!=null&&img_b.nw>=8&&img_b.nh>=8){canvas.style.filter=ftrans;canvas.filters.item(filter).apply();if(canvas.filters.item(filter).status==1){var b,a=canvas.firstChild,pw=img_b.wm||w,ph=img_b.hm||h,xo=img_b.ox||0,yo=img_b.oy||0;if(a){b=document.createElement(['<v:fill src="'+img_b.source+'" size="'+pw+'pt,'+ph+'pt" origin="'+xo+','+yo+'" position="0,0" aspect="ignore"  type="frame" />'].join(''));canvas.replaceChild(b,a);}
timer.start();canvas.filters.item(filter).play();if(canvas.filters.item(filter).status==2){canvas.onfilterchange=function(){if(canvas.filters.item(filter).status==0){var t=timer.stop();canvas.TLfilter=null;cvi_trans._clr(callback,trans,t,30*((dur*1000)/t),canvas);}};}}}}catch(err){canvas.TLerror=err.message;log('Error: ',err.message+' - trans "'+trans+'" has failed!');cvi_trans._clr(callback,trans,0,0,canvas);}}else if(canvas.tagName.toUpperCase()=="CANVAS"){if(canvas.timer){window.clearInterval(canvas.timer);}if(canvas.getContext){tween=(typeof(cvi_tween[tween])==='function'?tween:cvi_tfx[trans].tween&&typeof(cvi_tween[cvi_tfx[trans].tween])==='function'?cvi_tfx[trans].tween:'linear');cpa=(cpa==null||typeof cpa!=='object'?[0.25,0.1,0.25,1.0]:cpa);fps=Math.min(Math.max(parseInt(fps,10)||cvi_trans.fps,15),100)||cvi_trans.fps;function fill(c,x,y,w,h,wc){if(wc){c.beginPath();c.rect(x,y,w,h);c.closePath();c.fill();}else{c.fillRect(x,y,w,h);}};var ctx=canvas.getContext('2d'),w=parseInt(canvas.width),h=parseInt(canvas.height);cvi_trans.isWC=navigator.userAgent.indexOf('WebKit')!=-1&&!window.external&&!document.defaultCharset?1:0;if(cvi_tfx[trans].buffer){var buffer=document.createElement('canvas');if(cvi_trans.isWC){with(buffer){id='cvi_trans_buffer';height=h;width=w;}with(buffer.style){position='fixed';left='-9999px';top='0px';height=h+'px';width=w+'px';}document.body.appendChild(buffer);}else{buffer.width=w;buffer.height=h;}var cbx=buffer.getContext('2d');}
if(cvi_tfx[trans].mask){var mask=document.createElement('canvas');if(cvi_trans.isWC){with(mask){id='cvi_trans_mask';height=h;width=w;}with(mask.style){position='fixed';left='-9999px';top='0px';height=h+'px';width=w+'px';}document.body.appendChild(mask);}else{mask.width=w;mask.height=h;}var cmx=mask.getContext('2d');}
if(cvi_tfx[trans].alpha){if(!cbx||!cmx||!alpha||alpha.width<8||alpha.height<8){efx[0]="fade";trans='fade';opt1=100;}}var stl='',val=0,cnt=0,ival=Math.round(1000/fps),steps=Math.round((dur*1000)/ival);ctx.save();try{canvas.TLbusy=true;canvas.TLerror=null;if(efx[0]=="alpha"){var o=parseInt(getInt(opt1,0,trans),10),x=o==1||o==3?1:0,y=o==2||o==3?1:0,c=Math.round(steps*.5),a=1/c;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;ctx.drawImage(img_a,0,0,w,h);cmx.clearRect(0,0,w,h);if(cnt<=c){cmx.globalCompositeOperation="source-over";if(x||y){cmx.save();cmx.translate(x?w:0,y?h:0);cmx.scale(x?-1:1,y?-1:1);cmx.drawImage(alpha,0,0,w,h);cmx.restore();}else{cmx.drawImage(alpha,0,0,w,h);}cmx.globalCompositeOperation="darker";cmx.fillStyle="rgba(0,0,0,"+(1-(val*a))+")";cmx.fillRect(0,0,w,h);}else{cmx.globalAlpha=1-((val-c)*a);cmx.globalCompositeOperation="source-over";if(x||y){cmx.save();cmx.translate(x?w:0,y?h:0);cmx.scale(x?-1:1,y?-1:1);cmx.drawImage(alpha,0,0,w,h);cmx.restore();}else{cmx.drawImage(alpha,0,0,w,h);}}cbx.clearRect(0,0,w,h);cbx.globalCompositeOperation="source-over";cbx.drawImage(img_b,0,0,w,h);cbx.globalCompositeOperation="destination-out";cbx.drawImage(mask,0,0,w,h);ctx.drawImage(buffer,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="barn"){var pos=efx[1]||"horizontal",dir=efx[2]||"out",v=pos=="vertical"?1:0,m=dir=="in"?1:0,ow=w,oh=h,ww=v?Math.round(w/2):w,hh=v?h:Math.round(h/2),s=((v?w:h)/(steps*2));timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;ctx.drawImage(img_a,0,0,w,h);cbx.clearRect(0,0,w,h);cbx.globalCompositeOperation="source-over";cbx.drawImage(img_b,0,0,w,h);cbx.globalCompositeOperation="destination-out";cbx.fillStyle="rgba(0,0,0,1.0)";if(m){ow=v?(val*s):0;oh=v?0:(val*s);cbx.fillRect(ow,oh,Math.max(w-(2*ow),1),Math.max(h-(2*oh),1));}else{ow=v?ww-(val*s):w;oh=v?h:hh-(val*s);cbx.fillRect(0,0,Math.max(ow,1),Math.max(oh,1));cbx.fillRect(w-ow,h-oh,w,h);}ctx.drawImage(buffer,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="blinds"){var q=parseInt(getInt(opt1,8,trans),10),dir=efx[1]||"right",hz=dir=="right"||dir=="left"?1:0,r=(dir=="right"?1:0),d=(dir=="down"?1:0),ww=hz?(w/q):w,hh=hz?h:(h/q),sx=(ww/steps),sy=(hh/steps),s=0;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;ctx.drawImage(img_a,0,0,w,h);cbx.clearRect(0,0,w,h);cbx.globalCompositeOperation="source-over";cbx.drawImage(img_b,0,0,w,h);cbx.globalCompositeOperation="destination-out";cbx.fillStyle="rgba(0,0,0,1.0)";if(hz){s=val*sx;for(var i=0;i<q;i++){cbx.fillRect((i*ww)+(r?s:0),0,Math.max(ww-s,1),hh);}}else{s=val*sy;for(var i=0;i<q;i++){cbx.fillRect(0,(i*hh)+(d?s:0),ww,Math.max(hh-s,1));}}ctx.drawImage(buffer,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="checkerboard"){var gx=parseInt(getInt(opt1,8,trans),10),gy=parseInt(getInt(opt2,gx,trans),10),dir=efx[1]||"right",hz=(dir=='left'||dir=='right'?1:0),r=(dir=='right'?1:0),d=(dir=='down'?1:0),ww=(w/gx)*(hz?2:1),hh=(h/gy)*(hz?1:2),sx=(ww/steps),sy=(hh/steps),w5=hz?ww/2:0,h5=hz?0:hh/2,s=0,p=0,k=0,q=0;if(hz){gx=Math.ceil(gx/2)+1;}else{gy=Math.ceil(gy/2)+1;}timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;ctx.drawImage(img_a,0,0,w,h);cbx.clearRect(0,0,w,h);cbx.globalCompositeOperation="source-over";cbx.drawImage(img_b,0,0,w,h);cbx.globalCompositeOperation="destination-out";cbx.fillStyle="rgba(0,0,0,1.0)";for(var y=0;y<gy;y++){p=y%2;for(var x=0;x<gx;x++){k=x%2;if(hz){s=val*sx;q=Math.max(ww-s,1);if(p){cbx.fillRect(((x*ww)+(r?s:0))-w5,y*hh,q,hh);}else{cbx.fillRect((x*ww)+(r?s:0),y*hh,q,hh);}}else{s=val*sy;q=Math.max(hh-s,1);if(k){cbx.fillRect(x*ww,((y*hh)+(d?s:0))-h5,ww,q);}else{cbx.fillRect(x*ww,(y*hh)+(d?s:0),ww,q);}}}}ctx.drawImage(buffer,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="circles"){var gx=parseInt(getInt(opt1,8,trans),10),gy=parseInt(getInt(opt2,gx,trans),10),dir=efx[1]||"out",m=dir=="in"?1:0,ww=(w/gx),hh=(h/gy),w5=ww/2,h5=hh/2,r=Math.sqrt(Math.pow(ww,2)+Math.pow(hh,2))/2,s=(r/steps),z=0;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;ctx.drawImage(m?img_b:img_a,0,0,w,h);cbx.clearRect(0,0,w,h);cbx.globalCompositeOperation="source-over";cbx.drawImage(m?img_a:img_b,0,0,w,h);cbx.globalCompositeOperation="destination-out";cbx.fillStyle="rgba(0,0,0,1.0)";z=Math.max(m?val*s:r-(val*s),1);for(var x=0;x<gx;x++){for(var y=0;y<gy;y++){cbx.beginPath();cbx.moveTo((x*ww)+w5,(y*hh)+h5);cbx.arc((x*ww)+w5,(y*hh)+h5,z,0,Math.PI*2,true);cbx.closePath();cbx.fill();}}ctx.drawImage(buffer,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="corner"){var pos=efx[1]||"lefttop",dir=efx[2]||"in",d90=Math.PI/2,angle=d90/steps,d=dir=="in"?1:0,p=pos=="righttop"?1:pos=="leftbottom"?2:pos=="rightbottom"?3:0,z=0;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;z=(angle*val);ctx.drawImage(d?img_a:img_b,0,0,w,h);ctx.save();if(p==3){ctx.translate(w,h);ctx.rotate((d?d90:0)-z);ctx.drawImage(d?img_b:img_a,-w,-h,w,h);}else if(p==2){ctx.translate(0,h);ctx.rotate((d?0-d90:0)+z);ctx.drawImage(d?img_b:img_a,0,-h,w,h);}else if(p==1){ctx.translate(w,0);ctx.rotate((d?d90:0)-z);ctx.drawImage(d?img_b:img_a,-w,0,w,h);}else{ctx.translate(0,0);ctx.rotate((d?0-d90:0)+z);ctx.drawImage(d?img_b:img_a,0,0,w,h);}ctx.restore();if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="curl"){var d=parseInt(getInt(opt1,6,trans),10),dir=efx[1]||"horizontal",v=dir=="vertical"?1:0,ss=((v?h:w)/steps),c=Math.round((v?h:w)/d),o=.5,p=0,s=0,sx=0,sy=0,dx=0,dy=0,ww=0,hh=0,wc=cvi_trans.isWC;cbx.clearRect(0,0,w,h);cbx.save();cbx.translate(v?0:w,v?h:0);cbx.scale(v?1:-1,v?-1:1);cbx.drawImage(img_a,0,0,w,h);cbx.restore();timer.start();function shade(c,x,y,w,h,o){var s=c.createLinearGradient(x,y,w,h);s.addColorStop(0.0,'rgba(0,0,0,'+o+')');s.addColorStop(0.2,'rgba(0,0,0,0)');s.addColorStop(0.3,'rgba(254,254,254,0)');s.addColorStop(0.45,'rgba(254,254,254,'+o+')');s.addColorStop(0.6,'rgba(254,254,254,0)');s.addColorStop(0.66,'rgba(0,0,0,0)');s.addColorStop(1.0,'rgba(0,0,0,'+o+')');return s;};function shadow(c,x,y,w,h,o){var s=c.createLinearGradient(x,y,w,h);s.addColorStop(0.0,'rgba(0,0,0,'+o+')');s.addColorStop(1.0,'rgba(0,0,0,0)');return s;};canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;s=Math.max(val*ss,1);ctx.drawImage(img_b,0,0,w,h);if(v){hh=Math.min(s,c);ww=w;p=Math.max(h-s-hh,1);sx=0;sy=Math.min(h-hh,s);dx=0;dy=h-s-hh-hh;}else{ww=Math.min(s,c);hh=h;p=Math.max(w-s-ww,1);sy=0;sx=Math.min(w-ww,s);dy=0;dx=w-s-ww-ww;}ctx.drawImage(img_a,0,0,v?w:p,v?p:h,0,0,v?w:p,v?p:h);ctx.drawImage(buffer,sx,sy,ww,hh,dx,dy,ww,hh);ctx.fillStyle=shade(ctx,dx,dy,v?0:dx+ww,v?dy+hh:0,o);fill(ctx,dx,dy,ww,hh,wc);ctx.fillStyle=shadow(ctx,v?0:dx+ww,v?dy+hh:0,v?0:dx+ww+c,v?dy+hh+c:0,o);fill(ctx,v?0:dx+ww,v?dy+hh:0,v?w:c,v?c:h,wc);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="cut"){var t=ival;ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps,canvas);}
else if(efx[0]=="fade"){var o=parseFloat(getInt(opt1,100,trans)/100),fa=o+((1-o)/2),fb=1-fa,ap=Math.round(steps*fa),bp=Math.round(steps*fb),oa=1,ob=0,a=1/(steps*fa);ctx.globalAlpha=1;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;oa=(val>ap?0:a*(ap-val));ob=(val<bp?0:a*(val-bp));ctx.clearRect(0,0,w,h);ctx.globalAlpha=(o==1?1:oa);ctx.drawImage(img_a,0,0,w,h);cbx.clearRect(0,0,w,h);cbx.globalAlpha=ob;cbx.drawImage(img_b,0,0,w,h);ctx.globalAlpha=1;ctx.drawImage(buffer,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="flash"){var r=Math.sqrt(Math.pow(w,2)+Math.pow(h,2))/2,a=Math.max(Math.min(Math.round(steps*0.1),3),1),b=2*a,c=Math.max(steps-b,1),s=(r/a),q=(1/c),x=w/2,y=h/2,z=0,v=0,wc=cvi_trans.isWC;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;if(cnt<=b){z=cnt<=a?1:0;v=Math.max(s*(val-(z?0:a)),1);ctx.drawImage(img_a,0,0,w,h);stl=ctx.createRadialGradient(x,y,z?0:v,x,y,z?v:r);stl.addColorStop(0,"rgba(255,255,255,1.0)");stl.addColorStop(1,"rgba(255,255,255,0.0)");ctx.fillStyle=stl;fill(ctx,0,0,w,h,wc);}else{v=Math.max(1-(q*(val-b)),0);ctx.drawImage(img_b,0,0,w,h);ctx.fillStyle="rgba(255,255,255,"+v+")";ctx.fillRect(0,0,w,h);}if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="gradientwipe"||efx[0]=="copy"){var cp=efx[0]=="copy"?1:0,g=cp?0.3:parseFloat(getInt(opt1,25,trans)/100),dir=efx[1]||"right",xo=0,yo=0,xp=0,yp=0,v=(dir=='left'||dir=='right'?0:1),r=(dir=='left'||dir=='up'?1:0),gw=Math.round(v?w:w*g),gh=Math.round(v?h*g:h),sa=(v?h+gh:w+gw),ss=(sa/steps),wc=cvi_trans.isWC;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;xo=Math.round(v?0:r?sa-(val*ss):val*ss);yo=Math.round(v?r?sa-(val*ss):val*ss:0);xp=v?0:xo-gw;yp=v?yo-gh:0;ctx.drawImage(img_a,0,0,w,h);cbx.clearRect(0,0,w,h);cbx.globalCompositeOperation="source-over";cbx.drawImage(img_b,0,0,w,h);cbx.globalCompositeOperation="destination-out";cbx.fillStyle="rgba(0,0,0,1.0)";if(r){if(wc||window.opera){if(v){if(yp<0){cbx.fillRect(0,yp,w,Math.abs(yp));}else{cbx.fillRect(0,0,w,yp);}}else{if(xp<0){cbx.fillRect(xp,0,Math.abs(xp),h);}else{cbx.fillRect(0,0,xp,h);}}}else{cbx.fillRect(0,0,v?w:xp,v?yp:h);}}else{cbx.fillRect(xo,yo,w,h);}stl=cbx.createLinearGradient(xp,yp,xo,yo);stl.addColorStop((r?1:0),"rgba(0,0,0,0.0)");stl.addColorStop((r?0:1),"rgba(0,0,0,1.0)");cbx.fillStyle=stl;fill(cbx,xp,yp,gw,gh,wc);ctx.drawImage(buffer,0,0,w,h);if(cp){stl=ctx.createLinearGradient(xp,yp,xo,yo);stl.addColorStop((r?1:0),"rgba(0,255,0,0.0)");stl.addColorStop((r?.6:.4),"rgba(128,255,160,0.6)");stl.addColorStop((r?.3:.7),"rgba(255,255,255,0.9)");stl.addColorStop((r?.25:.75),"rgba(255,255,255,1.0)");stl.addColorStop((r?.2:.8),"rgba(255,255,255,0.9)");stl.addColorStop((r?0:1),"rgba(128,255,160,0.0)");ctx.fillStyle=stl;fill(ctx,xp,yp,gw,gh,wc);}if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="inset"){var dir=efx[1]||"rightdown",sw=(w/steps),sh=(h/steps),ww=0,hh=0;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;ctx.drawImage(img_a,0,0,w,h);ww=Math.min(Math.max(val*sw,1),w);hh=Math.min(Math.max(val*sh,1),h);if(dir=='rightup'){ctx.drawImage(img_b,0,h-hh,ww,hh,0,h-hh,ww,hh);}else if(dir=='leftdown'){ctx.drawImage(img_b,w-ww,0,ww,hh,w-ww,0,ww,hh);}else if(dir=='leftup'){ctx.drawImage(img_b,w-ww,h-hh,ww,hh,w-ww,h-hh,ww,hh);}else{ctx.drawImage(img_b,0,0,ww,hh,0,0,ww,hh);}if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="iris"){var typ=efx[1]||"plus",dir=efx[2]||"out",o=dir=="in"?0:1,x=w/2,y=h/2,m=Math.max(w,h),n=m/2,k=0;if(typ=='diamond'||typ=='cross'||typ=='star'){var d=Math.sqrt(Math.pow(m,2)+Math.pow(m,2)),ss=(m/steps),sr=(d/steps);}else if(typ=='square'||typ=='plus'){var d=Math.sqrt(Math.pow(m,2)+Math.pow(m,2)),ss=(m/steps);}else if(typ=='circle'){var d=Math.sqrt(Math.pow(w,2)+Math.pow(h,2)),f=(Math.PI/4)*-3,g=(Math.PI*2),n=Math.ceil(d/2),ss=(d/steps);}var os=(ss/2),xo=n-x,yo=n-y;timer.start();function fillStar(c,x,y,n,r,p){var r1=r,r2=r*.4;c.translate(x,y);c.rotate(p);c.beginPath();c.moveTo(0,r1);for(var i=0;i<=n;i++){c.save();c.rotate(2*i*Math.PI/n);c.lineTo(0,r1);c.restore();c.save();c.rotate(2*i*Math.PI/n+(2*Math.PI/n)/2);c.lineTo(0,r2);c.restore();}c.closePath();c.fill();c.rotate(-p);c.translate(-x,-y);};function drawStar(c,x,y,n,r,p){var r1=r,r2=r*.4;c.translate(x,y);c.rotate(p);c.lineTo(0,r1);for(var i=0;i<=n;i++){c.save();c.rotate(2*i*Math.PI/n);c.lineTo(0,r1);c.restore();c.save();c.rotate(2*i*Math.PI/n+(2*Math.PI/n)/2);c.lineTo(0,r2);c.restore();}c.rotate(-p);c.translate(-x,-y);};canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;ctx.drawImage(img_a,0,0,w,h);cbx.clearRect(0,0,w,h);cbx.globalCompositeOperation="source-over";cbx.drawImage(img_b,0,0,w,h);cbx.globalCompositeOperation="destination-out";cbx.fillStyle="rgba(0,0,0,1.0)";if(typ=='diamond'){k=(val*ss);cbx.beginPath();if(o){cbx.moveTo((0-xo-n)+k,h/2);cbx.lineTo(0-xo+n,(0-yo-n)+k);cbx.lineTo((0-xo+m+n)-k,h/2);cbx.lineTo(0-xo+n,(h+yo+n)-k);}else{cbx.moveTo(0-xo,0-yo);cbx.lineTo(x,y-k);cbx.lineTo(x+k,y);cbx.lineTo(x,y+k);cbx.lineTo(x-k,y);cbx.lineTo(x,y-k);cbx.lineTo(0-xo,0-yo);cbx.lineTo(0-xo,h+yo);cbx.lineTo(w+xo,h+yo);cbx.lineTo(w+xo,0-yo);}cbx.closePath();cbx.fill();}
else if(typ=='cross'){k=(val*os);cbx.beginPath();if(o){cbx.moveTo(x,0-yo+k);cbx.lineTo(0-xo-k,0-yo-n);cbx.lineTo(0-xo-n,0-yo-k);cbx.lineTo(0-xo+k,y);cbx.lineTo(0-xo-n,h+yo+k);cbx.lineTo(0-xo-k,h+yo+n);cbx.lineTo(x,h+yo-k);cbx.lineTo(w+xo+k,h+yo+n);cbx.lineTo(w+xo+n,h+yo+k);cbx.lineTo(w+xo-k,y);cbx.lineTo(w+xo+n,0-yo-k);cbx.lineTo(w+xo+k,0-yo-n);}else{cbx.moveTo(0-xo-n,0-yo-n);cbx.lineTo(x,0-yo-n);cbx.lineTo(x,y-k);cbx.lineTo(0-xo-n+k,0-yo-n);cbx.lineTo(0-xo-n,0-yo-n+k);cbx.lineTo(x-k,y);cbx.lineTo(0-xo-n,h+yo+n-k);cbx.lineTo(0-xo-n+k,h+yo+n);cbx.lineTo(x,y+k);cbx.lineTo(w+xo+n-k,h+yo+n);cbx.lineTo(w+xo+n,h+yo+n-k);cbx.lineTo(x+k,y);cbx.lineTo(w+xo+n,0-yo-n+k);cbx.lineTo(w+xo+n-k,0-yo-n);cbx.lineTo(x,y-k);cbx.lineTo(x,0-yo-n);cbx.lineTo(w+xo+n,0-yo-n);cbx.lineTo(w+xo+n,h+yo+n);cbx.lineTo(0-xo-n,h+yo+n);}cbx.closePath();cbx.fill();}
else if(typ=='circle'){k=(val*os);cbx.beginPath();if(o){cbx.moveTo(x,y);cbx.arc(x,y,Math.max(n-k,1),0,g,false);}else{cbx.moveTo(0-xo,0-yo);cbx.lineTo(x,y);cbx.arc(x,y,Math.max(k,1),f,g+f,false);cbx.lineTo(0-xo,0-yo);cbx.lineTo(0-xo,h+yo);cbx.lineTo(w+xo,h+yo);cbx.lineTo(w+xo,0-yo);}cbx.closePath();cbx.fill();}
else if(typ=='square'){k=(val*os);if(o){cbx.fillRect(x-n+k,y-n+k,Math.max(m-(k+k),1),Math.max(m-(k+k),1));}else{cbx.beginPath();cbx.moveTo(0-xo,0-yo);cbx.lineTo(x-k,y-k);cbx.lineTo(x+k,y-k);cbx.lineTo(x+k,y+k);cbx.lineTo(x-k,y+k);cbx.lineTo(x-k,y-k);cbx.lineTo(0-xo,0-yo);cbx.lineTo(0-xo,h+yo);cbx.lineTo(w+xo,h+yo);cbx.lineTo(w+xo,0-yo);cbx.closePath();cbx.fill();}}
else if(typ=='plus'){k=(val*os);if(o){cbx.fillRect(0,y-n+k,w,Math.max(m-(k+k),1));cbx.fillRect(x-n+k,0,Math.max(m-(k+k),1),h);}else{cbx.beginPath();cbx.moveTo(0-xo,0-yo);cbx.lineTo(x-k,y-k);cbx.lineTo(x-k,y-n);cbx.lineTo(x+k,y-n);cbx.lineTo(x+k,y-k);cbx.lineTo(x+n,y-k);cbx.lineTo(x+n,y+k);cbx.lineTo(x+k,y+k);cbx.lineTo(x+k,y+n);cbx.lineTo(x-k,y+n);cbx.lineTo(x-k,y+k);cbx.lineTo(x-n,y+k);cbx.lineTo(x-n,y-k);cbx.lineTo(x-k,y-k);cbx.lineTo(0-xo,0-yo);cbx.lineTo(0-xo,h+yo);cbx.lineTo(w+xo,h+yo);cbx.lineTo(w+xo,0-yo);cbx.closePath();cbx.fill();}}
else{if(o){fillStar(cbx,x,y,5,d-(val*sr),-(Math.PI/5));}else{cbx.beginPath();cbx.moveTo(0-xo-n,0-yo-n);cbx.lineTo(0-xo-n,h+yo+n);cbx.lineTo(x,h+yo+n);drawStar(cbx,x,y,5,(val*sr),-(Math.PI/5));cbx.lineTo(x,h+yo+n);cbx.lineTo(w+xo+n,h+yo+n);cbx.lineTo(w+xo+n,0-yo-n);cbx.closePath();cbx.fill();}}ctx.drawImage(buffer,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="pixelate"){var q=parseInt(getInt(opt1,40,trans),10),c=Math.round(steps*.5),a=1/c,ow=0,oh=0,mw=w/q,mh=h/q,d=q/c,s=0;ctx.mozImageSmoothingEnabled=false;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;s=cnt<=c?1:0;cbx.clearRect(0,0,w,h);if(s){ow=Math.round(Math.min(Math.max(w/((val*d)+1),mw),w));oh=Math.round(Math.min(Math.max(h/((val*d)+1),mh),h));}else{ow=Math.round(Math.max(Math.min(w/((steps-val)*d),w),mw));oh=Math.round(Math.max(Math.min(h/((steps-val)*d),h),mh));cbx.globalAlpha=a*(val-c);}cbx.drawImage(s?img_a:img_b,0,0,w,h,0,0,ow,oh);ctx.drawImage(buffer,0,0,ow,oh,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.mozImageSmoothingEnabled=true;ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="pull"||efx[0]=="reveal"){var dir=efx[1]||"right",r=efx[0]=="reveal"?1:0,hz=dir=="right"||dir=="left"?1:0,sc=((hz?w:h)/steps),s=0;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;ctx.drawImage(r?img_b:img_a,0,0,w,h,0,0,w,h);s=val*sc;if(dir=="left"){ctx.drawImage(r?img_a:img_b,0,0,w,h,r?0-s:w-s,0,w,h);}else if(dir=="down"){ctx.drawImage(r?img_a:img_b,0,0,w,h,0,r?s:s-h,w,h);}else if(dir=="up"){ctx.drawImage(r?img_a:img_b,0,0,w,h,0,r?0-s:h-s,w,h);}else{ctx.drawImage(r?img_a:img_b,0,0,w,h,r?s:s-w,0,w,h);}if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="push"){var dir=efx[1]||"right",hz=dir=="right"||dir=="left"?1:0,sc=((hz?w:h)/steps),s=0;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;ctx.drawImage(img_a,0,0,w,h,0,0,w,h);s=val*sc;if(dir=="right"){ctx.drawImage(img_a,0,0,w,h,s,0,w,h);ctx.drawImage(img_b,0,0,w,h,-w+s,0,w,h);}else if(dir=="left"){ctx.drawImage(img_a,0,0,w,h,0-s,0,w,h);ctx.drawImage(img_b,0,0,w,h,w-s,0,w,h);}else if(dir=="down"){ctx.drawImage(img_a,0,0,w,h,0,s,w,h);ctx.drawImage(img_b,0,0,w,h,0,-h+s,w,h);}else if(dir=="up"){ctx.drawImage(img_a,0,0,w,h,0,0-s,w,h);ctx.drawImage(img_b,0,0,w,h,0,h-s,w,h);}if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="radialgradient"){var r=Math.sqrt(Math.pow(w,2)+Math.pow(h,2))/2,c=Math.round(steps*0.5),s=(r/c),x=w/2,y=h/2,v=0,z=0,wc=cvi_trans.isWC;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;ctx.drawImage(img_a,0,0,w,h);cbx.clearRect(0,0,w,h);cbx.globalCompositeOperation="source-over";cbx.drawImage(img_b,0,0,w,h);cbx.globalCompositeOperation="destination-out";z=cnt<=c?0:c;v=Math.max(s*(val-z),1);stl=cbx.createRadialGradient(x,y,z==0?0:v,x,y,z==0?v:r);stl.addColorStop(0,"rgba(0,0,0,0.0)");stl.addColorStop(1,"rgba(0,0,0,1.0)");cbx.fillStyle=stl;fill(cbx,0,0,w,h,wc);ctx.drawImage(buffer,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="radialwipe"){var typ=efx[1]||"clock",s=0,x=w/2,y=h/2,a=(Math.PI/2)*-1,d=Math.PI*2,r=Math.ceil(Math.sqrt(Math.pow(w,2)+Math.pow(h,2))/2);if(typ=="radial"){r=r*2;d=Math.PI/2;}s=(d/(steps*(typ=="wedge"?2:1)));cnt=1;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;ctx.drawImage(img_a,0,0,w,h);cbx.clearRect(0,0,w,h);cbx.globalCompositeOperation="source-over";cbx.drawImage(img_b,0,0,w,h);cbx.globalCompositeOperation="destination-out";cbx.fillStyle="rgba(0,0,0,1.0)";cbx.beginPath();if(typ=="wedge"){cbx.moveTo(x,y);cbx.arc(x,y,r,a-(val*s),a+(val*s),true);}else if(typ=="radial"){cbx.moveTo(0,0);cbx.arc(0,0,r,0,val*s,true);}else{cbx.moveTo(x,y);cbx.arc(x,y,r,a,a+(val*s),true);}cbx.closePath();cbx.fill();ctx.drawImage(buffer,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="randombars"){var typ=efx[1]||"horizontal",v=typ=="vertical"?1:0,a=v?w:h,z=0,ss,cs,l=new Array();for(var i=0;i<a;i++){l[i]=i;}l.shuffle();ss=Math.ceil(a/steps),cs=l.length-ss;cmx.clearRect(0,0,w,h);cmx.fillStyle="rgba(0,0,0,1.0)";cmx.fillRect(0,0,w,h);timer.start();canvas.timer=window.setInterval(function(){ctx.drawImage(img_a,0,0,w,h);cbx.clearRect(0,0,w,h);cbx.globalCompositeOperation="source-over";cbx.drawImage(img_b,0,0,w,h);cbx.globalCompositeOperation="destination-out";z=Math.min(ss*cnt,cs);if(v){for(var i=z;i<(z+ss);i++){cmx.clearRect(l[i],0,1,h);}}else{for(var i=z;i<(z+ss);i++){cmx.clearRect(0,l[i],w,1);}}cbx.drawImage(mask,0,0,w,h);ctx.drawImage(buffer,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="randomdissolve"){var q=parseInt(getInt(opt1,2,trans),10),gx=Math.ceil(w/q),gy=Math.ceil(h/q),a=gx*gy,x=0,y=0,z=0,ss,cs,b=new Array();for(var i=0;i<a;i++){b[i]=i;}b.shuffle();ss=Math.ceil(a/steps),cs=b.length-ss;cmx.clearRect(0,0,w,h);cmx.fillStyle="rgba(0,0,0,1.0)";cmx.fillRect(0,0,w,h);timer.start();canvas.timer=window.setInterval(function(){ctx.drawImage(img_a,0,0,w,h);cbx.clearRect(0,0,w,h);cbx.globalCompositeOperation="source-over";cbx.drawImage(img_b,0,0,w,h);cbx.globalCompositeOperation="destination-out";z=Math.min(ss*cnt,cs);for(var i=z;i<(z+ss);i++){y=Math.floor(b[i]/gx);x=b[i]-(y*gx);cmx.clearRect(x*q,y*q,q,q);}cbx.drawImage(mask,0,0,w,h);ctx.drawImage(buffer,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="rotate"){var dir=efx[1]||"out",m=dir=="in"?1:0,z=0,ww=0,hh=0,d=1/steps,a=(Math.PI*2)/steps;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;z=m?1-(val*d):val*d;ww=Math.max(w*z,1);hh=Math.max(h*z,1);cbx.clearRect(0,0,w,h);cbx.save();cbx.translate(w/2,h/2);cbx.rotate(a*val);cbx.drawImage(m?img_a:img_b,0,0,w,h,0-(ww/2),0-(hh/2),ww,hh);cbx.restore();ctx.drawImage(m?img_b:img_a,0,0,w,h);ctx.drawImage(buffer,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="scale"){var dir=efx[1]||"out",m=dir=="in"?1:0,z=0,x=0,y=0,ww=0,hh=0,d=1/steps;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;z=m?1-(val*d):val*d;ww=Math.max(w*z,1);hh=Math.max(h*z,1);x=(w-ww)/2;y=(h-hh)/2;cbx.clearRect(0,0,w,h);cbx.drawImage(m?img_a:img_b,0,0,w,h,x,y,ww,hh);ctx.drawImage(m?img_b:img_a,0,0,w,h);ctx.drawImage(buffer,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="slide"){var q=parseInt(getInt(opt1,1,trans),10),typ=efx[1]||"hide",s=(w/steps),hw=(w/2),c=0,o=0,yo=0,ww=0,hh=h/q;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;if(typ=="push"){ww=val*s;for(var i=0;i<q;i++){o=i%2;yo=i*hh;ctx.drawImage(img_a,0,yo,w,hh,(o?ww:0-ww),yo,w,hh);ctx.drawImage(img_b,0,yo,w,hh,(o?ww-w:w-ww),yo,w,hh);}}else if(typ=="swap"){if(c){ww=hw+(hw-(val*s));for(var i=0;i<q;i++){o=i%2;yo=i*hh;ctx.drawImage(img_a,0,yo,w,hh,(o?ww:0-ww),yo,w,hh);ctx.drawImage(img_b,0,yo,w,hh,(o?0-ww:ww),yo,w,hh);}}else{ww=Math.min(val*s,hw);c=ww==hw?true:false;for(var i=0;i<q;i++){o=i%2;yo=i*hh;ctx.drawImage(img_b,0,yo,w,hh,(o?0-ww:ww),yo,w,hh);ctx.drawImage(img_a,0,yo,w,hh,(o?ww:0-ww),yo,w,hh);}}}else{ww=val*s;ctx.drawImage(img_b,0,0,w,h,0,0,w,h);for(var i=0;i<q;i++){o=i%2;yo=i*hh;ctx.drawImage(img_a,0,yo,w,hh,(o?ww:0-ww),yo,w,hh);}}if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="smudge"){var tr=Math.round(steps*0.8),qr=steps-tr,ss=h/tr,k=1/tr,p=1/qr,yo=0,hh=0,e=0,s=0,o=0,wc=cvi_trans.isWC;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;if(val<=tr){s=Math.max(val*ss,1);o=Math.min(Math.max(val*k,0),1);e=Math.max(s-ss,0);yo=Math.min(s,h-1);hh=Math.max(h-s,1);}else{o=Math.min(Math.max((val-tr)*p,0),1);}ctx.drawImage(img_b,0,0,w,h);cbx.clearRect(0,0,w,h);cbx.globalCompositeOperation="source-over";cbx.drawImage(img_a,0,yo,w,hh,0,yo,w,hh);cbx.drawImage(img_a,0,Math.max(s-ss,0),w,ss,0,0,w,s);cbx.globalCompositeOperation="destination-out";stl=cbx.createLinearGradient(0,0,0,h);stl.addColorStop(0.0,'rgba(0,0,0,1)');stl.addColorStop(o,'rgba(0,0,0,'+(val<=tr?0:1)+')');stl.addColorStop(1.0,'rgba(0,0,0,0)');cbx.fillStyle=stl;fill(cbx,0,0,w,h,wc);ctx.drawImage(buffer,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="spiral"){var gx=parseInt(getInt(opt1,8,trans),10),gy=parseInt(getInt(opt2,gx,trans),10),m=gx*gy,ww=(w/gx),bw=Math.ceil(ww),hh=(h/gy),bh=Math.ceil(hh),lf=(m/steps),tt=Math.round(steps/m),ct=0,yo=0,xo=-1,dir=0,xc=gx,yc=gy-1;cmx.clearRect(0,0,w,h);cmx.fillStyle="rgba(0,0,0,1.0)";cmx.fillRect(0,0,w,h);timer.start();canvas.timer=window.setInterval(function(){function spiral(){if(dir==0&&ct==xc){xc--;dir++;ct=0;}else if(dir==1&&ct==yc){yc--;dir++;ct=0;}else if(dir==2&&ct==xc){xc--;dir++;ct=0;}else if(dir==3&&ct==yc){yc--;dir=0;ct=0;}switch(dir){case 0:xo++;break;case 1:yo++;break;case 2:xo--;break;case 3:yo--;break;}ct++;cmx.clearRect(Math.round(xo*ww),Math.round(yo*hh),bw,bh);};ctx.drawImage(img_a,0,0,w,h);cbx.clearRect(0,0,w,h);cbx.globalCompositeOperation="source-over";cbx.drawImage(img_b,0,0,w,h);cbx.globalCompositeOperation="destination-out";if(lf<1){if(cnt!=0&&cnt%tt==0){spiral();}}else{for(var i=cnt;i<(cnt+lf);i++){spiral();}}cbx.drawImage(mask,0,0,w,h);ctx.drawImage(buffer,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="split"){var pos=efx[1]||"horizontal",dir=efx[2]||"out",v=pos=="vertical"?1:0,m=dir=="in"?1:0,h5=h/2,w5=w/2,sc=(v?h5:w5)/steps,s=0;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;s=Math.min(Math.max(val*sc,1),v?m?h:h5:m?w:w5);ctx.drawImage(m?img_a:img_b,0,0,w,h);if(v){ctx.drawImage(m?img_b:img_a,0,0,w,h5,0,0,w,m?s:h5-s);ctx.drawImage(m?img_b:img_a,0,h5,w,h5,0,m?h-s:h5+s,w,m?s:h5-s);}else{ctx.drawImage(m?img_b:img_a,0,0,w5,h,0,0,m?s:w5-s,h);ctx.drawImage(m?img_b:img_a,w5,0,w5,h,m?w-s:w5+s,0,m?s:w5-s,h);}if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="squares"){var gx=parseInt(getInt(opt1,8,trans),10),gy=parseInt(getInt(opt2,gx,trans),10),dir=efx[1]||"out",m=dir=="in"?1:0,ww=(w/gx),hh=(h/gy),w5=ww/2,h5=hh/2,sx=(ww/steps),sy=(hh/steps),xo=0,yo=0,z=0;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;ctx.drawImage(m?img_b:img_a,0,0,w,h);cbx.clearRect(0,0,w,h);cbx.globalCompositeOperation="source-over";cbx.drawImage(m?img_a:img_b,0,0,w,h);cbx.globalCompositeOperation="destination-out";cbx.fillStyle="rgba(0,0,0,1.0)";for(var x=0;x<gx;x++){xo=(val*sx)/2;for(var y=0;y<gy;y++){yo=(val*sy)/2;if(m){cbx.fillRect((x*ww)+w5-xo,(y*hh)+h5-yo,Math.max(2*xo,1),Math.max(2*yo,1));}else{cbx.fillRect((x*ww)+xo,(y*hh)+yo,Math.max(ww-(2*xo),1),Math.max(hh-(2*yo),1));}}}ctx.drawImage(buffer,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="stretch"){var typ=efx[1]||"horizontal",dir=efx[2]||"in",m=dir=="in"?1:0,hz=dir=="right"||dir=="left"||typ=="horizontal"?1:0,s=((hz?w:h)/steps),hw=(w/2),fh=(h/2),xo=0,yo=0,ww=0,hh=0;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;ww=hz?Math.min(Math.max(val*s,1),w):w;hh=hz?h:Math.min(Math.max(val*s,1),h);if(typ=="push"){if(dir=="right"){ctx.drawImage(img_a,0,0,w,h,ww,0,w-ww,hh);ctx.drawImage(img_b,0,0,w,h,0,0,ww,hh);}else if(dir=="left"){ctx.drawImage(img_a,0,0,w,h,0,0,w-ww,hh);ctx.drawImage(img_b,0,0,w,h,w-ww,0,ww,hh);}else if(dir=="up"){ctx.drawImage(img_a,0,0,w,h,0,0,ww,h-hh);ctx.drawImage(img_b,0,0,w,h,0,h-hh,ww,hh);}else if(dir=="down"){ctx.drawImage(img_a,0,0,w,h,0,hh,ww,h-hh);ctx.drawImage(img_b,0,0,w,h,0,0,ww,hh);}}else if(typ=="hide"){ctx.drawImage(img_a,0,0,w,h);if(dir=="left"){ctx.drawImage(img_b,0,0,w,h,w-ww,0,ww,hh);}else if(dir=="down"){ctx.drawImage(img_b,0,0,w,h,0,0,ww,hh);}else if(dir=="up"){ctx.drawImage(img_b,0,0,w,h,0,h-hh,ww,hh);}else{ctx.drawImage(img_b,0,0,w,h,0,0,ww,hh);}}else{ctx.drawImage(m?img_a:img_b,0,0,w,h);xo=hz?m?hw-(ww/2):ww*.5:0;yo=hz?0:m?fh-(hh/2):hh*.5;ctx.drawImage(m?img_b:img_a,0,0,w,h,xo,yo,hz?m?ww:w-ww:ww,hz?hh:m?hh:h-hh);}if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="strips"){var dir=efx[1]||"rightdown",m=(w+h),x=0,y=0,s=(m/steps);timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;ctx.drawImage(img_a,0,0,w,h);cbx.clearRect(0,0,w,h);cbx.globalCompositeOperation="source-over";cbx.drawImage(img_b,0,0,w,h);cbx.globalCompositeOperation="destination-out";cbx.fillStyle="rgba(0,0,0,1.0)";if(dir=='rightdown'){x=(w-m)+(val*s);y=(h-m)+(val*s);cbx.beginPath();cbx.moveTo(w,h);cbx.lineTo(w,y);cbx.lineTo(x,h);cbx.closePath();cbx.fill();}else if(dir=='rightup'){x=(w-m)+(val*s);y=m-(val*s);cbx.beginPath();cbx.moveTo(w,0);cbx.lineTo(w,y);cbx.lineTo(x,0);cbx.closePath();cbx.fill();}else if(dir=='leftdown'){x=m-(val*s);y=(h-m)+(val*s);cbx.beginPath();cbx.moveTo(0,h);cbx.lineTo(0,y);cbx.lineTo(x,h);cbx.closePath();cbx.fill();}else if(dir=='leftup'){x=m-(val*s);y=m-(val*s);cbx.beginPath();cbx.moveTo(0,0);cbx.lineTo(0,y);cbx.lineTo(x,0);cbx.closePath();cbx.fill();}ctx.drawImage(buffer,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="turn"){var q=parseInt(getInt(opt1,5,trans),10),pos=efx[1]||"vertical",dir=efx[2]||"right",v=pos=="vertical"?1:0,r=dir=="left"||dir=="up"?1:0,ww=v?(w/q):w,hh=v?h:(h/q),sx=(ww/steps),sy=(hh/steps),s=0;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;if(v){s=val*sx;for(var i=0;i<q;i++){ctx.drawImage(img_a,(i*ww),0,ww,h,(i*ww)+(r?0:s),0,Math.max(ww-s,1),h);ctx.drawImage(img_b,(i*ww),0,ww,h,(i*ww)+(r?ww-s:0),0,Math.max(s,1),h);}}else{s=val*sy;for(var i=0;i<q;i++){ctx.drawImage(img_a,0,(i*hh),w,hh,0,(i*hh)+(r?0:s),w,Math.max(hh-s,1));ctx.drawImage(img_b,0,(i*hh),w,hh,0,(i*hh)+(r?hh-s:0),w,Math.max(s,1));}}if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="wheel"){var q=parseInt(getInt(opt1,4,trans),10),x=w/2,y=h/2,d=(Math.PI*2)/q,r=Math.ceil(Math.sqrt(Math.pow(w,2)+Math.pow(h,2))/2),s=(d/steps);timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;ctx.drawImage(img_a,0,0,w,h);cbx.clearRect(0,0,w,h);cbx.globalCompositeOperation="source-over";cbx.drawImage(img_b,0,0,w,h);cbx.globalCompositeOperation="destination-out";cbx.fillStyle="rgba(0,0,0,1.0)";for(var i=0;i<q;i++){cbx.beginPath();cbx.moveTo(x,y);cbx.arc(x,y,r,(i*d)+(val*s),(i*d)+(steps*s),false);cbx.closePath();cbx.fill();}ctx.drawImage(buffer,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="wrench"){var pos=efx[1]||"vertical",v=pos=="vertical"?1:0,c=Math.round(steps*.5),a=1/c,xo=0,yo=0,ow=0,oh=0,s=0;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;s=cnt<=c?1:0;cbx.clearRect(0,0,w,h);if(s){ow=Math.round(Math.min(Math.max(w*(1-(val*a)),1),w));xo=((w-ow)/2);oh=Math.round(Math.min(Math.max(h*(1-(val*a)),1),h));yo=((h-oh)/2);}else{ow=Math.round(Math.min(Math.max(w*((val-c)*a),1),w));xo=((w-ow)/2);oh=Math.round(Math.min(Math.max(h*((val-c)*a),1),h));yo=((h-oh)/2);cbx.globalAlpha=a*(val-c);}cbx.drawImage(s?img_a:img_b,v?0:xo,v?yo:0,v?w:ow,v?oh:h,0,0,w,h);ctx.drawImage(buffer,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="zigzag"){var gx=parseInt(getInt(opt1,8,trans),10),gy=parseInt(getInt(opt2,gx,trans),10),m=gx*gy,ww=(w/gx),bw=Math.ceil(ww),hh=(h/gy),bh=Math.ceil(hh),lf=(m/steps),tt=Math.round(steps/m),ct=0,yo=0,xo=-1,dir=0,xc=gx;cmx.clearRect(0,0,w,h);cmx.fillStyle="rgba(0,0,0,1.0)";cmx.fillRect(0,0,w,h);timer.start();canvas.timer=window.setInterval(function(){function zigzag(){if(dir==0&&ct==xc){dir++;ct=0;xo++;yo++;}else if(dir==1&&ct==(xc+1)){dir=0;ct=0;yo++;}if(dir==0){xo++;}else{xo--;}ct++;cmx.clearRect(Math.round(xo*ww),Math.round(yo*hh),bw,bh);};ctx.drawImage(img_a,0,0,w,h);cbx.clearRect(0,0,w,h);cbx.globalCompositeOperation="source-over";cbx.drawImage(img_b,0,0,w,h);cbx.globalCompositeOperation="destination-out";if(lf<1){if(cnt!=0&&cnt%tt==0){zigzag();}}else{for(var i=cnt;i<(cnt+lf);i++){zigzag();}}cbx.drawImage(mask,0,0,w,h);ctx.drawImage(buffer,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}
else if(efx[0]=="zoom"){var dir=efx[1]||"out",m=dir=="in"?1:0,z=0,f=0,x=0,y=0,ww=0,hh=0,a=1/steps,d=a;timer.start();canvas.timer=window.setInterval(function(){val=cvi_tween[tween](steps,cnt,cpa)*steps;z=m?val*d:1-(val*d);f=m?a*val:1-(a*val);ww=Math.min(Math.max(w*z,1),w);hh=Math.min(Math.max(h*z,1),h);x=(w-ww)/2;y=(h-hh)/2;cbx.clearRect(0,0,w,h);cbx.globalAlpha=f;cbx.drawImage(m?img_b:img_a,x,y,ww,hh,0,0,w,h);ctx.drawImage(m?img_a:img_b,0,0,w,h);ctx.drawImage(buffer,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}cnt++;if(cnt>steps){var t=timer.stop()-ival;window.clearInterval(canvas.timer);ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();cvi_trans._clr(callback,trans,t,fps*((dur*1000)/t),canvas);}},ival);}}catch(err){canvas.TLerror=err.message;ctx.drawImage(img_b,0,0,w,h);if(layer){ctx.drawImage(layer,0,0,w,h);}ctx.restore();log('Error: ',err.message+' - trans "'+trans+'" has failed!');cvi_trans._clr(callback,trans,0,0,canvas);}}}}return false;},stop:function(canvas,img){if(cvi_trans.vml&&canvas.TLfilter){var filter=canvas.TLfilter;if(canvas.filters.item(filter).status==2){canvas.filters.item(filter).stop();}}else if(canvas.timer&&canvas.getContext){window.clearInterval(canvas.timer);canvas.timer=0;var ctx=canvas.getContext('2d'),w=parseInt(canvas.width),h=parseInt(canvas.height);ctx.drawImage(img,0,0,w,h);ctx.restore();}cvi_trans._clr('','',0,0,canvas);return false;},_clr:function(callback,trans,time,fps,obj){if(cvi_trans.isWC){var ele=document.getElementById('cvi_trans_buffer');if(ele){document.body.removeChild(ele);}ele=document.getElementById('cvi_trans_mask');if(ele){document.body.removeChild(ele);}}obj.TLfilter=null;obj.TLbusy=false;if(callback){if(typeof window[callback]==='function'){window[callback](trans||"",time||0,fps||0,obj.id);}}return false;}}
var transm={version:1.0,released:'2010-12-21 06:21:00',defaultWidth:320,defaultHeight:180,defaultRadius:0,defaultName:null,defaultData:null,defaultCallback:null,defaultLayer:null,defaultAutoplay:0,defaultPingpong:0,defaultVerbose:0,defaultNocache:0,defaultFadein:0,defaultClearbg:0,defaultTimeout:6,defaultTransition:'random',defaultTweening:'default',defaultCparray:null,defaultDuration:2,defaultDelay:5,defaultFps:30,defaultMeter:false,defaultMfgcolor:'#ff0000',defaultMbgcolor:'#ffffff',defaultMopacity:0.75,defaultMsize:32,defaultMposx:280,defaultMposy:140,engine:(window.opera?"O":document.all&&!window.opera?"Ms":navigator.userAgent.indexOf('WebKit')>-1?"Webkit":navigator.userAgent.indexOf('KHTML')>-1&&navigator.userAgent.indexOf('WebKit')==-1?"Khtml":navigator.userAgent.indexOf('Gecko')>-1&&window.updateCommands?"Moz":""),css:function(v){var i,t,d=new Object(),s=new Array("O","Ms","Khtml","Webkit","Moz");d["o"]=d["ms"]=d["khtml"]=d["webkit"]=d["moz"]=d["css"]=false;if(v&&(typeof v==='string')){t=v.substr(0,1).toUpperCase()+v.substring(1);for(i=0;i<s.length;i++){try{d[s[i].toLowerCase()]=(document.body.style[s[i]+t]!==undefined);}catch(e){}}}try{d["css"]=(document.body.style[v]!==undefined);}catch(e){}d["any"]=(d["css"]||d["moz"]||d["khtml"]||d["webkit"]||d["ms"]||d["o"]?true:false);return d;},style:function(v){if(v&&(typeof v==='string')){var d=this.css(v),t=v.substr(0,1).toUpperCase()+v.substring(1);return this.engine!=""&&d.any?d.css?v:d[this.engine.toLowerCase()]?this.engine+t:false:false;}return false;},canvas:function(v){var t=document.createElement('canvas'),c=false;if(t.tagName.toUpperCase()=="CANVAS"){try{c=t.getContext("2d");}catch(e){}}if(c&&v&&(typeof v==='string')){if(c[v]){return true;}else if(t[v]){return true;}else{return false;}}else{return Boolean(c);}},current:function(o){var s;if(o.currentStyle){s=o.currentStyle;}else if(document.defaultView&&document.defaultView.getComputedStyle){s=document.defaultView.getComputedStyle(o,"");}else{s=o.style;}return s;},color:function(v){if(v.toLowerCase().match(/^#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]$/i)){return v;}else if(v.toLowerCase().match(/^#[0-9a-f][0-9a-f][0-9a-f]$/i)){return'#'+v.substr(1,1)+v.substr(1,1)+v.substr(2,1)+v.substr(2,1)+v.substr(3,1)+v.substr(3,1);}else{return'#000000';}},rgb:function(v){function h2d(h){return(Math.max(0,Math.min(parseInt(h,16),254)));};return h2d(v.substr(1,2))+','+h2d(v.substr(3,2))+','+h2d(v.substr(5,2));},vml:function(){return(document.all&&document.namespaces&&!window.opera);},log:function(s,v){s=s.toUpperCase()||'LOG';if(window.console){if(!window.console.warn){window.console.log(s+': '+v);}else{window.console[s.toLowerCase()||'log'](v);}}else if(window.opera){opera.postError(s+': '+v);}else{window.document.title=s+': '+v;}return false;},G:function(v){return(document.getElementById(v));},R:function(v){return(document.body.removeChild(v));},A:function(v){return(document.body.appendChild(v));},C:function(v){return(document.createElement(v));},add:function(object,options){function uniqueID(){var v=Date.parse(new Date())+Math.floor(Math.random()*100000000000);return v.toString(16);}function getFName(v,s){var fn=v.replace(/^.*[\/\\]/g,''),t=fn.lastIndexOf(".");if(s&&t>0){fn=fn.substring(0,t);}return fn;};function getArg(a,t){return(typeof options[a.toLowerCase()]===t?options[a.toLowerCase()]:transm["default"+a]);};function getNum(a,n,m){return Math.max(n,Math.min(m,(typeof options[a.toLowerCase()]==='number'?options[a.toLowerCase()]:transm["default"+a])));};function finalize(){tmp=transm.C('a');tmp.style.height=height+'px';tmp.style.width=width+'px';with(tmp.style){display='block';position='absolute';background='transparent';zIndex=11;left='0px';top='0px';padding='0px';margin='0px';outline='0px none';border='0px none';}object.appendChild(tmp);tmp.unselectable=true;if(nsa){tmp.style[nsa]='none';}if(nda){tmp.style[nda]='none';}tmp.id=self.id+"_link";tmp.title=null;tmp.href=null;tmp.target=null;if(self.meter){if(self.w3c){var meter=transm.C('canvas');meter.id=self.id+"_meter";meter.width=self.msize;meter.height=self.msize;meter.style.height=self.msize+'px';meter.style.width=self.msize+'px';meter.style.position='absolute';meter.style.left=self.mposx+'px';meter.style.top=self.mposy+'px';if(nsa){meter.style[nsa]='none';}if(nda){meter.style[nda]='none';}tmp.appendChild(meter);}else if(self.vml){var meter=transm.C('div');meter.id=self.id+"_meter";meter.style.height=self.msize+'px';meter.style.width=self.msize+'px';meter.style.display='block';meter.style.position='absolute';meter.style.left=self.mposx+'px';meter.style.top=self.mposy+'px';meter.style.visibility='visible';tmp.appendChild(meter);meter.unselectable=true;meter.innerHTML='<v:oval strokeweight="0" stroked="f" filled="t" fillcolor="#808080" style="zoom:1;display:block;position:absolute;left:0px;top:0px;margin:0px;padding:0px;width:'+self.msize+'px;height:'+self.msize+'px;"><v:fill color="'+self.mbgcolor+'" opacity="'+self.mopacity+'" /></v:oval><v:shape path="m 500,500 ae 500,500,500,500,5898150,23592960 x e" coordorigin="0,0" coordsize="1000,1000" strokeweight="0" stroked="f" filled="t" fillcolor="#808080" style="zoom:1;display:block;position:absolute;left:0px;top:0px;margin:0px;padding:0px;width:'+self.msize+'px;height:'+self.msize+'px;"><v:fill color="'+self.mfgcolor+'" opacity="'+self.mopacity+'" /></v:shape>';meter.style.visibility='hidden';}else{var meter=transm.C('div');meter.id=self.id+"_meter";meter.style.width=(self.cw-4)+'px';with(meter.style){fontSize='4px';lineHeight='4px';height='4px';position='absolute';display='block';background=self.mfgcolor;right='2px';bottom='2px';visibility='hidden';}meter.style[self.opa]=self.mopacity;meter.style.filter="alpha(opacity="+(self.mopacity*100)+")";tmp.appendChild(meter);meter.unselectable=true;if(nsa){meter.style[nsa]='none';}if(nda){meter.style[nda]='none';}}}var cover=transm.C('div');cover.id=self.id+"_cover";cover.style.width=parseInt(self.cw/2,10)+'px';with(cover.style){height='16px';fontSize='12px';lineHeight='12px';position='absolute';display='block';background=self.mbgcolor;}cover.style.left=parseInt((self.cw/4),10)+'px';cover.style.top=parseInt((self.ch/2)-7,10)+'px';if(nbr){cover.style[nbr]='8px';}tmp.appendChild(cover);cover.unselectable=true;if(nsa){cover.style[nsa]='none';}if(nda){cover.style[nda]='none';}cover.style[self.opa]=self.mopacity;cover.style.filter="alpha(opacity="+(self.mopacity*100)+")";var pro=transm.C('div');pro.id=self.id+"_progress";if(nbr){pro.style[nbr]='8px';}with(pro.style){width='0px';fontSize='12px';lineHeight='12px';height='16px';margin='0px';position='absolute';display='block';background=self.mfgcolor;left='0px';top='0px';}cover.appendChild(pro);pro.unselectable=true;if(self.vml&&document.documentMode){pro.style.filter="alpha(opacity="+(self.mopacity*100)+")";}if(self.vml&&!self.nocache){tmp=transm.C('v:image');tmp.id=self.id+"_vml_preloader";tmp.src="";tmp.strokeweight="0";tmp.stroked="f";tmp.style.display='block';tmp.style.visibility='visible';tmp.style.cssText='zoom:1;position:absolute;left:-9999px;top:0px;margin:0px;padding:0px;width:'+self.cw+'px;height:'+self.ch+'px;';transm.A(tmp);}transm._preload(self,0);return self.id;};var width,height,cw,ch,tmp,data,img,id,vml,w3c,opa,nbr,nsa,nda,i,ctx,radius=0,radii,verbose,defopts={"width":transm.defaultWidth,"height":transm.defaultHeight,"radius":transm.defaultRadius,"name":transm.defaultName,"data":transm.defaultData,"layer":transm.defaultLayer,"autoplay":transm.defaultAutoplay,"pingpong":transm.defaultPingpong,"verbose":transm.defaultVerbose,"fadein":transm.defaultFadein,"callback":transm.defaultCallback,"clearbg":transm.defaultClearbg,"timeout":transm.defaultTimeout,"transition":transm.defaultTransition,"tweening":transm.defaultTweening,"cparray":transm.defaultCparray,"duration":transm.defaultDuration,"delay":transm.defaultDelay,"fps":transm.defaultFps,"meter":transm.defaultMeter,"mfgcolor":transm.defaultMfgcolor,"mbgcolor":transm.defaultMbgcolor,"mopacity":transm.defaultMopacity,"msize":transm.defaultMsize,"mposx":transm.defaultMposx,"mposy":transm.defaultMposy};if(options){for(i in defopts){if(!options[i]){options[i]=defopts[i];}}}else{options=defopts;}verbose=getArg('Verbose','boolean');vml=transm.vml();if(!vml){w3c=transm.canvas();}nbr=transm.style('BorderRadius');nsa=transm.style('UserSelect');nda=transm.style('UserDrag');opa=transm.style('Opacity');if(typeof cvi_tfx=='object'&&typeof cvi_trans=='object'){width=cw=parseInt(getNum('Width',64,1024),10);height=ch=parseInt(getNum('Height',64,1024),10);if(typeof options['radius']==='number'){radius=parseInt(getNum('Radius',0,Math.min(width/2,height/2)),10);}radii=(typeof options['radius']==='object'?options['radius']:new Array());for(i=0;i<4;i++){radii[i]=parseInt(Math.min(width/2,height/2,Math.max(radii[i]||0,0)),10);}object.id=(object.id!='undefined'?object.id:uniqueID());id=getArg('Name','string');tmp=(id==''||id==null?object.id+'_transm':id);data=(typeof options['data']==='object'?options['data']:new Array());if(!transm.G(tmp)&&data!=null&&data.length&&data.length>1){tmp=transm.current(object);if(tmp.display.match(/^none|inline|run-in|compact|marker$/i)){object.style.display='block';}if(tmp.position.match(/^none|static$/i)){object.style.position='relative';}object.innerHTML='';with(object.style){overflow='hidden';padding='0px';outline='0px none';border='0px none';cursor='progress';}object.unselectable=true;object.style.height=height+'px';object.style.width=width+'px';if(nsa){object.style[nsa]='none';}if(nda){object.style[nda]='none';}try{if(vml){if(document.namespaces['v']==null){var e=["shape","shapetype","group","background","path","formulas","handles","fill","stroke","shadow","textbox","textpath","imagedata","line","polyline","curve","roundrect","oval","rect","arc","image"],s=document.createStyleSheet();for(i=0;i<e.length;i++){s.addRule("v\\:"+e[i],"behavior: url(#default#VML);");}document.namespaces.add("v","urn:schemas-microsoft-com:vml");}if(radius){var self=transm.C('v:roundrect');self.vml=true;self.radius=Math.max(Math.min(100,radius/(Math.min(width,height)/100)),0)+'%';self.arcsize=self.radius;}else{var self=transm.C('v:shape');self.vml=true;self.coordsize=width+','+height;var r=radii,w=width,h=height,p="m 0,"+r[0];if(r[3]>0){p+=" l 0,"+(h-r[3])+" qy "+r[3]+","+h;}else{p+=" l 0,"+h;}if(r[2]>0){p+=" l "+(w-r[2])+","+h+" qx "+w+","+(h-r[2]);}else{p+=" l "+w+","+h;}if(r[1]>0){p+=" l "+w+","+r[1]+" qy "+(w-r[1])+",0";}else{p+=" l "+w+",0";}if(r[0]>0){p+=" l "+r[0]+",0 qx 0,"+r[0];}else{p+=" l 0,0";}p+=" x e";self.fillpath=p;self.path=self.fillpath;}self.strokeweight="0";self.filled="t";self.stroked="f";self.fillcolor="#808080";self.style.display='block';self.style.visibility='visible';self.style.cssText='zoom:1;position:absolute;left:0px;top:0px;margin:0px;padding:0px;width:'+width+'px;height:'+height+'px;';self.style.visibility='hidden';}else if(w3c){var self=transm.C('canvas');self.w3c=true;self.csp=transm.canvas('getImageData');self.wcs=navigator.userAgent.indexOf('WebKit')!=-1&&!window.external&&!document.defaultCharset?1:0;self.wcf=navigator.userAgent.indexOf('Gecko')>-1&&window.updateCommands&&!window.external?1:0;}else{if(document.images&&document.getElementById&&document.createElement&&document.appendChild&&document.removeChild&&document.childNodes){var self=transm.C('img');self.old=true;self.style.position='absolute';self.style.left='0px';self.style.top='0px';self.tri=document.all&&!window.opera?1:0;}}if(self){self.data=data;self.nsa=nsa;self.nda=nda;self.opa=opa?opa:'opacity';if(typeof cvi_tween['sineEaseInOut']!='function'){self.nolib=true;if(verbose){transm.log('warn','transm: missing "cvi_tween_lib"');}}for(i=0;i<self.data.length;i++){if(self.data[i].source.match(/\.(gif|png|jpg|jpeg)(?:\?([^#]*))?(?:#(\.*))?$/i)){self.data[i].n=getFName(self.data[i].source,true);}}for(i=0;i<self.data.length;i++){if(!self.data[i].n){self.data.splice(i,1);i--;}}if(self.data.length>1){self.verbose=verbose;self.autoplay=getArg('Autoplay','boolean');self.pingpong=getArg('Pingpong','boolean');self.clearbg=getArg('Clearbg','boolean');self.fadein=getArg('Fadein','boolean');self.nocache=getArg('Nocache','boolean');self.timeout=parseInt(getNum('Timeout',1,60),10)*1000;self.transition=getArg('Transition','string');self.tweening=getArg('Tweening','string');self.cparray=getArg('Cparray','object');self.duration=parseFloat(getNum('Duration',0.5,5));self.delay=parseFloat(getNum('Delay',0,600));self.fps=parseInt(getNum('Fps',15,100),10);self.layer=getArg('Layer','string');self.back=getArg('Callback','string');self.meter=getArg('Meter','boolean');self.mfgcolor=transm.color(getArg('Mfgcolor','string'));self.mbgcolor=transm.color(getArg('Mbgcolor','string'));self.mfgc=transm.rgb(self.mfgcolor);self.mbgc=transm.rgb(self.mbgcolor);self.mopacity=parseFloat(getNum('Mopacity',0.1,1.0));self.msize=parseInt(getNum('Msize',24,Math.min(width,height)),10);self.mposx=parseInt(getNum('Mposx',0,width-self.msize),10);self.mposy=parseInt(getNum('Mposy',0,height-self.msize),10);self.xfac=width>height?1:height>width?width/height:1;self.yfac=height>width?1:width>height?height/width:1;self.ifac=self.xfac==1?(width/height):(height/width);self.curI=0;self.preI=0;self.curD=1;self.fromB='a';self.pbgcolor=tmp.backgroundColor;self.pbgimage=tmp.backgroundImage;self.options=options;self.id=id!=null?id:object.id+'_transm';if(w3c){self.radius=radius;self.radii=radii;self.height=height;self.width=width;}self.ch=height;self.cw=width;with(self.style){padding='0px';margin='0px';outline='0px none';border='0px none';}self.style.height=height+'px';self.style.width=width+'px';self.unselectable=true;if(nsa){self.style[nsa]='none';}if(nda){self.style[nda]='none';}self.style[self.opa]=1;self.TLtrans=null;self.TLtween=null;self.TLerror=null;self.TLfilter=null;self.TLacall=null;self.TLaarg=null;self.TLbcall=null;self.TLbarg=null;self.TLbusy=false;self.TLdur=0;self.TLfps=0;object.appendChild(self);if(self.w3c){var buff_a=transm.C('canvas'),buff_b=transm.C('canvas');if(self.wcs){buff_a.id=self.id+'_img_a';buff_a.height=ch;buff_a.width=cw;with(buff_a.style){position='fixed';left='-9999px';top='0px';}buff_a.style.height=ch+'px';buff_a.style.width=cw+'px';transm.A(buff_a);buff_b.id=self.id+'_img_b';buff_b.height=ch;buff_b.width=cw;with(buff_b.style){position='fixed';left='-9999px';top='0px';}buff_b.style.height=ch+'px';buff_b.style.width=cw+'px';transm.A(buff_b);}else{buff_a.width=buff_b.width=width;buff_a.height=buff_b.height=height;}self.a=buff_a;self.b=buff_b;self.ctx=self.getContext("2d");}if(self.old){tmp=transm.C('img');tmp.height=height;tmp.width=width;with(tmp.style){position='absolute';left='0px';top='0px';padding='0px';margin='0px';outline='0px none';border='0px none';}object.appendChild(tmp);tmp.unselectable=true;if(nsa){tmp.style[nsa]='none';}if(nda){tmp.style[nda]='none';}tmp.id=self.id+"_buffer";}if(self.layer){img=new Image();img.onerror=function(){self.layer=null;finalize();};img.onload=function(){if(img.width&&img.height&&img.width>=64&&img.height>=64){if(self.w3c){var buff_c=transm.C('canvas');if(self.wcs){buff_c.id=self.id+'_img_c';buff_c.height=ch;buff_c.width=cw;with(buff_c.style){position='fixed';left='-9999px';top='0px';}buff_c.style.height=ch+'px';buff_c.style.width=cw+'px';transm.A(buff_c);}else{buff_c.width=width;buff_c.height=height;}self.c=buff_c;ctx=self.c.getContext("2d");ctx.clearRect(0,0,self.width,self.height);ctx.drawImage(img,0,0,self.width,self.height);}else if(self.vml){if(radius){tmp=transm.C('v:roundrect');tmp.arcsize=self.radius;}else{tmp=transm.C('v:shape');tmp.coordsize=width+','+height;tmp.path=self.fillpath;}tmp.strokeweight="0";tmp.filled="t";tmp.stroked="f";tmp.fillcolor="#808080";tmp.style.visibility='visible';tmp.style.cssText='zoom:1;display:block;position:absolute;left:0px;top:0px;margin:0px;padding:0px;width:'+width+'px;height:'+height+'px;visibility:hidden;';object.appendChild(tmp);tmp.id=self.id+"_layer";}else if(self.old){if(self.tri){tmp=transm.C('div');tmp.style.display='block';tmp.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+self.layer+'", sizingMethod="scale")';}else{tmp=transm.C('img');tmp.src=self.layer;tmp.height=height;tmp.width=width;}tmp.style.height=height+'px';tmp.style.width=width+'px';with(tmp.style){position='absolute';zIndex=10;left='0px';top='0px';padding='0px';margin='0px';outline='0px none';border='0px none';}object.appendChild(tmp);tmp.unselectable=true;if(nsa){tmp.style[nsa]='none';}if(nda){tmp.style[nda]='none';}tmp.id=self.id+"_layer";}finalize();}else{self.layer=null;finalize();}};img.src=self.layer;}else{finalize();}}else{if(verbose){transm.log('warn','transm: insufficient images [exit]');}}}else{if(verbose){transm.log('error','transm: unsupported browser [exit]');}}}catch(err){if(verbose){transm.log('error','transm: has failed '+err.message+' [exit]');}}}}else{if(verbose){transm.log('warn','transm: missing "cvi_trans_lib" [exit]');}}return false;},play:function(self){if(self&&self.TLready){self.autoplay=true;if(self.parentNode.timer){window.clearInterval(self.parentNode.timer);}var delay=Math.max(0,Math.min((self.data[self.curI].delay||self.delay),600))*1000;if(self.meter){var meter=transm.G(self.id+"_meter");if(meter.timer){window.clearInterval(meter.timer);}if(self.w3c){var ctx=meter.getContext("2d"),t=Math.round(delay/40),d=Math.PI*2,s=d/t,c=0,w=meter.width,h=meter.height,x=w/2,y=h/2,a=(Math.PI/2)*-1,r=x;meter.timer=window.setInterval(function(){ctx.clearRect(0,0,w,h);ctx.save();ctx.arc(x,y,r,0,d,true);ctx.fillStyle="rgba("+self.mbgc+","+self.mopacity+")";ctx.fill();ctx.fillStyle="rgba("+self.mfgc+","+self.mopacity+")";ctx.beginPath();ctx.moveTo(x,y);ctx.arc(x,y,r,a,a+(c*s),true);ctx.closePath();ctx.fill();ctx.restore();c++;if(c>t){window.clearInterval(meter.timer);ctx.clearRect(0,0,w,h);transm.next(self,true);}},40);}else if(self.vml){var angle=meter.lastChild,t=Math.round(delay/40),m=0,s=360/t,c=0,a="m 500,500 ae 500,500,500,500,5898150,",z=" x e",p="";m=Math.round(360*65536);p=a+m+z;angle.path=p;meter.style.visibility='visible';meter.timer=window.setInterval(function(){m=Math.round((360-(c*s))*65536);p=a+m+z;angle.path=p;c++;if(c>t){window.clearInterval(meter.timer);meter.style.visibility='hidden';transm.next(self,true);}},40);}else{meter.style.visibility='visible';var t=Math.round(delay/40),cw=self.cw-4,s=cw/t,c=0;meter.timer=window.setInterval(function(){meter.style.width=(cw-(c*s))+'px';c++;if(c>t){window.clearInterval(meter.timer);meter.style.visibility='hidden';transm.next(self,true);}},40);}}else{self.parentNode.timer=window.setInterval(function(){transm.next(self,true);if(!self.autoplay){window.clearInterval(self.parentNode.timer);}},delay);}}return false;},stop:function(self){if(self&&self.TLready){self.autoplay=false;if(self.parentNode.timer){window.clearInterval(self.parentNode.timer);}if(self.meter){var meter=transm.G(self.id+"_meter");if(meter.timer){window.clearInterval(meter.timer);}if(self.w3c){var ctx=meter.getContext("2d");ctx.clearRect(0,0,meter.width,meter.height);}else{meter.style.visibility='hidden';}}}return false;},first:function(self){if(self&&!self.autoplay&&!self.TLbusy&&self.curI!=0){self.preI=self.curI;self.curI=0;transm._wipe(self);}return false;},prev:function(self){if(self&&!self.autoplay&&!self.TLbusy){self.preI=self.curI;if(self.curI>0){self.curI--;}else{self.curI=self.noi;}transm._wipe(self);}return false;},show:function(self,v){if(self&&!self.autoplay&&!self.TLbusy){self.preI=self.curI;self.curI=Math.min(Math.max(v||0,0),self.noi);transm._wipe(self);}return false;},next:function(self,v){if(self&&!self.TLbusy&&(!v&&!self.autoplay)||(v&&self.autoplay)){if(self.pingpong&&self.autoplay){self.preI=self.curI;if(self.curI>=self.noi){self.curD=0;}else if(self.curI<=0&&!self.curD){self.curD=1;self.curI=0;}if(self.curD){self.curI++;}else{self.curI--;}}else{if(self.curI<self.noi){self.curI++;}else{self.curI=0;}}transm._wipe(self);}return false;},last:function(self){if(self&&!self.autoplay&&!self.TLbusy&&self.curI!=self.noi){self.preI=self.curI;self.curI=self.noi;transm._wipe(self);}return false;},get:function(self,v){if(self){var info=null;switch(v.toLowerCase()){case"busy":info=self.TLbusy;break;case"playing":info=self.autoplay;break;case"current":info=self.curI;break;case"total":info=self.data.length;break;case"transition":info=self.TLtrans;break;case"tweening":info=self.TLtween;break;case"duration":info=self.TLdur;break;case"fps":info=self.TLfps;break;}return info;}return false;},info:function(self){if(self){return{transition:self.TLtrans,tweening:self.TLtween,duration:self.TLdur,fps:self.TLfps};}return false;},remove:function(self){if(self){var par=self.parentNode;if(self.timer){window.clearInterval(self.timer);}if(par.timer){window.clearInterval(par.timer);}if(self.wcs){var ele=transm.G(self.id+'_img_a');if(ele){transm.R(ele);}ele=transm.G(self.id+'_img_b');if(ele){transm.R(ele);}ele=transm.G(self.id+'_img_c');if(ele){transm.R(ele);}}if(self.clearbg){par.style.backgroundImage=self.pbgimage;par.style.backgroundColor=self.pbgcolor;}par.innerHTML='';}return false;},_preload:function(self,cnt){if(self){var img=null;if(self.timer){window.clearTimeout(self.timer);}if(cnt<self.data.length){var cw=parseInt((self.cw/2)-2,10),ow=cw/(self.data.length-1);transm.G(self.id+"_progress").style.width=(cnt*ow)+'px';self.timer=window.setTimeout("if("+self.verbose+"){transm.log('warn','transm: ["+self.timeout+"ms] timeout image > "+self.data[cnt].source+"');}transm._preload(transm.G('"+self.id+"'),"+(cnt+1)+");",self.timeout);if(self.vml&&!self.nocache){var pre=transm.G(self.id+"_vml_preloader");if(pre){pre.src=self.data[cnt].source;}}img=new Image();img.onabort=function(){if(self.verbose){transm.log('warn','transm: onabort image > '+self.data[cnt].source);}if(self.timer){window.clearTimeout(self.timer);}transm._setup(self);};img.onerror=function(){if(self.verbose){transm.log('warn','transm: onerror image > '+self.data[cnt].source);}cnt++;if(self.vml&&!self.nocache){if(self.timer){window.clearTimeout(self.timer);}window.setTimeout(function(){transm._preload(self,cnt);},0);}else{transm._preload(self,cnt);}};img.onload=function(){if(img.width&&img.height&&img.width>=64&&img.height>=64){var pos=0,tmp=0;self.data[cnt].l=true;self.data[cnt].nw=nw=img.naturalWidth||img.width;self.data[cnt].nh=nh=img.naturalHeight||img.height;tmp=self.data[cnt].imgshift;tmp=tmp>0&&tmp<=0.001?0:tmp;pos=Math.max(Math.min(self.data[cnt].imgshift||0.5,1.0),0.0);var nw=self.data[cnt].nw,nh=self.data[cnt].nh,ix=0,iy=0,iw=nw,ih=nh,xf=iw>ih?1:ih>iw?iw/ih:1,yf=ih>iw?1:iw>ih?ih/iw:1;if(self.xfac==1&&self.yfac==1&&xf==1&&yf==1){}else if(self.xfac==1&&self.yfac==1&&xf==1){iw=ih;ix=(nw-iw)*pos;}else if(self.xfac==1&&self.yfac==1&&yf==1){ih=iw;iy=(nh-ih)*pos;}else if(self.xfac==1){if(yf<self.yfac){iw=nh*self.ifac;ix=(nw-iw)*pos;}else{ih=nw*self.yfac;iy=(nh-ih)*pos;}}else if(self.yfac==1){if(xf<self.xfac){ih=nw*self.ifac;iy=(nh-ih)*pos;}else{iw=nh*self.xfac;ix=(nw-iw)*pos;}}self.data[cnt].mw=Math.round(iw);self.data[cnt].mh=Math.round(ih);self.data[cnt].ix=Math.round(ix);self.data[cnt].iy=Math.round(iy);var xf=(self.cw/iw),ff=xf,yf=(self.ch/ih),ww=(nw*xf),hh=(nh*yf);self.data[cnt].wm=(ww*.75);self.data[cnt].hm=(hh*.75);pos=0.5-pos;self.data[cnt].ox=((self.cw/ww)-1)*pos;self.data[cnt].oy=((self.ch/hh)-1)*pos;self.data[cnt].ww=Math.round(ww);self.data[cnt].hh=Math.round(hh);self.data[cnt].xx=Math.round(ff*-ix);self.data[cnt].yy=Math.round(ff*-iy);if(!self.vml){self.data[cnt].img=img;}if(transm.engine=="Ms"||self.tri){img.onload='';img=null;}if(self.verbose){transm.log('log','transm: '+self.data[cnt].nw+'x'+self.data[cnt].nh+' > '+self.data[cnt].source);}cnt++;if(self.vml&&!self.nocache){if(self.timer){window.clearTimeout(self.timer);}window.setTimeout(function(){transm._preload(self,cnt);},0);}else{transm._preload(self,cnt);}}else{if(self.verbose){transm.log('warn','transm: failed image > '+self.data[cnt].source);}cnt++;if(self.vml&&!self.nocache){if(self.timer){window.clearTimeout(self.timer);}window.setTimeout(function(){transm._preload(self,cnt);},0);}else{transm._preload(self,cnt);}}};img.src=self.data[cnt].source;}else{transm._setup(self);}}return false;},_return:function(self,trans,time,fps){if(self){if(trans){if(self.w3c){var tween=self.data[self.curI].tweening||self.tweening;tween=(typeof cvi_tween[tween]==='function'?tween:self.nolib?'linear':cvi_tfx[trans].tween||'linear');}self.TLtrans=trans;self.TLtween=tween||'linear';self.TLdur=time;self.TLfps=fps||30;}else{var caf=self.data[0].callafter||null,caa=self.data[0].argafter||null,cbf=self.data[0].callbefore||null,cba=self.data[0].argbefore||null;self.TLacall=caf;self.TLaarg=caa;self.TLbcall=cbf;self.TLbarg=cba;}transm._prepare(self);if(!trans||trans==''){if(self.back){if(typeof window[self.back]==='function'){try{window[self.back]();}catch(err){if(self.verbose){transm.log('error','transm: has failed '+err.message);}}}}}if(self.TLacall){if(typeof window[self.TLacall]==='function'){try{window[self.TLacall](self.TLaarg);}catch(err){if(self.verbose){transm.log('error','transm: has failed '+err.message);}}}}self.TLready=true;if(self.autoplay){transm.play(self);}}return false;},_prepare:function(self){if(self){var i=self.curI,link=transm.G(self.id+"_link");if(link){link.title=self.data[i].title||'';link.target=self.data[i].target||'_self';if(self.data[i].onclick){link.setAttribute("onclick",self.data[i].onclick||'');if(self.tri||self.vml){link.onclick=new Function(self.data[i].onclick||'');}link.style.cursor='pointer';}else{link.removeAttribute("onclick");link.style.cursor='auto';}if(self.data[i].href){link.setAttribute("href",self.data[i].href||null);link.style.cursor='pointer';}else{link.removeAttribute("href");}}}return false;},_setup:function(self){if(self){if(self.timer){window.clearInterval(self.timer);}for(var i=0;i<self.data.length;i++){if(!self.data[i].l){self.data.splice(i,1);i--;}}transm.G(self.id+"_cover").style.visibility='hidden';if(self.vml&&!self.nocache){var pre=transm.G(self.id+"_vml_preloader");if(pre){transm.R(pre);}}if(self.data.length>1){self.noi=self.data.length-1;var caf=self.data[0].callafter||null,caa=self.data[0].argafter||null,cbf=self.data[0].callbefore||null,cba=self.data[0].argbefore||null;self.TLacall=caf;self.TLaarg=caa;self.TLbcall=cbf;self.TLbarg=cba;if(self.clearbg){var par=self.parentNode;par.style.backgroundColor='transparent';par.style.backgroundImage='none';}if(self.w3c){transm._buffer(self,self.a,0);transm._display(self);}else{transm._display(self);}}else{if(self.verbose){transm.log('warn','transm: insufficient images [exit]');}transm.remove(self);}}return false;},_buffer:function(self,buffer,i){if(self&&self.w3c){if(buffer){var ctx=buffer.getContext("2d");ctx.clearRect(0,0,self.width,self.height);ctx.drawImage(self.data[i].img,self.data[i].ix,self.data[i].iy,self.data[i].mw,self.data[i].mh,0,0,self.width,self.height);}}return false;},_clear:function(self){if(self){var link=transm.G(self.id+"_link");if(link){link.title='';link.target='_self';link.onclick='';link.removeAttribute("onclick");link.removeAttribute("href");link.style.cursor='auto';}}return false;},_display:function(self){function clip(c,x,y,w,h,r1,r2,r3,r4){c.beginPath();if(r1>0){c.arc(x+r1,y+r1,r1,Math.PI,Math.PI*(3/2),false);}else{c.moveTo(x,y);}if(r2>0){c.arc(x+w-r2,y+r2,r2,Math.PI*(3/2),0,false);}else{c.lineTo(x+w,y);}if(r3>0){c.arc(x+w-r3,y+h-r3,r3,0,Math.PI*(1/2),false);}else{c.lineTo(x+w,y+h);}if(r4>0){c.arc(x+r4,y+h-r4,r4,Math.PI*(1/2),Math.PI,false);}else{c.lineTo(x,y+h);}c.closePath();};if(self){self.parentNode.style.cursor='auto';if(self.w3c){if(self.fadein){self.style.opacity=0;}self.ctx.clearRect(0,0,self.width,self.height);if(self.radius||self.radii){clip(self.ctx,0,0,self.width,self.height,self.radii[0]||self.radius||0,self.radii[1]||self.radius||0,self.radii[2]||self.radius||0,self.radii[3]||self.radius||0);self.ctx.clip();}self.ctx.save();self.ctx.drawImage(self.fromB=='a'?self.a:self.b,0,0,self.width,self.height);if(self.layer){self.ctx.drawImage(self.c,0,0,self.width,self.height);}self.ctx.restore();if(self.fadein){if(self.timer){window.clearInterval(self.timer);}var c=0,t=25,o=0,p=1/t;self.timer=window.setInterval(function(){o=p*c;self.style.opacity=o;c++;if(c>t){window.clearInterval(self.timer);self.style.opacity=1;transm._return(self,false);}},40);}else{transm._return(self,false);}}else if(self.vml){var fill=document.createElement(['<v:fill src="'+self.data[0].source+'" size="'+self.data[0].wm+'pt,'+self.data[0].hm+'pt" origin="'+self.data[0].ox+','+self.data[0].oy+'" position="0,0" aspect="ignore" type="frame"  />'].join(''));self.appendChild(fill);self.style.visibility='visible';if(self.layer){var tmp=transm.G(self.id+"_layer");if(tmp){fill=document.createElement(['<v:fill src="'+self.layer+'" type="frame" />'].join(''));tmp.appendChild(fill);tmp.style.visibility='visible';}}transm._return(self,false);}else{self.src=self.data[0].source;self.style.zIndex=2;self.style.width=self.data[0].ww+'px';self.style.height=self.data[0].hh+'px';self.style.left=Math.round(-self.data[0].ix)+'px';self.style.top=Math.round(-self.data[0].iy)+'px';if(self.fadein){self.style[self.opa]=0;self.style.filter="alpha(opacity=0)";if(self.timer){window.clearInterval(self.timer);}var c=0,t=25,o=0,p=1/t;self.timer=window.setInterval(function(){o=p*c;self.style[self.opa]=o;self.style.filter="alpha(opacity="+(o*100)+")";c++;if(c>t){window.clearInterval(self.timer);self.style[self.opa]=1;self.style.filter="alpha(opacity=100)";transm._return(self,false);}},40);}else{transm._return(self,false);}}}return false;},_wipe:function(self){if(self&&!self.TLbusy){if(self.parentNode.timer){window.clearInterval(self.parentNode.timer);}transm._clear(self);var alpha=null,a=self.fromB=='a'?1:0,i=self.curI,opt1=self.data[i].option1||null,opt2=self.data[i].option2||null,trans=self.data[i].transition||self.transition,dur=self.data[i].duration||self.duration,caf=self.data[i].callafter||null,caa=self.data[i].argafter||null,cbf=self.data[i].callbefore||null,cba=self.data[i].argbefore||null;self.TLacall=caf;self.TLaarg=caa;self.TLbcall=cbf;self.TLbarg=cba;if(self.TLbcall){if(typeof window[self.TLbcall]==='function'){try{window[self.TLbcall](self.TLbarg);}catch(err){if(self.verbose){transm.log('error','transm: has failed '+err.message);}}}}if(self.w3c){function callTrans(){cvi_trans.play('transm_return',self,a?self.a:self.b,a?self.b:self.a,alpha,self.layer?self.c:null,opt1,opt2,trans,tween,cpa,dur,fps);};self.fromB=a?'b':'a';transm._buffer(self,a?self.b:self.a,i);var mask=self.data[i].alphaimg||null,tween=self.data[i].tweening||self.tweening,cpa=self.data[i].cparray||self.cparray,fps=self.data[i].fps||self.fps;if(mask){var suf=mask.substring(1+mask.lastIndexOf(".")).toLowerCase(),todo=(suf=='jpg'||suf=='jpeg'?1:0);if(todo&&!self.csp){callTrans();}else{var img=new Image();img.onerror=function(){self.data[i].alphaimg=null;callTrans();};img.onload=function(){if(img.width&&img.height&&img.width>=8&&img.height>=8){if(todo&&self.csp){var ctx,i,n,s,t,w,h;alpha=transm.C('canvas');alpha.width=w=img.width;alpha.height=h=img.height;ctx=alpha.getContext("2d");ctx.clearRect(0,0,w,h);ctx.drawImage(img,0,0,w,h);try{s=ctx.getImageData(0,0,w,h);}catch(err){var excep=true;}if(excep){if(self.verbose){transm.log('error',err.message+". Explanations:\nhttp://en.wikipedia.org/wiki/Same_origin_policy\nhttp://www.w3.org/TR/XMLHttpRequest/#exceptions");}self.data[i].alphaimg=null;}else{for(i=0,n=s.data.length;i<n;i+=4){t=Math.round(s.data[i]*0.299+s.data[i+1]*0.587+s.data[i+2]*0.114);s.data[i]=s.data[i+1]=s.data[i+2]=0;s.data[i+3]=255-t;}ctx.clearRect(0,0,w,h);ctx.putImageData(s,0,0);}callTrans();}else{alpha=img;callTrans();}}else{self.data[i].alphaimg=null;callTrans();}};img.src=mask;}}else{callTrans();}}else if(self.vml){self.fromB=a?'b':'a';cvi_trans.play('transm_return',self,null,self.data[i],null,null,opt1,opt2,trans,null,null,dur,30);}else{self.fromB=a?'b':'a';self.TLbusy=true;var buffer=transm.G(self.id+"_buffer"),timer={d:null,t:null,start:function(){timer.d=new Date();timer.t=timer.d.getTime();},stop:function(){timer.d=new Date();return(timer.d.getTime()-timer.t);}},fps=self.data[i].fps||self.fps,ival=Math.round(1000/fps),steps=Math.round((dur*1000)/ival),c=0,o=0,p=1/steps;if(self.fromB=='b'){if(trans!='cut'){buffer.style[self.opa]=0;buffer.style.filter="alpha(opacity=0)";}buffer.style.width=self.data[i].ww+'px';buffer.style.height=self.data[i].hh+'px';buffer.style.left=self.data[i].xx+'px';buffer.style.top=self.data[i].yy+'px';buffer.src=self.data[i].source;buffer.style.zIndex=2;self.style.zIndex=1;if(trans!='cut'){if(self.timer){window.clearInterval(self.timer);}timer.start();self.timer=window.setInterval(function(){o=p*c;buffer.style[self.opa]=o;buffer.style.filter="alpha(opacity="+(o*100)+")";c++;if(c>steps){var t=timer.stop()-ival;window.clearInterval(self.timer);buffer.style[self.opa]=1;buffer.style.filter="alpha(opacity=100)";self.TLbusy=false;transm._return(self,'fade',t,fps*((dur*1000)/t));}},ival);}else{self.TLbusy=false;transm._return(self,'cut',0,fps);}}else{if(trans!='cut'){self.style[self.opa]=0;self.style.filter="alpha(opacity=0)";}self.style.width=self.data[i].ww+'px';self.style.height=self.data[i].hh+'px';self.style.left=self.data[i].xx+'px';self.style.top=self.data[i].yy+'px';self.src=self.data[i].source;self.style.zIndex=2;buffer.style.zIndex=1;if(trans!='cut'){if(self.timer){window.clearInterval(self.timer);}timer.start();self.timer=window.setInterval(function(){o=p*c;self.style[self.opa]=o;self.style.filter="alpha(opacity="+(o*100)+")";c++;if(c>steps){var t=timer.stop()-ival;window.clearInterval(self.timer);self.style[self.opa]=1;self.style.filter="alpha(opacity=100)";self.TLbusy=false;transm._return(self,'fade',t,fps*((dur*1000)/t));}},ival);}else{self.TLbusy=false;transm._return(self,'cut',0,fps);}}}}return false;}}
function transm_return(a,b,c,d){var self=transm.G(d);if(self){transm._return(self,a,b,c);}return false;}
var pics = new Array();
pics = [
{source:'http://www.semenagrad.ru/041207/08m.jpg', transition:'gradientwipe_right', target:'_blank', title:'фотоальбом редких растений из наших семян', href:"http://www.semenagrad.ru/041207/041207.htm"},
{source:'http://www.semenagrad.ru/041207/09m.jpg',transition:'gradientwipe_right',target:'_blank',title:'фотоальбом редких растений из наших семян',href:"http://www.semenagrad.ru/041207/041207.htm"},
{source:'http://www.semenagrad.ru/041207/19m.jpg',transition:'gradientwipe_right',target:'_blank',title:'фотоальбом редких растений из наших семян',href:"http://www.semenagrad.ru/041207/041207.htm"},
{source:'http://www.semenagrad.ru/041207/25m.jpg',transition:'gradientwipe_right',target:'_blank',title:'фотоальбом редких растений из наших семян',href:"http://www.semenagrad.ru/041207/041207.htm"},
{source:'http://www.semenagrad.ru/041207/35m.jpg',transition:'gradientwipe_right',target:'_blank',title:'фотоальбом редких растений из наших семян',href:"http://www.semenagrad.ru/041207/041207.htm"},
{source:'http://www.semenagrad.ru/041207/59m.jpg', transition:'gradientwipe_right', target:'_blank', title:'фотоальбом редких растений из наших семян', href:"http://www.semenagrad.ru/041207/041207.htm"},
{source:'http://www.semenagrad.ru/041207/72m.jpg',transition:'gradientwipe_right',target:'_blank',title:'фотоальбом редких растений из наших семян',href:"http://www.semenagrad.ru/041207/041207.htm"},
{source:'http://www.semenagrad.ru/041207/92m.jpg',transition:'gradientwipe_right',target:'_blank',title:'фотоальбом редких растений из наших семян',href:"http://www.semenagrad.ru/041207/041207.htm"},
{source:'http://www.semenagrad.ru/041207/98m.jpg',transition:'gradientwipe_right',target:'_blank',title:'фотоальбом редких растений из наших семян',href:"http://www.semenagrad.ru/041207/041207.htm"},
{source:'http://www.semenagrad.ru/041207/115m.jpg',transition:'gradientwipe_right',target:'_blank',title:'фотоальбом редких растений из наших семян',href:"http://www.semenagrad.ru/041207/041207.htm"},
{source:'http://www.semenagrad.ru/041207/201209/08m.jpg', transition:'gradientwipe_right', target:'_blank', title:'фотоальбом редких растений из наших семян', href:"http://www.semenagrad.ru/041207/041207.htm"},
{source:'http://www.semenagrad.ru/041207/201209-2/06m.jpg',transition:'gradientwipe_right',target:'_blank',title:'фотоальбом редких растений из наших семян',href:"http://www.semenagrad.ru/041207/041207.htm"},
{source:'http://www.semenagrad.ru/041207/201209-5/10m.jpg',transition:'gradientwipe_right',target:'_blank',title:'фотоальбом редких растений из наших семян',href:"http://www.semenagrad.ru/041207/041207.htm"}
];
var opts = new Object();
opts = {
width:160,
height:120,
timeout:3,
delay: 3,
mfgcolor: '#00a0ff',
mopacity: 0.5,
fadein:true,
autoplay:true,
name:'test',
data: pics
};
if(typeof $=='undefined') {function $(v) {return(document.getElementById(v));}}
window.onload = function () { 
transm.add($("wrapper"),opts);
};
document.writeln('<div  id="wrapper" style="cursor:hand"></div>');
