function checkKutsuForm()
{
	var f = document.forms['kutsu'];
	var inputcolor = "#ffffff";
	var textcolor = "#000000";
	var errorcolor = "#b01116";
	var errortextcolor = "#ffffff";
	
	document.getElementById('lisatiedot').style.background = inputcolor;
	document.getElementById('sahkoposti').style.background = inputcolor;
	document.getElementById('nimi').style.background = inputcolor;
	document.getElementById('lahiosoite').style.background = inputcolor;
	document.getElementById('postinumero').style.background = inputcolor;
	document.getElementById('postitoimipaikka').style.background = inputcolor;
	
	document.getElementById('lisatiedot').style.color = textcolor;
	document.getElementById('sahkoposti').style.color = textcolor;
	document.getElementById('nimi').style.color = textcolor;
	document.getElementById('lahiosoite').style.color = textcolor;
	document.getElementById('postinumero').style.color = textcolor;
	document.getElementById('postitoimipaikka').style.color = textcolor;
	
	var error = false;
	
	if( f.lisatiedot.value == '' )  {
		error = true;
		document.getElementById('lisatiedot').style.background = errorcolor;
		document.getElementById('lisatiedot').style.color = errortextcolor;
	}
	
	if( f.sahkopostilla.checked) {
		if( f.sahkoposti.value == '' )  {
			error = true;
			document.getElementById('sahkoposti').style.background = errorcolor;
			document.getElementById('sahkoposti').style.color = errortextcolor;
		}
	}
	if( f.kirjepostina.checked) {
		if( f.nimi.value == '' ) {
			error = true;
			document.getElementById('nimi').style.background = errorcolor;
			document.getElementById('nimi').style.color = errortextcolor;
		}
		if( f.lahiosoite.value == '' )	 {
			error = true;
			document.getElementById('lahiosoite').style.background = errorcolor;
			document.getElementById('lahiosoite').style.color = errortextcolor;
		}
		if( f.postinumero.value == '' ) {
			error = true;
			document.getElementById('postinumero').style.background = errorcolor;
			document.getElementById('postinumero').style.color = errortextcolor;
		}
		if( f.postitoimipaikka.value == '' ) {
			error = true;
			document.getElementById('postitoimipaikka').style.background = errorcolor;
			document.getElementById('postitoimipaikka').style.color = errortextcolor;
		}
	}
	
	if( error ) 
	{
		document.getElementById('error').innerHTML = 'Täytä tiedot puuttuviin kenttiin.';
	}
	else
	{
		document.getElementById('error').innerHTML = '&nbsp;';
	}
	
	return !error;
}






function checkTarjousForm()
{
	var f = document.forms['tarjous'];
	var inputcolor = "#ffffff";
	var textcolor = "#000000";
	var errorcolor = "#b01116";
	var errortextcolor = "#ffffff";
	
	document.getElementById('lisatiedot').style.background = inputcolor;
	document.getElementById('sahkoposti').style.background = inputcolor;
	document.getElementById('nimi').style.background = inputcolor;
	document.getElementById('lahiosoite').style.background = inputcolor;
	document.getElementById('postinumero').style.background = inputcolor;
	document.getElementById('postitoimipaikka').style.background = inputcolor;
	
	document.getElementById('lisatiedot').style.color = textcolor;
	document.getElementById('sahkoposti').style.color = textcolor;
	document.getElementById('nimi').style.color = textcolor;
	document.getElementById('lahiosoite').style.color = textcolor;
	document.getElementById('postinumero').style.color = textcolor;
	document.getElementById('postitoimipaikka').style.color = textcolor;
	
	var error = false;
	
	if( f.lisatiedot.value == '' )  {
		error = true;
		document.getElementById('lisatiedot').style.background = errorcolor;
		document.getElementById('lisatiedot').style.color = errortextcolor;
	}
	
	if( f.sahkopostilla.checked) {
		if( f.sahkoposti.value == '' )  {
			error = true;
			document.getElementById('sahkoposti').style.background = errorcolor;
			document.getElementById('sahkoposti').style.color = errortextcolor;
		}
	}
	if( f.kirjepostina.checked) {
		if( f.nimi.value == '' ) {
			error = true;
			document.getElementById('nimi').style.background = errorcolor;
			document.getElementById('nimi').style.color = errortextcolor;
		}
		if( f.lahiosoite.value == '' )	 {
			error = true;
			document.getElementById('lahiosoite').style.background = errorcolor;
			document.getElementById('lahiosoite').style.color = errortextcolor;
		}
		if( f.postinumero.value == '' ) {
			error = true;
			document.getElementById('postinumero').style.background = errorcolor;
			document.getElementById('postinumero').style.color = errortextcolor;
		}
		if( f.postitoimipaikka.value == '' ) {
			error = true;
			document.getElementById('postitoimipaikka').style.background = errorcolor;
			document.getElementById('postitoimipaikka').style.color = errortextcolor;
		}
	}
	
	if( error ) 
	{
		document.getElementById('error').innerHTML = 'Täytä tiedot puuttuviin kenttiin.';
	}
	else
	{
		document.getElementById('error').innerHTML = '&nbsp;';
	}
	
	return !error;
}

