Changed browser detection logic. jQuery plugin is used. #797