Colonial BancGroup ( CNB) on Tuesday said a private investor group agreed to invest $300 million, but the deal remains hung up on variables including the government's approval of an infusion of bailout funds and the group's financing.

Shares were up 18% to $1.06 in recent trading Wednesday, after Colonial announced its deal with Taylor, Bean & Whitaker, a wholesale mortgage lender headquartered in Ocala, Fla. The deal would leave the investor group with control of about 75% of the Colonial's common stock.

The deal came at the deadline at which Colonial was required under a regulatory agreement to increase its tier-1 leverage ratio to 8% and its total risk-based capital ratio to 12%, or face possible seizure by regulators. For the holding company, these ratios were 7.29% and 14.18% as of Dec. 31. For main subsidiary Colonial Bank, the capital ratios were 6.11% and 11.78% as of Dec. 31.

But the capital infusion from the investor group isn't a sure thing, since the money won't be forked over until "receipt by Colonial of satisfactory confirmation and final approval that the U.S. Treasury Department will purchase shares of preferred stock and warrants pursuant to the Capital Purchase Program equal to 3% of Colonial's risk weighed assets."

Based on risk-weighted assets of $18.4 billion as of Dec. 31, this would be a TARP investment of $554 million. So Colonial needs the Treasury and the investor group to come to a quick agreement.

If you liked this article you might like

'Mad Money' Lightning Round: Don't Sell Microsoft

Jim Cramer's 'Mad Money' Recap: Supply, Demand and the Bull

Cramer's 'Mad Money' Recap: A Healthy Correction (Final)

Cramer's 'Mad Money' Recap: A Healthy Correction (Final)

New Bank Failures: Week of Aug. 17

New Bank Failures: Week of Aug. 17

Regulators Shut Down Four Banks, Thrift

Regulators Shut Down Four Banks, Thrift