fixed uploader for IE8, javascript code refactoring