create more custom functions

Hi, lads…

I found a great tutorial about creating geolocation driving directions :

the thing is: I’m working in a e-commerce site, where the products for sale are available in different stores, so I need to use this functionality to display different maps, one for each store, so the people can enter their directions and and get their driving directions to each specific store… but the tutorial just teaches how to use it to get to one single adress

I made the script work perfect, but just for one direction… how can I make it function to allow many and different arrive adresses?

how can I duplicate or repeat the custom functions created with the tutorial?

Please, help, I really appreciate it… any idea will be great!