//>>built
define("dojox/fx/flip","dojo/_base/kernel dojo/_base/html dojo/dom dojo/dom-construct dojo/dom-geometry dojo/_base/connect dojo/_base/Color dojo/_base/sniff dojo/_base/lang dojo/_base/window dojo/_base/fx dojo/fx ./_base".split(" "),function(K,p,L,A,M,C,N,O,D,G,I,E,B){K.experimental("dojox.fx.flip");B.flip=function(c){var n=A.create("div"),d=c.node=L.byId(c.node),g=d.style,b=null,l=null,a=null,u=c.lightColor||"#dddddd",y=c.darkColor||"#555555",v=p.style(d,"backgroundColor"),w=c.endColor||v,q={},m=
[],h=c.duration?c.duration/2:250;a=c.dir||"left";var k=.9;l="transparent";var z=c.whichAnim,x=c.axis||"center";k=c.depth;var e=function(r){return"#000000"===(new N(r)).toHex()?"#000001":r};7>O("ie")&&(w=e(w),u=e(u),y=e(y),v=e(v),l="black",n.style.filter="chroma(color\x3d'#000000')");(function(r){return function(){var t=p.coords(r,!0);b={top:t.y,left:t.x,width:t.w,height:t.h}}})(d)();l={position:"absolute",top:b.top+"px",left:b.left+"px",height:"0",width:"0",zIndex:c.zIndex||g.zIndex||0,border:"0 solid "+
l,fontSize:"0",visibility:"hidden"};d=[{},{top:b.top,left:b.left}];a={left:"Left Right Top Bottom Width Height endHeightMin Left endHeightMax".split(" "),right:"Right Left Top Bottom Width Height endHeightMin Left endHeightMax".split(" "),top:"Top Bottom Left Right Height Width endWidthMin Top endWidthMax".split(" "),bottom:"Bottom Top Left Right Height Width endWidthMin Top endWidthMax".split(" ")}[a];"undefined"!=typeof k?(k=Math.max(0,Math.min(1,k))/2,k=.4+(.5-k)):k=Math.min(.9,Math.max(.4,b[a[5].toLowerCase()]/
b[a[4].toLowerCase()]));e=d[0];for(var f=4;6>f;f++)"center"==x||"cube"==x?(b["end"+a[f]+"Min"]=b[a[f].toLowerCase()]*k,b["end"+a[f]+"Max"]=b[a[f].toLowerCase()]/k):"shortside"==x?(b["end"+a[f]+"Min"]=b[a[f].toLowerCase()],b["end"+a[f]+"Max"]=b[a[f].toLowerCase()]/k):"longside"==x&&(b["end"+a[f]+"Min"]=b[a[f].toLowerCase()]*k,b["end"+a[f]+"Max"]=b[a[f].toLowerCase()]);"center"==x?e[a[2].toLowerCase()]=b[a[2].toLowerCase()]-(b[a[8]]-b[a[6]])/4:"shortside"==x&&(e[a[2].toLowerCase()]=b[a[2].toLowerCase()]-
(b[a[8]]-b[a[6]])/2);q[a[5].toLowerCase()]=b[a[5].toLowerCase()]+"px";q[a[4].toLowerCase()]="0";q["border"+a[1]+"Width"]=b[a[4].toLowerCase()]+"px";q["border"+a[1]+"Color"]=v;e["border"+a[1]+"Width"]=0;e["border"+a[1]+"Color"]=y;e["border"+a[2]+"Width"]=e["border"+a[3]+"Width"]="cube"!=x?(b["end"+a[5]+"Max"]-b["end"+a[5]+"Min"])/2:b[a[6]]/2;e[a[7].toLowerCase()]=b[a[7].toLowerCase()]+b[a[4].toLowerCase()]/2+(c.shift||0);e[a[5].toLowerCase()]=b[a[6]];c=d[1];c["border"+a[0]+"Color"]={start:u,end:w};
c["border"+a[0]+"Width"]=b[a[4].toLowerCase()];c["border"+a[2]+"Width"]=0;c["border"+a[3]+"Width"]=0;c[a[5].toLowerCase()]={start:b[a[6]],end:b[a[5].toLowerCase()]};D.mixin(l,q);p.style(n,l);G.body().appendChild(n);u=function(){A.destroy(n);g.backgroundColor=w;g.visibility="visible"};if("last"==z){for(f in e)e[f]={start:e[f]};e["border"+a[1]+"Color"]={start:y,end:w};c=e}z&&"first"!=z||m.push(I.animateProperty({node:n,duration:h,properties:e}));z&&"last"!=z||m.push(I.animateProperty({node:n,duration:h,
properties:c,onEnd:u}));C.connect(m[0],"play",function(){n.style.visibility="visible";g.visibility="hidden"});return E.chain(m)};B.flipCube=function(c){var n=[],d=M.getMarginBox(c.node),g=d.w/2;d=d.h/2;g={top:{pName:"height",args:[{whichAnim:"first",dir:"top",shift:-d},{whichAnim:"last",dir:"bottom",shift:d}]},right:{pName:"width",args:[{whichAnim:"first",dir:"right",shift:g},{whichAnim:"last",dir:"left",shift:-g}]},bottom:{pName:"height",args:[{whichAnim:"first",dir:"bottom",shift:d},{whichAnim:"last",
dir:"top",shift:-d}]},left:{pName:"width",args:[{whichAnim:"first",dir:"left",shift:-g},{whichAnim:"last",dir:"right",shift:g}]}}[c.dir||"left"].args;c.duration=c.duration?2*c.duration:500;c.depth=.8;c.axis="cube";for(d=g.length-1;0<=d;d--)D.mixin(c,g[d]),n.push(B.flip(c));return E.combine(n)};B.flipPage=function(c){var n=c.node,d=p.coords(n,!0),g=d.x,b=d.y,l=d.w,a=d.h,u=p.style(n,"backgroundColor"),y=c.lightColor||"#dddddd",v=c.darkColor,w=A.create("div"),q=[],m=[],h=c.dir||"right",k={left:["left",
"right","x","w"],top:["top","bottom","y","h"],right:["left","left","x","w"],bottom:["top","top","y","h"]},z={right:[1,-1],left:[-1,1],top:[-1,1],bottom:[1,-1]};p.style(w,{position:"absolute",width:l+"px",height:a+"px",top:b+"px",left:g+"px",visibility:"hidden"});g=[];for(b=0;2>b;b++){a=(l=b%2)?k[h][1]:h;var x=l?"last":"first",e=l?u:y,f=l?e:c.startColor||n.style.backgroundColor;m[b]=D.clone(w);var r=function(t){return function(){A.destroy(m[t])}}(b);G.body().appendChild(m[b]);g[b]={backgroundColor:l?
f:u};g[b][k[h][0]]=d[k[h][2]]+z[h][0]*b*d[k[h][3]]+"px";p.style(m[b],g[b]);q.push(dojox.fx.flip({node:m[b],dir:a,axis:"shortside",depth:c.depth,duration:c.duration/2,shift:z[h][b]*d[k[h][3]]/2,darkColor:v,lightColor:y,whichAnim:x,endColor:e}));C.connect(q[b],"onEnd",r)}return E.chain(q)};B.flipGrid=function(c){var n=c.rows||4,d=c.cols||4,g=[],b=A.create("div"),l=c.node,a=p.coords(l,!0),u=a.x,y=a.y,v=a.w,w=a.h,q=a.w/d,m=a.h/n;a=[];p.style(b,{position:"absolute",width:q+"px",height:m+"px",backgroundColor:p.style(l,
"backgroundColor")});for(var h=0;h<n;h++){var k=h%2,z=k?"right":"left",x=k?1:-1,e=D.clone(l);p.style(e,{position:"absolute",width:v+"px",height:w+"px",top:y+"px",left:u+"px",clip:"rect("+h*m+"px,"+v+"px,"+w+"px,0)"});G.body().appendChild(e);g[h]=[];for(var f=0;f<d;f++){var r=D.clone(b),t=k?f:d-(f+1),P=function(H,F,J){return function(){F%2?p.style(H,{clip:"rect("+F*m+"px,"+v+"px,"+(F+1)*m+"px,"+(J+1)*q+"px)"}):p.style(H,{clip:"rect("+F*m+"px,"+(v-(J+1)*q)+"px,"+(F+1)*m+"px,0px)"})}}(e,h,f);G.body().appendChild(r);
p.style(r,{left:u+t*q+"px",top:y+h*m+"px",visibility:"hidden"});t=dojox.fx.flipPage({node:r,dir:z,duration:c.duration||900,shift:x*q/2,depth:.2,darkColor:c.darkColor,lightColor:c.lightColor,startColor:c.startColor||c.node.style.backgroundColor});r=function(H){return function(){A.destroy(H)}}(r);C.connect(t,"play",this,P);C.connect(t,"play",this,r);g[h].push(t)}a.push(E.chain(g[h]))}C.connect(a[0],"play",function(){p.style(l,{visibility:"hidden"})});return E.combine(a)};return B});