function SimpleViewBase(id){this.id=id;this.type="SimpleViewBase";this.hashcode="SimpleViewBase@"+Math.floor(Math.random()*9999999999);this.elm=document.getElementById(this.id);this.conditions=null;this.toString=function(){return this.id};this.setElement=elm_setElement;this.setCssClass=elm_setCssClass;this.setDisplay=elm_setDisplay;this.setStyles=elm_setStyles;this.setConditions=elm_setConditions;this.getCssClass=function(){return this.elm?this.elm.className:"";}
this.getDisplay=function(){return this.elm?this.elm.className:"";}
this.getConditions=function(){var out="";for(var index=0;index<this.conditions.length;index++)
{var condition=this.conditions[index];var when=condition.when;var otherwise=condition.otherwise;if(when){out+="\n\t\t"+when.test+":\n\t\t\t(attribute)\n";var first=true;for(var name in when.attributes){if(name!='test'){out+=(first?"\t\t\t":",\n\t\t\t")+name+" = "+when.attributes[name];first=false;}}
first=true;out+=when.items?"\n\t\t\t(items)\n":"";for(var i=0;when.items&&i<when.items.length;i++){out+=(first?"\t\t\t":",\n\t\t\t")+when.items[i]['name']+" = "+when.items[i]['value'];first=false;}}
if(otherwise){out+="\n\t\totherwise:\n\t\t\t(attribute)\n";var first=true;for(var name in otherwise.attributes){if(name!='test'){out+=(first?"\t\t\t":",\n\t\t\t")+name+" = "+otherwise.attributes[name];first=false;}}
first=true;out+=otherwise.items?"\n\t\t\t(items)\n":"";for(var i=0;otherwise.items&&i<otherwise.items.length;i++){out+=(first?"\t\t\t":",\n\t\t\t")+otherwise.items[i]['name']+" = "+otherwise.items[i]['value'];first=false;}}}
return out;}
function elm_setElement(elem,value){if(elem){elem.innerHTML=value;if(value)
this.setStyles(elem,"displayNone","");else
this.setStyles(elem,"","displayNone");}}
function elm_setCssClass(cssclass){if(cssclass)
this.setStyles(this.elm,"",cssclass);}
function elm_setDisplay(display){if(this.model&&this.model.elmFields&&(display=='disabled'||display=='enabled')){for(var i=0;i<this.model.elmFields.length;i++)
this.model.elmFields[i].disabled=(display=='disabled');}
this.setStyles(this.elm,"hidden|display|disabled|enabled",display);}
function elm_setStyles(element,del,set){var re=eval("/("+del+")/g");var reSet=eval("/("+set+")/");try{if(!element.className)element.className="";if(!element.className.match(reSet)||set==""){element.className=element.className.replace(re,"");element.className+=" "+set;}}catch(e){debug("SimpleViewBase",this.id+".setStyles",e);}}
function elm_setConditions(conditions){this.conditions=conditions;}}