//>>built
define("dojox/html/ext-dojo/style",["dojo/_base/kernel","dojo/dom-style","dojo/_base/lang","dojo/_base/html","dojo/_base/sniff","dojo/_base/window","dojo/dom","dojo/dom-construct","dojo/dom-style","dojo/dom-attr"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a){
_1.experimental("dojox.html.ext-dojo.style");
var st=_3.getObject("dojox.html.ext-dojo.style",true);
var _b=_3.getObject("dojox.html");
_3.mixin(_b["ext-dojo"].style,{supportsTransform:true,_toPx:function(_c){
var ds=_4.style,_d=this._conversion;
if(typeof _c==="number"){
return _c+"px";
}else{
if(_c.toLowerCase().indexOf("px")!=-1){
return _c;
}
}
!_d.parentNode&&_8.place(_d,_6.body());
ds(_d,"margin",_c);
return ds(_d,"margin");
},init:function(){
var _e=_6.doc.documentElement.style,_f=_b["ext-dojo"].style,_10=_9.get,_11=_9.set;
_9.get=function(_12,_13){
var tr=(_13=="transform"),to=(_13=="transformOrigin");
if(tr){
return _f.getTransform(_12);
}else{
if(to){
return _f.getTransformOrigin(_12);
}else{
return arguments.length==2?_10(_12,_13):_10(_12);
}
}
};
_9.set=function(_14,_15,_16){
var tr=(_15=="transform"),to=(_15=="transformOrigin"),n=_7.byId(_14);
if(tr){
return _f.setTransform(n,_16,true);
}else{
if(to){
return _f.setTransformOrigin(n,_16);
}else{
return arguments.length==3?_11(n,_15,_16):_11(n,_15);
}
}
};
for(var i=0,_17=["WebkitT","MozT","OT","msT","t"];i<_17.length;i++){
if(typeof _e[_17[i]+"ransform"]!=="undefined"){
this.tPropertyName=_17[i]+"ransform";
}
if(typeof _e[_17[i]+"ransformOrigin"]!=="undefined"){
this.toPropertyName=_17[i]+"ransformOrigin";
}
}
if(this.tPropertyName){
this.setTransform=function(_18,_19){
return _9.set(_18,this.tPropertyName,_19);
};
this.getTransform=function(_1a){
return _9.get(_1a,this.tPropertyName);
};
}else{
if(_5("ie")){
this.setTransform=this._setTransformFilter;
this.getTransform=this._getTransformFilter;
}
}
if(this.toPropertyName){
this.setTransformOrigin=function(_1b,_1c){
return _11(_1b,this.toPropertyName,_1c);
};
this.getTransformOrigin=function(_1d){
return _10(_1d,this.toPropertyName);
};
}else{
if(_5("ie")){
this.setTransformOrigin=this._setTransformOriginFilter;
this.getTransformOrigin=this._getTransformOriginFilter;
}else{
this.supportsTransform=false;
}
}
this._conversion=_8.create("div",{style:{position:"absolute",top:"-100px",left:"-100px",fontSize:0,width:"0",backgroundPosition:"50% 50%"}});
},_notSupported:function(){
console.warn("Sorry, this browser doesn't support transform and transform-origin");
},_setTransformOriginFilter:function(_1e,_1f){
var to=_3.trim(_1f).replace(" top"," 0").replace("left ","0 ").replace(" center","50%").replace("center ","50% ").replace(" bottom"," 100%").replace("right ","100% ").replace(/\s+/," "),_20=to.split(" "),n=_7.byId(_1e),t=this.getTransform(n),_21=true;
for(var i=0;i<_20.length;i++){
_21=_21&&/^0|(\d+(%|px|pt|in|pc|mm|cm))$/.test(_20[i]);
if(_20[i].indexOf("%")==-1){
_20[i]=this._toPx(_20[i]);
}
}
if(!_21||!_20.length||_20.length>2){
return _1f;
}
_4.attr(n,"dojo-transform-origin",_20.join(" "));
t&&this.setTransform(_1e,t);
return _1f;
},_getTransformOriginFilter:function(_22){
return _4.attr(_22,"dojo-transform-origin")||"50% 50%";
},_setTransformFilter:function(_23,_24){
var t=_24.replace(/\s/g,""),n=_7.byId(_23),_25=t.split(")"),_26=1,_27=1,_28="DXImageTransform.Microsoft.Matrix",_29=_a.has,_2a=_4.attr,PI=Math.PI,cos=Math.cos,sin=Math.sin,tan=Math.tan,max=Math.max,min=Math.min,abs=Math.abs,_2b=PI/180,_2c=PI/200,ct="",_2d="",_2e=[],x0=0,y0=0,dx=0,dy=0,xc=0,yc=0,a=0,m11=1,m12=0,m21=0,m22=1,tx=0,ty=0,_2f=[m11,m12,m21,m22,tx,ty],_30=false,ds=_4.style,_31=ds(n,"position")=="absolute"?"absolute":"relative",w=ds(n,"width")+ds(n,"paddingLeft")+ds(n,"paddingRight"),h=ds(n,"height")+ds(n,"paddingTop")+ds(n,"paddingBottom"),_32=this._toPx;
!_29(n,"dojo-transform-origin")&&this.setTransformOrigin(n,"50% 50%");
for(var i=0,l=_25.length;i_38?0:(_38-_37)/2);
}
}else{
if(_5("ie")==8){
ds(n,"zIndex")=="auto"&&(n.style.zIndex="0");
}
}
try{
_30=!!n.filters.item(_28);
}
catch(e){
_30=false;
}
if(_30){
n.filters.item(_28).M11=m11;
n.filters.item(_28).M12=m12;
n.filters.item(_28).M21=m21;
n.filters.item(_28).M22=m22;
n.filters.item(_28).filterType="bilinear";
n.filters.item(_28).Dx=0;
n.filters.item(_28).Dy=0;
n.filters.item(_28).sizingMethod="auto expand";
}else{
n.style.filter+=" progid:"+_28+"(M11="+m11+",M12="+m12+",M21="+m21+",M22="+m22+",FilterType='bilinear',Dx=0,Dy=0,sizingMethod='auto expand')";
}
tx=parseInt(_2a(n,"dojo-transform-matrix-tx")||"0");
ty=parseInt(_2a(n,"dojo-transform-matrix-ty")||"0");
var _39=_2a(n,"dojo-transform-origin").split(" ");
for(i=0;i<2;i++){
_39[i]=_39[i]||"50%";
}
xc=(_39[0].toString().indexOf("%")!=-1)?w*parseInt(_39[0])*0.01:_39[0];
yc=(_39[1].toString().indexOf("%")!=-1)?h*parseInt(_39[1])*0.01:_39[1];
if(_29(n,"dojo-startX")){
x0=parseInt(_2a(n,"dojo-startX"));
}else{
x0=parseInt(ds(n,"left"));
_2a(n,"dojo-startX",_31=="absolute"?x0:"0");
}
if(_29(n,"dojo-startY")){
y0=parseInt(_2a(n,"dojo-startY"));
}else{
y0=parseInt(ds(n,"top"));
_2a(n,"dojo-startY",_31=="absolute"?y0:"0");
}
ds(n,{position:_31,left:x0-parseInt(dx)+parseInt(xc)-((parseInt(xc)-tx)*m11+(parseInt(yc)-ty)*m12)+"px",top:y0-parseInt(dy)+parseInt(yc)-((parseInt(xc)-tx)*m21+(parseInt(yc)-ty)*m22)+"px"});
return _24;
},_getTransformFilter:function(_3a){
try{
var n=_7.byId(_3a),_3b=n.filters.item(0);
return "matrix("+_3b.M11+", "+_3b.M12+", "+_3b.M21+", "+_3b.M22+", "+(_4.attr(_3a,"dojo-transform-tx")||"0")+", "+(_4.attr(_3a,"dojo-transform-ty")||"0")+")";
}
catch(e){
return "matrix(1, 0, 0, 1, 0, 0)";
}
},setTransform:function(){
this._notSupported();
},setTransformOrigin:function(){
this._notSupported();
}});
_b["ext-dojo"].style.init();
return _4.style;
});