added the loading.gif and debugging firefox compatibility