jade.Log=function(){};jade.Log.FACILITY_ALERT=0;jade.Log.FACILITY_FIREBUG=1;jade.Log.FACILITY_LOG4JS=2;
jade.Log.DEBUG=0;jade.Log.INFO=1;jade.Log.WARN=2;jade.Log.ERROR=3;jade.Log.level=null;
jade.Log.facility=null;jade.Log.logger=null;jade.Log.print=function(M,R){var K,J,Q,L,P,O,N;
if(!R.length){return }switch(this.facility){case this.FACILITY_ALERT:if(M!=this.ERROR){return 
}N="";P=R[0];O=0;if(typeof (P)=="string"){O++;L=0;J=0;Q=P.length;while(J<Q){if(P[J]=="%"&&"fidos".indexOf(P[J+1])>=0){N+=P.substring(L,J);
N+=R[O++];J++;L=J+1}J++}N+=P.substring(L,Q)}for(J=O;J<R.length;J++){if(N){N+=" "}N+=R[J]
}alert(N);break;case this.FACILITY_LOG4JS:K=[];O=0;P=R[0];if(typeof (P)=="string"){O++;
L=0;J=0;Q=P.length;while(J<Q){if(P[J]=="%"&&"fidos".indexOf(P[J+1])>=0){K.push(P.substring(L,J-1));
K.push(R[O++]);J++;L=J+1}J++}K.push(P.substring(L,Q))}for(J=O;J<R.length;J++){K.push(R[J])
}if(M==this.DEBUG){this.logger.debug.apply(this.logger,K)}else{if(M==this.INFO){this.logger.info.apply(this.logger,K)
}else{if(M==this.WARN){this.logger.warn.apply(this.logger,K)}else{this.logger.error.apply(this.logger,K)
}}}break}};jade.Log.debug=function(B){this.print(this.DEBUG,arguments)};jade.Log.info=function(B){this.print(this.INFO,arguments)
};jade.Log.warn=function(B){this.print(this.WARN,arguments)};jade.Log.error=function(B){this.print(this.ERROR,arguments)
};jade.Log.init=function(){if(("console" in window)&&("firebug" in window.console)){this.facility=this.FACILITY_FIREBUG;
this.error=console.error}else{if("log4javascript" in window){this.facility=this.FACILITY_LOG4JS;
this.logger=log4javascript.getDefaultLogger()}else{this.facility=this.FACILITY_ALERT
}}this.setLevel(jade.Log.ERROR)};jade.Log.setLevel=function(B){if(this.level!=B){this.level=B;
switch(this.facility){case this.FACILITY_FIREBUG:this.debug=this.isDebugLevel()?console.debug:this.noOp;
this.info=this.isInfoLevel()?console.info:this.noOp;this.warn=this.isWarnLevel()?console.warn:this.noOp;
break;case this.FACILITY_LOG4JS:if(this.isDebugLevel()){this.logger.setLevel(log4javascript.Level.DEBUG)
}else{if(this.isInfoLevel()){this.logger.setLevel(log4javascript.Level.INFO)}else{if(this.isWarnLevel()){this.logger.setLevel(log4javascript.Level.WARN)
}else{this.logger.setLevel(log4javascript.Level.ERROR)}}}}}};jade.Log.noOp=function(){};
jade.Log.getLevel=function(){return this.level};jade.Log.isDebugLevel=function(){return this.level==jade.Log.DEBUG
};jade.Log.isInfoLevel=function(){return this.level<=jade.Log.INFO};jade.Log.isWarnLevel=function(){return this.level<=jade.Log.WARN
};jade.Log.init();