I have the following code:
(function ($) {
/**
* Opens a new modal window
* @param object options an object with any of the following options
* @return object the jQuery object of the new window
*/
$.modal = function (options) {
var settings = $.extend({}, $.modal.defaults, options),
root = getModalDiv(),
Can someone explain why the function is given to the object $.modal and not just modal? Also what's the significance of the first line: