// submitToURL.js
// --------------
// Exports a function that submits a form to a particular url.
//
// Functions in this file:
//   submitToURL(form, url, query)
//
// MODIFY WITH CARE - THIS FILE MIGHT BE LINKED TO BY MANY PROJECTS
//
// Created by zaz@sri.com.
// Last modified by zaz@sri.com, 9/11/01.

// submitToURL
// -----------
// This function submits a form to the url passed in.  Oddly enough, 
// the name/value of the first submit button on the form is in the 
// resulting page, just as if someone had clicked it, which can cause
// problems if you're not careful.
//
// form: the input form to be submitted
// url: the url the form is to be submitted to
// query: the query to be attached to the url (optional)

function submitToURL(form, url, query)
{
  if (query != null && query != "null") url += "?" + query;
  document[form].action = url;
  document[form].submit();
}