// JavaScript Document
//Repeater全选
 function Check(parentChk,ChildId,ControlName)   
    {   
        var oElements = document.getElementsByTagName("INPUT");   
        var bIsChecked = parentChk.checked;   
      
       for(i=0; i<oElements.length;i++)   
        {   
            if( IsCheckBox(oElements[i]) &&    
                IsMatch(oElements[i].id, ChildId,ControlName))   
            {   
                oElements[i].checked = bIsChecked;   
            }           
        }      
     }   
      
    function IsMatch(id, ChildId,ControlName)   
    {   
        var sPattern ='^'+ControlName+'.*'+ChildId+'$';   
        var oRegExp = new RegExp(sPattern);   
        if(oRegExp.exec(id))    
            return true;   
        else    
            return false;   
    }   
      
    function IsCheckBox(chk)   
    {   
        if(chk.type == 'checkbox') return true;   
        else return false;   
    }   
    
     //显示或隐藏添加属性
function show(id)
{
if(document.getElementById(id).style.display=="none")
{
document.getElementById(id).style.display="block";
}
else
{
document.getElementById(id).style.display="none";
}
}
//显示DIV
function ShowDiv(id)
{
document.getElementById(id).style.display="block";
}
//隐藏DIV
function HideDiv(id)
{
document.getElementById(id).style.display="none";
}

//生成随机数字
var chars = [ '0','1','2','3','4','5','6','7','8','9',   
        'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',   
        'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
function generateMixed(n) {
    var res = "";
    for(var i = 0; i < n ; i ++) {
        var id = Math.ceil(Math.random()*62);
        res += chars[id];
    }
    return res;
} 

//删除指定节点
function Delete(ObjID)
{
   var Row= document.getElementById(ObjID);
   Row.parentNode.removeChild(Row);   //删除
   //document.getElementById("fileDiv").removeChild(document.getElementById("file" + obj));
}
//清空指定节点
function Clear(ObjID)
{
var div=document.getElementById(ObjID);
div.innerHTML="";
}

function ShowDiv(id)
{
    if($("#"+id).css("display")=="none")
    {
         $("#"+id).show("slow");
         //$("#sunfishlu").css("display","block");
    }
    else
    {
         $("#"+id).hide("slow");
            //$("#sunfishlu").css("display","none");
    }

}

function ShowHideDiv(id)
{
    if($("#"+id).css("display")=="none")
    {
         $("#"+id).show();
         //$("#sunfishlu").css("display","block");
    }
    else
    {
         $("#"+id).hide();
            //$("#sunfishlu").css("display","none");
    }

}