You'll need to be more specific about what information you are seeking -- your post has some pretty vague questions.
1) Is Javascript safe/secure?
This depends entirely on the context. Given that it currently runs on about a billion machines, It seems safe enough to me. It's used by all the big guys. What, exactly do you have in mind?
2. How do I prevent robots from accessing includes/functions folders on my web server?
.
What do you mean by prevent robots from accessing includes/functions folders? You could add them to robots.txt according to the robots exclusion standard and the well-behaved ones would stay out.
Hackers are something else. Security in this case would depend on many things. PHP scripts should authenticate a user before doing anything sensitive or dangerous for them. Your web server can also provide some security such as HTTP authentication or Apache offers Deny/Allow directives to exclude visitors based on all sorts of criteria.
3. How can I have some type of secure timer on a webpage?
What do you mean by 'secure' timer? Any timer that runs on the client side is completely under the control of the client and there's nothing your server can do about it. Your server code needs to be constructed assuming all kinds of cheating from a visitor.