function jsmarty_function_mailto(x,C){if(!x.address){C.trigger_error("mailto: missing 'address' parameter");return "";}var a,j=0,W=[];var R,o,D,s,G;R=o="";D=s=x.address;for(a in x){switch(a){case "cc":case "bcc":case "followupto":W[j++]=a+"="+x[a].replace("%40","@");break;case "subject":case "newsgroups":W[j++]=a+"="+x[a];break;case "extra":R=x[a];break;case "text":D=x[a];break;}}for(a=0;a<j;a++){o+=(0==j)?"?":"&";o+=mail_params[a];}s+=o;G=(x.encode)?x.encode:"none";switch(G){case "hex":var d=[],z=[];for(a=0,f=s.length;a<f;a++){if(s.charAt(a).match(/\w/)){z[a]="%"+s.charCodeAt(a).toString(16);}else{z[a]=s.charAt(a);}}for(a=0,f=D.length;a<f;a++){d[a]="&#"+D.charCodeAt(a)+";";}mailto="&#109;&#97;&#105;&#108;&#116;&#111;&#58;";return "<a href=\""+mailto+z.join("")+"\""+R+">"+d.join("")+"</a>";case "none":return "<a href=\"mailto:"+s+"\" "+R+">"+D+"</a>";case "javascript":var S=[],H="document.write('<a href=\"mailto:"+s+"\" "+R+">"+D+"</a>');";for(a=0,f=H.length;a<f;a++){S[a]="%"+H.charCodeAt(a).toString(16);}return "<script type=\"text/javascript\">eval(unescape('"+S.join("")+"'))</"+"script>";case "javascript_charcode":var Z=[],H="<a href=\"mailto:"+s+"\" "+R+">"+D+"</a>";for(a=0,f=H.length;a<f;a++){Z[a]=H.charCodeAt(a);}H=["<script type=\"text/javascript\" language=\"JavaScript\">","document.write(String.fromCharCode("+Z.join()+"))","</"+"script>"];return H.join("\n");default:C.trigger_error("mailto: 'encode' parameter must be none, javascript or hex");return "";}}