
function errPopup(id, display){
  if(display==1){
    $(id).style.width="180px";
    $(id).style.height="";
    $(id).style.overflow="";
  } else {
    $(id).style.width="26px";
    $(id).style.height="20px";
    $(id).style.overflow="hidden";
  }
}

function deleteClient(id){
  var opt = {
      method: 'post',
      postBody: 'function=delete&id='+id,
      onSuccess: function(t) {
        if (t.responseText == 1){
          Element.remove('client_id_'+id);
        } else { alert(t.responseText)}
      },
      onFailure: function(t) {
          alert('Error ' + t.status + ' -- ' + t.statusText);
      }
  }
  new Ajax.Request('account.php', opt);
}

function updateClient(id){
  var opt = {
      method: 'post',
      postBody: 'function=update&id='+id,
      onSuccess: function(t) {
        if (t.responseText == 1){
        } else { alert(t.responseText)}
      },
      onFailure: function(t) {
      //    alert('Error ' + t.status + ' -- ' + t.statusText);
      }
  }
  new Ajax.Request('account.php', opt);
}

function CheckAll(id) {
    var frm = document.getElementById(id);
    len = frm.elements.length;
    for (i=0; i < len; i++) {
        frm.elements[i].checked=document.getElementById("all").checked;
    }
}

function getSelectedCheckboxValue(_62){
  var _63=new Array();
  var _64=getSelectedCheckbox(_62);
  if(_64.length!=0){
    _63.length=_64.length;
    for(var i=0;i<_64.length;i++){
      if(_62[_64[i]]){
        _63[i]=_62[_64[i]].value;
      }else{
        _63[i]=_62.value;
      }
    }
  }
  return _63;
}

function postForm(){
	tinyMCE.triggerSave(true,true);
	new Ajax.Updater('win-body', 'message.php', {asynchronous:true, postBody:'action=send&'+Form.serialize('frm') });
}