Moved document ready functions to ends of files for jslint compliance (avoid undeclared errors).
Added global declaration for jslint compliance.
jslint style fixes: added global declarations and reordered functions so that declarations precede calls.