function ValidCustom (SubmitForm, mode)
{
  var badData = '';

  if (!ValidText (SubmitForm, "txtName"))
    badData = badData + "* The Figure Name is required.\n";
  if (!ValidText (SubmitForm, "txtBaseFigure"))
    badData = badData + "* The Base Figure is required.\n";
  if (isEmpty (SubmitForm, "txtHeight"))
    badData = badData + "* The Figure Height is required.\n";
  if (!ValidText (SubmitForm, "txtDescription"))
    badData = badData + "* The Figure Description is required.\n";
  if (!ValidLength (SubmitForm, "txtDescription", 30))
    badData = badData + "* Please enter a better description of your figure.\n";

  if (getElement("selSeries").value < 1)
    badData = badData + "* Please select a Toy Series for your figure.\n";

  var fne = getElement("userfile1");
  if (fne)
  {
    if (mode != "UserUpdate")
    {
      var fn = getElement("userfile1").value;
      if (!fn)
        badData = badData + "* You must provide at least one picture.\n";
    }
    
    for (i = 1; i <= 6; i++)
    {
      var uf = getElement("userfile" + i);
      if (uf)
      {
        var fn = uf.value;
      
        var fn = fne.value;
         if (fn != "")
         {
           var ext = fn.substr(fn.length - 3).toLowerCase();

           if (ext == "jpg" || ext == "gif" || ext == "png")
            ;
          else
            badData = badData + "* Picture #" + i + " does not appear to be a valid picture.  It must be a jpg, gif or png format.\n";
        }
      }
    }
  }

  if (badData == '')
  {
    return true;
  }
  else
  {
    alert('Please correct the following errors to submit your custom figure:\n\n' + badData);
    return false;
  }
}

function Vote()
{
  var radioOptions = document.forms['frmVote'].radVote;
  var val = '';
  
  for (x = 0; x < radioOptions.length; x++)
  {
    if (radioOptions[x].checked)
      val = radioOptions[x].value;
  }

  if (val == '')
  {
    alert('To cast your vote, you must select the number of stars you wish to rate this custom.');
    return false;
  }
  
  return true;
}

function VoteAndNext()
{
  var radioOptions = document.forms['frmVote'].radVote;
  var val = '';
  
  for (x = 0; x < radioOptions.length; x++)
  {
    if (radioOptions[x].checked)
      val = radioOptions[x].value;
  }

  if (val == '')
  {
    alert('To cast your vote, you must select the number of stars you wish to rate this custom.');
    return false;
  }
  
  document.forms['frmVoteNext'].radVote.value = val;
  document.forms['frmVoteNext'].submit();
  return true;
}