Phone mask with jquery
===

I have a problem masking an input with jquery, this input contains a phone number.

The number can be: (XX)XXXX-XXXX or (XX)XXXXX-XXXX

There is any way to mask it accepting both cases?

Thanks for advance.