function check_comments(form)
{
    return true;
	if (verify_sender_name(form.sender_name))
	{
		if (verify_email(form.email, form.email_confirm))
		{
			if (verify_subject(form.subject))
			{
				return true;
			}
		}
	}
	return false;
}

function check_contact_us(form)
{
    return true;
	if (verify_sender_name(form.sender_name))
	{
		if (verify_company_name(form.company))
		{
			if (verify_city(form.city))
			{
				if (verify_email(form.email, form.email_confirm))
				{
					if (verify_country(form.country, form.country_other, form.province, form.state))
					{
						if (verify_business_activity(form.business_activity, form.business_activity_other))
						{
							if (verify_job_activity(form.elements['job_activity[]'], form.job_activity_other))
							{
								return true;
							}
						}
					}
				}
			}
		}
	}
	return false;
}


function check_surplus_contact(form) {
    return true;
    if (verify_sender_name(form.sender_name)) {
        if (verify_company_name(form.company)) {
            if (verify_city(form.city)) {
                if (verify_email(form.email, form.email_confirm)) {
                    if (verify_country(form.country, form.country_other, form.province, form.state)) {
                        if (verify_business_activity(form.business_activity, form.business_activity_other)) {
                            return true;
                        }
                    }
                }
            }
        }
    }
    return false;
}

/*function check_all(form)
{
	return true;
}*/


// General checks

function isValidRadio(radio)
{
    var valid = false;
    for (var i = 0; i < radio.length; i++) {
        if (radio[i].checked) {
            return true;
        }
    }
    return false;
}

function verify_other(other)
{
	var string = other.value
	if (string == null || string.length == 0)
	{
		alert('If you chose OTHER, you must enter a value.');
		other.focus();
		return false;
	}
	else
	{
		return true;
	}
}


// Specific checks

function verify_sender_name(username)
{
	string = username.value;
	if (string == null || string.length == 0)
	{
		alert('Please enter a name.');
		username.focus();
		return false;
	}
	else
	{
		return true;
	}
}


function verify_company_name(company_name)
{
	var string = company_name.value;
	if (string == null || string.length == 0)
	{
		alert('Please enter a company name.');
		company_name.focus();
		return false;
	}
	else
	{
		return true;
	}
}

function verify_city(city)
{
	var string = city.value;
	if (string == null || string.length == 0)
	{
		alert('Please enter a city.');
		city.focus();
		return false;
	}
	else
	{
		return true;
	}
}

function verify_email(email, email_confirm)
{
	var email1 = email.value;
	var email2 = email_confirm.value;
	
	if (email1 == null || email1.length == 0)
	{
		alert('Please enter your email address');
		email.focus();
		return false;
	}
	
	if (email2 == null || email2.length == 0)
	{
		alert('Please confirm your email address');
		email_confirm.focus();
		return false;
	}
	
	if (email1 != email2)
	{
		alert('The email addresses you entered do not match');
		email_confirm.focus()
		return false;
	}
	
	return true;
}

function verify_city(city)
{
	var string = city.value;
	if (string == null || string.length == 0)
	{
		alert('Please enter your city.');
		city.focus();
		return false;
	}
	else
	{
		return true;
	}
}


function mark_country_sub_required(country)
{
	// alert('checking country requirements....');
	var is_getElementById   = (document.getElementById) ? "true" : "false";
	
	if (is_getElementById)
	{
		if (country.value == 'Canada')
		{
			document.getElementById('province_req').innerHTML = '*';
			document.getElementById('state_req').innerHTML = '';
			document.getElementById('province').disabled = false;
			document.getElementById('state').disabled = true;
// 			document.getElementById('country_other_req').innerHTML = '';
		}		
		else if (country.value == 'United States')
		{
			document.getElementById('province_req').innerHTML = '';
			document.getElementById('state_req').innerHTML = '*';
			document.getElementById('province').disabled = true;
			document.getElementById('state').disabled = false;
// 			document.getElementById('country_other_req').innerHTML = '';
		}
// 		else if (country.value == 'Other')
// 		{
// 			document.getElementById('province_req').innerHTML = '';
// 			document.getElementById('state_req').innerHTML = '';
// 			document.getElementById('country_other_req').innerHTML = '*';
// 		}
		else
		{
			document.getElementById('province_req').innerHTML = '';
			document.getElementById('state_req').innerHTML = '';
			document.getElementById('province').disabled = true;
			document.getElementById('state').disabled = true;
// 			document.getElementById('country_other_req').innerHTML = '';
		}
	}
}

function verify_country(country, country_other, province, state)
{
	if (country.value == '')
	{
		alert('Please choose a country.');
		country.focus();
		return false;
	}
	else if (country.value == 'Canada')
	{
		return verify_province(province);
	}
	else if (country.value == 'US')
	{
		return verify_state(state);
	}
	else
	{
		if (country.value == 'Other')
		{
			if (!verify_other(country_other))
			{
				return false;
			}
		}
		
		return true;
	}
}

function verify_province(province)
{
	if (province.value == 'none')
	{
		alert('If you selected Canada as your country, you must choose a province.');
		province.focus();
		return false;
	}
	else
	{
		return true;
	}
}

function verify_state(state)
{
	if (state.value == 'none')
	{
		alert('If you selected the United States as your country, you must choose a state.');
		state.focus();
		return false;
	}
	else
	{
		return true;
	}	
}

function verify_business_activity(business_activity, business_activity_other)
{
	var last_element = business_activity.length - 1;
	if(!isValidRadio(business_activity))
	{
		alert('Please choose a Company Business Activity.');
		business_activity[0].focus();
		return false;
	}
	else
	{
		if (business_activity[last_element].checked)
		{
			if(!verify_other(business_activity_other))
			{
				return false;
			}
		}
		
		return true;
	}
}


function verify_job_activity(job_activity, job_activity_other)
{
	var last_element = job_activity.length - 1;
	if (!isValidRadio(job_activity))
	{
		alert('Please choose at least one of the Company Job Activities');
		job_activity[0].focus()
		return false;
	}
	else
	{
		if (job_activity[last_element].checked)
		{
			if(!verify_other(job_activity_other))
			{
				return false;
			}
		}
		
		return true;
	}
}


function verify_subject(subject)
{
	string = subject.value;
	if (string == null || string.length == 0)
	{
		alert('Please enter a subject.');
		subject.focus();
		return false;
	}
	else
	{
		return true;
	}
}