Change Helper.js to use relative path to itself when loading scripts.
diff --git a/.DS_Store b/.DS_Store
index b799adc..e6cf14d 100644
--- a/.DS_Store
+++ b/.DS_Store
Binary files differ
diff --git a/js/.DS_Store b/js/.DS_Store
index df19300..3aa25a9 100644
--- a/js/.DS_Store
+++ b/js/.DS_Store
Binary files differ
diff --git a/js/Helper.js b/js/Helper.js
index 52faac9..3a5b3e3 100644
--- a/js/Helper.js
+++ b/js/Helper.js
@@ -1,59 +1,72 @@
// Including js files to be used in the web pages
// Add your js source code reference here, rather than in the HTML files
-document.write('<script type="text/javascript" src="../NDN.js"></script>');
+// Find path to Helper.js
+var scripts = document.getElementsByTagName('SCRIPT');
+var path = '';
-document.write('<script type="text/javascript" src="../WebSocketTransport.js"></script>');
+if(scripts && scripts.length>0) {
+ for(var i in scripts) {
+ if(scripts[i].src && scripts[i].src.match(/Helper\.js$/)) {
+ path = scripts[i].src.replace(/(.*)Helper\.js$/, '$1');
+ }
+ }
+}
+console.log(path);
-document.write('<script type="text/javascript" src="../util/CCNProtocolDTags.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'NDN.js"></script>');
+
+document.write('<script type="text/javascript" src="' + path + 'WebSocketTransport.js"></script>');
+
+document.write('<script type="text/javascript" src="' + path + 'util/CCNProtocolDTags.js"></script>');
-document.write('<script type="text/javascript" src="../util/CCNTime.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'util/CCNTime.js"></script>');
-document.write('<script type="text/javascript" src="../Name.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'Name.js"></script>');
-document.write('<script type="text/javascript" src="../ContentObject.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'ContentObject.js"></script>');
-document.write('<script type="text/javascript" src="../encoding/DateFormat.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'encoding/DateFormat.js"></script>');
-document.write('<script type="text/javascript" src="../Interest.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'Interest.js"></script>');
-document.write('<script type="text/javascript" src="../Key.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'Key.js"></script>');
-document.write('<script type="text/javascript" src="../PublisherID.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'PublisherID.js"></script>');
-document.write('<script type="text/javascript" src="../PublisherPublicKeyDigest.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'PublisherPublicKeyDigest.js"></script>');
-document.write('<script type="text/javascript" src="../FaceInstance.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'FaceInstance.js"></script>');
-document.write('<script type="text/javascript" src="../ForwardingEntry.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'ForwardingEntry.js"></script>');
-document.write('<script type="text/javascript" src="../Closure.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'Closure.js"></script>');
-document.write('<script type="text/javascript" src="../encoding/BinaryXMLEncoder.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'encoding/BinaryXMLEncoder.js"></script>');
-document.write('<script type="text/javascript" src="../encoding/BinaryXMLDecoder.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'encoding/BinaryXMLDecoder.js"></script>');
-document.write('<script type="text/javascript" src="../encoding/BinaryXMLStructureDecoder.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'encoding/BinaryXMLStructureDecoder.js"></script>');
-document.write('<script type="text/javascript" src="../encoding/DataUtils.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'encoding/DataUtils.js"></script>');
-document.write('<script type="text/javascript" src="../encoding/EncodingUtils.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'encoding/EncodingUtils.js"></script>');
-document.write('<script type="text/javascript" src="../security/KeyManager.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'security/KeyManager.js"></script>');
-document.write('<script type="text/javascript" src="../securityLib/jsbn.js"></script>');
-document.write('<script type="text/javascript" src="../securityLib/jsbn2.js"></script>');
-document.write('<script type="text/javascript" src="../securityLib/rsa.js"></script>');
-document.write('<script type="text/javascript" src="../securityLib/rsa2.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'securityLib/jsbn.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'securityLib/jsbn2.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'securityLib/rsa.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'securityLib/rsa2.js"></script>');
-document.write('<script type="text/javascript" src="../securityLib/sha1.js"></script>');
-document.write('<script type="text/javascript" src="../securityLib/sha256.js"></script>');
-document.write('<script type="text/javascript" src="../securityLib/sha512.js"></script>');
-document.write('<script type="text/javascript" src="../securityLib/md5.js"></script>');
-document.write('<script type="text/javascript" src="../securityLib/ripemd160.js"></script>');
-document.write('<script type="text/javascript" src="../securityLib/base64.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'securityLib/sha1.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'securityLib/sha256.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'securityLib/sha512.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'securityLib/md5.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'securityLib/ripemd160.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'securityLib/base64.js"></script>');
-document.write('<script type="text/javascript" src="../securityLib/rsapem-1.1.js"></script>');
-document.write('<script type="text/javascript" src="../securityLib/rsasign-1.2.js"></script>');
-document.write('<script type="text/javascript" src="../securityLib/asn1hex-1.1.js"></script>');
-document.write('<script type="text/javascript" src="../securityLib/x509-1.1.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'securityLib/rsapem-1.1.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'securityLib/rsasign-1.2.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'securityLib/asn1hex-1.1.js"></script>');
+document.write('<script type="text/javascript" src="' + path + 'securityLib/x509-1.1.js"></script>');