 All variables will be declared at the top of each function with the entire script wrapped in an anonymous function to ensure that it doesn't clash with any other scripts that might get added to the same page. Whichever resource that you use to start with may not show all the JavaScript that way to start with but it should have covered how to code that way by the time you get to the point where you are able to write useful scripts to use on live web pages. Felgall, do you have a page on your site that gives a demo of all those bits together? 