// JScript File
function select_alls(chkval,idval)
{
var frm=document.forms[0];
var idCheckBox;
	for (i=0;i<frm.length;i++)
	{
	    if (idval.indexOf('checkall')!=-1)  //==0 true
	        {
	            if (chkval==true)
		            {
		                frm.elements[i].checked=true;
		            }
	            else
		            {
		                frm.elements[i].checked=false;
		            }
	        }
	    else if (idval.indexOf('deletethis')!=-1)		
	        {
		        if(frm.elements[i].checked==false)
		        {
		            frm.elements[4].checked=false;
		        }
		         if(i>1 && i<10)
		        {
		        idCheckBox="ctl00_BodyContentPH_grv_EmpDetails_ctl0" + i + "_deletethis";
		        }
		        else if(i>9)
		        {
		        idCheckBox="ctl00_BodyContentPH_grv_EmpDetails_ctl" + i + "_deletethis";
		        }
		        if(document.getElementById(idCheckBox)!=null)
		        {
		        if(document.getElementById(idCheckBox).checked==false)
		        {
		        frm.elements[8].checked=false;
		        }
		        }
	        }
	}
}
function confirmlogout(frm,SureToLogout,SelectUserIdsToLogout)
{
    var status = "";
    for (i=0;i<frm.length;i++)
    {
        if (frm.elements[i].name.indexOf('chkSelect')!=-1)
        {	
    	    if(frm.elements[i].checked)
		    {
	            status = true;	    
		    }
        }
    }
    if(status == true)
    {
        //return confirm("Are you sure, to Logout?");
        return confirm(SureToLogout);
    }		
    else
    {
        //alert("Select UserIds To Logout");
        alert(SelectUserIdsToLogout);
        return false;
    }
}
