
function ToggleSelect(param) {
  var checked = false;
  if (param.value == "Select All") {
    param.form['select_all_1'].value = "Deselect All";
    param.form['select_all_2'].value = "Deselect All";
    checked = true;
  }
  else {
    param.form['select_all_1'].value = "Select All";
    param.form['select_all_2'].value = "Select All";
    checked = false;
  }
  var form_length = param.form.length
  for (i = 0; i < form_length; i++) {
    if (param.form[i].type == 'checkbox') {
      param.form[i].checked = checked;
    }
  }
}

function SetProcessFlag(param, pflag) {
  param.form.pflag.value = pflag;
  param.form.target = '_self';
  param.form.submit();
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


  function toggle(id) {
    if (document.getElementById)
      { var elem = document.getElementById(id); }
    else {
      if (document.all ) { var elem = document.all[ id ]; } else { var elem = new Object(); }
    }
    if (!elem ) { return; }
    if (elem.style ) { elem = elem.style; }
    if (typeof( elem.display ) == 'undefined' && !(window.ScriptEngine && ScriptEngine().indexOf( 'InScript' ) + 1)) {
      window.alert( 'Hidden does not work in this browser, for more information please contact support@idesk.com' );
      return;
    }
    if (elem.display == 'none') {
      elem.display = 'block';
    } else {
      elem.display = 'none';
    }
  }
  
  function exp_(id) {
    if (document.getElementById)
      { var elem = document.getElementById(id); }
    else {
      if (document.all ) { var elem = document.all[ id ]; } else { var elem = new Object(); }
    }
    if (!elem ) { return; }
    if (elem.style ) { elem = elem.style; }
    if (typeof( elem.display ) == 'undefined' && !(window.ScriptEngine && ScriptEngine().indexOf( 'InScript' ) + 1)) {
      window.alert( 'Hidden does not work in this browser, for more information please contact support@idesk.com' );
      return;
    }
    elem.display = 'block';
  }

  function col_(id) {
    if (document.getElementById)
      { var elem = document.getElementById(id); }
    else {
      if (document.all ) { var elem = document.all[ id ]; } else { var elem = new Object(); }
    }
    if (!elem ) { return; }
    if (elem.style ) { elem = elem.style; }
    if (typeof( elem.display ) == 'undefined' && !(window.ScriptEngine && ScriptEngine().indexOf( 'InScript' ) + 1)) {
      window.alert( 'Hidden does not work in this browser, for more information please contact support@idesk.com' );
      return;
    }
    elem.display = 'none';
  }

  function exp_all() {
    exp_('m_category');
    exp_('m_link');
    exp_('m_option');
    exp_('m_subcategory');
	exp_('m_editor');
	exp_('m_invoices');
	exp_('m_templates');
	exp_('m_plugins');
	exp_('m_mails');
	exp_('m_database');
	exp_('m_tools');
	exp_('m_event');
	exp_('m_plug');
	exp_('m_db');
	exp_('m_term');
   
  }

  function col_all() {
    col_('m_category');
    col_('m_link');
    col_('m_option');
    col_('m_subcategory');
	col_('m_editor');
	col_('m_invoices');
	col_('m_plugins');
	col_('m_mails');
	col_('m_database');
	col_('m_tools');
	col_('m_event');
	col_('m_plug');
	col_('m_db');
	col_('m_term');
  }
