Added CSS styles for JS failure on Content Block

Re-sorted & optimized conditional functions,
moved scripts from index to main.js file,
tested across ff, safari, chrome