javascript to ray script