<!--
//######################################################################
//### Generic Javascript Form Functions
//######################################################################
//### - 07.13.00: Generated Listing from the 06.03.00 Last Updated File - Check for misc newer versions
//### - 07.13.00: Added AutoTab
//### - 07.13.00: Updated SetFocusToField --> setFieldFocus
//### - 07.25.00: Added isZipcode / isZipcodeField
//### - 08.18.00: Updated radio button function descriptions
//### - 09.22.00: Added unselectRadioGroup and unsetRadioIndex
//### - 09.25.00: Added basic check box functions
//### - 09.26.00: Added elementType, setTextValue
//### - 10.12.00: Added the Drop Down functions
//### - 10.12.00: Added disableRadioGroup, disableRadioIndex, enableRadioIndex
//### - 10.13.00: Added disableField, enableField, disableNormalElement, enableNormalElement
//### - 10.16.00: Added isKeyNoSpecialChars(e), isKeyNoQuotes(e), isKeyOnlyNumbers(e)
//### - 10.22.00: Updated elementType
//### - 01.11.01: Added zeroPad & setTextBoxColors
//### - 01.25.01: Added stripAlpha
//### - 01.26.01: Updated isMoney
//### - 02.07.01: Added checkRequiredField
//### - 04.30.01: Added subForm
//### - 04.30.01: Added resForm
//### - 04.30.01: Added verSub
//### - 04.30.01: Added verReset
//### - 04.30.01: Added winShake
//### - 04.30.01: Added showProp
//### - 05.08.01: Added checkExists
//### - 05.08.01: Added openWin
//### - 05.08.01: Added openFullWin
//### - 05.08.01: Added popDate
//######################################################################
//### --- Generic Functions for Form Radio Buttons ---
//### getRadioValue(strFormName,strElementName)
//### selectRadioValue(strSelectRadioValue,strFormName,strElementName)
//### unselectRadioGroup(strFormName,strElementName)
//### setRadioIndex(nIndex,strFormName,strElementName)
//### unsetRadioIndex(nIndex,strFormName,strElementName)
//### disableRadioGroup(sFormName,sElementName)
//### enableRadioGroup(sFormName,sElementName)
//### disableRadioIndex(nIndex,sFormName,sElementName)
//### enableRadioIndex(nIndex,sFormName,sElementName)
//### --- Generic Functions for Drop Downs ---
//### selectDropDownValue(sSelectValue,sFormName,sElementName)
//### setDropDownIndex(nIndex,sFormName,sElementName)
//### unsetDropDownIndex(nIndex,sFormName,sElementName)
//### --- Generic Functions for Check Boxes ---
//### checkBox(strFormName,strElementName)
//### uncheckBox(strFormName,strElementName)
//### --- Generic Functions for Text Boxes ---
//### setTextValue(sFormName,sElementName,sValue)
//### setTextBoxColors(sElement,sFormName,sBackColor,sTextColor)
//### popDate(sForm, sDatefield)
//### --- Generic Functions for All Elements ---
//### elementType(strFormName,strElementName)
//### disableField(sFormName,sElementName)
//### enableField(sFormName,sElementName)
//### disableNormalElement(sFormName,sElementName)
//### enableNormalElement(sFormName,sElementName)
//### --- Generic Functions for Form Navigation
//### autoTab(sFieldLength,sFormField,sFormName,sNextFormField,sNextFormName)
//### --- Generic Functions for Field Validation/Formatting
//### replaceChars(strOrig,strOut,strAdd)
//### stripAlpha(sInput)
//### zeroPad(sNum,nFront,nLen)
//### isEmpty(strInput)
//### isCreditCardField(strFormName,strElementName)
//### isCreditCard(strInput)
//### isNumberField(strFormName,strElementName)
//### isNumber(strInput)
//### isFloat(strInput)
//### isAlphaField(strFormName,strElementName)
//### isAlpha(strInput)
//### isAlphaNumericField(strFormName,strElementName)
//### isAlphaNumeric(strInput)
//### isEmailField(strFormName,strElementName)
//### isEmail(strInput)
//### isUrlField(strFormName,strElementName)
//### isUrl(strInput)
//### formatUrl(strInput)
//### isMoneyField(strFormName,strElementName)
//### isMoney(strInput)
//### isDateField(strFormName,strElementName)
//### isDate(strInput)
//### isPercentageField(strFormName,strElementName)
//### isZipcodeField(sFormName,sElementName)
//### isZipcode(sInput)
//### formatMoneyToNumber(strAmount)
//### formatMoney(strAmount)
//### formatDate(strDate)
//### requireField(strElement,strFormName,strAlert)
//### setFieldFocus(sFormField,sFormName)
//### checkRequiredField(sFormName,sElementName,sErrorMsg)
//### --- Generic Functions for Event Validation ---
//### isKeyNoSpecialChars(e)
//### isKeyNoQuotes(e)
//### isKeyOnlyNumbers(e)
//### subForm(sForm)
//### resForm(sForm)
//### verSub(sForm, message)
//### verReset(sForm, message)
//### --- Generic Functions for Visual Effects ---
//### winShake()
//### checkExists(obj)
//### openWin(pagename, win, w, h)
//### openFullWin(pagename, win)
//### --- Generic Functions for Testing ---
//### showProp(obj, objname)
//######################################################################

//===
//======================================================================
//=== Description:
//===       Input:  -
//===     Returns:
//=== Uses Func's:
//===     Example:
//===     Created: 00.00.00 - L2 / Last Modified: 00.00.00 - L2
//======================================================================

//######################################################################
//### Generic Functions for Form Radio Buttons
//######################################################################

//=== getRadioValue(strFormName,strElementName)
//======================================================================
//=== Description: Return the current value of the selected radio button from a group
//===       Input: strFormName - the name of the form in which the radio button group exits
//===              strElementName - the name of the radio button group
//===     Returns: the value of the selected radio button
//===     Example: onChange='alert(getRadioValue(this.form.name,this.name))'
//===     Created: 00.00.00 - L2 / Last Modified: 08.18.00 - L2
//======================================================================
function getRadioValue(strFormName,strElementName)
{
  nRadioLength  = eval('document.'+strFormName+'.'+strElementName+'.length');
  strRadioValue = '';

  for(var nCurrent = 0; nCurrent < nRadioLength; nCurrent++)
  {
    if ( eval('document.'+strFormName+'.'+strElementName+'[nCurrent].checked') )
    { strRadioValue = eval('document.'+strFormName+'.'+strElementName+'[nCurrent].value'); }
  }

  return strRadioValue;
}

