confusing function names !

confusing function names !

when  this line is declared

  1.  loaded = inview.trigger("unveil");
  2.   $.fn.unveil = function(threshold, callback)

is the above line creating a function called unveil ???

if it is than inside that function there is another function

  1.     function unveil()// line 31

is it legal to delare a function with the same name inside another function ?? or is it a common programming practice ??

The full pluggin code is here : Unveil.js