Teletovic scores 34 and Nets beat Mavs 107-106