Getting browser current URL

Does anybody know how to get browser(IE, Netscape) current url?
And how to determine an active browser?

Thanks,

Kostia