Fixing IE script execution order by using 'document.write'. Lame.