Java script custom function how to call : I have written some custom function for image slider but it not get called 

following is my code.

    carousel: {
      init: function() {
          // main function to run
      }
      previous: function() {
         // function to run when they want to go back
      },
      next: function() {
        // function to run when they want to go forward
      }
    }

and i am calling it like `onclick=javascript:previous()`
but it display error in console function not defined

can somebody help me
