Thanks for the reply Jasper.
When I connected all of the white wires and the blue wire together and the black wires and the red wires toghether, the light went on, however, when I shut off the switch, the breaker tripped. When I tried the various other combinations, the light would go on, but the switch would'nt work. The switch in the wall has a red and a blue wire tied to it.