﻿// JScript 文件
function SetIsHidden(id,isEmpty){  
    var obj = document.getElementById(id);
    if(obj == null) return;
    if(isEmpty == "True") obj.style.display = 'none';
}

function LimitStrLen(id,len){
    var obj = document.getElementById(id);
    if(obj == null) return;   
    var str = obj.innerText;
    var tmpLen = str.length;   
    var n = tmpLen;  
    for (var i = 0; i < tmpLen; i++){   
        if(str.charCodeAt(i) < 0||str.charCodeAt(i) > 255) n++;//全角字符     
    }
    if(n >= len) obj.innerText = str.substr(0,len) + "..."; 
}

function Resize(id){
    var frm = document.getElementById(id);
    var subWeb = document.frames ? document.frames[id].document : frm.contentDocument;
    if(frm != null && subWeb != null){  
        frm.height = subWeb.body.scrollHeight;
        //window.alert(frm.height);
    }
}
