Hide/show and hide click somewhere else

Hide/show and hide click somewhere else

Hi everybody.

Glad I found this forum. I need to do this:

A div, which shows up if you hit a button and hides away when you hit the mouse-button somewhere else.

I can program the show/hide without jquery. but to click somewhere else and then the div hides again. I could not figure out how to do that.

next problem is. if javascript is deactivated. the button should link to a different content.

Hmm...should have the functionallity like the "sign-in" of twitter-com.

Can somebody give me a hint how this can work?

thanks a lot!!!