//JavaScript Document.

//全选
function CheckAll(form)
{
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.Name != "chkAll"&&e.disabled!=true)
       e.checked = form.chkAll.checked;
    }
}

//HTML过滤函数
function HTML(text)
{
	text = text.replace(/&/g, "&amp;") ;
	text = text.replace(/"/g, "&quot;") ;
	text = text.replace(/</g, "&lt;") ;
	text = text.replace(/>/g, "&gt;") ;
	text = text.replace(/'/g, "&#146;") ;
	return text ;
}
function ReHTML(text)
{
	text = text.replace(/&amp;/g, "&") ;
	text = text.replace(/&quot;/g, '"') ;
	text = text.replace(/&lt;/g, "<") ;
	text = text.replace(/&gt;/g, ">") ;
	text = text.replace(/&#146;/g, "'") ;
	return text ;
}
function LoadHTML(o){
	//var sData = document.createElement("div");
	//sData.innerHTML=ReHTML(o.innerHTML);
	//alert(sData.getAttribute("language"))
	o.innerHTML=ReHTML(o.innerHTML);
	
}

function ShowCurrent(sId, sValue){
        if(sValue==1){
                document.getElementById(sId).style.display = "block";
        }else{
                document.getElementById(sId).style.display = "none";
        }
}

//字体大小
function doZoom(ChangeID, Size){
        document.getElementById(ChangeID).style.fontSize = Size + 'px';
}

function IsInteger(str){
        //var str = document.form1.age.value;
        if(str.length!=0){
                var reg=/^[-+]?\d*$/;
                if(!reg.test(str)){
                        sAlert("此项必须是整数类型.");
                        return false;
                }
        }
}

//检验E-mail地址
function isEmail(){
        var strEmail=document.form1.mail.value;
        if(strEmail != ""){
                if(strEmail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1){
                        sAlert("E-Mail格式不正确！");
                        return false;
                }
        }
}

function wzx1(num){
	num.className="www1";
}
function wzx2(num){
	num.className="www2";
}