<!--

function checkComment()
{
	var errorMess = "";
	if (document.frmComment.strName.value.length < 2)
	{
		document.frmComment.strName.style.backgroundColor='#FFF0B3';
		errorMess += '# Ditt namn måste innehålla minst 2 tecken.\n';
	}
	else
	{
		document.frmComment.strName.style.backgroundColor='#FFFFFF';
	}

	if (document.frmComment.strComment.value.length < 10 || document.frmComment.strComment.value.length > 250)
	{
		document.frmComment.strComment.style.backgroundColor='#FFF0B3';
		errorMess += '# Ditt kommentar måste innehålla 10-250 tecken.\n';
	}
	else
	{
		document.frmComment.strComment.style.backgroundColor='#FFFFFF';
	}
	
	if (document.frmComment.strCode.value.length < 1)
	{
		document.frmComment.strCode.style.backgroundColor='#FFF0B3';
		errorMess += '# Du har inte angivit något svar på frågan.\n';
	}
	else
	{
		document.frmComment.strCode.style.backgroundColor='#FFFFFF';
	}
	
	if (errorMess.length > 1)
	{
		alert(errorMess);
		return false
	}
	else
	{
		return true;
	}
}

function checkMessage()
{
	var errorMess = "";
	if (document.frmMessage.strName.value.length < 2)
	{
		document.frmMessage.strName.style.backgroundColor='#FFF0B3';
		errorMess += '# Ditt namn måste innehålla minst 2 tecken.\n';
	}
	else
	{
		document.frmMessage.strName.style.backgroundColor='#FFFFFF';
	}
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.frmMessage.strEmail.value)))
	{
		document.frmMessage.strEmail.style.backgroundColor='#FFF0B3';
		errorMess += '# Du har inte angivit en giltig e-postadress.\n';
	}
	else
	{
		document.frmMessage.strEmail.style.backgroundColor='#FFFFFF';
	}
	if (document.frmMessage.strMessage.value.length < 10)
	{
		document.frmMessage.strMessage.style.backgroundColor='#FFF0B3';
		errorMess += '# Ditt meddelande måste innehålla minst 10 tecken.\n';
	}
	else
	{
		document.frmMessage.strMessage.style.backgroundColor='#FFFFFF';
	}
	if (document.frmMessage.intProtect.value.length < 1)
	{
		document.frmMessage.intProtect.style.backgroundColor='#FFF0B3';
		errorMess += '# Du har inte angivit någon kod.\n';
	}
	else
	{
		document.frmMessage.intProtect.style.backgroundColor='#FFFFFF';
	}
	
	if (errorMess.length >1)
	{
		alert(errorMess);
		return false
	}
	else
	{
		return true;
	}
}

function checkAd()
{
	var errorMess = "";
	if (document.frmAd.strCompany.value.length < 2)
	{
		document.frmAd.strCompany.style.backgroundColor='#FFF0B3';
		errorMess += '# Företagsnamnet måste innehålla minst 2 tecken.\n';
	}
	else
	{
		document.frmAd.strCompany.style.backgroundColor='#FFFFFF';
	}
	if (document.frmAd.strCat.value.length < 2)
	{
		document.frmAd.strCat.style.backgroundColor='#FFF0B3';
		errorMess += '# Du har inte angivit någon kategori.\n';
	}
	else
	{
		document.frmAd.strCat.style.backgroundColor='#FFFFFF';
	}
	if (document.frmAd.strDesc.value.length < 10 || document.frmAd.strDesc.value.length > 1000)
	{
		document.frmAd.strDesc.style.backgroundColor='#FFF0B3';
		errorMess += '# Beskrivningen måste innehålla 10-1000 tecken.\n';
	}
	else
	{
		document.frmAd.strDesc.style.backgroundColor='#FFFFFF';
	}
	if (document.frmAd.strURL.value.length < 5)
	{
		document.frmAd.strURL.style.backgroundColor='#FFF0B3';
		errorMess += '# Hemsidesadressen måste innehålla minst 5 tecken.\n';
	}
	else
	{
		document.frmAd.strURL.style.backgroundColor='#FFFFFF';
	}
	if (document.frmAd.strCCompany.value.length < 2)
	{
		document.frmAd.strCCompany.style.backgroundColor='#FFF0B3';
		errorMess += '# Företagsnamn för fakturering måste innehålla minst 2 tecken.\n';
	}
	else
	{
		document.frmAd.strCCompany.style.backgroundColor='#FFFFFF';
	}
	if (document.frmAd.strCOrgNbr.value.length < 10)
	{
		document.frmAd.strCOrgNbr.style.backgroundColor='#FFF0B3';
		errorMess += '# Organisationsnumret måste innehålla minst 10 tecken.\n';
	}
	else
	{
		document.frmAd.strCOrgNbr.style.backgroundColor='#FFFFFF';
	}
	if (document.frmAd.strCAdress.value.length < 5)
	{
		document.frmAd.strCAdress.style.backgroundColor='#FFF0B3';
		errorMess += '# Adress för fakturering måste innehålla minst 5 tecken.\n';
	}
	else
	{
		document.frmAd.strCAdress.style.backgroundColor='#FFFFFF';
	}
	if (document.frmAd.strCZip.value.length < 5)
	{
		document.frmAd.strCZip.style.backgroundColor='#FFF0B3';
		errorMess += '# Postnumret för fakturering måste innehålla minst 5 tecken.\n';
	}
	else
	{
		document.frmAd.strCZip.style.backgroundColor='#FFFFFF';
	}
	if (document.frmAd.strCCity.value.length < 2)
	{
		document.frmAd.strCCity.style.backgroundColor='#FFF0B3';
		errorMess += '# Staden för fakturering måste innehålla minst 2 tecken.\n';
	}
	else
	{
		document.frmAd.strCCity.style.backgroundColor='#FFFFFF';
	}
	if (document.frmAd.strCPhone.value.length < 6)
	{
		document.frmAd.strCPhone.style.backgroundColor='#FFF0B3';
		errorMess += '# Telefonnummer för fakturering måste innehålla minst 6 tecken.\n';
	}
	else
	{
		document.frmAd.strCPhone.style.backgroundColor='#FFFFFF';
	}
	if (document.frmAd.strCContact.value.length < 2)
	{
		document.frmAd.strCContact.style.backgroundColor='#FFF0B3';
		errorMess += '# Du har inte angivit någon kontaktperson.\n';
	}
	else
	{
		document.frmAd.strCContact.style.backgroundColor='#FFFFFF';
	}
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.frmAd.strCEmail.value)))
	{
		document.frmAd.strCEmail.style.backgroundColor='#FFF0B3';
		errorMess += '# Du har inte angivit en giltig e-postadress.\n';
	}
	else
	{
		document.frmAd.strCEmail.style.backgroundColor='#FFFFFF';
	}
	if (document.frmAd.intProtect.value.length < 1)
	{
		document.frmAd.intProtect.style.backgroundColor='#FFF0B3';
		errorMess += '# Du har inte angivit svaret på frågan.\n';
	}
	else
	{
		document.frmAd.intProtect.style.backgroundColor='#FFFFFF';
	}
	
	if (errorMess.length >1)
	{
		alert(errorMess);
		return false
	}
	else
	{
		return true;
	}
}

// -->
