// JScript 文件

  function CheckAll(formName,chkName,chkid)
{
    
    var objForm = document.forms[formName];
    var objLen = objForm.length;
    for (var iCount = 0; iCount < objLen; iCount++)
    {
		if (objForm.elements[iCount].type == "checkbox")
		{
		     //if((objForm.elements[iCount].name.indexOf("chkExport")>-1))
		     if((objForm.elements[iCount].name.indexOf(chkName)>-1))
		     {
		        if(document.getElementById(chkid).checked)
		        {
			         objForm.elements[iCount].checked = true;
			    }
			    else
			    {
					  objForm.elements[iCount].checked = false;
			    }
	
			 }
		}
		
    }
}
function CheckOk(formName,chkName,str,width,height)
{
    var i=0;
    var id;
    var objForm = document.forms[formName];
    var objLen = objForm.length;
    for (var iCount = 0; iCount < objLen; iCount++)
    {
		if (objForm.elements[iCount].type == "checkbox")
		{
		     
		     if((objForm.elements[iCount].name.indexOf(chkName)>-1))
		     {
		          if( objForm.elements[iCount].checked )
		          {
		             i=i+1;
		             id=objForm.elements[iCount].value;
		          }

			 }
		}
		
    }
    if(i>0)
    {
        if(str != "")
        {
            if(i>1)
            {
              alert('只允许选择一条记录！');
            }
            else if(i == 1)
            {
           
              var url = str;
              if(url.indexOf('?')>0)
              {
               url=str+"&id="+id;
              }
              else
              {
               url = str+"?id="+id;
              }
             
              var R=window.showModalDialog(url,"水平","dialogWidth="+width+";dialogHeight="+height);
             if(R == "ok")
              {
              return R;
              //    location.reload();
              }
     
          return false;
            }
        }
        else
        {　
             return true;
        }
    }
    else
    {
     alert('必须选择一条记录！');
     return false;
    }
}
function ChkOk(formName,chkName)
{
    var i=0;
    var objForm = document.forms[formName];
    var objLen = objForm.length;
    for (var iCount = 0; iCount < objLen; iCount++)
    {
		if (objForm.elements[iCount].type == "checkbox")
		{
		     
		     if((objForm.elements[iCount].name.indexOf(chkName)>-1))
		     {
		          if( objForm.elements[iCount].checked )
		          {
		             i=i+1;
		            
		          }

			 }
		}
		
    }
    if(i>0)
    {
       return true;
      
    }
    else
    {
      alert('必须选择一条数据！');
      return false;
    }
}