externalising js for IE and some tweaks