function InAction(action_id){
         JsHttpRequest.query(
         'ajax/backend/back_actions.php', // backend
         {
          'action_id'  : action_id,
          'func'       : 'in'
         },
         // Function is called when an answer arrives. 
         function(result, errors) {
         // Write errors to the debug div.
         //alert(''); 
         //document.write(errors);
         // Write the answer.
            if (result) {
               if (result['result'] == true) {
                  confirm(result['text']);
               }else alert(result['text']);
            }
         },
         false  // do not disable caching
         );         
}
function OutAction(action_id){
         JsHttpRequest.query(
         'ajax/backend/back_actions.php', // backend
         {
          'action_id'  : action_id,
          'func'       : 'out'
         },
         // Function is called when an answer arrives. 
         function(result, errors) {
         // Write errors to the debug div.
         //alert(''); 
         //document.write(errors);
         // Write the answer.
            if (result) {
               if (result['result'] == true) {
                  confirm(result['text']);
               }else alert(result['text']);
            }
         },
         false  // do not disable caching
         );         
}
function AddMember(action_id,user_id,ban){
         JsHttpRequest.query(
         'ajax/backend/back_actions.php', // backend
         {
          'action_id'  : action_id,
          'user_id'    : user_id,
          'func'       : 'add'
         },
         // Function is called when an answer arrives. 
         function(result, errors) {
         // Write errors to the debug div.
         //alert(''); 
         //document.write(errors);
         // Write the answer.
            if (result) {
               if (result['result'] == true) {
                  confirm(result['text']);
               }else alert(result['text']);
            }
         },
         false  // do not disable caching
         );         
}
function DeleteMember(action_id,user_id){
         JsHttpRequest.query(
         'ajax/backend/back_actions.php', // backend
         {
          'action_id'  : action_id,
          'user_id'    : user_id,
          'func'       : 'delete'
         },
         // Function is called when an answer arrives. 
         function(result, errors) {
         // Write errors to the debug div.
         //alert(''); 
         //document.write(errors);
         // Write the answer.
            if (result) {
               if (result['result'] == true) {
                  confirm(result['text']);
               }else alert(result['text']);
            }
         },
         false  // do not disable caching
         );         
}
function GetMembers(action_id,container){

         JsHttpRequest.query(
         'ajax/backend/back_actions.php', // backend
         {
          'action_id'  : action_id,
          'func'       : 'members'
         },
         // Function is called when an answer arrives. 
         function(result, errors) {
         // Write errors to the debug div.
         //alert(''); 
         //document.write(errors);
         // Write the answer.
            if (result) {
               if (result['result'] == true) {
                  container.innerHTML = result['text'];
               }else {
                     alert(result['text']);
                     css(container, {display:'none'});
               }
            }
         },
         false  // do not disable caching
         );          
}
ac_timer = null;
ac_x_open = ac_y_open = 0;
function ShowMembers(action_id,a,show,first)
{        
         var cont = document.getElementById('ac_members');

         if (show)
         {
            if (first){ 
               cont.innerHTML = l_load+'...';
               GetMembers(action_id,cont);         
               var box = getBounds(a);
               ac_x_open = box.left + box.width + 5;
               ac_y_open = box.top - 0;
            }
            
            clearTimeout(ac_timer);
            css(cont, {'top': ac_y_open+'px', 'left': ac_x_open+'px', 'display':'block'});                     
         }else {
               ac_timer = setTimeout("HideMembers()", 500);
             //css(cont, {'display':'none'});   
         }    
}
function HideMembers()
{
         if (typeof ac_timer == 'undefined') return;
         clearTimeout(ac_timer);
         var cont = document.getElementById('ac_members');
         css(cont, {'display':'none'});  
}


