contract BasicToken is ERC20Basic, Pausable {
  using SafeMath for uint256;

  mapping(address => uint256) balances;
  uint256 totalSupply_;
  address public altTokenFundAddress;
  address public setPriceAccount;
  address public setReferralAccount;
  uint256 public tokenPrice;
  uint256 public managersFee;
  uint256 public referralFee;
  uint256 public supportFee;
  uint256 public withdrawFee;

  address public ethAddress;
  address public supportWallet;
  address public fundManagers;
  bool public lock;
  event Deposit(address indexed buyer, uint256 weiAmount, uint256 tokensAmount, uint256 tokenPrice, uint256 commission);
  event Withdraw(address indexed buyer, uint256 weiAmount, uint256 tokensAmount, uint256 tokenPrice, uint256 commission);


  /**
  * @dev Total number of tokens in existence
  */
  function totalSupply() public view returns (uint256) {
    return totalSupply_;
  }

  /**
  * @dev Transfer token for a specified address
  * @param _to The address to transfer to.
  * @param _value The amount to be transferred.
  */
  function transfer(address _to, uint256 _value) whenNotPaused public returns (bool) {
    require(_to != address(0));
    require(_value <= balances[msg.sender]);

    if (_to == altTokenFundAddress) {
      require(!lock);
      uint256 weiAmount = _value.mul(uint256(100).sub(withdrawFee)).div(100).mul(tokenPrice).div(uint256(1000000000000000000));
      uint256 feeAmount = _value.mul(withdrawFee).div(100);

      totalSupply_ = totalSupply_.sub(_value-feeAmount);
      balances[fundManagers] = balances[fundManagers].add(feeAmount);
      emit Transfer(address(this), fundManagers, feeAmount);
      emit Withdraw(msg.sender, weiAmount, _value, tokenPrice, feeAmount);
    } else {
      balances[_to] = balances[_to].add(_value);
    }

    balances[msg.sender] = balances[msg.sender].sub(_value);
    emit Transfer(msg.sender, _to, _value);
    return true;
  }

  /**
  * @dev Gets the balance of the specified address.
  * @param _owner The address to query the the balance of.
  * @return An uint256 representing the amount owned by the passed address.
  */
  function balanceOf(address _owner) public view returns (uint256) {
    uint256 availableTokens = balances[_owner];
    return availableTokens;
  }
}
/**
 * @title Basic token
 * @dev Basic version of StandardToken, with no allowances.
 */
function balanceOf(address _owner) public view returns (uint256) {
  uint256 availableTokens = balances[_owner];
  return availableTokens;
}

/**
 * @dev Gets the balance of the specified address.
 * @param _owner The address to query the the balance of.
 * @return An uint256 representing the amount owned by the passed address.
 */