function stackTrace(){var counter=20;var f=stackTrace;var stack=[];while(f&&counter--){stack.push(f.name);f=f.caller;}
return stack;}
function ExCustom(sender){Error.apply(this);this.prototype=this.constructor.prototype;this.sender=sender;this.name="ExCustom";this.trace=stackTrace();}
ExCustom.prototype=new Error();ExCustom.prototype.constructor=ExCustom;ExCustom.prototype.toString=function(){return this.name+"["+this.trace.reverse().join(" -> ")+"]";}
function ExAssertFails(value,message,sender){this.prototype.constructor.apply(this,[sender]);this.value=value;this.message=message;this.name="ExAssertTrue";}
ExAssertFails.prototype=new ExCustom();ExAssertFails.prototype.toString=function(){return(this.message||this.prototype.toString.apply(this));}
var ExInvalidRule=function(object,sender){this.prototype.constructor.apply(this,[sender]);this.object=object;}
ExInvalidRule.prototype=new ExCustom();var ExElementNotExist=function(message,sender){this.prototype.constructor.apply(this,[sender]);this.message=message;}
ExElementNotExist.prototype=new ExCustom();ExElementNotExist.prototype.toString=function(){return(this.message||this.prototype.toString.apply(this));}
var ExFatal=function(message){alert("FATAL ERROR: "+message);}
ExFatal.prototype=new ExCustom();