fetch BLAST results via AJAX on the onsubmit event and not onclick

`onsubmit` is triggered whenever the form is about to be submitted, regardless
of the input mode.  `onclick`, on the other hand, won't be triggered if the
form submission was triggered by pressing `Enter` key.

The rationale for this change is not only pragmatic, but also a bug that caused
the placeholder text for advanced parameters to be submitted on some old
browsers that don't support placeholders natively.  On such browsers,
SequenceServer mocks a placeholder by setting `value` attribute of the input
(text) box to the desired text, and removing it just before submitting the form
(if not already removed when filling the form).  However, fetching BLAST
results on `onclick` caused the form to be submitted before SequenceServer
could remove the mock placeholder text.

Thanks to Jonna Katharina Kulmuni, and Fourmidable for helping discover and
squash this issue.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
reimplement sequence polling functionality as a simple jQuery plugin

Polling the sequence input box for a change was previously tightly coupled with
`SS.blast.signal_sequence_type_changed`, causing the code to look messy and
difficult to understand.  A single method was doing too much -- code smell.
Factoring out the polling logic into a separate utility method simplifies
things a lot.

`$.fn.poll` uses the same logic as before for polling (recursively call itself
after a 100 ms), but the code has been reordered so it is easier to understand.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
pass sequence type as a parameter to the sequence_type_changed event handler

Previously, a global state (`sequence_type`) on the sequence input box was used
(through jQuery's `data` method) to store sequence type of the input sequence.
The same global state was used by the `sequence_type_changed` event handler to
determine the new/changed input sequence type.  Globals should be avoided.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
guess sequence type on the client side

This should offer visible performance improvements in most SequenceServer
setup.  First, this avoids the repeated network overhead in determining
sequence type.  Second, JS is faster than Ruby.  Third, the implementation
should be more performant than its server side counterpart.

Client computers are reasonably well powered nowadays.  It is well justified to
offload as much processing as possible to the client side :).

`post '/' do ... end` code block is also simplified as a result, since there is
only one AJAX request (for BLASTing) that it has to handle now.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
pick AJAX URL and location.hash from the action attribute of the search form

Using empty string in `jQuery.post` can cause few browsers to misbehave.  For
example, the following exception was thrown by an old version of Firefox:

    "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE)
    [nsIXMLHttpRequest.open]"  nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"

Thanks to Jonna Katharina Kulmuni for reporting this.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
use full viewport height for the body element in the search form

Otherwise `body` stretches only enough to enclose the container div within,
leaving an ugly white patch at the bottom if the container div happens to be
smaller than viewport height.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>