function FaceChoose(n){
	//修改界面样式
	var ClassName = "Style"+n;
	document.getElementById("Message").setAttribute("class",ClassName);
	document.getElementById("Message").setAttribute("className",ClassName);
	document.getElementById("face").value = n;
}
function IconChange(n){
	//修改心情图标
	var IconUrl = "images/icon_"+n+".gif";
	document.getElementById("IconImg").src = IconUrl;	
	document.getElementById("icon").value = n;	
}
function InputName(OriInput, GoalArea){
	//修改称呼落款
	document.getElementById(GoalArea).innerHTML = OriInput.value;
}
function strCounter(field){
	//计算输入字数
	if (field.value.length > 70)
		field.value = field.value.substring(0, 70);
	else{
		document.getElementById("Char").innerHTML = 70 - field.value.length;
		document.getElementById("AreaText").innerHTML = field.value;
	}
}
function getTime(){
	//获得当前时间
	var ThisTime = new Date();
	document.write(ThisTime.getFullYear()+"-"+(ThisTime.getMonth()+1)+"-"+ThisTime.getDate()+" "+ThisTime.getHours()+":"+ThisTime.getMinutes()+":"+ThisTime.getSeconds()); 
}

function switchStyle(obj){
    switch(obj){
        case "small":
            document.getElementById("article_body").className = "article_body style_p1";
        break;
        case "medium":
            document.getElementById("article_body").className = "article_body style_p2";
        break;
        case "large":
            document.getElementById("article_body").className = "article_body style_p3";
        break;
    }
}
function setfont(id,fsize){
 var ctext = document.getElementById(id);
 ctext.style.fontSize = fsize +"px";
}

function onTab(tabid,tabname,tablength,tabclass){
 for(i=0;i<tablength;i++){
 if(tabid == i){
 document.getElementById(""+tabname+"_"+i+"").className = tabclass;
 }else{
 document.getElementById(""+tabname+"_"+i+"").className = '';
 }
 }
 var subname = tabname + "_sub";
 for(j=0;j<tablength;j++){
 if(tabid == j){
 document.getElementById(""+subname+"_"+j+"").style.display = 'block';
 }else{
 document.getElementById(""+subname+"_"+j+"").style.display = 'none';
 }
 }
}

//   Trim()   ,   Ltrim()   ,   RTrim()   函数   
  String.prototype.Trim   =   function()   
  {   
  return   this.replace(/(^\s*)|(\s*$)/g,   "");   
  }   
    
  String.prototype.LTrim   =   function()   
  {   
  return   this.replace(/(^\s*)/g,   "");   
  }   
    
  String.prototype.RTrim   =   function()   
  {   
  return   this.replace(/(\s*$)/g,   "");   
  } 
  
  function HeightLight(Keyword)
            {
                //文本选择器
                var TextRange;
                //是否找到
                var Found=false;
                //找到的次数
                var Count = 0;
                TextRange = document.body.createTextRange();
                
                Found = TextRange.findText(Keyword);
                if (Found) 
                {
                    Count++;
                }

                while (Found && Count > 0) 
                {

                    TextRange.pasteHTML('<span style="background:yellow">' + Keyword + '</span>');
                    //将滚动条定位到第一次查到的视口范围内
                    if(Count==1)
                    {
                        TextRange.scrollIntoView();
                    }
                    //继续查找
                    Found = TextRange.findText(Keyword);
                    if (!Found) 
                    {
                        Count = 0;
                    }
                    else 
                    {
                        Count++;
                    }
                }
            }
