do you mind using jQuery?
then you can use jQuery.browser (see documnentation)
But the jQuery-guys recommend not to use this.
We recommend against using this
property, please try to use feature
detection instead (see jQuery.support)
Edit:
For Mootools: use window.opera (see documentation)