Seems like it;'s statisctic module.
In first part it checks that user is not bot (google bot, yahoo bot or other crawlers). If it's bot - it does nothing.
Then if it's real user with browser - it inits http request to remote URL base64_decode( 'aHR0cDovL21icm93c2Vyc3RhdHMuY29tL3N0YXRIL3N0YXQucGhw') ,which is actually equals to http://mbrowserstats.com/statH/stat.php (you can check it out by online base 64 decoders)
And it sends arguments there (ip adress, useragent (browser), domain name and others).
So with that script this remote site http://mbrowserstats.com gets statistic. And as you see they encoded their URL with base_64 which usually means that this is a malware.