function EformRuntime()
{this.evaluator=null;this.update=function(element)
{if(element==null)throw(this+" empty or no element was passed");if(this.evaluator==null)throw(this+" empty or no evaluator was specified");if(element.conditions==null)return;for(var index=0;index<element.conditions.length;index++)
{var condition=element.conditions[index];var when=condition.when;var otherwise=condition.otherwise;if(when!=null&&this.evaluator.evaluate(when.test)=='true')
{if(when.attributes)this.copyAttributes(when.attributes,element);if(when.items)this.copyItems(when.items,element);}
else if(otherwise!=null)
{if(otherwise.attributes)this.copyAttributes(otherwise.attributes,element);if(otherwise.items)this.copyItems(otherwise.items,element);}}}
this.copyAttributes=function(attributes,element)
{if(attributes==null||element==null)return;for(var name in attributes)
{var value=attributes[name];try
{value=this.evaluator.evaluate(new String(value));eval("element."+this.setter(name)+"(value)");}
catch(e){}}}
this.copyItems=function(items,element)
{if(items==null||element==null)return;var list=new Array();for(var i=0;items&&i<items.length;i++)
{try
{var value=items[i]['value'];value=this.evaluator.evaluate(new String(value));var name=items[i]['name'];var item=new Object();item['name']=name;item['value']=value;list.push(item);}
catch(e){}}
element.setItems(list);}
this.getter=function(property)
{return"get"+property.replace(/\b([a-z])/g,function(letter){return letter.toUpperCase()})}
this.setter=function(property)
{return"set"+property.replace(/\b([a-z])/g,function(letter){return letter.toUpperCase()})}
this.toString=function()
{return"[runtime]";}}
