Your main code should be on the same level as your sub-folders.
In other words index.php(this is your main file) exists with folder js and folder templates and, if you had pictures, folder images.
You call the templates (and I would use the .html on them not .tpl) by naming your main file as index.PHP and then using :
Where you want the header to appear. Same for a footer, if you have one, and same for the js.
Where you want the js:
Does this help?