// JavaScript Document
function validate ( form2 ){
	for (i=0; i<document.getElementById('QTY').value; i++) {
		if (document.getElementById('NM'+i).value == "") {
			alert( "Please type a name." );
			document.getElementById('NM'+i).focus();
			return false ;
		}
		if (document.getElementById('ADR'+i).value == "") {
			alert( "Please type an address." );
			document.getElementById('ADR'+i).focus();
		return false ;
		}	
		if (document.getElementById('CTY'+i).value == "") {
			alert( "Please type a city." );
			document.getElementById('CTY'+i).focus();
		return false ;
		}	
		if (document.getElementById('ST'+i).value == "") {
			alert( "Please type a state." );
			document.getElementById('ST'+i).focus();
		return false ;
		}
		if (document.getElementById('GFT_SND'+i).value == "") {
			alert( "Please type the name desired on the certificate." );
			document.getElementById('GFT_SND'+i).focus();
		return false ;
		}
		if (document.getElementById('ZP'+i).value == "") {
			alert( "Please type a zip." );
			document.getElementById('ZP'+i).focus();
		return false;
		}
		if (document.getElementById('ZP'+i).value.length!=5) {
			alert("Zip Code must be 5 digits.");
			document.getElementById('ZP'+i).focus();
		return false;
		}
		if ((document.getElementById('LIN1'+i).value == "") && (document.getElementById('LIN2'+i).value == "") && (document.getElementById('LIN3'+i).value == "")) {
			alert( "Using Line 1, 2, and/or 3 please indicate what you would like engraved on your brick." );
			document.getElementById('LIN1'+i).focus();
		return false ;
		}
		if ((document.getElementById('LIN1'+i).value != "") && (document.getElementById('LIN1'+i).value.length>14)) {				   
			alert("14 character max for brick line 1.");
			document.getElementById('LIN1'+i).focus();
		return false;
		}
		if ((document.getElementById('LIN2'+i).value != "") && (document.getElementById('LIN2'+i).value.length>14)) {				   
			alert("14 character max for brick line 2.");
			document.getElementById('LIN2'+i).focus();
		return false;
		}
		if ((document.getElementById('LIN3'+i).value != "") && (document.getElementById('LIN3'+i).value.length>14)) {			   
			alert("14 character max for brick line 3.");
			document.getElementById('LIN3'+i).focus();
		return false;
		}
		if (isNaN(document.getElementById('ZP'+i).value))   { 
     		alert('Please only use numbers for the zip code.') 
      		document.getElementById('ZP'+i).focus(); 
		return false ;
		}
	}
}
	function chk_val ( form3 ){
		//for (i=0; i<document.getElementById('QTY').value; i++) {
			if (document.getElementById('CONFIRM').checked == false)	{
				alert ('Please confirm your content by checking the checkbox');
				document.getElementById('CONFIRM').focus();
				return false;
			} else { 	
				return true;
			}

		//}
	}


