Confused by all the crazy ups and downs of Washington over the government shutdown and debt ceiling? Here's a five-minute primer on what's happening.

What’s going on right now?

We think we're close to the end of the showdown that has paralyzed Washington and threatened economic disaster for two weeks. Democrats and Republicans in the Senate appear to be on the cusp of a deal to reopen the government and to avoid breaching a Thursday deadline to raise the federal debt ceiling. (The debt ceiling is scary and gets its own primer here.)

When will they reach the deal?

Probably on Tuesday. Senate Republicans will discuss the matter at 11 a.m.

What will the deal involve?

Details are still up in the air, but it's likely to have a three main elements:

-- Reopen the government and fund it through Jan. 15, 2014.
-- Raise the debt limit through Feb. 7, 2014.
-- Set up a negotiating committee to try to come up with a longer-term budget plan so we don't go through this again early next year. The committee would be expected to issue budget recommendations by Dec. 13. Should it fail, agencies would have more flexibility to implement the deep cuts to domestic and Pentagon spending, known as sequestration, that took effect earlier this year.

Then there would likely be minor side elements dealing with Obamacare:

-- Require additional measures, favored by Republicans, to ensure that people who receive financial help in buying health insurance under Obamacare are being honest about their income.
-- Potentially some Obamacare change or other concession that is favored by Democrats

A one big sticking point is how much flexibility the government would have around the Feb. 7 debt ceiling deadline. Usually, the administration can launch special measures that can buy a few weeks or even months to prolong its ability to borrow, something Democrats want to preserve. Republicans want to set a fixed Feb. 7 date.

When would the government open and the crisis be over?

As soon as Congress passes the deal and President Obama signs it.

When will the deal pass the Senate?

As soon as Tuesday if all senators agree. If a single senator refuses to allow an immediate vote on the measure (looking at you, Ted Cruz), it could take several days.

Will the deal pass the House?

Hard to say. If House Speaker John A. Boehner (R-Ohio) allows a quick vote, it could happen anytime, likely with the support of most Democrats and a substantial number of Republicans. If House Republicans delay or seek to amend the Senate bill, it could take longer. They're going to meet at 9 a.m. to discuss their next moves.

That sounds pretty wishy-washy to me.

Welcome to Washington!

Okay, more seriously, how long do lawmakers have to get the deal done?

Not long at all. Thursday is the day when the government no longer can borrow any money and basically will be running on fumes. That's the day we hit the debt ceiling deadline.

After the debt ceiling deadline is breached, there might be a couple of days, or even a week, of breathing room, as the Treasury Department uses up whatever's left in the federal piggy bank.

But soon enough, there won't be enough money to make all payments, and the Treasury  might have to delay or suspend Social Security checks, food stamps and tens of billions of dollars in payments.

Treasury would have only daily tax receipts to pay for the government, which amount to only 70 cents for every dollar of federal spending over the next month. And that could cause financial market chaos and a recession.

So precisely when does Congress have to act to make sure all those bad things don't happen?

The sooner the better, but we don't have an absolute fixed date. Federal finances tend to be unpredictable. Markets could freak out at any time, though we can't say with certainty when that will happen. (And if we could, we would be very rich investors.)

Assuming this deal makes it through, who's won and who's lost?

(Photo by Mark Wilson/Getty Images)

He can be giddy. But just a little. (Photo by Mark Wilson/Getty Images)

What a simplistic way of thinking about things! But since you asked, it seems pretty clear in this round of the budget wars, President Obama and the Democrats will have outmaneuvered their Republican opponents.

House Republicans decided to shut down the government in hopes of major changes to Obamacare. None is in the offing.

Senate Republicans reluctantly went along with that strategy -- at least for a while. In the meantime, the GOP brand was badly beaten up in the polls.

Prognosticators now guess that Republicans could have a very hard time winning the Senate in 2014 -- even though the electoral map is stacked against the Democrats. But the House still looks safe for the GOP.

Meanwhile, Obama and Democrats basically stayed firm to their view that they would not pay a "ransom" in order to accomplish the basic tasks of keeping the government open and raising the debt limit.

Hold up one second. Hasn't Obama been forced to compromise to raise the debt ceiling and open the government?

Not really. Obama is giving the flimsiest of fig leaves to the Republicans -- a promise to do a better job ensuring that people who report their income to get help buying health insurance under Obamacare are actually reporting their income properly. And he might get something in exchange, a delay in a tax that labor unions hated!

So the best way to look at that exchange is a side deal that greased the more important agreement to open up the government and raise the debt ceiling.

So is it all wonderful for Obama and Democrats?

Nope. The truth is that for all the drama, they're getting little out of this deal. They don't roll back the deep spending cuts known as sequester -- a policy that is eating away at domestic priorities like education and research and development. They don't get new money to spend on jobs or an immigration bill.

They just get a political win. And they avoid an economic disaster.

Once this crisis is over, what happens next?

Well, per the outlines of the agreement, both Republicans and Democrats would assign lawmakers to a committee to hash out a broader budget plan for the coming year. These joint efforts have not had success in the past, and we've gone years without a formal budget.

But hope dies hard. For Democrats and Republicans alike, the basic question in the committee will be whether they find a way to roll back the sequester, which is due to launch a new round of budget cuts in January.

Democrats hate the sequester, because it's basically the opposite of the vision of domestic investment they've long campaigned on. Republicans are more ambivalent, but there are many in the GOP who don't like how deeply it cuts Pentagon spending.

The most likely path to replacing part of the sequester is to make cuts to mandatory spending -- like health care programs or farm subsidies -- instead. On a practical level, Republicans and Democrats agree that mandatory spending is better to cut since it's the long-term driver of our debt. But mandatory spending has pretty entrenched constituencies -- such as the elderly or farmers -- which makes such cuts difficult to achieve.

A bigger budget deal -- the elusive "grand bargain" -- could also be considered as part of the conference. But any discussion of significant changes to mandatory spending usually leads Democrats to insist on new taxes, which has been a deal-breaker for the GOP.

What happens if the committee fails to come to an agreement and we're back in January with new deadlines?

Most likely, neither side will want a new fight over government funding or the debt ceiling with the mid-term elections fast approaching. So they'll just extend everything once again, leaving (albeit more flexible) sequester cuts in place, and the voters will decide what they want come November.

Like that's worked well in the past.

Fair point.