function showFace(e,d){var f=$("uchome_face_bg");if(f){f.parentNode.removeChild(f)}f=document.createElement("div");f.id="uchome_face_bg";f.style.position="absolute";f.style.left=f.style.top="0px";f.style.width="100%";f.style.height=document.body.scrollHeight+"px";f.style.backgroundColor="#FFFFFF";f.style.zIndex=10000;f.style.display="none";f.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=0,finishOpacity=100,style=0)";f.style.opacity=0;f.onclick=function(){$(e+"_menu").style.display="none";$("uchome_face_bg").style.display="none"};$("append_parent").appendChild(f);if($(e+"_menu")!=null){$(e+"_menu").style.display=""}else{var c=document.createElement("div");c.id=e+"_menu";c.className="facebox";c.style.position="absolute";var b=document.createElement("ul");for(i=1;i<31;i++){var a=document.createElement("li");a.innerHTML='<img src="image/face/'+i+'.gif" onclick="insertFace(\''+e+"',"+i+", '"+d+'\')" style="cursor:pointer; position:relative;" />';b.appendChild(a)}c.appendChild(b);$("append_parent").appendChild(c)}setMenuPosition(e,0);f.style.display=""}function insertFace(c,d,b){var a="[em:"+d+":]";if($(b)!=null){insertContent(b,a)}$(c+"_menu").style.display="none";$("uchome_face_bg").style.display="none"}function textCounter(d,e,c){var b=strLen(d.value);var a=$(e);if(b>c){d.value=getStrbylen(d.value,c);a.innerHTML="0"}else{a.innerHTML=c-b}if(c-b>0){a.parentNode.style.color=""}else{a.parentNode.style.color="red"}}function getStrbylen(f,a){var b=0;var g=0;var e="";var d=f.split("");for(var c=0;c<d.length;c++){if(c<a&&b+byteLength(d[c])<=a){b+=byteLength(d[c]);g=c+1}}if(f.length>g){e=f.substr(0,g)}else{e=f}return e}function byteLength(a){aMatch=a.match(/[^\x00-\x80]/g);return(a.length+(!aMatch?0:aMatch.length))}function strLen(c){var d=document.charset;var a=0;for(var b=0;b<c.length;b++){a+=c.charCodeAt(b)<0||c.charCodeAt(b)>255?(d=="utf-8"?3:2):1}return a};
