//----------------------------------------------
// Javascript functions for admin area
// Maian Events v2.0+
//----------------------------------------------

// Displays message
function message(txt) {
  alert(txt);
}

// Toggle divs..
function toggle_box(id) {
  var e = document.getElementById(id);
  if(e.style.display == 'none')
  e.style.display = 'block';
  else
  e.style.display = 'none';
}

// Delete confirm alert box..
function delete_confirm(txt) {
  var txt;
  var confirmSub = confirm(txt);
  if (confirmSub) { 
    return true;
  } else { 
    return false; 
  }
}

// Check/uncheck array of checkboxes..
function selectAll() {
  for (var i=0;i<document.MyForm.elements.length;i++) {
    var e = document.MyForm.elements[i];
    if ((e.name != 'log') && (e.type=='checkbox') && (e.name != 'approve') && (e.name != 'reject') && (e.name != 'mail')) {
      e.checked = document.MyForm.log.checked;
    }
  }
}

// Prevents both approve and reject checkboxes from being checked at one time..
function processBoxes()
{
  if (document.MyForm.approve.checked && document.MyForm.reject.checked) {
    document.MyForm.reject.checked=false;
  }
}
