function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
  {alert(alerttxt);return false}
else {return true}
}
}

function validate_other(field,alerttxt)
{
with (field)
{
if (document.txt_form.carrier.value=="Other"&&value=="")
	{alert(alerttxt);return false}
else {return true}
}
}

function validate_phone(field,alerttxt)
{
with (field)
{

if (!(value.length == 10))
  {alert(alerttxt);return false}
else {return true}

}
}

function validate_form(thisform)
{
with (thisform)
{
if (validate_required(number,"Please enter your cellular number!")==false)
  {number.focus();return false}
  
if(validate_phone(number,"The phone number should be 10 digits, no spaces or dashes, no leading 1.  Dont forget your area code!")==false)
  {number.focus();return false}

if(validate_required(carrier,"Please select a cellular carrier!")==false)
  {carrier.focus();return false}

if(validate_other(other,"You selected OTHER as your carrier, please fill in the carrier name!")==false)
  {other.focus();return false}
  
}
}
