dojo.declare("MagicLogo",null,{interval:150,hueStep:0.5,targetDiv:null,color:null,start:function(_1){
this.targetDiv=dojo.byId(_1);
var _2=this.targetDiv.style.backgroundColor;
if(_2.substr(0,3)=="rgb"){
this.color=this._RGB2HSV(this._RGBString2RGB(_2));
}else{
_2=_2.replace(/\#/,"");
this.color=this._RGB2HSV(this._HEX2RGB(_2));
}
this.timeout=setTimeout(dojo.hitch(this,this.colorStep),this.interval);
},colorStep:function(){
this.color.H+=this.hueStep;
if(this.color.H>360){
this.color.H-=360;
}
this.targetDiv.style.backgroundColor="#"+this._RGB2HEX(this._HSV2RGB(this.color));
this.timeout=setTimeout(dojo.hitch(this,this.colorStep),this.interval);
},_d2h:function(_3){
_3=Math.max(0,Math.min(255,_3));
if(_3>16){
return _3.toString(16);
}
return "0"+_3.toString(16);
},_h2d:function(_4){
return Math.max(0,Math.min(255,parseInt(_4,16)));
},_RGBString2RGB:function(_5){
var _6=_5.length;
var _7=_5.substring(4,_6-1).split(",");
return {"R":_7[0],"G":_7[1],"B":_7[2],"A":1};
},_HEX2RGB:function(_8){
return ({"R":this._h2d(_8.substr(0,2)),"G":this._h2d(_8.substr(2,2)),"B":this._h2d(_8.substr(4,2)),"A":1});
},_RGB2HEX:function(_9){
return (this._d2h(_9.R)+this._d2h(_9.G)+this._d2h(_9.B));
},_RGB2HSV:function(_a){
var M=Math.max(_a.R,_a.G,_a.B);
var _b=M-Math.min(_a.R,_a.G,_a.B);
var H,S,V;
if(M!=0){
S=Math.round(_b/M*100);
if(_a.R==M){
H=0+(_a.G-_a.B)/_b;
}else{
if(_a.G==M){
H=2+(_a.B-_a.R)/_b;
}else{
if(_a.B==M){
H=4+(_a.R-_a.G)/_b;
}
}
}
var H=Math.min(Math.round(H*60),360);
if(H<0){
H+=360;
}
}
return ({"H":H?H:0,"S":S?S:0,"V":Math.round((M/255)*100)});
},_HSV2RGB:function(_c){
var R,G,A,B,C;
var H=_c.H/360;
var S=_c.S/100;
var V=_c.V/100;
var F;
if(S>0){
if(H>=1){
H=0;
}
H=6*H;
var F=H-Math.floor(H);
A=Math.round(255*V*(1-S));
B=Math.round(255*V*(1-(S*F)));
C=Math.round(255*V*(1-(S*(1-F))));
V=Math.round(255*V);
switch(Math.floor(H)){
case 0:
R=V;
G=C;
B=A;
break;
case 1:
R=B;
G=V;
B=A;
break;
case 2:
R=A;
G=V;
B=C;
break;
case 3:
R=A;
G=B;
B=V;
break;
case 4:
R=C;
G=A;
B=V;
break;
case 5:
R=V;
G=A;
B=B;
break;
}
return ({"R":R?R:0,"G":G?G:0,"B":B?B:0,"A":1});
}else{
return ({"R":(V=Math.round(V*255)),"G":V,"B":V,"A":1});
}
}});
var magicLogo=new MagicLogo();

