// JS functions.

// Function to enable check all checkboxes.
function checkAll(num)
{
	var docObj = "window.document";
	for ( ii = 0; ii <= num; ii++ ) {
		chObj = eval( docObj + ".getElementById('cbId" + ii +"')" );
		if (chObj)
			chObj.checked = true;
	}
	return;
}
// Function to enable check all checkboxes.
function uncheckAll(num)
{
	var docObj = "window.document";
	for ( ii = 0; ii <= num; ii++ ) {
		chObj = eval( docObj + ".getElementById('cbId" + ii +"')" );
		if (chObj)
			chObj.checked = false;
	}
	return;
}

// Function to check/uncheck a box when row is clicked
function checkRowBox( id )
{
	var docObj = "window.document";
	docObj = "window.document";
	chObj = eval(docObj +  ".getElementById('cbId"+id+"')");
	if ( chObj.checked == true )
		chObj.checked = false;
	else
		chObj.checked = true;
}

// function to confirm the delete action
function confirmDelete(num) {
	var docObj = "window.document";
 	var flag = false;
	for ( ii = 0; ii <= num; ii++ ) {
 		chObj = eval( docObj + ".getElementById('cbId" + ii +"')" );
		if(chObj.checked == true) {
			flag = true;
 			break;
 		}
	}
	if(flag) {
		var del_ok=confirm('Are you sure to remove the checked items ?	');
		if(del_ok) {
			return true;
		} else {
			return false;
		}
 	} else {
 		return false;
 	}
}

// General Confirmation function
function checkConfirm(numAction)
{
	var docObj = "window.document";
	if (numAction == 'single') {
		return confirm("Are you sure you want to delete this row?");
	} else {
		return confirm("Are you sure you want to change the list?");
	}
}

// Function to set the POST function variable
function setFunction(act)
{
	//alert();
	window.document.listForm.doNow.value=act;
	return;
}