//=== selectRadioValue(strSelectRadioValue,strFormName,strElementName)
//======================================================================
//=== Description: Sets the selected radio button based on the string being
//===              passed to the function matching a radio button value
//===       Input: strSelectRadioValue - the string value that should be matched
//===              strFormName - the name of the form in which the radio button group exits
//===              strElementName - the name of the radio button group
//===     Returns: none
//===     Example: onClick="selectRadioValue('value 1',this.form.name,this.name)"
//===     Created: 00.00.00 - L2 / Last Modified: 08.18.00 - L2
//======================================================================
function selectRadioValue(strSelectRadioValue,strFormName,strElementName)
{
  nRadioLength  = eval('document.'+strFormName+'.'+strElementName+'.length');

  for(var nCurrent = 0; nCurrent < nRadioLength; nCurrent++)
  {
    strCurRadioValue = eval('document.'+strFormName+'.'+strElementName+'[nCurrent].value')
    //alert( strCurRadioValue + '==' + strSelectRadioValue + ', ' + eval('strCurRadioValue == strSelectRadioValue') )
    if ( strCurRadioValue == strSelectRadioValue )
    { setRadioIndex(nCurrent,strFormName,strElementName); }
  }
}

//=== unselectRadioGroup(strFormName,strElementName)
//======================================================================
//=== Description: Deselects all radio buttons in a group
//===       Input: strFormName - the name of the form in which the radio button group exits
//===              strElementName - the name of the radio button group
//===     Returns: none
//===     Example: onClick="unselectRadioGroup(this.form.name,this.name)"
//===     Created: 09.22.00 - L2 / Last Modified: 09.22.00 - L2
//======================================================================
function unselectRadioGroup(strFormName,strElementName)
{
  nRadioLength  = eval('document.'+strFormName+'.'+strElementName+'.length');

  for(var nCurrent = 0; nCurrent < nRadioLength; nCurrent++)
  { unsetRadioIndex(nCurrent,strFormName,strElementName); }
}

function setRadioIndex(nIndex,strFormName,strElementName)
{ eval('document.'+strFormName+'.'+strElementName+'[nIndex].checked = true') }

function unsetRadioIndex(nIndex,strFormName,strElementName)
{ eval('document.'+strFormName+'.'+strElementName+'[nIndex].checked = false') }

//=== disableRadioGroup(sFormName,sElementName)
//======================================================================
//=== Description: Disables all radio buttons in a group
//===       Input: sFormName - the name of the form in which the radio button group exits
//===              sElementName - the name of the radio button group
//===     Returns: none
//===     Example: onClick="disableRadioGroup(this.form.name,this.name)"
//===     Created: 10.12.00 - L2 / Last Modified: 10.12.00 - L2
//======================================================================
function disableRadioGroup(sFormName,sElementName)
{
  nLength  = eval('document.' + sFormName + '.' + sElementName + '.length');

  for(var nIndex = 0; nIndex < nLength; nIndex++)
  { disableRadioIndex(nIndex,sFormName,sElementName); }
}

//=== enableRadioGroup(sFormName,sElementName)
//======================================================================
//=== Description: Disables all radio buttons in a group
//===       Input: sFormName - the name of the form in which the radio button group exits
//===              sElementName - the name of the radio button group
//===     Returns: none
//===     Example: onClick="disableRadioGroup(this.form.name,this.name)"
//===     Created: 10.12.00 - L2 / Last Modified: 10.12.00 - L2
//======================================================================
function enableRadioGroup(sFormName,sElementName)
{
  nLength  = eval('document.' + sFormName + '.' + sElementName + '.length');

  for(var nIndex = 0; nIndex < nLength; nIndex++)
  { enableRadioIndex(nIndex,sFormName,sElementName); }
}

function disableRadioIndex(nIndex,sFormName,sElementName)
{ eval('document.' + sFormName + '.' + sElementName + '[nIndex].disabled = true') }

function enableRadioIndex(nIndex,sFormName,sElementName)
{ eval('document.' + sFormName + '.' + sElementName + '[nIndex].disabled = false') }

//######################################################################
//### Generic Functions for Drop Downs
//######################################################################

//=== selectDropDownValue(sSelectValue,sFormName,sElementName)
//======================================================================
//=== Description: Sets the selected drop down index based on the string being
//===              passed to the function matching the drop down value
//===       Input: sSelectValue - the string value that should be matched
//===              sFormName - the name of the form in which the radio button group exits
//===              sElementName - the name of the radio button group
//===     Returns: none
//===     Example: onclick="selectDropDownValue('1',this.form.name,'D1')"
//===     Created: 10.12.00 - L2 / Last Modified: 10.12.00 - L2
//======================================================================
function selectDropDownValue(sSelectValue,sFormName,sElementName)
{
  var nLength  = eval('document.' + sFormName + '.' + sElementName + '.length');

  for(var nIndex = 0; nIndex < nLength; nIndex++)
  {
    var sValue = eval('document.' + sFormName + '.' + sElementName + '[nIndex].value')
    if ( sValue == sSelectValue )
    { setDropDownIndex(nIndex,sFormName,sElementName) }
  }
}

function setDropDownIndex(nIndex,sFormName,sElementName)
{ eval('document.' + sFormName + '.' + sElementName + '[nIndex].selected = true') }

function unsetDropDownIndex(nIndex,sFormName,sElementName)
{ eval('document.' + sFormName + '.' + sElementName + '[nIndex].selected = false') }

//######################################################################
//### Generic Functions for Check Boxes
//######################################################################

function checkBox(strFormName,strElementName)
{ eval('document.'+strFormName+'.'+strElementName+'.checked = true') }

function uncheckBox(strFormName,strElementName)
{ eval('document.'+strFormName+'.'+strElementName+'.checked = false') }

//######################################################################
//### Generic Functions for Text Boxes
//######################################################################

function setTextValue(sFormName,sElementName,sValue)
{ eval('document.'+sFormName+'.'+sElementName+'.value='+sValue) }

//=== setTextBoxColors(sElement,sFormName,sBackColor,sTextColor)
//======================================================================
//=== Description: Changes the background and text color for a text field
//===       Input: sFormName    - form name
//===              sElementName - form element
//===              sBackColor   - background color for text box
//===              sTextColor   - text color for text box
//=== Uses Func's: None
//===     Returns: Nothing
//===     Example: setTextBoxColors(sElement,sFormName,'#CC3300','WHITE');
//===     Created: 01.03.01 - L2 / Last Modified: 01.11.01 - L2
//======================================================================
function setTextBoxColors(sElement,sFormName,sBackColor,sTextColor)
{
  eval('document.' + sFormName + '.' + sElement + '.style.backgroundColor = sBackColor;');
  eval('document.' + sFormName + '.' + sElement + '.style.color           = sTextColor;');
}

//=== popDate(sForm, sDatefield)
//======================================================================
//=== Description: Changes the background and text color for a text field
//===       Input: sForm    - form name
//===              sDatefield - form element that needs date value
//=== Uses Func's: None
//===     Returns: Nothing
//===     Example: popDate(this.form.name, 'date');
//===     Created: 05.08.01 - RBM / Last Modified: 00.00.00 - L2
//======================================================================
function popDate(sForm, sDatefield) {
  var objDate = new Date();
  var sDate = (objDate.getMonth()+1)+'/';
  sDate += objDate.getDate()+'/';
  sDate += objDate.getFullYear();
  eval("document."+sForm+"."+sDatefield+".value = sDate;");
}

//######################################################################
//### Generic Functions for All Element
//######################################################################

//=== elementType(strFormName,strElementName)
//======================================================================
//=== Description: Returns the form Element Type
//===       Input: strFormName - the name of the form in which the radio button group exits
//===              strElementName - the name of the radio button group
//===     Returns: The name of the Form Element Type as follows:
//===                     Text field: "text"
//===                   Radio button: "radio"
//===                       Checkbox: "checkbox"
//===                   Hidden field: "hidden"
//===                  Submit button: "submit"
//===                   Reset button: "reset"
//===                 Password field: "password"
//===                         Button: "button"
//===                    Select list: "select-one"
//===          Multiple select lists: "select-multiple"
//===                 Textarea field: "textarea"
//===     Example: onClick="elementType(this.form.name,this.name)"
//===     Created: 09.25.00 - L2 / Last Modified: 10.22.00 - L2
//======================================================================
function elementType(strFormName,strElementName)
{
  var sElementType = eval('document.'+strFormName+'.'+strElementName+'.type')
  x = new Boolean(sElementType)  //--- if sElementType is 'undefined' will return 'false'
  if (x == false)  //--- if type is 'undefined' - check to see if it's a radio button
  { sElementType = eval('document.'+strFormName+'.'+strElementName+'[0].type') }  // Check to see if it's "radio"
  return sElementType;
}

//=== disableField(sFormName,sElementName)
//======================================================================
//=== Description: Disables a form element
//===       Input: sFormName    - the name of the form (i.e.: this.form.name)
//===              sElementName - the name of element  (i.e.: this.name)
//=== Uses Func's: elementType, disableNormalElement, disableRadioGroup
//===     Returns: 1 if successful - 0 if the element is undefined or unknown
//===     Example: onclick="enableField(this.form.name,this.name)"
//===     Created: 10.13.00 - L2 / Last Modified: 10.13.00 - L2
//======================================================================
function disableField(sFormName,sElementName)
{
  var sElementType = elementType(sFormName,sElementName);

  switch (sElementType)
  {
    case "undefined":
      return 0;
    break;
    case "text" :
    case "checkbox":
    case "hidden":
    case "submit":
    case "reset":
    case "password":
    case "button":
    case "select-one":
    case "select-multiple":
    case "textarea":
      disableNormalElement(sFormName,sElementName);
    break;
    case "radio":
      disableRadioGroup(sFormName,sElementName);
    break;
  default:
      return 0;
  }
}

//=== enableField(sFormName,sElementName)
//======================================================================
//=== Description: Enables a form element
//===       Input: sFormName    - the name of the form (i.e.: this.form.name)
//===              sElementName - the name of element  (i.e.: this.name)
//=== Uses Func's: elementType, enableNormalElement, enableRadioGroup
//===     Returns: 1 if successful - 0 if the element is undefined or unknown
//===     Example: onclick="enableField(this.form.name,this.name)"
//===     Created: 10.13.00 - L2 / Last Modified: 10.13.00 - L2
//======================================================================
function enableField(sFormName,sElementName)
{
  var sElementType = elementType(sFormName,sElementName);

  switch (sElementType)
  {
    case "undefined":
      return 0;
    break;
    case "text" :
    case "checkbox":
    case "hidden":
    case "submit":
    case "reset":
    case "password":
    case "button":
    case "select-one":
    case "select-multiple":
    case "textarea":
      enableNormalElement(sFormName,sElementName);
    break;
    case "radio":
      enableRadioGroup(sFormName,sElementName);
    break;
  default:
      return 0;
  }
}

function disableNormalElement(sFormName,sElementName)
{ eval('document.' + sFormName + '.' + sElementName + '.disabled = true') }

function enableNormalElement(sFormName,sElementName)
{ eval('document.' + sFormName + '.' + sElementName + '.disabled = false') }

//######################################################################
//### Generic Functions for Form Navigation
//######################################################################

//-- Automatically goes to the specificed field after X number of characters have been entered
//-- Ex: onkeyup="autoTab('6',this.name,this.form.name,'t2',this.form.name)"
function autoTab(sFieldLength,sFormField,sFormName,sNextFormField,sNextFormName)
{
  nFieldLength = parseInt(sFieldLength);
  if ( (eval('document.' + sFormName+ '.' + sFormField+ '.value.length')) >= nFieldLength )
  { setFieldFocus(sNextFormField,sNextFormName) }
}

//######################################################################
//### Generic Functions for Field Validation/Formatting
//######################################################################

//--------------------------------------------------------------------------------
//    Function: replaceChars(strOrig,strOut,strAdd)
// Description: Replaces a string with another string
//       Input: strOrig - the string that is being modified
//              strOut  - what to replace
//              strAdd  - what to replace with
//     Returns: the modified string
//--------------------------------------------------------------------------------
function replaceChars(strOrig,strOut,strAdd)
{
  strTemp = "" + strOrig;
  while (strTemp.indexOf(strOut)>-1)
  {
    nCharPos = strTemp.indexOf(strOut);
    strTemp = "" + (strTemp.substring(0, nCharPos) + strAdd + strTemp.substring((nCharPos+ strOut.length), strTemp.length));
  }
  return strTemp;
}

//=== stripAlpha(sInput)
//======================================================================
//=== Description: Strip Alpha characters from input
//===       Input: sInput - string to be stripped
//=== Uses Func's: isNumber
//===     Returns: correctly formated string
//===     Example: stripAlpha('B12Z3') //--- Returns '123'
//===     Created: 01.25.01 - L2 / Last Modified: 00.00.00 - L2
//======================================================================
function stripAlpha(sInput)
{
  if (!isNumber(sInput)) //--- Make sure number contains no letters
  {
    var sTemp, sTempNumber, sChar;
    sTemp = '';
    sTempNumber = sInput + ' '; //--- Add a space to the end for substing function

    for (nCount=0;nCount<sInput.length;nCount++)
    {
      sChar = sTempNumber.substring(nCount,nCount+1);  //--- Strip out one character at a time
      if (isNumber(sChar)) { sTemp += sChar; }         //--- Add to string only if's a number
    }
    sInput = sTemp;
  }
  return sInput;
}

//=== zeroPad(sNum,nFront,nLen)
//======================================================================
//=== Description: Padds a string with zeros
//===       Input: sNum   - string to be padded
//===              nFront - 1 = add zeros to front, else to end
//===              nLen   - the total length of the string
//=== Uses Func's: None
//===     Returns: correctly formated string
//===     Example: zeroPad(i,1,2)
//===     Created: 00.00.00 - L2 / Last Modified: 01.11.01 - L2
//======================================================================
function zeroPad(sNum,nFront,nLen)
{
  sNum = '' + sNum; //--- Convert to string
  while (sNum.length < nLen)
  {
    if (nFront) { sNum = '0' + sNum; }
    else        { sNum += '0'; }
  }
  return sNum;
}

//--------------------------------------------------------------------------------
//    Function: isEmpty(strInput)
// Description: See if an input value has been entered
//       Input: strInput - string being checked
//     Returns: true  - if empty
//              false - otherwise
//--------------------------------------------------------------------------------
function isEmpty(strInput)
{
  if (strInput.length == 0 || strInput == null) { return true;  }
  else                                          { return false; }
}

//--------------------------------------------------------------------------------
//    Function: isCreditCardField(strFormName,strElementName)
// Description: Checks to see that the number passes the Luhn Mod-10 test
//       Input: strFormName, strElementName - the form and element names being checked
//     Returns: true  - if field only contains proper characters
//              false - otherwise & pop-up required field prompt
//--------------------------------------------------------------------------------
function isCreditCardField(strFormName,strElementName)
{
  strInput = eval('document.'+strFormName+'.'+strElementName+'.value');
  strInput = replaceChars(strInput,' ','');  // Remove ' '
  strInput = replaceChars(strInput,'-','');  // Remove '-'
  if ( !isCreditCard(strInput) )
  {
    if ( !isEmpty(strInput) )
    { requireField(strElementName,strFormName,"The value that you have entered (" + strInput + ") is invalid!\n\nPlease check the credit card number once again.") }
    return false;
  }
  return true;
}

function isCreditCard(strInput)
{
  if (strInput.length > 19) return (false);  // Encoding only works on cards with less than 19 digits
  sum = 0; mul = 1; l = strInput.length;
  for (i = 0; i < l; i++)
  {
    digit    = strInput.substring(l-i-1,l-i);
    tproduct = parseInt(digit ,10)*mul;

    if (tproduct >= 10) sum += (tproduct % 10) + 1;
    else                sum += tproduct;
    if (mul == 1)       mul++;
    else                mul--;
  }
  if ((sum % 10) == 0)  return (true);
  else                  return (false);
}

//--------------------------------------------------------------------------------
//    Function: isNumberField(strFormName,strElementName)
// Description: Check field to see if it only contains numberic characters
//       Input: strFormName, strElementName - the form and element names being checked
//     Returns: true  - if field only contains proper characters
//              false - otherwise & pop-up required field prompt
//--------------------------------------------------------------------------------
function isNumberField(strFormName,strElementName)
{
  strInput = eval('document.'+strFormName+'.'+strElementName+'.value');
  if ( !isNumber(strInput) )
  {
    if ( !isEmpty(strInput) )
    { requireField(strElementName,strFormName,"The value that you have entered (" + strInput + ") is invalid!\n\nPlease format it so that it only contains numbers.") }
    return false;
  }
  return true;
}

// is a number
function isNumber(strInput)
{
  strInput = '' + strInput;
  var reg = /^[0-9.\-]+$/;
  if (reg.test(strInput)) { return true;  }
  else                    { return false; }
}

// is a float
function isFloat(strInput)
{
  strInput = '' + strInput;
  var reg = /^[0-9]+[.][0-9]+$/;
  if (reg.test(strInput)) { return true;  }
  else                    { return false; }
}


//--------------------------------------------------------------------------------
//    Function: isAlphaField(strFormName,strElementName)
// Description: Check field to see if it only contains alpha characters
//       Input: strFormName, strElementName - the form and element names being checked
//     Returns: true  - if field only contains proper characters
//              false - otherwise & pop-up required field prompt
//--------------------------------------------------------------------------------
function isAlphaField(strFormName,strElementName)
{
  strInput = eval('document.'+strFormName+'.'+strElementName+'.value');
  if ( !isAlpha(strInput) )
  {
    if ( !isEmpty(strInput) )
    { requireField(strElementName,strFormName,"The value that you have entered (" + strInput + ") is invalid!\n\nPlease format it so that it only contains the A-Z characters.") }
    return false;
  }
  return true;
}

function isAlpha(strInput)
{
  strInput = '' + strInput;
  var reg = /^[A-Za-z_]+$/;
  if (reg.test(strInput)) { return true;  }
  else                    { return false; }
}

//--------------------------------------------------------------------------------
//    Function: isAlphaNumericField(strFormName,strElementName)
// Description: Check field to see if it only contains alpha-numberic characters
//       Input: strFormName, strElementName - the form and element names being checked
//     Returns: true  - if field only contains proper characters
//              false - otherwise & pop-up required field prompt
//--------------------------------------------------------------------------------
function isAlphaNumericField(strFormName,strElementName)
{
  strInput = eval('document.'+strFormName+'.'+strElementName+'.value');
  if ( !isAlphaNumeric(strInput) )
  {
    if ( !isEmpty(strInput) )
    { requireField(strElementName,strFormName,"The value that you have entered (" + strInput + ") is invalid!\n\nPlease format it so that it only contains the A-Z or 0-9 characters.") }
    return false;
  }
  return true;
}

function isAlphaNumeric(strInput)
{
  strInput = '' + strInput;
  var reg = /^\w+$/;
  if (reg.test(strInput)) { return true;  }
  else                    { return false; }
}

//--------------------------------------------------------------------------------
//    Function: isEmailField(strFormName,strElementName)
// Description: Check field to see if it's a proper email
//       Input: strFormName, strElementName - the form and element names being checked
//     Returns: true  - if email matches the 'youremail@somewhere.com' format
//              false - otherwise & pop-up required field prompt
//--------------------------------------------------------------------------------
function isEmailField(strFormName,strElementName)
{
  strInput = eval('document.'+strFormName+'.'+strElementName+'.value');
  if ( !isEmail(strInput) )
  {
    if ( !isEmpty(strInput) )
    { requireField(strElementName,strFormName,"The email that you have entered (" + strInput + ") is invalid!\n\nPlease format it as follows: youremail@somewhere.com") }
//    { requireField(strElementName,strFormName,"The email that you have entered (" + strInput + ") is invalid!\n\nPlease format it so that it contains an '@' and an '.'\n\nExample: youremail@somewhere.com") }
    return false;
  }
  return true;
}

// Regular Expression Email Checking
function isEmail(strInput)
{
  strInput = '' + strInput;
  var reg = /^\w+[@]\w+[.]\w+$/;
  if (reg.test(strInput)) { return true;  }
  else                    { return false; }
}

//--------------------------------------------------------------------------------
//    Function: isUrlField(strFormName,strElementName)
// Description: Check field to see if it's a proper url
//       Input: strFormName, strElementName - the form and element names being checked
//     Returns: true  - if url matches the 'http://www.yourweb.com' format
//              false - otherwise & pop-up required field prompt
//--------------------------------------------------------------------------------
function isUrlField(strFormName,strElementName)
{
  strInput = eval('document.'+strFormName+'.'+strElementName+'.value');
  if ( !isUrl(strInput) )
  {
    if ( !isEmpty(strInput) )
    { requireField(strElementName,strFormName,"The web address that you have entered (" + strInput + ") is invalid!\n\nPlease format it so that it is in the full url format.\n\nExample: http://www.yourpage.com"); }
    return false;
  }
  return true;
}

// Regular Expression Email Checking
function isUrl(strInput)
{
  strInput = '' + strInput;
  var reg = /^http:\/\/[a-z_0-9]+\.[a-z_0-9]+\.[a-z]{3}$/;
  if (reg.test(strInput)) { return true;  }
  else                    { return false; }
}

function formatUrl(strInput)
{
  strInput = "" + strInput;

  // Add http:// to the front of Url without it
  if ( !isEmpty(strInput) )
  {
    if ( strInput.indexOf('http://') == -1 )
    { strInput = "http://" + strInput; }
  }
  return strInput;
}

//--------------------------------------------------------------------------------
//    Function: isMoneyField(strFormName,strElementName)
// Description: Check field to see if its properly formated for money
//       Input: strFormName, strElementName - the form and element names being checked
//     Returns: true  - if field only contains proper characters
//              false - otherwise & pop-up required field prompt
//--------------------------------------------------------------------------------
function isMoneyField(strFormName,strElementName)
{
  strInput = eval('document.'+strFormName+'.'+strElementName+'.value');
  strInput = formatMoneyToNumber(strInput);
  if ( !isNumber(strInput) )
  {
    if ( !isEmpty(strInput) )
    { requireField(strElementName,strFormName,"The value that you have entered (" + strInput + ") is invalid!\n\nPlease format it so that it only contains numbers or [$-,.] characters.\n\nExample: $100.00 or $10,000.00") }
    return false;
  }
  return true;
}

// Regular Expression Email Checking
function isMoney(strInput)
{
  strInput = '' + strInput;
//  var reg = /^\$[0-9,]+[.][0-9]{2,}$/;
  var reg = /^\$\d{1,3}(,\d{3})*\.\d{2}$/;
  if (reg.test(strInput)) { return true;  }
  else                    { return false; }
}

//--------------------------------------------------------------------------------
//    Function: isDateField(strFormName,strElementName)
// Description: Check field to see if the value is within a valid date range
//       Input: strFormName, strElementName - the form and element names being checked
//     Returns: true  - if field only contains proper characters
//              false - otherwise & pop-up required field prompt
//--------------------------------------------------------------------------------
function isDateField(strFormName,strElementName)
{
  strInput = eval('document.'+strFormName+'.'+strElementName+'.value');

  if ( !isDate(strInput) )
  {
    if ( !isEmpty(strInput) )
    { requireField(strElementName,strFormName,"The value that you have entered (" + strInput + ") is invalid!\n\nPlease make sure that you have the date in the\nMM/DD/YYYY format and that it it a legitimate date.") }
    return false;
  }
  return true;
}

// is a date - format of MMDDYY
function isDate(strInput)
{
  strInput = '' + strInput;
  var reg = /^[0-1][0-9][/][0-3][0-9][/][2][0-9][0-9][0-9]$/;
//  var reg = /^[01-12]//[01-31]//[2000-2099]$/;
  if (reg.test(strInput)) { return true;  }
  else                    { return false; }
}


//--------------------------------------------------------------------------------
//    Function: isPercentageField(strFormName,strElementName)
// Description: Check field to see if it only contains numeric or [$%-,.] characters
//       Input: strFormName, strElementName - the form and element names being checked
//     Returns: true  - if field only contains proper characters
//              false - otherwise & pop-up required field prompt
//--------------------------------------------------------------------------------
function isPercentageField(strFormName,strElementName)
{
  strInput = eval('document.'+strFormName+'.'+strElementName+'.value');
  strInput = replaceChars(strInput,'%','');  // Remove '%'
  if ( !isNumber(strInput) )
  {
    if ( !isEmpty(strInput) )
    { requireField(strElementName,strFormName,"The value that you have entered (" + strInput + ") is invalid!\n\nPlease format it so that it only contains numbers or [%-.] characters.\n\nExample: 8%, 8.25% or 8") }
    return false;
  }
  return true;
}

//=== isZipcodeField(sFormName,sElementName)
//======================================================================
//=== Description: Determines if the input is of a recognized Zipcode format - if not select/focus on field
//===       Input: sFormName, sElementName - Form & element name
//===     Returns: True  - If field only contains proper characters
//===              False - Otherwise & pop-up required field prompt
//===     Example: isZipcodeField(this.form.name,this.name)
//===     Created: 07.25.00 - L2 / Last Modified: 00.00.00 - L2
//======================================================================
function isZipcodeField(sFormName,sElementName)
{
  sInput = eval('document.'+sFormName+'.'+sElementName+'.value');
  sInput = replaceChars(sInput,' ','');  //--- Remove spaces
  if ( !isZipcode(sInput) )
  {
    if ( !isEmpty(sInput) )
    { requireField(strElementName,strFormName,"The value that you have entered (" + strInput + ") is invalid!\n\nPlease format it so that it is a 5 or 9 digit number.\n\nExample: 45243 or 45243-0934") }
    return false;
  }
  return true;
}

//=== isZipcode(sInput)
//======================================================================
//=== Description: Determines if the input is of a recognized Zipcode format
//===       Input: sInput - Input string
//===     Returns: True if the value is in DDDDD or DDDDD-DDDD format, else False
//===     Example: isZipcode('12345-1234') --> True, isZipcode('AS2345') --> False
//===     Created: 07.25.00 - L2 / Last Modified: 00.00.00 - L2
//======================================================================
function isZipcode(sInput)
{
  sInput = '' + sInput;
  var reg = /^\d{5}$|^\d{5}[\-\s]?\d{4}$/;
  if (reg.test(strInput)) { return true;  }
  else                    { return false; }
}

function formatMoneyToNumber(strAmount)
{
  // Remove all extra characters
  strAmount = replaceChars(strAmount,'$','');  // Remove '$'
  strAmount = replaceChars(strAmount,',','');  // Remove ','
  strAmount = replaceChars(strAmount,' ','');  // Remove ' '

  if ( strAmount.indexOf('.') != strAmount.lastIndexOf('.') ) // Make sure there aren't two decimals in number
  { strAmount = strAmount.substring(0,strAmount.lastIndexOf('.')); }
  return strAmount;
}

//--------------------------------------------------------------------------------
//    Function: formatMoney(strAmount)
// Description: Formats to $X,XXX.XX
//       Input: strAmount
//     Returns: strAmount in $X,XXX.XX format
//--------------------------------------------------------------------------------
function formatMoney(strAmount)
{
  strAmount = '' + formatMoneyToNumber(strAmount);

  // Split up amount
  strDollar   = '' + Math.floor(strAmount);
  nCents      = 100 * (strAmount - strDollar) + 0.5;
  strTenth    = '' + Math.floor(nCents/10);
  strHundreth = '' + Math.floor(nCents%10);

  // Add commas
  nCommas     = Math.ceil((strDollar.length/3)-1);  // Numbers of commas needed
  for (var nPlace = 1; nPlace < nCommas+1; nPlace++)
  {
    nLength   = strDollar.length - nPlace + 1;
    nCommaPos = nLength - (3 * nPlace);
    strDollar = strDollar.substring(0,nCommaPos)+','+strDollar.substring(nCommaPos,strDollar.length);
  }

  // Put it all together
  strAmount   = '$' + strDollar + '.' + strTenth + strHundreth;

  return strAmount;
}

//--------------------------------------------------------------------------------
//    Function: formatDate(strDate)
// Description: Formats to MM/DD/YYYY from MMDDYY or MMDDYYYY
//       Input: strDate
//     Returns: strDate in MM/DD/YYYY format
//--------------------------------------------------------------------------------
function formatDate(strDate)
{
  // Remove all extra characters
  strDate = replaceChars(strDate,' ','');  // Remove ' '
  strDate = replaceChars(strDate,'/','');  // Remove '/'
  strDate = replaceChars(strDate,'.','');  // Remove '.'

  // Check to see that the string is either 6 or 8 characters
  if ((strDate.length == 6) || (strDate.length == 8))
  {
    strMonth = strDate.substring(0,2);
    strDay   = strDate.substring(2,4);
    strYear  = strDate.substring(4,strDate.length);

    if (strYear.length == 2) { strYear = '20' + strYear; }  // Convert YY to 20YY

    // Put it all together
    strDate  = strMonth + '/' + strDay + '/' + strYear
  }

  return strDate;
}

// Alert user that field is required & set the cursor to that field
function requireField(strElement,strFormName,strAlert)
{
  alert(strAlert);
  setFieldFocus(strElement,strFormName);
}

function setFieldFocus(sFormField,sFormName)
{
  sFieldType = eval('document.' + sFormName+ '.' + sFormField+ '.type;'); //--- Determine Field Type
  eval('document.' + sFormName+ '.' + sFormField+ '.focus();');           //--- Set Focus
  if (sFieldType == 'text')                                               //--- If the field is of type 'text' then Select
  { eval('document.' + sFormName+ '.' + sFormField+ '.select();'); }
}

//=== checkRequiredField(sFormName,sElementName,sErrorMsg)
//======================================================================
//=== Description: Checks to see if the field is Empty
//===       Input: sFormName, sElementName - the form and element names being checked
//===              sErrorMsg - the error message that is passed to requiredField()
//=== Uses Func's: isEmpty(), requiredField()
//===     Returns: true  - not empty
//===              false - empty
//===     Example: if (!checkRequiredField('formMain','name','Required Field.')) { return false; };
//===     Created: 02.07.01 - L2 / Last Modified: 00.00.01 - L2
//======================================================================
function checkRequiredField(sFormName,sElementName,sErrorMsg)
{
  if ( eval('isEmpty(document.'+sFormName+'.'+sElementName+'.value)') )
  {
    requireField(sElementName,sFormName,sErrorMsg);
    return false;
  }
  else
  { return true; }
}

//######################################################################
//### Generic Functions for Event Validation
//######################################################################

//=== isKeyNoSpecialChars(e)
//======================================================================
//=== Description: Keeps a user from entering specified characters into a form element
//===       Input: e - the javascript event
//=== Uses Func's: none
//===     Returns: true if restricted character - false if not restricted
//===     Example: onkeypress="if (isKeyNoSpecialChars(event)) {return false;}"
//===     Created: 10.16.00 - L2 / Last Modified: 10.16.00 - L2
//======================================================================
function isKeyNoSpecialChars(e)
{
  if (navigator.appName == "Netscape") { var nCheckChar = e.which;   }
  else                                 { var nCheckChar = e.keyCode; }

  var sCheckChar = String.fromCharCode(nCheckChar);

  if ((nCheckChar > 32 && nCheckChar < 48)
   || (nCheckChar > 57 && nCheckChar < 65)
   || (nCheckChar > 90 && nCheckChar < 97))
  {
    e.returnValue = false;
    return true;
  }
  else { return false; }
}

//=== isKeyNoQuotes(e)
//======================================================================
//=== Description: Keeps a user from entering specified characters into a form element
//===       Input: e - the javascript event
//=== Uses Func's: none
//===     Returns: true if restricted character - false if not restricted
//===     Example: onkeypress="if (isKeyNoQuotes(event)) {return false;}"
//===     Created: 10.16.00 - L2 / Last Modified: 10.16.00 - L2
//======================================================================
function isKeyNoQuotes(e)
{
  if (navigator.appName == "Netscape") { var nCheckChar = e.which;   }
  else                                 { var nCheckChar = e.keyCode; }

  var sCheckChar = String.fromCharCode(nCheckChar);

  if (( nCheckChar == 34 ) || ( nCheckChar == 39 ))
  {
    e.returnValue = false;
    return true;
  }
  else { return false; }
}

//=== isKeyOnlyNumbers(e)
//======================================================================
//=== Description: Keeps a user from entering specified characters into a form element
//===       Input: e - the javascript event
//=== Uses Func's: none
//===     Returns: true if restricted character - false if not restricted
//===     Example: onkeypress="if (isKeyOnlyNumbers(event)) {return false;}"
//===     Created: 10.16.00 - L2 / Last Modified: 10.16.00 - L2
//======================================================================
function isKeyOnlyNumbers(e)
{
  if (navigator.appName == "Netscape") { var nCheckChar = e.which;   }
  else                                 { var nCheckChar = e.keyCode; }

  var sCheckChar = String.fromCharCode(nCheckChar);

  if (!( nCheckChar > 45 && nCheckChar < 58))
  {
    e.returnValue = false;
    return true;
  }
  else { return false; }
}

//=== subForm(sForm)
//======================================================================
//=== Description: submits the form when button is pressed
//===       Input: sForm - name of form to submit
//=== Uses Func's: none
//===     Returns: true
//===     Example: onclick="subForm(this.form);"
//===     Created: 04.30.01 - RBM
//======================================================================
function subForm(sForm) {
  eval("document."+sForm+".submit();");
}

//=== resForm(sForm)
//======================================================================
//=== Description: resets the form when button is pressed
//===       Input: sForm - name of the form to reset
//=== Uses Func's: none
//===     Returns: true
//===     Example: onclick="resForm(this.form);"
//===     Created: 04.30.01 - RBM
//======================================================================
function resForm(sForm) {
  eval("document."+sForm+".reset();");
}

//=== verSub(sForm, message)
//======================================================================
//=== Description: Verifies submission event with user
//===       Input: message - message to ask user
//===      sForm - form to verify
//=== Uses Func's: subForm
//===     Returns: true if element is not empty
//===     Example: onclick="verSub(this.form, 'are you sure?');"
//===     Created: 04.30.01 - RBM
//======================================================================
function verSub(sForm, message) {
  if (confirm(message)) {
    subForm(sForm);
  }
}

//=== verReset(sForm, message)
//======================================================================
//=== Description: Verifies reset event with user
//===       Input: message - message to ask user
//===      sForm - form to verify
//=== Uses Func's: resForm
//===     Returns: N/A
//===     Example: onkeypress="verReset(this.form, 'are you sure?');"
//===     Created: included on: 04.30.01 RBM
//======================================================================
function verReset(sForm, message) {
  if (confirm(message)) {
    resForm(sForm);
  }
}

//######################################################################
//### Generic Functions for Visual Effects
//######################################################################

//=== winShake()
//======================================================================
//=== Description: shakes the window when the user does the specific event
//===       Input: N/A
//=== Uses Func's: self
//===     Returns: true if restricted character - false if not restricted
//===     Example: onkeypress="windowShake();"
//===     Created: included on: 04.30.01
//======================================================================
var dur = 10;   // duration
var count = 0;    // count
var dir = 1;    // direction
var speed = [8,4,2,1];  // speed
var steps = 0;    // steps
var dirs = [-1,1];  // directions

function winShake() {
  parent.window.moveBy(speed[steps]*dirs[dir=1-dir],0);
  count++;
  if (count < dur) {
    setTimeout("winShake()",70/speed[steps]);
  } else if (steps<(speed.length-1)) {
    steps++;
    count=0;
    winShake();
  }
  if (steps >= 4) {}
}

//=== checkExists()
//======================================================================
//=== Description: checks to see if a window or object presently exists
//===       Input: obj - is the name of the object to be checked for
//===     Returns: true if it finds that the window does exist
//=== Uses Func's: N/A
//===     Example: onload="checkExists('testwin');"
//===     Created: 05.08.01 - RBM / Last Modified: 00.00.00 - L2
//======================================================================
function checkExists(obj){
  if(obj){
  return true;
  }
}

//=== openWin(pagename, win, w, h)
//======================================================================
//=== Description: creates a window object
//===       Input: win - name given to window,
//===      pagename - page to be displayed in new window
//===     Returns: a new window object with a page loaded
//=== Uses Func's: N/A
//===     Example: onload="openWin('test.html','testwin', 200, 25);"
//===     Created: 05.08.01 - RBM / Last Modified: 00.00.00 - L2
//======================================================================
function openWin(pagename, win, w, h){
  var bars = 'directories=0,location=0,menubar=0,status=0';
  bars += ',titlebar=no,toolbar=no';
  var options = 'scrollbars=0,width='+w+',height='+h+',resizeable=0';
  var features = bars + ',' + options;
  var newWin = open(pagename, win, features);
  newWin.document.close();
  newWin.focus();
}

//=== openWinScroll(pagename, win, w, h)
//======================================================================
//=== Description: creates a window object
//===       Input: win - name given to window,
//===      pagename - page to be displayed in new window
//===     Returns: a new window object with a page loaded
//=== Uses Func's: N/A
//===     Example: onload="openWinScroll('test.html','testwin', 200, 25);"
//===     Created: 05.08.01 - RBM / Last Modified: 00.00.00 - L2
//======================================================================
function openWinScroll(pagename, win, w, h){
  var bars = 'directories=0,location=0,menubar=0,status=0';
  bars += ',titlebar=no,toolbar=no';
  var options = 'scrollbars=1,width='+w+',height='+h+',resizeable=0';
  var features = bars + ',' + options;
  var newWin = open(pagename, win, features);
  newWin.document.close();
  newWin.focus();
}

//=== openFullWin(pagename, win)
//======================================================================
//=== Description: creates a window object fullscreen
//===       Input: win - name given to window,
//===      pagename - page to be displayed in new window
//===     Returns: a new window object with a page loaded
//=== Uses Func's: N/A
//===     Example: onload="openFullWin('test.html','testwin');"
//===     Created: 05.08.01 - RBM / Last Modified: 00.00.00 - L2
//======================================================================
function openFullWin(pagename, win) {
  var features = 'toolbar=0,location=0,directories=0,menubar=0';
  features += ',scrollbars=0,resizeable=0,fullscreen=1';
  var popWin = window.open(pagename, win, features);
  popWin.document.close();
  popWin.focus();
}


//=== browser()
//======================================================================
//=== Description: returns browser information
//===       Input: N/A
//===
//===     Returns: browser information
//=== Uses Func's: N/A
//===     Example: onload="browser();"
//===     Created: 07.30.01 - RBM / Last Modified: 00.00.00 - L2
//======================================================================
function browser() {
  // the below code defines the screen resolutions that are currently being used
  var aHeight   = screen.availHeight;     aWidth   = screen.availWidth
  var Height    = screen.Height;          Width    = screen.Width
  var Depth     = screen.pixelDepth;      appName  = navigator.appName
  var codeName  = navigator.appCodeName;  appVer   = navigator.appVersion
  var lang      = navigator.language;     plat     = navigator.platform
  var user      = navigator.userAgent
  var nowDate     = new Date();

  document.writeln("Screen Resolution: " + Width + "x" + Height + " at " + Depth + " Color Depth<br />")
  document.writeln("Available Resolution: " + aWidth + "x" + aHeight + "<br />")
  document.writeln("CodeName: " + codeName + "<br />")
  document.writeln("Browser: " + appName + "<br />Version: " + appVer + "<br />")
  document.writeln("Language: " + lang + "<br />Platform: " + plat + "<br />")
  document.writeln("UserAgent: " + user + "<br >")
  document.writeln("Date/Time: " + nowDate + "<br />")

  // the below code defines what platform is being used
  //var platform = navigator.platform.substr(0,3);

  /*  if (platform == "Win")
  {
    document.writeln("<FONT SIZE=\"3\">");
  }
  else if (platform == "Mac")
  {
    document.writeln("<FONT SIZE=\"2\">");
  }*/
}

//=== copywrite()
//======================================================================
//=== Description: displays copywrite information
//===       Input: N/A
//===
//===     Returns: copywrite information
//=== Uses Func's: N/A
//===     Example: onload="copywrite();"
//===     Created: 07.30.01 - RBM / Last Modified: 00.00.00 - L2
//======================================================================

function copywrite() {
  // Assign the last modified date to the variable lastmoddate for the copyright info
  var lastmoddate = document.lastModified;
  // Create an if statement to test the value of lastmoddate
  if(lastmoddate == 0) {
    document.writeln("Lastmodified: Unknown<br />&copy; 2000 Copyright Llyvare")
  } else {
    document.writeln("LastModified: " + lastmoddate + "<br />&copy; 2000 Copyright Richard B. Miller<br />Designed and Maintained by Richard B. Miller")
  }
}

//######################################################################
//### Generic Functions for Testing
//######################################################################

//=== showProp(obj, objname)
//======================================================================
//=== Description: shows the properties of the object given
//===       Input: obj - object to show; objname - name of object
//===     Returns: N/A
//=== Uses Func's: N/A
//===     Example: onclick="showProp(this, this.name);"
//===     Created: 04.30.01 - RBM / Last Modified: 00.00.00 - RBM
//======================================================================
function showProp(obj, objname) {
  var result;
  for (var i in obj) {
    result += i + " = " + obj[i] + "<br />";
  }
  document.writeln("The properties for the " + objname + " object:" + "<br /><br />");
  document.writeln(result);
}

//================================================================================
// Regular Expressions to be integrated
//================================================================================

/*

var charexp = /./
var letterexp = /[a-z]/i
var phonexp =  /^\d{10}$/
var memberexp = /^\d{3}$/
var zipexp = /^\d{5}$|^\d{5}[\-\s]?\d{4}$/
var emailexp = /^[a-z][a-z_0-9\.]+@[a-z_0-9\.]+\.[a-z]{3}$/i
var pledgexp = /^\d*$|^\d*\.\d{2}$/

function isValid(pattern, str)
{ return pattern.test(str) }

function hasLetter(str)
{ return letterexp.test(str) }

function hasChar(str)
{ return charexp.test(str) }

function stripChars(pattern, str)
{ return str.replace(pattern,"") }

function stripNonDigits(str)
{ return str.replace(/[^0-9]/g,"") }

function checkform(form)
{
  //Check the first name text box for an entry
  if  (!hasLetter(form.firstname.value))
  {
    alert("Invalid first name")
    form.firstname.focus()
    return false
  }

  //Check the last name text box for an entry
  if (!hasLetter(form.lastname.value))
  {
    alert("Invalid last name")
    form.lastname.focus()
    return false
  }

  //Check that the member number entry is valid
  if (!isValid(memberexp,form.membernum.value))
  {
    alert("Invalid member number")
    form.membernum.focus()
    return false
  }

  //Check that the ZIP code entry is valid.
  if (!isValid(zipexp,form.zip.value))
  {
    alert("Invalid ZIP code")
    form.zip.focus()
    return false
  }

  //Check that the email entry is valid
  if (!isValid(emailexp,form.email.value))
  {
    alert("Invalid email")
    form.email.focus()
    return false
  }

  //Check that the phone entry is valid by first stripping off all nondigits.
  newphone = ""
  if (hasChar(form.phone.value))
  {
    newphone = stripNonDigits(form.phone.value)
    notvalid = !isValid(phonexp,newphone)
  }
  if (newphone == "" || notvalid)
  {
    alert("Invalid phone number - include area code")
    form.phone.focus()
    return false
  }

  //Check that the phone entry is valid by first stripping off all any dollar sign using stripChars.
  newpledge = ""
  if (hasChar(form.pledge.value))
  {
    newpledge = stripChars(/\$/,form.pledge.value)
    notvalid = !isValid(pledgexp,newpledge)
  }
  if (newpledge == "" || notvalid)
  {
    alert("Please enter a valid dollar amount")
    form.pledge.focus()
    return false
  }

  alert("Data valid")
}

*/
//-->