A Theory for Neural Networks with Time Delays