	
	var valid = true
	var popme = true
	
	        function everything() {
			             
					fValidate()
					  
					return valid;
					}
			
	      	function anyblanks(errortext) {
				if(errortext == "Please enter a valid:")
					{
						valid = true;
					}
					else
					{
						alert(errortext);
						valid = false;	
					}
				}
			
			function fValidate() {
	                var text = "Please enter a valid:"
					if(isFName() == false) {
	                        text += "\nFirst Name"
	                }
					if(isLName() == false) {
	                        text += "\nLast Name"
	                }
	                if(isAddress() == false) {
	                        text += "\nAddress"
	                }
					if(isCity() == false) {
	                        text += "\nCity"
	                }
					if(isState() == false) {
	                       text += "\nState"
	              	}
					if(isZip() == false) {
	                        text += "\nZip Code"
	                }
					if(isEmail() == false) {
	                        text += "\nEmail Address"
	                }
					
					if(isDOB_Month() == false) {
	                        text += "\nMonth of Birth"
	                }
					
					if(isDOB_Day() == false) {
	                        text += "\nDay of Birth"
	                }
					
					if(isDOB_Year() == false) {
	                        text += "\nYear of Birth"
	                }
					
					if(isFeet() == false) {
	                        text += "\nFeet"
	                }
					
					if(isInches() == false) {
	                        text += "\nInches"
	                }
					
					if(isWeight() == false) {
	                        text += "\nWeight"
	                }
					if(isDayPhone() == false) {
	                        text += "\nDaytime Phone"
	                }
					if(isNightPhone() == false) {
	                        text += "\nEvening Phone"
	                }
			
						
						
					anyblanks(text)
					
	
	        }
	   
	
			
			function isFName() {
	                if (document.fMatrix.first_name.value == "") {
	                        return false
	                }
	                else {
	                        return true
	                }
	        }
			
			function isLName() {
	                if (document.fMatrix.last_name.value == "") {
	                        return false
	                }
	                else {
	                        return true
	                }
	        }
	   
	   		   function isAddress() {
					if (document.fMatrix.address.value == "" || document.fMatrix.address.value.search(" ") == "-1") {
							return false
	                }
	                else {
	                        return true
	                }
	        }
			
			   function isCity() {
	                if (document.fMatrix.city.value == "") {
	                        return false
	                }
	                else {
	                        return true
	                }
	        }
					
	 		  function isState() {
	                if (document.fMatrix.state.value == "xx"){
	                        return false
	                }
	                else {
	                        return true
	                }
	        }
	
	 		  function isZip() {
	                if (document.fMatrix.zipcode.value.length < 5){
	                        return false
	                }
	                else {
	                        return true
	                }
	        }
			
			  function isEmail() {
	                if ((document.fMatrix.email.value == "" || document.fMatrix.email.value.indexOf('@', 0) == -1) || document.fMatrix.email.value.indexOf('.') == -1) {
	                        return false
	                }
	                else {
	                        return true
	                }
	        }
			
			function isDOB_Month() {
	                if (document.fMatrix.dob_month.value == "") {
	                        return false
	                }
	                else {
							for (i = 0; i < document.fMatrix.dob_month.value.length; i++){
								c = document.fMatrix.dob_month.value.charAt(i);
								//alert(c)
								if (isNaN(parseInt(c))){
									return false
								}
							}                     
	                	}
				 return true
	        }
			
			function isDOB_Day() {
	                if (document.fMatrix.dob_day.value == "") {
	                        return false
	                }
	                else {
							for (i = 0; i < document.fMatrix.dob_day.value.length; i++){
								c = document.fMatrix.dob_day.value.charAt(i);
								//alert(c)
								if (isNaN(parseInt(c))){
									return false
								}
							}                     
	                	}
				 return true
	        }
			
			function isDOB_Year() {
	                if (document.fMatrix.dob_year.value == "") {
	                        return false
	                }
	                else {
							for (i = 0; i < document.fMatrix.dob_year.value.length; i++){
								c = document.fMatrix.dob_year.value.charAt(i);
								//alert(c)
								if (isNaN(parseInt(c))){
									return false
								}
							}                     
	                	}
				 return true
	        }
			
			function isFeet() {
	                if (document.fMatrix.height_ft.value == "") {
	                        return false
	                }
	                else {
							for (i = 0; i < document.fMatrix.height_ft.value.length; i++){
								c = document.fMatrix.height_ft.value.charAt(i);
								//alert(c)
								if (isNaN(parseInt(c))){
									return false
								}
							}                     
	                	}
				 return true
	        }
			function isInches() {
	                if (document.fMatrix.height_in.value == "") {
	                        return false
	                }
	                else {
							for (i = 0; i < document.fMatrix.height_in.value.length; i++){
								c = document.fMatrix.height_in.value.charAt(i);
								//alert(c)
								if (isNaN(parseInt(c))){
									return false
								}
							}                     
	                	}
				 return true
	        }
			
			function isWeight() {
	                if (document.fMatrix.weight.value == "") {
	                        return false
	                }
	                else {
							for (i = 0; i < document.fMatrix.weight.value.length; i++){
								c = document.fMatrix.weight.value.charAt(i);
								//alert(c)
								if (isNaN(parseInt(c))){
									return false
								}
							}                     
	                	}
				 return true
	        }
			
			//function isCallTime() {
	        //        if (document.fMatrix.besttime.value == "") {
	        //                return false
	        //        }
	        //        else {
	        //                return true
	        //        }
	        //}
			function isNightPhone() {
			
			if (document.fMatrix.evening_phone_1.value.length < 3 || document.fMatrix.evening_phone_2.value.length < 3 || document.fMatrix.evening_phone_3.value.length < 4)  {
				return false
			}
			else {
					for (i = 0; i < document.fMatrix.evening_phone_1.value.length; i++){
					c = document.fMatrix.evening_phone_1.value.charAt(i);
					//alert(c)
					if (isNaN(parseInt(c))){
							return false
						}
					}
					for (i = 0; i < document.fMatrix.evening_phone_2.value.length; i++){
					c = document.fMatrix.evening_phone_2.value.charAt(i);
					//alert(c)
					if (isNaN(parseInt(c))){
							return false
						}
					}
					for (i = 0; i < document.fMatrix.evening_phone_3.value.length; i++){
					c = document.fMatrix.evening_phone_3.value.charAt(i);
					//alert(c)
					if (isNaN(parseInt(c))){
							return false
						}
					}
				}		
			return true
			}
			
			
			function isDayPhone() {
	       	if (document.fMatrix.daytime_phone_1.value.length < 3 || document.fMatrix.daytime_phone_2.value.length < 3 || document.fMatrix.daytime_phone_3.value.length < 4)  {
				return false
			}
			else {
					for (i = 0; i < document.fMatrix.daytime_phone_1.value.length; i++){
					c = document.fMatrix.daytime_phone_1.value.charAt(i);
					//alert(c)
					if (isNaN(parseInt(c))){
							return false
						}
					}
					for (i = 0; i < document.fMatrix.daytime_phone_2.value.length; i++){
					c = document.fMatrix.daytime_phone_2.value.charAt(i);
					//alert(c)
					if (isNaN(parseInt(c))){
							return false
						}
					}
					for (i = 0; i < document.fMatrix.daytime_phone_3.value.length; i++){
					c = document.fMatrix.daytime_phone_3.value.charAt(i);
					//alert(c)
					if (isNaN(parseInt(c))){
							return false
						}
					}
				}		
			return true
			}
			
		
			//	for (var i = 0; i <= document.fMatrix.daytime_phone_1.value.length; i++)
			
			function isCheckDigit() {
			
					ck = document.fMatrix.cds_cc_number.value.substring(0,2);
					alert(ck);
					
			
					if (document.fMatrix.cds_pay_type[0].checked == true){
					
					
					
					
						//Cards[1] = new CardType("MasterCard", "51,52,53,54,55", "16");
						alert("MC");
					}
					else{
						if (document.fMatrix.cds_pay_type[1].checked == true){
					
							//Cards[3] = new CardType("VisaCard", "4", "13,16");
							alert("VISA");
						}
						else{
							if (document.fMatrix.cds_pay_type[2].checked == true){
					
								//Cards[2] = new CardType("AmExCard", "34,37", "15");
								alert("AMEX");
							}
							else{
								if (document.fMatrix.cds_pay_type[3].checked == true){
								
								//Cards[4] = new CardType("DiscoverCard", "6011", "16");
								alert("DISCOV");
								}
								else{
								alert("NONE");
								return false
								}							
							}
						}
					}
				}
				
			
				function isCCNum() {
				
					
	
					var i, n, c, r, t;
	
		// reverse the string
		
					s = document.fMatrix.cds_cc_number.value;
					r = "";	
				 	for (i = 0; i < s.length; i++) {
			    	c = s.charAt(i);
					if (c >= 0 && c <= 9){
					r = c + r;
					}
		  			}
		
		
					if (s.length != r.length){
				//document.write("BREAK");
					return false;
					}
	
		
	// Loop through the string. 
	// Double Even posions, Leave Odd posiotions alone
		
					t = "";
			  		for (i = 0; i < r.length; i++)	{
					c = parseInt(r.charAt(i), 10);
		    		if (i % 2 != 0)	{
	    			c *= 2;
					}
	    			t = t + c;
					}
	
			
	// Add up all the single digits in this string.
	
	
					n = 0;
					for (i = 0; i < t.length; i++) 
					{
					c = parseInt(t.charAt(i), 10);
					n = n + c;
					}
		
	// If the resulting sum is an even multiple of ten (but not zero), the
	// card number is good.
		
	
					if (n != 0 && n % 10 == 0){
					return true;
					}
					else {
					return false;
					}
			}
	
			
