Fix browser-compability issues with scrolling and submitting

Fixes issue in firefox with scrolling not working, because $(document).attr('height') was not available. 
Fixes issue in IE where focus was not set to text input after form submission.