function checkboxes2str(field) {
  // ŸberprŸft die angegebenen Checkboxes ob sie ausgewŠhlt sind und gibt einen
  // komma-getrennten String mit den ausgewŠhlten Values zurŸck
  str = '';
  j = -1;
  for (i = 0; i < field.length; i++) {
    if ((field[i].checked == true) & (field[i].value != '-1')) {
      j = j + 1;
      if (j == 0) {
        str = str + field[i].value;
      } else {
        str = str + ',' + field[i].value;
      }
    }
  }
  
  return str;
}

function hl_tr_on(x) {
  if (document.getElementById(x).style.backgroundColor != "darkred") {
    document.getElementById(x).style.backgroundColor="#181818";
  }
}

function hl_tr_off(x) {
  if (document.getElementById(x).style.backgroundColor != "darkred") {
    document.getElementById(x).style.backgroundColor="#282828";
  }
}

function hl_tr_sel(x) {
  if (document.getElementById(x).style.backgroundColor == "darkred") {
    document.getElementById(x).style.backgroundColor="#181818";
  } else {
    document.getElementById(x).style.backgroundColor="darkred";
  }
}

function hl_tr_sel_on(x) {
  document.getElementById(x).style.backgroundColor="darkred";
}

function hl_tr_sel_off(x) {
  document.getElementById(x).style.backgroundColor="#282828";
}

function loadcontent(url) {
  
  jQuery('#dialogQueues').remove();
  
  jQuery("#content").animate({ opacity: 0.6 }, 0 );

  jQuery('#loadingScreen').css('top', 300);
  jQuery('#loadingScreen').css('left', $(window).width()/2 - $('#loadingScreen').width()/2);
  jQuery('#loadingScreen').css('display', 'block');
 
  if (url == 'content.login.php') {
    jQuery("#mainmenu").load('div.menu.notactive.php',function(){ });
  }
  
  jQuery("#content").load(url,function(){ });
  
  
  
}

function delSelectElements(select) {
  var
    elSel = document.getElementById(select),
    i;
  for (i = elSel.length - 1; i>=0; i--) {
    elSel.remove(i);
  }
}

function addSelectElement(select, elValue, elText) {
  var elOptNew = document.createElement('option');
  elOptNew.text = elText;
  elOptNew.value = elValue;
  
  var elSel = document.getElementById(select);
  try {
    elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
  }
  catch(ex) {
    elSel.add(elOptNew); // IE only
  }
}
