<script type="text/javascript">
function ChangeState(ID, action) {
  if(action == "suppress"){
	if(confirm("<?php echo L_G_CONFIRMSUPPRESSAFF?>"))
		document.location.href = "index.php?md=<?php echo $_REQUEST['md']; ?>&aid="+ID+"&action="+action+"&<?php echo SID?>";
  } else if(action == "approve") {
	if(confirm("<?php echo L_G_CONFIRMAPPROVEAFF?>"))
	  document.location.href = "index.php?md=<?php echo $_REQUEST['md']; ?>&aid="+ID+"&action="+action+"&<?php echo SID?>";
  } else if(action == "pending") {
	if(confirm("<?php echo L_G_CONFIRMPENDINGAFF?>"))
	  document.location.href = "index.php?md=<?php echo $_REQUEST['md']; ?>&aid="+ID+"&action="+action+"&<?php echo SID?>";
  }
}

function Delete(ID) {
  if(confirm("<?php echo L_G_CONFIRMDELETEAFF?>"))
	document.location.href = "index.php?md=<?php echo $_REQUEST['md']; ?>&aid="+ID+"&action=delete"+"&<?php echo SID?>";
}

function showTree() {
 	document.location.href = "index.php?md=<?php echo $_REQUEST['md']; ?>&action=showtree"+"&<?php echo SID?>";
}

function accountingDetails(ID) {
	document.location.href = "index.php?md=<?php echo $_REQUEST['md']; ?>&action=accounting&aid="+ID+"&<?php echo SID?>";
}

function viewUser(ID) {
	document.location.href = "index.php?md=<?php echo $_REQUEST['md']; ?>&action=view&aid="+ID+"&<?php echo SID?>","AddUser","scrollbars=1, top=100, left=100, width=450, height=500, status=0";
}

function editUser(ID) {
	document.location.href = "index.php?md=<?php echo $_REQUEST['md']; ?>&action=edit&aid="+ID+"&<?php echo SID?>","AddUser","scrollbars=1, top=100, left=100, width=500, height=500, status=0";
}

function changeCommCat(ID) {
    document.location.href = "index.php?md=<?php echo $_REQUEST['md']; ?>&action=changecommcat&aid="+ID+"&<?php echo SID?>","AddUser","scrollbars=1, top=100, left=100, width=500, height=500, status=0";
}

function addUser() {
	//var wnd = window.open("index_popup.php?md=<?php echo $_REQUEST['md']; ?>&action=add"+"&<?php echo SID?>","AddUser","scrollbars=1, top=100, left=100, width=500, height=500, status=0")
	//wnd.focus();
	document.location.href= "index.php?md=<?php echo $_REQUEST['md']; ?>&action=add"+"&<?php echo SID?>";
}

function InviteIntoCampaign(ID) {
  document.location.href = "index.php?md=<?php echo $_REQUEST['md']; ?>&action=invite&aid="+ID+"&";
  //var wnd = window.open("index.php?md=<?php echo $_REQUEST['md']; ?>&action=invite&aid="+ID,"AddUser","scrollbars=1, top=100, left=100, width=400, height=300, status=0")
  //wnd.focus();
}
</script>