Way back when i saw a cartoon movie of three boys who somehow manage to travel back in time to the era of swashbuckling pirates and soon befriend them and a female pirate captain on the island of tortuga. Not 100% on the plot but i believe the time travelling relic may be a book.
The Pirates of Tortuga: Under the black flag (2001)
Yep thats it.
Thanks Miss Sparkles!