In the wake of the $15 billion buyout offer for Harrah's (NYSE:HET), investors are rushing into gambling stocks. That cheer, however, is not spreading to online gambling software providers such as Optimal Group (NASDAQ:OPMR), CryptoLogic (NASDAQ:CRYP), and GigaMedia (NASDAQ:GIGM). But despite the bad news regarding legislation for online gaming, there may be opportunities for investors.

Actually, the bad news should not be a surprise. After all, take a look at the 10-K filing of Optimal, which mentions the "conflicting efforts to clarify the status of Internet gaming" in the U.S. It goes on to mention that imposition of laws against online gaming would mean a "significant negative impact" on the business.

Well, yesterday the stock price of Optimal plunged $2.95 to $8.81 (the 52-week high is $22.42). You see, over the weekend Congress passed the Unlawful Internet Gambling Enforcement Act of 2006. It is all but inevitable that President Bush will sign the Act into law.

Basically, the bill makes it illegal for a firm to accept funds connected with online gambling in the U.S. In other words, it is the worst-case scenario for the online gaming sector. Then again, when there is "blood in the streets," there may be investment opportunities.

Take a look at CryptoLogic, which is a recommendation of Motley Fool Hidden Gems. The company develops gaming software for virtual casinos and poker houses, and derives about 30% of its revenues from U.S. sources. Now, of course, this revenue is in extreme jeopardy.

How bad is this? OK, let's suppose CryptoLogic's revenues in the U.S. go to zero. The company will likely still have about $100 million in revenues on a go-forward basis. Also, because of high margins, the net profits are still likely to be substantial. Assuming a 25% net profit margin, the business could generate $25 million in net income.

Next, compare this to the firm's enterprise value -- the market cap minus the money in the bank ($126 million) plus any debt (none, in this case) -- which amounts to roughly $118 million. Using the $25 million net income figure, CryptoLogic would be selling at four times its enterprise value. Moreover, despite the big setback, management believes it can continue to grow its business at a 20% annual rate.

No doubt, there is still a lot of risk here. Yet the worst-case scenario is now getting baked into the stock. In other words, for those investors who have a high tolerance for risk and like taking fliers on small stocks, wouldn't this be the time to consider a purchase?

For more Foolishness:

Discover sleepy but sparkling small-cap stock ideas when you dig into a free 30-day trial of Motley Fool Hidden Gems.

Fool contributor Tom Taulli does not own shares mentioned in this article.