function ChkDelivery(theForm){
if(theForm.shipoption.selectedIndex < 1){
 	document.getElementById("Msg").innerHTML = "Please select a Delivery Option.";
	theForm.shipoption.focus();
	return(false);
}
if(theForm.shipoption.selectedIndex == 1){
	theForm.action="https://www.paypal.com/cgi-bin/webscr"
	return(true)
}
else{
		if(theForm.first_name.value == ""){
			document.getElementById("Msg").innerHTML = "Please provide your First name.";
			theForm.first_name.focus();
			return(false);
		 }
		 if(theForm.last_name.value == ""){
			document.getElementById("Msg").innerHTML = "Please provide your Last name.";
			theForm.last_name.focus();
			return(false);
		 }
		if (theForm.address1.value == ""){
				document.getElementById("Msg").innerHTML = "Please provide the Shipping Address.";
				theForm.address1.focus();
			return(false);
		}
		if (theForm.city.value == ""){
				document.getElementById("Msg").innerHTML = "Please provide the Shipping City. ";
				theForm.city.focus();
			return(false);
		}
		if (theForm.city.value.length < 3){
				document.getElementById("Msg").innerHTML = "Please review the Shipping City.";
				theForm.city.focus();
			return(false);
		}
		if (theForm.state.selectedIndex < 1){
				document.getElementById("Msg").innerHTML = "Please select the Shipping State.";
				theForm.state.focus();
			return(false);
		}
		chkZip = strip(theForm.zip.value) + "";
		if (chkZip == ""){
				document.getElementById("Msg").innerHTML = "Please provide the Shipping Zip Code.";
				theForm.zip.focus();
			return(false);
		}
		if (chkZip.length != 5){
				document.getElementById("Msg").innerHTML = "Please provide  5 numbers only for the Shipping Zip Code.";
				theForm.zip.focus();
			return(false);
		}
		 if(theForm.night_phone_a.value == ""){
			document.getElementById("Msg").innerHTML = "Please provide your Area code.";
			theForm.night_phone_a.focus();
			return(false);
		 }
		 if(theForm.night_phone_a.value.length != 3){
			document.getElementById("Msg").innerHTML = "Please review your Area code.";
			theForm.night_phone_a.focus();
			return(false);
		 }
		 
		 if(theForm.night_phone_b.value == ""){
			document.getElementById("Msg").innerHTML = "Please provide the first 3 numbers (prefix) of your telephone number.";
			theForm.night_phone_b.focus();
			return(false);
		 }
		 if(theForm.night_phone_b.value.length != 3){
			document.getElementById("Msg").innerHTML = "Please reivew your telephone number.";
			theForm.night_phone_b.focus();
			return(false);
		 }
		 
		 if(theForm.night_phone_c.value == ""){
			document.getElementById("Msg").innerHTML = "Please provide the last 4 numbers of your telephone number.";
			theForm.night_phone_c.focus();
			return(false);
		 }
		 if(theForm.night_phone_c.value.length != 4){
			document.getElementById("Msg").innerHTML = "Please reivew your telephone number.";
			theForm.night_phone_c.focus();
			return(false);
		 }
		 
		 if(theForm.email.value == ""){
			document.getElementById("Msg").innerHTML = "Please provide your email address.";
			theForm.email.focus();
			return(false);
		 }
		var EMValue = theForm.email.value;	
			var delim1 = EMValue.indexOf("@");
			var delim2 = EMValue.indexOf(".");
			if (delim1 == -1) {
				document.getElementById("Msg").innerHTML = "Please fix your email address.";
				theForm.email.focus();
				return (false);
			}		
			if (delim2 == -1) {
				document.getElementById("Msg").innerHTML = "Please fix your email address.";
				theForm.email.focus();
				return (false);
			}		
			if ((delim2 - delim1) < 3) {
				document.getElementById("Msg").innerHTML = "Please fix your email address.";
				theForm.email.focus();
				return (false);
			}
		
			var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@.-_";
			var checkStr = theForm.email.value;
			var allValid = true;
			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;
				}
			}
			if (!allValid)  {
				document.getElementById("Msg").innerHTML = "Your EMail Address contains characters we don't recognize.";
				theForm.email.focus();
				return (false);
			}
			return(true)
	}	// shipping chosen
}

function strip(number) {
 var sOut = '';
 mask = '1234567890';
 for(count = 0; count <= number.length; count++) {
 	if(mask.indexOf(number.substring(count, count+1),0) != -1 ) sOut += number.substring(count,count+1);
 }
 return sOut;
}

function ClearMsg(what){
			document.getElementById(what).innerHTML = "&nbsp;"
	}