For the foreign readers:
My approach to solving the problem is more robust, better developed and better coded.
Then I suggest you do not follow the original reference.
Translate this page with Google Translator, from Portuguese to English, because I found that the translation is good for this language.
Look then to read in English ... or at least translate, in a second instance, from English into your language.
And then follow the beginning of the first post of the topic.
Regards,
boladegude