Near-optimal Control of Switched Systems with Continuous-time Dynamics using Approximate Dynamic Programming