function jsmarty_function_html_options(w,q){var Z=JSmarty.Plugin;Z.add("shared.escape_special_chars",q.plugins_dir);var H,D,j,s=0,S=[];var R=jsmarty_function_html_options_optoutput;var W=Z.get("php.strval");var x=Z.get("php.array_map");var G=Z.get("php.array_values");var h=null;var C=[];var a=null;var o=null;var d=null;var z=[];for(H in w){if(!w.hasOwnProperty(H)){continue;}switch(H){case "name":h=w[H];break;case "options":d=w[H];break;case "values":o=G(w[H]);break;case "output":a=G(w[H]);break;case "selected":z=x(W,G([w[H]]));break;default:if(typeof (w[H])!="object"){C[s++]=" "+H+"=\""+w[H]+"\"";}else{q.trigger_error("html_checkboxes: extra attribute "+H+" cannot be an array");}break;}}if(!d&&!o){return ;}if(d){for(H in d){if(!d.hasOwnProperty(H)){continue;}S[s++]=R(H,d[H],z);}}else{for(H=0,D=o.length;H<D;H++){j=(a[H])?a[H]:"";S[s++]=R(o[H],j,z);}}return (h)?"<select name=\""+h+"\""+C.join("")+">\n"+S.join("\n")+"</select>\n":S.join("\n");}function jsmarty_function_html_options_optoutput(S,a,o){var k=jsmarty_function_html_options_optgroup;var d=new JSmarty.Classes.Buffer(),x=JSmarty.Plugin;var R=x.get("shared.escape_special_chars");var Z=x.get("php.is_array"),C=x.get("php.in_array");if(!Z(a)){a=R(a);d.append("<option label=\"",a,"\" value=\"",R(S),"\"");d.appendIf(C(S,o))(" selected=\"selected\"");d.append(">",a,"</option>");}return d.toString()||k(S,a,o);}function jsmarty_function_html_options_optgroup(d,x,R){var Z,C=new JSmarty.Classes.Buffer();var o=jsmarty_function_html_options_optoutput;C.append("<optgroup label=\"",d,"\">");for(Z in x){if(!x.hasOwnProperty(Z)){continue;}C.append(o(d,x,R));}C.append("</optgroup>");return C.toString();}