var quote_rules=new Array();
quote_rules[0] = 'checkName()|custom';
quote_rules[1] = 'checkPhone()|custom';
quote_rules[2] = 'email|required|Email found empty';
quote_rules[3] = 'email|email|Please enter a valid email';
quote_rules[4] = 'checkInsurance()|custom';
//quote_rules[5] = 'checkComment()|custom';
quote_rules[5] = 'checkCompany()|custom';
quote_rules[6]	 = 'security_code|required|Security Code found empty';

function checkName(){
	var regx = /^[a-zA-Z\ ]+$/;
	if(document.getElementById('name').value == '') {
		return 'Name found empty';
	}
	else if(!regx.test(document.getElementById('name').value)) {
		return 'Name should contain alphabets only';
	}
}	

function checkPhone() {
 var regx =/^[0-9-().+]+$/;
  if(document.getElementById('phone').value == '') {
      return 'Phone found empty';
  } else if(!regx.test(document.getElementById('phone').value)) {
      return 'Phone number should be in numeric format only';  
  }
}

function checkCompany(){
	var regx = /^[a-zA-Z\ ]+$/;
	if(document.getElementById('company1').value == '') {
		return 'Company found empty';
	}
	else if(!regx.test(document.getElementById('company1').value)) {
		return 'Company should contain alphabets only';
	}
}	

function checkInsurance() {
	if(document.getElementById('insurance').value == '') {
		return 'Select at least one type of insurance coverage';
	}
}

//function checkComment() {
	//var regx = /^[a-zA-Z0-9\ ]+$/;
	//if(document.getElementById('comment').value == '') {
	//	return 'Comment found empty';
	//}
	//else if (!regx.test(document.getElementById('comment').value)) {
	//	return 'Comment should contain alphanumeric characters only';
	//}
//}
