
var
wizTypes=["text","password","textarea","select-one","radio","file"],wizards=[];var
wizardFields=["add","Class","dispose","function","getColumns","getElements","hideErrors","index","initialized","initializing","name","onChange","post","refresh","tables","toString"];TWizard=function(name,guid)
{this.Class="TWizard";this.guid=guid;this.index=wizards.length;this.initializing=true;this.name=name;this.onChange=null;this.tables=[];Cookies.set("wiz"+name.upperFirst()+"Guid",guid,dtString);wizards[this.index]=this;addEvent(window,"load",new Function("wizards["+this.index+"].getElements()"));addEvent(window,"unload",new Function("wizards["+this.index+"].dispose()"));}
TWizard.prototype.add=function(name)
{if(typeof(this.tables[name])=="undefined")
{var
index=this.tables.length,newTable=new TTable(this,name,index);this.tables[index]=newTable;this.tables[name]=newTable;if(wizardFields.indexOf(name)==-1)
eval(this.name+"."+name+" = "+this.name+".tables[\""+name+"\"];");return newTable;}
else
throw new Error("This table already exists in the collection.");}
TWizard.prototype.dispose=function()
{for(var i=0;i<this.tables.length;i++)
{this.tables[i].dispose();this.tables[i]=null;}
this.onChange=null;this.tables=[];wizards[this.index]=null;}
TWizard.prototype.getColumns=function(XML,name)
{var
declaration=XML.documentElement.getElementsByTagName("declaration")[0],tableNodes=declaration.getElementsByTagName("table");for(var i=0;i<tableNodes.length;i++)
{if(tableNodes[i].getAttribute("name")==name)
return tableNodes[i].getElementsByTagName("column");}
return null;}
TWizard.prototype.getElements=function()
{for(var i=0;i<this.tables.length;i++)
{var
table=this.tables[i];for(var k=0;k<table.rows.length;k++)
table.rows[k].getElements();}}
TWizard.prototype.hideErrors=function()
{for(var i=0;i<this.tables.length;i++)
this.tables[i].hideErrors();}
TWizard.prototype.initialized=function()
{this.initializing=false;}
TWizard.prototype.refresh=function(XML)
{var
changed=[];this.initializing=true;try
{for(var i=0;i<this.tables.length;i++)
{var
table=this.tables[i],rowNodes=XML.documentElement.getElementsByTagName(table.name),columns=this.getColumns(XML,table.name);for(var rowIndex=0;rowIndex<rowNodes.length;rowIndex++)
{var
rowNode=rowNodes[rowIndex],columnNodes=rowNode.childNodes,row=null;if(rowNode.parentNode.nodeName!="deleted")
{if(rowIndex>=table.rows.length)
row=table.addRow();else
row=table.rows[rowIndex];for(var columnIndex=0;columnIndex<columns.length;columnIndex++)
{var
column=columns[columnIndex],field=row.fields[column.getAttribute("name")],columnNode=rowNode.getElementsByTagName(column.getAttribute("name"))[0],value=columnNode!=null&&columnNode.firstChild?fromXml(columnNode.firstChild.data,field.type):null,error=parseInt(column.getAttribute("error"));if(!isSame(value,field.FValue))
{changed.add({field:field,oldValue:field.FValue});field.value(value);field.updateElements(value);}
if(error==rowIndex)
field.error=true;}}}
while(table.rows.length>rowNodes.length)
table.rows.length--;if(table.row>=table.rows.length)
table.row=table.rows.length-1;table.bof=(table.row<=0);table.eof=(table.row==table.rows.length-1);}}
catch(error)
{Log.error(error);if(error.description)
alert(error.description);else if(error.message)
alert(error.message);else
alert(error);}
finally
{this.initializing=false;for(var k=0;k<changed.length;k++)
{var
field=changed[k].field,oldValue=changed[k].oldValue;if(this.onChange)
{field.table.setRow();this.onChange(this,field,oldValue);}
if(field.onchange!=null)
field.onchange(field,oldValue);}}}
TWizard.prototype.post=function(XML)
{if(this.initializing)
return true;try
{var
url=new Url("misc/postWizard.aspx");url=url.add("guid",this.guid);XML=url.request("post",XML,true,false);if(typeof(XML)!="boolean")
{this.refresh(XML);return true;}}
catch(error)
{Log.error(error);}
return false;}
TWizard.prototype.toString=function(value,type,format)
{if(value==null)
return"";switch(type)
{case dtInteger:case dtLong:return String(value);case dtDouble:if(typeof(format)!="undefined")
return value.formatString(format);else
return value.formatString("0.########");case dtPercentage:if(typeof(format)!="undefined")
return value.formatString(format);else
return value.formatString("0.########")+"%";case dtMoney:if(typeof(format)!="undefined")
return value.formatString(format);else
return value.formatString("0.00");case dtDateTime:if(typeof(format)!="undefined")
{if(format==null||format=="")
format="g";else if(format.length>1)
{format=format.replace(/d/gi,"D");format=format.replace(/m/g,"N");format=format.replace(/y/gi,"Y");format=format.replace(/h/gi,"H");format=format.replace(/s/gi,"S");format=format.replace(/\//gi,"-");}
return value.formatString(format);}
else if(value.formatString("HHnnss")=="000000")
return value.formatString("d");else
return value.formatString("g");case dtString:case dtGuid:return String(value);case dtBoolean:if(value)
return trueText[Languages.current];else
return falseText[Languages.current];}}
var
tableFields=["addColumn","addRow","bof","canSave","Class","columns","current","dispose","eof","first","function","getRow","goto","hideErrors","index","initialize","last","name","next","prior","owner","removeRow","removeRowAt","row","Rows","rows","setRow","wizard"],floats=[dtDouble,dtMoney,dtPercentage];TTable=function(owner,name,index)
{this.bof=true;this.Class="TTable";this.columns=[];this.eof=true;this.index=index;this.name=name;this.owner=owner;this.row=-1;this.rows=[];this.wizard=owner;this.setRow=function()
{var
row=this.current();if(row==null)
{for(var i=0;i<this.columns.length;i++)
{var
column=this.columns[i],table=this.wizard.name+"."+this.name;if(tableFields.indexOf(column.name)==-1)
eval(table+"."+column.name+" = null;");}}
else
{for(var i=0;i<row.fields.length;i++)
{var
field=row.fields[i],table=this.wizard.name+"."+this.name,rowStr=table+".rows["+row.index+"]";if(tableFields.indexOf(field.name)==-1)
eval(table+"."+field.name+" = "+rowStr+".fields["+i+"];");}}}}
TTable.prototype.addColumn=function(name,type)
{if(typeof(this.columns[name])=="undefined")
{var
index=this.columns.length,newColumn=new TColumn(this,name,type,index);this.columns[index]=newColumn;this.columns[name]=newColumn;return newColumn;}
else
throw new Error("This column already exists in the collection.");}
TTable.prototype.addRow=function()
{if(this.bof&&this.eof)
this.bof=false;this.eof=false;this.row=this.rows.length;var
index=this.rows.length,newRow=new TRow(this,this.row,arguments);this.rows[index]=newRow;newRow.addFields();newRow.getElements();this.setRow();return newRow;}
TTable.prototype.canSave=function()
{if(this.rows.length==0)
return false;for(var i=0;i<this.rows.length;i++)
{var
fields=this.rows[i].canSave();if(fields.length>0)
return false;}
return true;}
TTable.prototype.current=function()
{if(this.row>-1)
return this.rows[this.row];else
return null;}
TTable.prototype.dispose=function()
{for(var i=0;i<this.rows.length;i++)
{this.rows[i].dispose();this.rows[i]=null;}
for(var i=0;i<this.columns.length;i++)
{this.columns[i].dispose();this.columns[i]=null;}
this.columns=[];this.owner=null;this.rows=[];this.wizard=null;}
TTable.prototype.first=function()
{if(this.rows.length>0)
{this.bof=true;this.eof=false;this.row=0;this.setRow();}}
TTable.prototype.getRow=function(column,value)
{for(var i=0;i<this.rows.length;i++)
if(this.rows[i].fields[column].FValue==value)
return this.rows[i];return null;}
TTable.prototype.goto=function(column,value)
{if(typeof(value)=="undefined"&&typeof(column)=="number")
{var
row=column;if(row>=0&&row<this.rows.length)
{this.row=row;this.bof=(row<=0);this.eof=(row==this.rows.length-1);this.setRow();return true;}
else
throw new Error("Illegal call to TTable.goto( index ). The index was out of range.");}
for(var i=0;i<this.rows.length;i++)
if(this.rows[i].fields[column].FValue==value)
{this.bof=(i<=0);this.eof=(i==this.rows.length-1);this.row=i;this.setRow();return true;}
return false;}
TTable.prototype.hideErrors=function()
{for(var i=0;i<this.rows.length;i++)
this.rows[i].hideErrors();}
TTable.prototype.initialize=function()
{for(var i=0;i<this.rows.length;i++)
this.rows[i].initialize();}
TTable.prototype.last=function()
{if(this.rows.length>0)
{this.bof=false;this.eof=true;this.row=this.rows.length-1;this.setRow();}}
TTable.prototype.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();}}
TTable.prototype.prior=function()
{if(this.rows.length>0)
{if(this.row==0)
{this.bof=true;this.eof=false;}
else
this.row--;this.setRow();}}
TTable.prototype.removeRow=function(row)
{for(var i=row.index;i<this.rows.length-1;i++)
{this.rows[i]=this.rows[i+1];this.rows[i].index=i;this.rows[i].updateElements();}
row.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(row.xml("delete"));this.setRow();}
TTable.prototype.removeRowAt=function(index)
{if(index>=0&&index<this.rows.length)
this.removeRow(this.rows[index]);else
throw new Error("Illegal call to method \"removeRowAt\". Index out of range (\""+index+"\").");}
TTable.prototype.Rows=function(index)
{if(index<0)
throw new Error("Illegal call to method \"Rows( index )\". Index out of range (\""+index+"\").");while(index>=this.rows.length)
this.addRow();return this.rows[index];}
TColumn=function(owner,name,type,index)
{this.checks=[];this.Class="TColumn";this.elements=[];this.index=index;this.name=name;this.owner=owner;this.table=owner;this.type=type;this.wizard=owner.wizard;owner.initialize();}
TColumn.prototype.change=function(sender,event)
{if(this.owner.current()!=null)
return this.owner.current().fields[this.index].change(sender,event);else
{event.returnValue=false;return false;}}
TColumn.prototype.dispose=function()
{for(var i=0;i<this.checks.length;i++)
{this.checks[i].dispose();this.checks[i]=null;}
for(var i=0;i<this.elements.length;i++)
this.elements[i]=null;this.checks=[];this.elements=[];this.owner=null;this.table=null;this.wizard=null;}
TColumn.prototype.value=function(value)
{if(this.owner.current()!=null)
{if(typeof(value)=="undefined")
return this.owner.current().fields[this.index].FValue;else
this.owner.current().fields[this.index].value(value);}}
TCheck=function(owner,message,expression)
{this.eval=null;this.message=message;this.owner=owner;this.regex=null;this.wizard=owner.wizard;if(typeof(expression)=="string")
this.eval=expression;else if(typeof(expression)!="undefined"&&expression!=null)
this.regex=expression;}
TCheck.prototype.dispose=function()
{this.regex=null;this.owner=null;this.wizard=null;}
TCheck.prototype.test=function(field)
{if(this.eval)
{var
expression=this.eval;expression=expression.replace(/\bthis\b/gi,this.toJs(field));expression=expression.replace(/\bthis$/gi,this.toJs(field));expression=expression.replace(/^this\b/gi,this.toJs(field));expression=expression.replace(/^this$/gi,this.toJs(field));return(eval(expression)==true);}
else if(this.regex)
{var
format=undefined,value="null";if(field.type==dtDateTime)
format="DD-MM-YYYY HH:NN:SS";else if(field.type==dtDouble||field.type==dtMoney||field.type==dtPercentage)
format="0.0";if(field.value!=null)
value=this.wizard.toString(field.value(),field.type,format);return new RegExp(this.regex.source,this.regex.ignoreCase?"ig":"g").test(value);}
else
return(field.value()!=null);}
TCheck.prototype.toJs=function(field)
{var
value=field.value();if(value==null)
return"null";switch(field.type)
{case dtInteger:case dtLong:return String(value);case dtDouble:case dtPercentage:case dtMoney:return value.formatString("0.");case dtDateTime:return value.jsDate();case dtString:case dtGuid:return String(value).toJs();case dtBoolean:if(value)
return"true";else
return"false";default:return"";}}
var
rowFields=["addFields","Class","dispose","fields","function","getElements","hideErrors","index","initialize","owner","table","wizard","xml"];TRow=function(owner,index,values)
{this.Class="TRow";this.fields=[];this.index=index;this.owner=owner;this.table=owner;this.wizard=owner.wizard;this.initialize();if(typeof(values)!="undefined")
{for(var i=0;i<this.owner.columns.length;i++)
if(i<values.length)
this.fields[i].FValue=convert(values[i],this.owner.columns[i].type);if(!this.wizard.initializing)
{this.wizard.post(this.xml());try
{if(this.wizard.onChange)
this.wizard.onChange(this.wizard,null,null);}
catch(error)
{Log.error(error);if(error.description)
alert(error.description);else if(error.message)
alert(error.message);else
alert(error);}}}}
TRow.prototype.addFields=function()
{for(var i=0;i<this.fields.length;i++)
{var
field=this.fields[i],row=this.wizard.name+"."+this.table.name+".rows["+this.index+"]";if(rowFields.indexOf(field.name)==-1)
eval(row+"."+field.name+" = "+row+".fields["+i+"];");}}
TRow.prototype.canSave=function()
{this.hideErrors();this.wizard.post(this.xml("canSave"));var
fields=[];for(var i=0;i<this.fields.length;i++)
{var
field=this.fields[i];if(!field.checksOut())
fields.add(field);else if(field.error&&!fields.contains(field))
{fields.add(field);field.error=false;}}
return fields;}
TRow.prototype.clear=function()
{for(var i=0;i<this.fields.length;i++)
{var
field=this.fields[i];field.FValue=null;field.updateElements(null);}}
TRow.prototype.dispose=function()
{for(var i=0;i<this.fields.length;i++)
{this.fields[i].dispose();this.fields[i]=null;}
this.fields=[];this.owner=null;this.table=null;this.wizard=null;}
TRow.prototype.getElements=function()
{for(var i=0;i<this.fields.length;i++)
{var
field=this.fields[i],name=this.wizard.name+"_"+this.table.name+"_"+field.name+"_"+this.index,elements=document.getElementsByName(name),button=Html.get("btn"+name.upperFirst()),labelname="lbl"+name.upperFirst();for(var k=0;k<field.elements.length;k++)
field.elements[k]=null;field.elements=[];for(var k=0;k<elements.length;k++)
{var
element=elements[k],type=typeof(element.type)!="undefined"?element.type:null;field.elements.add(element);element.field=field;if(type=="text"&&floats.contains(field.type))
{if(element.title!=""&&typeof(element.format)=="undefined")
{element.format=element.title;element.title="";}}}
var
labels=document.getElementsByTagName("span");for(var k=0;k<labels.length;k++)
{var
label=labels[k];if(label.id==labelname)
{field.elements.add(label);label.field=field;if(typeof(label.toHtml)=="undefined")
{label.toHtml=(label.lang=="1");label.removeAttribute("lang");}
if(label.title!=""&&typeof(label.format)=="undefined")
{label.format=label.title;label.title="";}}}
if(button!=null)
{field.elements.add(button);button.field=field;}}}
TRow.prototype.hideErrors=function()
{for(var i=0;i<this.fields.length;i++)
this.fields[i].hideErrors();}
TRow.prototype.initialize=function()
{for(var i=this.fields.length;i<this.owner.columns.length;i++)
{var
newField=new TField(this,this.owner.columns[i]);this.fields[newField.index]=newField;this.fields[newField.name]=newField;}}
TRow.prototype.updateElements=function()
{for(var i=0;i<this.fields.length;i++)
{var
field=this.fields[i];for(var k=0;k<field.elements.length;k++)
{var
element=field.elements[k];if(element.id.startsWith("lbl"))
element.id="lbl"+this.wizard.name.upperFirst()+"_"+this.table.name+"_"+field.name+"_"+this.index;else if(element.id.startsWith("btn"))
element.id="btn"+this.wizard.name.upperFirst()+"_"+this.table.name+"_"+field.name+"_"+this.index;else
{element.name=this.wizard.name+"_"+this.table.name+"_"+field.name+"_"+this.index;if(element.id.split(/_/gi).length>4)
element.id="edt"+this.wizard.name.upperFirst()+"_"+this.table.name+"_"+field.name+"_"+this.index+"_"+element.value;else
element.id="edt"+this.wizard.name.upperFirst()+"_"+this.table.name+"_"+field.name+"_"+this.index;}
if(element.onblur)
element.onblur=new Function(this.wizard.name+"."+this.table.name+".Rows("+this.index+").fields[\""+field.name+"\"].blur( this, event );");if(element.onchange)
element.onchange=new Function(this.wizard.name+"."+this.table.name+".Rows("+this.index+").fields[\""+field.name+"\"].change( this, event );");if(element.onfocus)
element.onfocus=new Function(this.wizard.name+"."+this.table.name+".Rows("+this.index+").fields[\""+field.name+"\"].focus( this, event );");}}}
TRow.prototype.xml=function(action)
{var
retVal="<"+this.wizard.name+(typeof(action)!="undefined"?" action=\""+action+"\"":"")+">\r\n"+" <"+this.table.name+" index=\""+this.index+"\">";for(var i=0;i<this.fields.length;i++)
if(this.fields[i].FValue!=null)
retVal+="\r\n"+"  <"+this.fields[i].column.name+""+
(this.fields[i].FValue==null?"/>\n":">"+toXml(this.fields[i].FValue,this.fields[i].type)+"</"+this.fields[i].column.name+">");retVal+="\r\n"+" </"+this.table.name+">\r\n"+"</"+this.wizard.name+">";return retVal;}
TField=function(owner,column)
{this.changing=false;this.Class="TField";this.column=column;this.elements=[];this.error=false;this.errorsShown=false;this.exError=false;this.index=column.index;this.message=null;this.name=column.name;this.owner=owner;this.row=owner;this.spans=[];this.table=owner.table;this.type=column.type;this.FValue=null;this.wizard=owner.wizard;this.onblur=this.getEvent("blur");this.onchange=this.getEvent("change");this.onfocus=this.getEvent("focus");}
TField.prototype.blur=function(sender,event)
{if(this.onblur!=null)
this.onblur(this,sender,event);Element.removeClassName(sender,"focused");}
TField.prototype.change=function(sender,event)
{if(!this.changing)
{this.changing=true;if(event&&typeof(event.type)!="undefined")
event.cancelBubble=true;var
newValue,oldValue=this.FValue;try
{if(wizTypes.contains(sender.type))
newValue=sender.value;else if(sender.type=="checkbox")
newValue=sender.checked;else
throw new Error("Illegal sender: "+sender.type);this.value(newValue);newValue=convert(newValue,this.type);if(!isSame(this.FValue,newValue))
this.correct(sender,this.FValue);else
{this.format(sender);this.updateElements(newValue,sender);}
if(this.errorsShown&&this.checksOut())
this.hideErrors();return true;}
catch(error)
{Log.error(error);if(error.description)
alert(error.description);else if(error.message)
alert(error.message);else
alert(error);if(window.navigator.appVersion.indexOf("MSIE")>-1)
{if(sender.select)
sender.select();else if(sender.focus)
sender.focus();else
this.correct(sender,this.FValue);event.returnValue=false;}
else
this.correct(sender,this.FValue);return false;}
finally
{this.changing=false;}}}
TField.prototype.checksOut=function()
{for(var i=0;i<this.column.checks.length;i++)
{var
check=this.column.checks[i];if(!check.test(this))
{if(this.message==null)
{this.message=check.message;if(this.changing)
this.updateErrors(this.message);}
else if(this.errorsShown)
this.updateErrors(check.message);return false;}}
if(this.exError)
return false;return true;}
TField.prototype.clearError=function()
{this.exError=false;this.hideErrors();}
TField.prototype.correct=function(sender,value)
{if(sender.type=="checkbox")
{if(value)
sender.checked=true;else
sender.checked=false;}
else if(sender.type=="radio")
{sender.checked=false;var
done=false;for(var i=0;i<this.elements.length&&!done;i++)
{var
element=this.elements[i];if(isSame(element.value,value,this.type))
{element.checked=true;done=true;}}}
else
sender.value=this.wizard.toString(value,this.type,sender.format);}
TField.prototype.dispose=function()
{for(var i=0;i<this.elements.length;i++)
{this.elements[i].field=null;this.elements[i]=null;}
for(var i=0;i<this.spans.length;i++)
this.spans[i]=null;this.column=null;this.elements=[];this.owner=null;this.row=null;this.spans=[];this.table=null;this.wizard=null;this.onblur=null;this.onchange=null;this.onfocus=null;}
TField.prototype.focus=function(sender,event)
{if(typeof(sender)=="undefined"&&typeof(event)=="undefined")
{for(var i=0;i<this.elements.length;i++)
{var
element=this.elements[i];if(element.select)
{element.select();return;}
if(element.focus)
{element.focus();return;}}}
else
{if(this.onfocus!=null)
this.onfocus(this,sender,event);if(sender.type!="select-one")
Element.addClassName(sender,"focused");}}
TField.prototype.format=function(sender)
{if(this.FValue!=null)
{var
format=typeof(sender.format)!="undefined"?sender.format:this.type==dtDouble?"0.########":this.type==dtMoney?"0.00":this.type==dtPercentage?"0.########%":null;if(floats.contains(this.type)&&format)
sender.value=this.FValue.formatString(format);}}
TField.prototype.getEvent=function(event)
{var
func=TEvent.find(this.wizard.name+"_"+this.table.name+"_"+this.row.index+"_"+this.name+event.upperFirst(),this.wizard.name+"_"+this.table.name+"_"+this.name+event.upperFirst(),this.table.name+"_"+this.name+event.upperFirst(),this.name+event.upperFirst(),this.wizard.name+event.upperFirst(),"field"+event.upperFirst());return func;}
TField.prototype.hideErrors=function()
{this.error=false;this.errorsShown=false;if(!this.exError)
this.message=null;for(var i=0;i<this.spans.length;i++)
this.spans[i].style.display="none";for(var i=0;i<this.elements.length;i++)
Element.removeClassName(this.elements[i],"wrong");}
TField.prototype.showError=function(message)
{if(this.errorsShown)
return;if(this.message&&typeof(message)=="undefined")
message=this.message;if(this.changing)
{this.exError=true;this.message=message;}
for(var i=0;i<this.elements.length;i++)
{var
element=this.elements[i];Element.addClassName(element,"wrong");if(typeof(element.type)!="undefined"&&element.type=="radio"&&i<this.elements.length-1)
continue;if(!element.type||element.type!="button")
{if(i>this.spans.length-1)
{var
parent=element.parentNode,span=document.createElement("DIV");if(typeof(element.type)!="undefined"&&element.type=="radio")
parent=parent.parentNode;span.id="spnError"+this.name.upperFirst()+"_"+i;span.className="error";span.innerHTML=String(message).htmlEncode();span.style.display="block";span.style.clear="both";if(this.type==dtDateTime&&parent.nodeName=="TD")
parent=element.parentNode.parentNode.parentNode.parentNode.parentNode;this.spans.add(parent.appendChild(span));this.errorsShown=true;}
else if(this.spans[i].style.display=="none")
{this.spans[i].style.display="block";this.spans[i].innerHTML=String(message).htmlEncode();this.errorsShown=true;}}}}
TField.prototype.updateElements=function(value,without)
{for(var i=0;i<this.elements.length;i++)
{var
element=this.elements[i];if(element!=without)
{if(element.type=="checkbox")
{if(value)
element.checked=true;else
element.checked=false;}
else if(element.type=="radio")
element.checked=(convert(element.value,this.type)==value);else if(element.type&&element.type!="button")
element.value=this.wizard.toString(value,this.type,element.format);else if(!element.id.startsWith("btn"))
{value=this.wizard.toString(value,this.type,element.format);if(element.toHtml)
element.innerHTML=Html.toHtml(value);else
element.innerHTML=value;}}}}
TField.prototype.updateErrors=function(message)
{this.message=message;for(var i=0;i<this.spans.length;i++)
this.spans[i].innerHTML=String(message).htmlEncode();}
TField.prototype.value=function(value)
{if(typeof(value)=="undefined")
return this.FValue;var
oldValue=this.FValue;this.FValue=convert(value,this.type);if(isSame(oldValue,this.FValue))
return;if(!this.wizard.initializing)
{if(!this.wizard.post(this.xml()))
this.FValue=oldValue;else
{if(!this.changing)
{this.updateElements(this.FValue);if(this.errorsShown&&this.checksOut())
this.hideErrors();}
if(this.wizard.onChange)
{this.table.setRow();this.wizard.onChange(this.wizard,this,oldValue);}
if(this.onchange!=null)
this.onchange(this,oldValue);}}}
TField.prototype.xml=function()
{var
retVal="<"+this.wizard.name+">\r\n"+" <"+this.table.name+" index=\""+this.row.index+"\">\r\n"+"  <"+this.name+
(this.FValue==null?" />\r\n":">"+toXml(this.FValue,this.type)+"</"+this.name+">\r\n")+" </"+this.table.name+">\r\n"+"</"+this.wizard.name+">";return retVal;}