Added overlayclose, fixes and Tidy up

Added overlayclose option. Default is true but if set to false it will only close on X
Declared missing variables (many were implicitly declared)
Changed  var options = $.extend(defaults, options); to  var option = $.extend(defaults, options); and all variables accordingly.
because it is a dublicate declaration.
Made the javascript better  formed by fixing minor warning errors IDE displays. It is now has no errors at all!