refactored ColorBox script