Brilliant.
I have put the code in the headers and footer section. I have also installed the FB chat plugin. You don’t need the plugin to make the chat work. The code below (alone) will still enable Facebook chat.
I think if you look at the above code then tweak with CSS and disable the Facebook chat then you may be able to sort my above issue?