$(document).ready(function() {

	$("table").tablesorter({

		// pass the headers argument and assing a object

		headers: {

			0: {

				// disable it by setting the property sorter to false

				sorter: false

			},

			1: {

				// disable it by setting the property sorter to false

				sorter: "shortDate"

			}



		}

	});

});



function checkAll()

{

  $("form#frmListing INPUT[type='checkbox']").attr('checked', $('#chkAll').is(':checked')); 

}



function selaccessupdate()

{

	var selected=0;

	formx = document.frmListing;

	for(var i=1;i<formx.length;i++)

	{

		if(formx.elements[i].type=="checkbox")

		{

			if((formx.elements[i].checked) && (formx.elements[i].name.indexOf("chkAll")<0))

					{

						selected++;

					}

		}

	}

	if (document.frmListing.hdnactiveclient.value == 0)

	{

		alert("Please select the client first from the dropdown above.");

		return false;

	}

	a=confirm("Are you sure you want to update Campaign access permissions for the selected user?");

	if(a==true)

	{

		document.frmListing.submit();

	}

	return a;

}



function clientupdate(val)

{

	if (val > 0)

	{

		window.location.href = 'clientaccess.php?id='+val+'&searchbox='+document.formsearch.searchbox.value;

	}

}

