This is how I was thinking of doing it. My only worry with this code is it's long term readability. It took me a minute to figure it out. Maybe just break it up?

```
var depth = file.currentFile.split('/').length,
      prefix = Array(depth).join('../');
targetLink =  prefix + file.targetFile;
```