added crossbrowser and crossdevice compatibility