Next time, when you are asking for help, please give us a description of what exactly you are having a problem with. Try to make a descriptive title.
Anyways, it looks like in your code, your function is not closed.
This function doesn’t have a closing braces }. If you look at all the braces one by one, they all go to an if, else if or else statement. All you need to do is add a closing curly braces } at the end like so: