
if ('undefined' == typeof String.prototype.ltrim) {
  String.prototype.ltrim = function() {
    return this.replace(/^\s+/, '');
  }
}

if ('undefined' == typeof String.prototype.rtrim) {
  String.prototype.rtrim = function() {
    return this.replace(/\s+$/, '');
  }
}

if ('undefined' == typeof String.prototype.trim) {
  String.prototype.trim = function() {
    return this.replace(/^\s+/, '').replace(/\s+$/, '');
  }
}




function CheckVoteForm()
{
  form = document.voting;

  checked = false;
  len = form.answer.length;
  for(i = 0; i < len; i++)
  {
    if (form.answer[i].checked)
    {
      checked = true;
    }
  }

  if (!checked)
  {
    alert('Пожалуйста, отметьте один из вариантов');
    return false;
  }

  return true;
}

