var ProcessingStates=new Class({checkStates:{undetermined:0,processing:1,valid:2,invalid:3,exception:4},checkState:null,setStateClear:function(){
this.setStateUndetermined();
},isStateClear:function(){
return this.isStateUndetermined();
},setStateUndetermined:function(){
this.checkState=this.checkStates.undetermined;
},isStateUndetermined:function(){
return (this.checkState==this.checkStates.undetermined);
},setStateProcessing:function(){
this.checkState=this.checkStates.processing;
},isStateProcessing:function(){
return (this.checkState==this.checkStates.processing);
},setStateValid:function(){
this.checkState=this.checkStates.valid;
},isStateValid:function(){
return (this.checkState==this.checkStates.valid);
},setStateInvalid:function(){
this.checkState=this.checkStates.invalid;
},isStateInvalid:function(){
return (this.checkState==this.checkStates.invalid);
},setStateException:function(){
this.checkState=this.checkStates.exception;
},isStateException:function(){
return (this.checkState==this.checkStates.exception);
},isStateDone:function(){
return ((this.checkState==this.checkStates.valid)||(this.checkState==this.checkStates.invalid)||(this.checkState==this.checkStates.exception));
},isStateError:function(){
return ((this.checkState==this.checkStates.invalid)||(this.checkState==this.checkStates.exception));
}});
var NotificationIcon=new Class({options:{commonName:"",types:{valid:{name:"valid",defaultVisible:0},invalid:{name:"invalid",defaultVisible:0},undetermined:{name:"undetermined",defaultVisible:1},processing:{name:"processing",defaultVisible:0},hidden:{name:"hidden",defaultVisible:0}},tipDefaultOptions:{initialize:function(){
this.fx=new Fx.Style(this.toolTip,"opacity",{duration:500,transition:Fx.Transitions.Cubic.easeInOut,wait:false}).set(0);
},onShow:function(_1){
this.fx.start(1);
},onHide:function(_2){
this.fx.start(0);
},fixed:true},tipOptions:{}},initialize:function(_3){
this.setOptions(_3);
if(this.options.initialize){
this.options.initialize.call(this);
}
var _4=$merge(this.options.tipDefaultOptions,this.options.tipOptions);
var i=this.options.commonName;
$each(this.options.types,function(_6,_7){
var _8=document.getElementById(i+"_img-"+_6.name);
var _9=document.getElementById(i+"_img-"+_6.name+"-flash");
if(_8){
_8.fx=new Fx.Style(_8,"opacity",{duration:500,transition:Fx.Transitions.Cubic.easeInOut}).set(_6.defaultVisible);
_8.tip=new PerItemTips(_8,_4);
}
if(_9){
_9.fx=new Fx.Style(_9,"opacity",{duration:500,transition:Fx.Transitions.Cubic.easeInOut}).set(0);
}
}.bind(this));
},showProcessing:function(_a,_b){
return this.showNotificationIcon(this.options.types.processing.name,_a,_b);
},showValid:function(_c,_d){
return this.showNotificationIcon(this.options.types.valid.name,_c,_d);
},showInvalid:function(_e,_f){
return this.showNotificationIcon(this.options.types.invalid.name,_e,_f);
},showUndetermined:function(_10,_11){
return this.showNotificationIcon(this.options.types.undetermined.name,_10,_11);
},hide:function(){
return this.showNotificationIcon(this.options.types.hidden.name);
},showNotificationIcon:function(_12,_13,_14){
if(_14==null){
_14=5;
}
if(_13==null){
_13="";
}
$each(this.options.types,function(_15,key){
var _17=document.getElementById(this.options.commonName+"_img-"+_15.name);
var _18=document.getElementById(this.options.commonName+"_img-"+_15.name+"-flash");
if(_17){
if(_15.name==_12){
_17.alt=_13;
_17.fx.start(1);
if(_14==1){
_17.tip.showSticky(_17);
}else{
}
}else{
_17.alt="";
_17.fx.start(0);
_17.tip.hideSticky(_17);
}
if(_18){
if(_15.name==_12){
_18.fx.start(0).chain(function(){
this.start(0.75);
}).chain(function(){
this.start(0);
});
}else{
_18.fx.start(0);
}
}
}
}.bind(this));
}});
NotificationIcon.implement(new Events,new Options);
