This document proposes a flexible channel allocation algorithm for cooperative cognitive radio networks using secondary user detection. It introduces Flexible Channel Cooperation (FLEC) which allows secondary users to optimize their use of resources including channels and time slots from primary users. The document develops efficient resource allocation algorithms for FLEC, including a distributed bargaining algorithm and centralized heuristic algorithm. It evaluates the performance of FLEC and shows it provides throughput improvements of 20-60% over conventional identical channel cooperation. A centralized heuristic algorithm achieves near-optimal performance with only 5% loss compared to the optimal centralized algorithm, providing a good tradeoff between performance and complexity.