///////////////////////////////////////////
// GET SELECTED VALUE (FROM DROP-DOWN LIST)

function GetSelectedValue(objControl)
{
  intCounter = 0;
  for (intCounter = 0; intCounter < objControl.length; intCounter++)
  {
    if (objControl.selectedIndex == intCounter)
    {
      return objControl.options[intCounter].value;
    }
  }
  return "";
}

///////////////////////////////////////////
// GET SELECTED TEXT (FROM DROP-DOWN LIST)

function GetSelectedText(objControl)
{
  intCounter = 0;
  for (intCounter = 0; intCounter < objControl.length; intCounter++)
  {
    if (objControl.selectedIndex == intCounter)
    {
      return objControl.options[intCounter].text;
    }
  }
  return "";
}

function IsBlank(strValue)
{
  if (strValue == null || strValue == '')
  {
    return true;
  }
  else
  {
    return false;
  }
}

function ValidateInput(frmForm)
{
  var strName = '';
  var strEmail = '';
  var strSubject = '';
  var strMessage = '';
  var strAlert = '';

  if (IsBlank(frmForm.inpUserName__________.value))
  {
    strAlert = strAlert + 'You must enter your name.' + '\n';
  }
  if (IsBlank(frmForm.inpUserEmail_________.value))
  {
    strAlert = strAlert + 'You must enter your email address.' + '\n';
  }
  if (IsBlank(GetSelectedValue(frmForm.selSubject___________)))
  {
    strAlert = strAlert + 'You must select a subject.' + '\n';
  }
  if (IsBlank(frmForm.texMessage___________.value))
  {
    strAlert = strAlert + 'You must include a message.' + '\n';
  }
  if (strAlert != '')
  {
    alert(strAlert);
    return false;
  }
  else
  {
    return true;
  }
}

