Create getrelationships.js

This code can easily be run using jsfiddle.net.