added cookie to determine direction of slide