$(document).ready(function() { // Observe the document being ready
    // Observe click of pulltab link and slide up/down login box
	$(".pulltab").click(function () { $("#login").slideToggle("fast"); });

    // Validate forms
    $("input[type=submit], input[type=image]").click(function (evt) { 
        if (evt.currentTarget.name !== "cancel") {
            $(this.form).validate({ // Add password confirmation rule
                rules : { 
                    password2 : { equalTo : "#password" },
                    routingno : { minlength : 9 }
                },
                messages : { password2 : { equalTo : "Passwords must match" } } 
            }); 
        }
    });

    // Find print links, display them, and print the window on click
    $("a.printLink").show().click(function (evt) { 
        evt.preventDefault();
        window.print();
    });

    // Apply lightbox effect to links with rel=lightbox
    $("a[rel=lightbox]").lightBox();
});
