
<script type="text/javascript">
function addTransaction() {
//	var wnd = window.open("index_popup.php?md=<?php echo $_REQUEST['md']; ?>&action=create&type=all","Transaction","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=create&type=all"+"&<?php echo SID?>";
}

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

function createRefundTransaction(ID) {
  document.location.href = "index.php?md=<?php echo $_REQUEST['md']; ?>&loaddata=1&tm_transtype=<?php echo TRANSTYPE_REFUND?>&action=createrefundchargeback&tid="+ID+"&<?php echo SID?>";
//  var wnd = window.open("index_popup.php?md=<?php echo $_REQUEST['md']; ?>&action=createrefund&tid="+ID,"Refund transaction","scrollbars=1, top=100, left=100, width=300, height=200, status=0");
//  wnd.focus();
}

function createChargebackTransaction(ID) {
  document.location.href = "index.php?md=<?php echo $_REQUEST['md']; ?>&loaddata=1&tm_transtype=<?php echo TRANSTYPE_CHARGEBACK?>&action=createrefundchargeback&tid="+ID+"&<?php echo SID?>";
//  var wnd = window.open("index_popup.php?md=<?php echo $_REQUEST['md']; ?>&action=createchargeback&tid="+ID,"Refund transaction","scrollbars=1, top=100, left=100, width=300, height=200, status=0");
//  wnd.focus();
}

function ChangeState(ID, action) {
  if(action == "suppress") {
    if(confirm("<?php echo L_G_CONFIRMSUPPRESSTRANS?>"))
     	document.location.href = "index.php?md=<?php echo $_REQUEST['md']; ?>&type=all&tid="+ID+"&action="+action+"&<?php echo SID?>";
  }
  else if(action == "approve") {
    if(confirm("<?php echo L_G_CONFIRMAPPROVETRANS?>"))
      document.location.href = "index.php?md=<?php echo $_REQUEST['md']; ?>&type=all&tid="+ID+"&action="+action+"&<?php echo SID?>";
  }else if(action == "pending") {
    if(confirm("<?php echo L_G_CONFIRMPENDINGTRANS?>"))
      document.location.href = "index.php?md=<?php echo $_REQUEST['md']; ?>&type=all&tid="+ID+"&action="+action+"&<?php echo SID?>";
  }
}

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

function ViewIPInfo(IP) {
	var wnd = window.open("index_popup.php?md=<?php echo $_REQUEST['md']; ?>&action=ipinfo&ip="+IP, "<?php echo L_G_IPDETAILS?>" ,"scrollbars=1, top=100, left=100, width=320, height=220, resizable=1, status=0")
    wnd.focus();
}

function massDeleteTransaction() {
    if(confirm("<?php echo L_G_CONFIRMMASSDELETETRANSACTION?>")) {
        document.getElementById('massaction').value='delete'
        document.getElementById('ListForm').submit();
    }
}
</script>
