
function change_to_error_class_info(the_object)
{
	$("info_alert").style.display="block";
	$(the_object.id+"_label").style.color="#CC0000";
	$(the_object.id).style.background="yellow";	
}

function remove_error_class_info()
{
	$$('span.ff_label').each(
	    function(el){
	        try{
	            el.style.color="#003300";
	            $(el.getAttribute("my_child")).style.background="#ffffff";
	        }catch(e){alert(el.id)}
	    }
	 );
}

function validate_user_data_info()
{
	var theForm = $("user_info_form");
	var errors = 0;
	remove_error_class();
	if (!theForm.firstname.value)
	{
	    change_to_error_class_info(theForm.firstname);
		errors++;
	}	
	if (!theForm.lastname.value)
	{
	    change_to_error_class_info(theForm.lastname);
		errors++;
	}		
	if (!theForm.city.value){
	    change_to_error_class_info(theForm.city);
		errors++;
	}	
	if (!theForm.postalcode.value){
	    change_to_error_class_info(theForm.postalcode);
		errors++;
	}	
	if (!theForm.email.value){
	    change_to_error_class_info(theForm.email);
		errors++;
	}
	else if(!email_validation(theForm.email.value)){
	    change_to_error_class_info(theForm.email);
		errors++;
	}
	
	if(errors==0)
		return true;
	else
	    return false;
}

