Functions are like programs you can insert inside of your script (Like every time you click like on facebook and it adds a thumbs up).
To code a function, type "function" followed by what you want to name the function, and then type () (which are where you insert parameters) and then {} (this is where you will put all your javascript code)
function funk (){}
Type the code that you want to happen inside the curly brackets. So every
time this function happens, that code is called upon.
"calling" a function basically means "using" a function.
To call a function on a button click, make the input tag inside of form tags and then give the input attributes of "type" = "button" and "onclick" = the name of the function.
Parameters on functions are used to pass information through to the function, so that you may use it over and over with different data. When you call the function, you will put the data or variable you want to pass through to the function inside the parenthesis. The function will then take that data and run it through in the place that you have set it. If you want to pass more than one, just put commas in between them.