fixed catalogue dimension issues

moved some js magic from one file to another file - just like patrick.