Creating Script of Functions in JavaScript