complete code to determine content selection type