I figured out the solution to this problem. I had <script ...> and </script> at start and end of the function file but i needed to close the script tag at the end of the first function, and start it again after for the next function.
Code:
<script type="text/javascript">
function 1(){
//stuff here
}
</script>
<script type="text/javascript">
function 2(){
//stuff here also
}
</script>