Should I write a plugin or just use a function?
<p>I'm building a website that uses jQuery for things like Modals and form validation. I find myself able to write the code fairly easily, but it's not very modular and I find myself re-writing a lot of the code. I have a CS background, but I'm very new to jQuery. I understand that jQuery has Object-Oriented capabilities, but I haven't quite gotten a grasp on how that is done in jQuery, so my code looks incredibly procedural, and I'd like to be able to modularize it better. </p>

<p>Take something like this for example:</p>

<pre><code>$("#show").click( function() {
    $("#view").fadeIn(500);
    return false;
});
$("#view .popup-close a").click( function() {
    $("#view").fadeOut(500);
    return false;
});
</code></pre>

<p>I have a list of similar declarations everywhere I have Modals. How would I write this statement in a more modular way?</p>
