var a,wizTypes=["text","password","textarea","select-one","radio","file"],wizards=[],wizardFields=["add","Class","dispose","function","getColumns","getElements","getRows","hideErrors","index","initialized","initializing","keys","name","onChange","post","refresh","replacements","tables","toString"];
TWizard=function(b,c){this.Class="TWizard";this.guid=c;this.index=wizards.length;this.initializing=true;this.keys=[];this.loaded=false;this.name=b;this.onChange=null;this.postPage="misc/postWizard.aspx";this.replacements=[];this.tables=[];wizards[this.index]=this;addEvent(window,"load","wizards["+this.index+"].load( event );");addEvent(window,"unload","wizards["+this.index+"].dispose();");setTimeout("wizards["+this.index+"].checkLoad();",5E3)};a=TWizard.prototype;
a.add=function(b){if(typeof this.tables[b]=="undefined"){var c=this.tables.length,d=new TTable(this,b,c);this.tables[c]=d;this.tables[b]=d;wizardFields.indexOf(b)==-1&&eval(this.name+"."+b+" = "+this.name+'.tables["'+b+'"];');return d}else throw new Error("This table already exists in the collection.");};a.checkLoad=function(){!this.loaded&&!this.load()&&setTimeout("wizards["+this.index+"].checkLoad();",100)};
a.dispose=function(){for(var b=0;b<this.tables.length;b++){this.tables[b].dispose();this.tables[b]=null}this.onChange=null;this.tables=[];wizards[this.index]=null};a.getColumns=function(b,c){b=b.documentElement.getElementsByTagName("declaration")[0].getElementsByTagName("table");for(var d=0;d<b.length;d++)if(b[d].getAttribute("name")==c)return b[d].getElementsByTagName("column");return null};a.getElements=function(){for(var b=0;b<this.tables.length;b++)for(var c=this.tables[b],d=0;d<c.rows.length;d++)c.rows[d].getElements()};
a.getRows=function(b,c){for(var d=[],e=0;e<b.documentElement.childNodes.length;e++){var f=b.documentElement.childNodes[e];f.nodeType==ntElement&&f.nodeName==c&&d.add(f)}return d};a.hideErrors=function(){for(var b=0;b<this.tables.length;b++)this.tables[b].hideErrors()};a.initialized=function(b){if(typeof b!="undefined")this.postPage=b;this.initializing=false};a.load=function(){if(!this.loaded&&document.body){this.loaded=true;this.getElements();return true}return false};
a.refresh=function(b){var c=[];this.initializing=true;try{for(var d=0;d<this.tables.length;d++){for(var e=this.tables[d],f=this.getRows(b,e.name),h=this.getColumns(b,e.name),g=0;g<f.length;g++){var j=f[g],l=null;if(j.parentNode.nodeName!="deleted"){l=g>=e.rows.length?e.addRow():e.rows[g];for(var m=0;m<h.length;m++){var n=h[m],i=l.fields[n.getAttribute("name")],o=j.getElementsByTagName(n.getAttribute("name"))[0],p=o!=null&&o.firstChild?fromXml(o.firstChild.data,i.type):null,q=parseInt(n.getAttribute("error"));
if(!isSame(p,i.FValue)){c.add({field:i,oldValue:i.FValue});i.value(p);i.updateElements(p);i.errorsShown&&i.checksOut()&&i.hideErrors()}if(q==g)i.error=true}}}for(;e.rows.length>f.length;)e.rows.length--;if(e.row>=e.rows.length)e.row=e.rows.length-1;e.bof=e.row<=0;e.eof=e.row==e.rows.length-1}}catch(k){Log.error(k);if(k.description)alert(k.description);else k.message?alert(k.message):alert(k)}finally{this.initializing=false;for(b=0;b<c.length;b++){i=c[b].field;d=c[b].oldValue;if(this.onChange){i.table.setRow();
this.onChange(this,i,d)}i.onchange!=null&&i.onchange(i,d)}}};a.post=function(b){if(this.initializing)return true;try{var c=new Url(this.postPage);c=c.add("guid",this.guid);b=c.request("post",b,true,false);if(typeof b!="boolean"){this.refresh(b);return true}}catch(d){Log.error(d)}return false};
a.toString=function(b,c,d){if(b==null)return"";switch(c){case dtInteger:case dtLong:return String(b);case dtDouble:return typeof d!="undefined"?b.formatString(d):b.formatString("0.########");case dtPercentage:return typeof d!="undefined"?b.formatString(d):b.formatString("0.########")+"%";case dtMoney:return typeof d!="undefined"?b.formatString(d):b.formatString("0.00");case dtDateTime:if(typeof d!="undefined"){if(d==null||d=="")d="g";else if(d.length>1){d=d.replace(/d/gi,"D");d=d.replace(/m/g,"N");
d=d.replace(/y/gi,"Y");d=d.replace(/h/gi,"H");d=d.replace(/s/gi,"S");d=d.replace(/\//gi,"-")}return b.formatString(d)}else return b.formatString("HHnnss")=="000000"?b.formatString("d"):b.formatString("g");case dtString:case dtGuid:return String(b);case dtBoolean:return b?trueText[Languages.current]:falseText[Languages.current]}};
var tableFields=["addColumn","addRow","bof","canSave","Class","columns","current","dispose","eof","first","function","getRow","gotoRow","hideErrors","index","initialize","last","name","next","prior","owner","removeRow","removeRowAt","row","Rows","rows","setRow","wizard"],formatable=[dtDouble,dtMoney,dtPercentage,dtDateTime];
TTable=function(b,c,d){this.bof=true;this.Class="TTable";this.columns=[];this.eof=true;this.index=d;this.name=c;this.owner=b;this.row=-1;this.rows=[];this.wizard=b;this.setRow=function(){var e=this.current();if(e==null)for(var f=0;f<this.columns.length;f++){e=this.columns[f];var h=this.wizard.name+"."+this.name;tableFields.indexOf(e.name)==-1&&eval(h+"."+e.name+" = null;")}else for(f=0;f<e.fields.length;f++){var g=e.fields[f];h=this.wizard.name+"."+this.name;var j=h+".rows["+e.index+"]";tableFields.indexOf(g.name)==
-1&&eval(h+"."+g.name+" = "+j+".fields["+f+"];")}}};a=TTable.prototype;a.addColumn=function(b,c){if(typeof this.columns[b]=="undefined"){var d=this.columns.length;c=new TColumn(this,b,c,d);this.columns[d]=c;return this.columns[b]=c}else throw new Error("This column already exists in the collection.");};
a.addRow=function(){if(this.bof&&this.eof)this.bof=false;this.eof=false;var b=this.row=this.rows.length,c=new TRow(this,this.row,arguments);this.rows[b]=c;c.addFields();c.getElements();this.setRow();return c};a.canSave=function(){if(this.rows.length==0)return false;for(var b=0;b<this.rows.length;b++)if(this.rows[b].canSave().length>0)return false;return true};a.current=function(){return this.row>-1?this.rows[this.row]:null};
a.dispose=function(){for(var b=0;b<this.rows.length;b++){this.rows[b].dispose();this.rows[b]=null}for(b=0;b<this.columns.length;b++){this.columns[b].dispose();this.columns[b]=null}this.columns=[];this.owner=null;this.rows=[];this.wizard=null};a.find=function(b,c){return this.getRow(b,c)};a.first=function(){if(this.rows.length>0){this.bof=true;this.eof=false;this.row=0;this.setRow();return this.current()}return null};
a.getRow=function(b,c){for(var d=0;d<this.rows.length;d++)if(this.rows[d].fields[b].FValue==c)return this.rows[d];return null};
a.gotoRow=function(b,c){if(typeof c=="undefined"&&typeof b=="number")if(b>=0&&b<this.rows.length){this.row=b;this.bof=b<=0;this.eof=b==this.rows.length-1;this.setRow();return true}else throw new Error("Illegal call to TTable.gotoRow( index ). The index was out of range.");for(var d=0;d<this.rows.length;d++)if(this.rows[d].fields[b].FValue==c){this.bof=d<=0;this.eof=d==this.rows.length-1;this.row=d;this.setRow();return true}return false};a.hideErrors=function(){for(var b=0;b<this.rows.length;b++)this.rows[b].hideErrors()};
a.initialize=function(){for(var b=0;b<this.rows.length;b++)this.rows[b].initialize()};a.last=function(){if(this.rows.length>0){this.bof=false;this.eof=true;this.row=this.rows.length-1;this.setRow();return this.current()}return null};a.next=function(){if(this.rows.length>0){if(this.row==this.rows.length-1){this.bof=false;this.eof=true}else this.row++;this.setRow();return this.current()}return null};
a.prior=function(){if(this.rows.length>0){if(this.row==0){this.bof=true;this.eof=false}else this.row--;this.setRow();return this.current()}return null};a.removeRow=function(b){for(var c=b.index;c<this.rows.length-1;c++){this.rows[c]=this.rows[c+1];this.rows[c].index=c;this.rows[c].updateElements()}b.clear();this.rows.length--;if(this.row>=this.rows.length)this.row=this.rows.length-1;this.bof=this.row<=0;this.eof=this.row==this.rows.length-1;this.wizard.post(b.xml("delete"));this.setRow()};
a.removeRowAt=function(b){if(b>=0&&b<this.rows.length)this.removeRow(this.rows[b]);else throw new Error('Illegal call to method "removeRowAt". Index out of range ("'+b+'").');};a.Rows=function(b){if(typeof b=="undefined")b=0;if(b<0)throw new Error('Illegal call to method "Rows( index )". Index out of range ("'+b+'").');for(;b>=this.rows.length;)this.addRow();return this.rows[b]};
TColumn=function(b,c,d,e){this.checks=[];this.Class="TColumn";this.elements=[];this.index=e;this.name=c;this.table=this.owner=b;this.type=d;this.wizard=b.wizard;b.initialize()};TColumn.prototype.change=function(b,c){if(this.owner.current()!=null)return this.owner.current().fields[this.index].change(b,c);else return c.returnValue=false};
TColumn.prototype.dispose=function(){for(var b=0;b<this.checks.length;b++){this.checks[b].dispose();this.checks[b]=null}for(b=0;b<this.elements.length;b++)this.elements[b]=null;this.checks=[];this.elements=[];this.wizard=this.table=this.owner=null};TColumn.prototype.value=function(b){if(this.owner.current()!=null)if(typeof b=="undefined")return this.owner.current().fields[this.index].FValue;else this.owner.current().fields[this.index].value(b)};
TCheck=function(b,c,d){this.eval=null;this.message=c;this.owner=b;this.regex=null;this.wizard=b.wizard;if(typeof d=="string")this.eval=d;else if(typeof d!="undefined"&&d!=null)this.regex=d};TCheck.prototype.dispose=function(){this.wizard=this.owner=this.regex=null};
TCheck.prototype.test=function(b){if(this.eval){var c=this.eval;c=c.replace(/\bthis\b/gi,this.toJs(b));c=c.replace(/\bthis$/gi,this.toJs(b));c=c.replace(/^this\b/gi,this.toJs(b));c=c.replace(/^this$/gi,this.toJs(b));return eval(c)==true}else if(this.regex){c=undefined;var d="null";if(b.type==dtDateTime)c="DD-MM-YYYY HH:NN:SS";else if(b.type==dtDouble||b.type==dtMoney||b.type==dtPercentage)c="0.0";if(b.value!=null)d=this.wizard.toString(b.value(),b.type,c);return(new RegExp(this.regex.source,this.regex.ignoreCase?
"ig":"g")).test(d)}else return b.value()!=null};TCheck.prototype.toJs=function(b){var c=b.value();if(c==null)return"null";switch(b.type){case dtInteger:case dtLong:return String(c);case dtDouble:case dtPercentage:case dtMoney:return c.formatString("0.");case dtDateTime:return c.jsDate();case dtString:case dtGuid:return String(c).toJs();case dtBoolean:return c?"true":"false";default:return""}};
var rowFields=["addFields","Class","dispose","fields","function","getElements","hideErrors","index","initialize","owner","table","wizard","xml"];
TRow=function(b,c,d){this.Class="TRow";this.fields=[];this.index=c;this.table=this.owner=b;this.wizard=b.wizard;this.initialize();if(typeof d!="undefined"){for(b=0;b<this.owner.columns.length;b++)if(b<d.length)this.fields[b].FValue=convert(d[b],this.owner.columns[b].type);if(!this.wizard.initializing){this.wizard.post(this.xml());try{this.wizard.onChange&&this.wizard.onChange(this.wizard,null,null)}catch(e){Log.error(e);if(e.description)alert(e.description);else e.message?alert(e.message):alert(e)}}}};
a=TRow.prototype;a.addFields=function(){for(var b=0;b<this.fields.length;b++){var c=this.fields[b],d=this.wizard.name+"."+this.table.name+".rows["+this.index+"]";rowFields.indexOf(c.name)==-1&&eval(d+"."+c.name+" = "+d+".fields["+b+"];")}};a.canSave=function(){this.hideErrors();this.setCurrent();this.wizard.post(this.xml("canSave"));for(var b=[],c=0;c<this.fields.length;c++){var d=this.fields[c];if(d.checksOut()){if(d.error&&!b.contains(d)){b.add(d);d.error=false}}else b.add(d)}return b};
a.clear=function(){for(var b=0;b<this.fields.length;b++){var c=this.fields[b];c.FValue=null;c.updateElements(null)}};a.dispose=function(){for(var b=0;b<this.fields.length;b++){this.fields[b].dispose();this.fields[b]=null}this.fields=[];this.wizard=this.table=this.owner=null};
a.getElements=function(){for(var b=0;b<this.fields.length;b++){var c=false,d=this.fields[b],e=this.wizard.name+"_"+this.table.name+"_"+d.name+"_"+this.index,f=document.getElementsByName(e),h=Html.get("btn"+e.upperFirst());e="lbl"+e.upperFirst();for(var g=0;g<d.elements.length;g++)d.elements[g]=null;d.elements=[];for(g=0;g<f.length;g++){var j=f[g],l=typeof j.type!="undefined"?j.type:null;if(j.disabled)c=true;d.elements.add(j);j.field=d;if(l=="text"&&formatable.contains(d.type))if(j.title!=""&&typeof j.format==
"undefined"){j.format=j.title;j.title=""}}if(c)d.disabled=true;c=document.getElementsByTagName("SPAN");for(g=0;g<c.length;g++){f=c[g];if(f.id==e){d.elements.add(f);f.field=d;if(typeof f.toHtml=="undefined"){f.toHtml=f.lang=="1";f.removeAttribute("lang")}if(f.title!=""&&typeof f.format=="undefined"){f.format=f.title;f.title=""}}}if(h!=null){d.elements.add(h);h.field=d}}};a.hideErrors=function(){for(var b=0;b<this.fields.length;b++)this.fields[b].hideErrors()};
a.initialize=function(){for(var b=this.fields.length;b<this.owner.columns.length;b++){var c=new TField(this,this.owner.columns[b]);this.fields[c.index]=c;this.fields[c.name]=c}};
a.updateElements=function(){for(var b=0;b<this.fields.length;b++)for(var c=this.fields[b],d=0;d<c.elements.length;d++){var e=c.elements[d];if(e.id.startsWith("lbl"))e.id="lbl"+this.wizard.name.upperFirst()+"_"+this.table.name+"_"+c.name+"_"+this.index;else if(e.id.startsWith("btn"))e.id="btn"+this.wizard.name.upperFirst()+"_"+this.table.name+"_"+c.name+"_"+this.index;else{e.name=this.wizard.name+"_"+this.table.name+"_"+c.name+"_"+this.index;e.id=e.id.split(/_/gi).length>4?"edt"+this.wizard.name.upperFirst()+
"_"+this.table.name+"_"+c.name+"_"+this.index+"_"+e.value:"edt"+this.wizard.name.upperFirst()+"_"+this.table.name+"_"+c.name+"_"+this.index}if(e.onblur)e.onblur=new Function(this.wizard.name+"."+this.table.name+".Rows("+this.index+').fields["'+c.name+'"].blur( this, event );');if(e.onchange)e.onchange=new Function(this.wizard.name+"."+this.table.name+".Rows("+this.index+').fields["'+c.name+'"].change( this, event );');if(e.onfocus)e.onfocus=new Function(this.wizard.name+"."+this.table.name+".Rows("+
this.index+').fields["'+c.name+'"].focus( this, event );')}};a.setCurrent=function(){return this.table.gotoRow(this.index)};
a.xml=function(b){b="<"+this.wizard.name+(typeof b!="undefined"?' action="'+b+'"':"")+">\r\n\t<"+this.table.name+' index="'+this.index+'">';for(var c=0;c<this.fields.length;c++)if(this.fields[c].FValue!=null)b+="\r\n\t\t<"+this.fields[c].column.name+""+(this.fields[c].FValue==null?"/>\n":">"+toXml(this.fields[c].FValue,this.fields[c].type)+"</"+this.fields[c].column.name+">");b+="\r\n\t</"+this.table.name+">\r\n</"+this.wizard.name+">";return b};
TField=function(b,c){this.changing=false;this.Class="TField";this.column=c;this.FDateInput=null;this.disabled=false;this.elements=[];this.exError=this.errorsShown=this.error=false;this.index=c.index;this.message=null;this.name=c.name;this.owner=b;this.replaced=false;this.row=b;this.spans=[];this.table=b.table;this.type=c.type;this.FValue=null;this.wizard=b.wizard;this.onblur=this.getEvent("blur");this.onchange=this.getEvent("change");this.onfocus=this.getEvent("focus")};a=TField.prototype;
a.blur=function(b,c){this.onblur!=null&&this.onblur(this,b,c);b.type!="select-one"&&Element.removeClassName(b,"focused")};
a.change=function(b,c){if(!this.changing){this.changing=true;if(c&&typeof c.type!="undefined")c.cancelBubble=true;var d;try{if(typeof b.DateInput!="undefined")d=b.DateInput.date();else if(wizTypes.contains(b.type))d=b.value;else if(b.type=="checkbox")d=b.checked;else throw new Error("Illegal sender: "+b.type);if(b.format=="t"&&this.dateInput()!=null){var e=this.dateInput().date(),f=d;f=f==null||f==""?new Date(1900,0,1,0,0):convert(f,this.type);d=e.integrateTime(f)}this.value(d);d=convert(d,this.type);
if(isSame(this.FValue,d)){this.format(b);this.updateElements(d,b)}else this.correct(b,this.FValue);this.errorsShown&&this.checksOut()&&this.hideErrors();this.changing=false;return true}catch(h){Log.error(h);if(h.description)alert(h.description);else h.message?alert(h.message):alert(h);if(window.navigator.appVersion.indexOf("MSIE")>-1){if(b.select)b.select();else b.focus?b.focus():this.correct(b,this.FValue);c.returnValue=false}else this.correct(b,this.FValue);return false}finally{this.changing=false}}};
a.checksOut=function(){for(var b=0;b<this.column.checks.length;b++){var c=this.column.checks[b];if(!c.test(this)){if(this.message==null){this.message=c.message;this.changing&&this.updateErrors(this.message)}else this.errorsShown&&this.updateErrors(c.message);return false}}if(this.exError)return false;return true};a.clearError=function(){this.exError=false;this.hideErrors()};
a.correct=function(b,c){if(b.type=="checkbox")b.checked=c?true:false;else if(b.type=="radio"){b=b.checked=false;for(var d=0;d<this.elements.length&&!b;d++){var e=this.elements[d];if(isSame(e.value,c,this.type))b=e.checked=true}}else b.value=this.wizard.toString(c,this.type,b.format)};
a.dateInput=function(){if(this.FDateInput==null){this.FDateInput="no";for(var b=0;b<this.elements.length;b++)if(typeof this.elements[b].DateInput!="undefined")this.FDateInput=this.elements[b].DateInput}return this.FDateInput=="no"?null:this.FDateInput};
a.disable=function(){if(!this.disabled){this.disabled=true;for(var b=0;b<this.elements.length;b++){var c=this.elements[b],d=null;if(c.type=="checkbox")for(d=c.nextSibling;d&&d.nodeName!="LABEL";)d=d.nextSibling;c.disabled=true;Html.addClass(c,"disabled");if(d){d.disabled=true;Html.addClass(d,"disabled")}}}};
a.dispose=function(){for(var b=0;b<this.elements.length;b++){this.elements[b].field=null;this.elements[b]=null}for(b=0;b<this.spans.length;b++)this.spans[b]=null;this.dateInput=this.column=null;this.elements=[];this.row=this.owner=null;this.spans=[];this.onfocus=this.onchange=this.onblur=this.wizard=this.table=null};
a.enable=function(){if(this.disabled){this.disabled=false;for(var b=0;b<this.elements.length;b++){var c=this.elements[b],d=null;if(c.type=="checkbox")for(d=c.nextSibling;d&&d.nodeName!="LABEL";)d=d.nextSibling;c.disabled=false;Html.removeClass(c,"disabled");if(d){d.disabled=false;Html.removeClass(d,"disabled")}}}};
a.focus=function(b,c){if(typeof b=="undefined"&&typeof c=="undefined")for(b=0;b<this.elements.length;b++){c=this.elements[b];if(c.select&&c.type!="select-one"){c.select();return}if(c.focus){c.focus();return}}else{this.onfocus!=null&&this.onfocus(this,b,c);b.type!="select-one"&&Element.addClassName(b,"focused")}};
a.format=function(b){if(this.FValue!=null){var c=typeof b.format!="undefined"?b.format:this.type==dtDouble?"0.########":this.type==dtMoney?"0.00":this.type==dtPercentage?"0.########%":null;if(formatable.contains(this.type)&&c){var d=this.FValue.formatString(c);b.value=c=="t"&&(this.FValue==null||this.FValue.formatString("HHnnss")=="000000")?"":c=="d"&&(this.FValue==null||this.FValue.formatString("yyyymmmdd")=="19000101")?"":d}}};
a.getEvent=function(b){return TEvent.find(this.wizard.name+"_"+this.table.name+"_"+this.row.index+"_"+this.name+b.upperFirst(),this.wizard.name+"_"+this.table.name+"_"+this.name+b.upperFirst(),this.table.name+"_"+this.name+b.upperFirst(),this.name+b.upperFirst(),this.wizard.name+"_"+this.table.name+b.upperFirst(),this.wizard.name+b.upperFirst(),"field"+b.upperFirst())};
a.handleReplacements=function(b){var c=[];if(!this.replaced){this.replaced=true;c=b?b.match(/\[[A-Z]+\]/g):[];if(c!=null&&c.length)for(var d=0;d<c.length;d++)this.wizard.keys.contains(c[d])||this.wizard.keys.add(c[d].replace(/[\[\]]/g,""))}c=this.wizard.keys;for(d=0;d<c.length;d++)b=b.replace("["+c[d]+"]",this.wizard.replacements[c[d]]||"");return b};
a.hideErrors=function(){this.errorsShown=this.error=false;if(!this.exError)this.message=null;for(var b=0;b<this.spans.length;b++)this.spans[b].style.display="none";for(b=0;b<this.elements.length;b++)Element.removeClassName(this.elements[b],"wrong")};a.isVisible=function(){for(var b=0;b<this.elements.length;b++){var c=Element.getStyle(this.elements[b],"display"),d=Element.getStyle(this.elements[b],"visibility");if(c!="none"&&d!="hidden")return true}return false};
a.showError=function(b){if(!this.errorsShown){if(this.message&&typeof b=="undefined")b=this.message;if(this.changing){this.exError=true;this.message=b}b=this.handleReplacements(b);for(var c=0;c<this.elements.length;c++){var d=this.elements[c];Element.addClassName(d,"wrong");if(!(typeof d.type!="undefined"&&d.type=="radio"&&c<this.elements.length-1))if(!d.type||d.type!="button")if(c>this.spans.length-1){var e=d.parentNode,f=document.createElement("DIV");if(typeof d.type!="undefined"&&d.type=="radio")e=
e.parentNode;f.id="spnError"+this.name.upperFirst()+"_"+c;f.className="error";f.innerHTML=String(b).htmlEncode();f.style.display="block";f.style.clear="both";if(this.type==dtDateTime&&e.nodeName=="TD")e=d.parentNode.parentNode.parentNode.parentNode.parentNode;this.spans.add(e.appendChild(f));this.errorsShown=true}else if(this.spans[c].style.display=="none"){this.spans[c].style.display="block";this.spans[c].innerHTML=String(b).htmlEncode();this.errorsShown=true}}}};
a.updateElements=function(b,c){for(var d=0;d<this.elements.length;d++){var e=this.elements[d];if(e!=c)if(e.type=="checkbox")e.checked=b?true:false;else if(e.type=="radio")e.checked=convert(e.value,this.type)==b;else if(e.type&&e.type!="button")e.value=this.wizard.toString(b,this.type,e.format);else if(!e.id.startsWith("btn")){var f=this.wizard.toString(b,this.type,e.format);e.innerHTML=e.toHtml?Html.toHtml(f):f}}};
a.updateErrors=function(b){this.message=b;b=this.handleReplacements(b);for(var c=0;c<this.spans.length;c++)this.spans[c].innerHTML=String(b).htmlEncode()};
a.value=function(b){if(typeof b=="undefined")return this.type==dtDateTime&&this.FValue!==null?new Date(this.FValue):this.FValue;var c=this.FValue;this.FValue=convert(b,this.type);if(!isSame(c,this.FValue))if(!this.wizard.initializing)if(this.wizard.post(this.xml())){if(!this.changing){this.updateElements(this.FValue);this.errorsShown&&this.checksOut()&&this.hideErrors()}if(this.wizard.onChange){this.table.setRow();this.wizard.onChange(this.wizard,this,c)}this.onchange!=null&&this.onchange(this,c)}else this.FValue=
c};a.xml=function(){return"<"+this.wizard.name+">\r\n\t<"+this.table.name+' index="'+this.row.index+'">\r\n\t\t<'+this.name+(this.FValue==null?" />\r\n":">"+toXml(this.FValue,this.type)+"</"+this.name+">\r\n")+"\t</"+this.table.name+">\r\n</"+this.wizard.name+">"};

