
necessary_fields = new Array (
	
	"telephone_day",
	"address1",
	"city",
	"postcode"
	
);

field_regexp = /interested/;
check_fields = false;

function check_quote_form (form) {
	
	for (i=0; i<form.length; i++){
	
		if (is_element(form.elements[i].name, necessary_fields)) {
		
			if (form.elements[i].value == "") {
			
				alert ("Please fill in this field!");
				form.elements[i].focus();
                form.elements[i].style.backgroundColor = "fff1d5"; 
			 	return false;
				
			}		
		
		    
        }     
        
        if (field_regexp.test(form.elements[i].name)) {
            
            if (form.elements[i].checked) check_fields = true;            
            
        }
	}
	
    if (!check_fields) {
    
        alert ("Please indicate the products in which you are interested!");
        
    }
    
	return check_fields;
	
}

function is_element (elem, s_array) {

	for (j=0; j<s_array.length; j++) {
		
		if (elem == s_array[j]) return true;
	
	}
	
	return false;

}