<!--
/*--------------------------------------------*/
/* Supporting "Constants"                     */
/*--------------------------------------------*/
states = new Array();

states["AL"] = "Alabama";
states["AK"] = "Alaska";
states["AZ"] = "Arizona";
states["AR"] = "Arkansas";
states["CA"] = "California";
states["CO"] = "Colorado";
states["CT"] = "Connecticut";
states["DE"] = "Delaware";
states["DC"] = "District of Columbia";
states["FL"] = "Florida";
states["GA"] = "Georgia";
states["HI"] = "Hawaii";
states["ID"] = "Idaho";
states["IL"] = "Illinois";
states["IN"] = "Indiana";
states["IA"] = "Iowa";
states["KS"] = "Kansas";
states["KY"] = "Kentucky";
states["LA"] = "Louisiana";
states["ME"] = "Maine";
states["MD"] = "Maryland";
states["MA"] = "Massachusetts";
states["MI"] = "Michigan";
states["MN"] = "Minnesota";
states["MS"] = "Mississippi";
states["MO"] = "Missouri";
states["MT"] = "Montana";
states["NE"] = "Nebraska";
states["NV"] = "Nevada";
states["NH"] = "New Hampshire";
states["NJ"] = "New Jersey";
states["NM"] = "New Mexico";
states["NY"] = "New York";
states["NC"] = "North Carolina";
states["ND"] = "North Dakota";
states["OH"] = "Ohio";
states["OK"] = "Oklahoma";
states["OR"] = "Oregon";
states["PA"] = "Pennsylvania";
states["RI"] = "Rhode Island";
states["SC"] = "South Carolina";
states["SD"] = "South Dakota";
states["TN"] = "Tennessee";
states["TX"] = "Texas";
states["UT"] = "Utah";
states["VT"] = "Vermont";
states["VA"] = "Virginia";
states["WA"] = "Washington";
states["WV"] = "West Virginia";
states["WI"] = "Wisconsin";
states["WY"] = "Wyoming";

/*--------------------------------------------*/

function writeUSStateOptions(s) {
        if(s=="none"){
                document.write("<option value=\"\">Select a State</option>\n");
        } // if

        for(state_code in states) {
                document.write("<option value=\""+state_code+"\" ");
                if(state_code==s){
                        document.write("SELECTED");
                } // if
                document.write(">"+states[state_code]+"</option>\n");
        } // for
} // function..writeUSStateOptions

/*--------------------------------------------*/

function convertUSStateCode(s) {
        /* put error checking in here someday...*/
        return states[s];
} // function..convertUSStateCode

/*--------------------------------------------*/

/*
Webmonkey GET Parsing Module
Language: JavaScript 1.0

The parsing of GET queries is fundamental
to the basic functionality of HTTP/1.0.
This module parses GET with JavaScript 1.0.

Source: Webmonkey Code Library
(http://www.hotwired.com/webmonkey/javascript/code_library/)

Author: Patrick Corcoran
Author Email: patrick@taylor.org
*/

function createRequestObject() {
  
  FORM_DATA = new Object();             // The Object ("Array") where our data will be stored.
  
  separator = ',';                          // The token used to separate data from multi-select inputs
  

  query = '' + this.location;
    // Get the current URL so we can parse out the data.
    // Adding a null-string '' forces an implicit type cast
    // from property to string, for NS2 compatibility.
    
  query = query.substring((query.indexOf('?')) + 1);
    // Keep everything after the question mark '?'.
  
  if (query.length < 1) { return false; }  // Perhaps we got some bad data?
  
  keypairs = new Object();
  numKP = 1;
    // Local vars used to store and keep track of name/value pairs
    // as we parse them back into a usable form.
    
  while (query.indexOf('&') > -1) {
    keypairs[numKP] = query.substring(0,query.indexOf('&'));
    query = query.substring((query.indexOf('&')) + 1);
    numKP++;
      // Split the query string at each '&', storing the left-hand side
      // of the split in a new keypairs[] holder, and chopping the query
      // so that it gets the value of the right-hand string.
  }

  keypairs[numKP] = query;
    // Store what's left in the query string as the final keypairs[] data.
  
  for (i in keypairs) {
    keyName = keypairs[i].substring(0,keypairs[i].indexOf('='));
      // Left of '=' is name.
    keyValue = keypairs[i].substring((keypairs[i].indexOf('=')) + 1);
      // Right of '=' is value.
    while (keyValue.indexOf('+') > -1) {
      keyValue = keyValue.substring(0,keyValue.indexOf('+')) + ' ' + keyValue.substring(keyValue.indexOf('+') + 1);
        // Replace each '+' in data string with a space.
    }
    
    keyValue = unescape(keyValue);
      // Unescape non-alphanumerics
      
    if (FORM_DATA[keyName]) {
      FORM_DATA[keyName] = FORM_DATA[keyName] + separator + keyValue;
        // Object already exists, it is probably a multi-select input,
        // and we need to generate a separator-delimited string
        // by appending to what we already have stored.
    } else {
      FORM_DATA[keyName] = keyValue;
        // Normal case: name gets value.
    }
  }

  return FORM_DATA;
}

// -->
