function SelectAll()
{    
	var length=document.forms[0].chkNum.value;

	if(length==0)
	{	    
		return;
	}
	
	if(length==1)
	{
	    if (document.forms[0].chkBox.disabled == false)
	    {
		    document.forms[0].chkBox.checked=document.forms[0].chkAll.checked;
		}
	}
	if(length>1)
	{
		for(var i=0;i<length;i++)
		{
		    if (document.forms[0].chkBox[i].disabled == false)
	        {
			    document.forms[0].chkBox[i].checked=document.forms[0].chkAll.checked;
			}
		}
	}
}
function UnSelectAll(itemIndex)
{	
	if(document.forms[0].chkAll.checked)
	{
		document.forms[0].chkAll.checked = document.forms[0].chkBox.checked;
	}	
}