function checkHeatLoss(f)
{
	errors = "The following errors have been found: \n\n";
	valid = true;
	
    contact_errors = checkContactDetails(f);
    
	if(contact_errors != "")
	{
        errors += contact_errors;
		valid = false;
	}
    
    if (!valid)
    {
        errors += "\nPlease try again";
        alert(errors);
    }
    
    return valid;
}

function checkContactForm(f)
{
	errors = "The following errors have been found: \n\n";
	valid = true;
	
    contact_errors = checkContactDetails(f);
    
	if(contact_errors != "")
	{
        errors += contact_errors;
		valid = false;
	}
    
    if (!valid)
    {
        errors += "\nPlease try again";
        alert(errors);
    }
    
    return valid;
}

function checkContactDetails(f)
{
	contact_errors = "";

    if (f.name.value == "")
    {
        contact_errors += "- Name must be completed.\n";
    }
   
    //if (f.job_title.value == "")
    //{
    //    contact_errors += "- Job title must be completed.\n";
    //} 
    
    if (f.company_name.value == "")
    {
        contact_errors += "- Company Name must be completed.\n";
    }

    if (f.address_1.value == "")
    {
        contact_errors += "- Address must be completed.\n";
    }   
 
    if (f.town.value == "")
    {
        contact_errors += "- Town must be completed.\n";
    } 
    
    if (f.postcode.value == "")
    {
        contact_errors += "- Postcode must be completed.\n";
    } 
    
    if (f.tel_no.value == "")
    {
        contact_errors += "- Telephone must be completed.\n";
    }

    if (f.email.value == "")
    {
        contact_errors += "- Email must be completed.\n";
    }
    	
    	
	return contact_errors;
}