//////////////////////////////
//							//
//	Validator_SurveyReqForm	//
//							//
//////////////////////////////

function ValidatorSurveyReqForm(theForm) {
var ctr = 0;
var i=0;
var j=0;
var checkOK = "0123456789";
var checkOKPer = "0123456789.";
var checkOKDate = "0123456789/";
var checkStr = 0;
var allValid = true;
var validGroups = true;
var decPoints = 0;
var allNum = "";    



	if (theForm.AcctNo.value.length < 1) {
		alert("You Must Enter An Account Number.");
		theForm.AcctNo.focus();
		return (false);
	}


	checkStr = theForm.AcctNo.value;

	for (i = 0;  i < checkStr.length;  i++) {
    	ch = checkStr.charAt(i);

	    for (j = 0;  j < checkOK.length;  j++) {
 			if (ch == checkOK.charAt(j))
        		break;
        }

		if (j == checkOK.length) {
			allValid = false;
			break;
    	}

		allNum += ch;
	}


	if (!allValid) {
    	alert("Please enter only digits (0-9) in the Account Number field.");
    	theForm.AcctNo.focus();
    	return (false);
  	}




	if (theForm.DateNeeded.value.length > 10) {
		alert("You Must Enter A Valid Needed By Date");
		theForm.DateNeeded.focus();
		return (false);
	}


	checkStr = theForm.DateNeeded.value;

	for (i = 0;  i < checkStr.length;  i++) {
    	ch = checkStr.charAt(i);

	    for (j = 0;  j < checkOKDate.length;  j++)
 			if (ch == checkOKDate.charAt(j))
        	break;

		if (j == checkOKDate.length) {
			allValid = false;
			break;
    	}

		allNum += ch;
	}


	if (!allValid) {
    	alert("Please enter only digits (0-9) or a slash (/) in the Date Needed field.");
    	theForm.DateNeeded.focus();
    	return (false);
  	}





	if (theForm.NameIns.value.length < 1) {
		alert("You Must Enter The Name Of The Insured");
		theForm.NameIns.focus();
		return (false);
	}





	'if (theForm.MailingAddr.value.length < 1) {
		'alert("You Must Enter A Mailing Street Address");
		'theForm.MailingAddr.focus();
		'return (false);
	'}




	'if (theForm.MailingTown.value.length < 1) {
		'alert("You Must Enter A Town For The Mailing Address.");
		'theForm.MailingTown.focus();
		'return (false);
	'}





	'if (theForm.MailingState.value.length < 1) {
		'alert("You Must Enter A State For The Mailing Address");
		'theForm.MailingState.focus();
		'return (false);
	'}


	if (theForm.LocAdr1.value.length == < 1 && theForm.MC_Phone.checked == true) {
		alert("You Must Enter At Least One Survey Address");
		theForm.LocAdr1.focus();
		return (false);
	}


	if (theForm.LocTown1.value.length < 1 && theForm.MC_Phone.checked == true) {
		alert("You Must Enter At Least One Survey Town");
		theForm.LocTown1.focus();
		return (false);
	}


	if (theForm.LocSt1.value.length == < 1 && theForm.MC_Phone.checked == true) {
		alert("You Must Enter At Least One Survey State");
		theForm.LocSt1.focus();
		return (false);
	}


	if (theForm.LocZip1.value.length == < 1 && theForm.MC_Phone.checked == true) {
		alert("You Must Enter At Least One Survey Zip Code");
		theForm.LocZip1.focus();
		return (false);
	}


	if (theForm.LocCounty1.value.length == < 1 && theForm.MC_Phone.checked == true) {
		alert("You Must Enter At Least One Survey County");
		theForm.LocCounty1.focus();
		return (false);
	}


	if (theForm.BOP_SMP.checked == false && theForm.BOP_SF.checked == false && theForm.Reinspection.checked == false &&
	    theForm.BOP_Fire.checked == false && theForm.AptCondo.checked == false && theForm.Church.checked == false &&
	    theForm.Farm.checked == false && theForm.Restaurant.checked == false && theForm.AllRisk.checked == false &&
	    theForm.Boiler.checked == false && theForm.BusInterrupt.checked == false && theForm.Glass.checked == false &&
	    theForm.SprinklerLeak.checked == false && theForm.Bailee.checked == false && theForm.BuildersRisk.checked == false &&
	    theForm.ContractorsEq.checked == false && theForm.DIC.checked == false && theForm.InstallFloat.checked == false &&
	    theForm.MarineOp.checked == false && theForm.MotorTruck.checked == false && theForm.Signs.checked == false &&
	    theForm.ValPapers.checked == false && theForm.LiqLiable.checked == false && theForm.MC_Phone.checked == false &&
	    theForm.MC_Jobsite.checked == false && theForm.OLT.checked == false && theForm.Products.checked == false &&
	    theForm.ProfLiable.checked == false && theForm.WorkmensComp.checked == false && theForm.CompleteOps.checked == false &&
	    theForm.LeadPaint.checked == false && theForm.Homeowners.checked = false && theForm.DriveBy.checked == false &&
	    theForm.PhotoOnly.checked == false && theForm.Fleet.checked == false && theForm.GarageLiable.checked == false &&
	    theForm.GKLL.checked == false && theForm.Hired.checked == false && theForm.PhysicalDamage.checked == false &&
	    theForm.Burglary.checked == false && theForm.IORobbery.checked == false && theForm.Money.checked == false &&
	    theForm.Safe.checked == false && theForm.StoreKeepers.checked == false && theForm.RecommendCheck.checked == false) (
			alert("You Must Check At Least One Survey Type");
			theForm.BOP_SMP.focus();
			return (false);
	}
	
	return (true);
}

