


function clientBlockBat( batid, lcomments )
{
	var lrealcom = escape( lcomments );
	
	new Ajax.Request(
	    '/MySpace/BlockBat',
	    {
		  method: 'get',
		  parameters: {bat_id:batid, comments:lrealcom},
		  onSuccess: function( xhrresp ) {
			
			  	if( xhrresp.responseText == 'BATCANCELLED' )
			  	{ 	
					personalSpaceLinkFollow( '/MySpace/MyBats' );	
			  	}
			  	else
			  	{
			  		alert( 'Une erreur est survenue ' );
			  	}
			  	
			}
		}
	); 
}

function clientValidateBat( batid, lcomments, is_num )
{
  var lrealcom = escape( lcomments );
  if(is_num == null) is_num = 0;
  
  new Ajax.Request(
      '/MySpace/ValidateBat',
      {
      method: 'get',
      parameters: {bat_id:batid, comments:lrealcom, is_num:is_num},
      onSuccess: function( xhrresp ) {
      
          if( xhrresp.responseText == 'BATVALIDATED' )
          {   
          personalSpaceLinkFollow( '/MySpace/MyBats' ); 
          }
          else if ( xhrresp.responseText == 'IMAGETRANSFERED' )
          {
            alert('L\'image a &eacute;t&eacute; transf&eacute;r&eacute;e dans votre espace membre');
            personalSpaceLinkFollow( '/MySpace/MyBats' ); 
          }
          else 
          {
            alert( 'Une erreur est survenue!' );
          }
          
      }
    }
  ); 
}
/*
function clientValidateBat( batid, lcomments )
{
  var lrealcom = escape( lcomments );
  
  new Ajax.Request(
      '/MySpace/ValidateBat',
      {
      method: 'get',
      parameters: {bat_id:batid, comments:lrealcom},
      onSuccess: function( xhrresp ) {
      
          if( xhrresp.responseText == 'BATVALIDATED' )
          {   
          personalSpaceLinkFollow( '/MySpace/MyBats' ); 
          }
          else
          {
            alert( xhrresp.responseText );
          }
          
      }
    }
  ); 
}
*/
