<!--

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 svaret på frågan.\n';
	}
	else
	{
		document.frmMessage.intProtect.style.backgroundColor='#FFFFFF';
	}
	
	if (errorMess.length >1)
	{
		alert(errorMess);
		return false
	}
	else
	{
		return true;
	}
}

function checkNewWork()
{
	var errorMess = "";
	if (document.frmWork.intWorkArea.value == 0)
	{
		document.frmWork.intWorkArea.style.backgroundColor='#FFF0B3';
		errorMess += '# Du har inte angivit någon yrkeskategori.\n';
	}
	else
	{
		document.frmWork.intWorkArea.style.backgroundColor='#FFFFFF';
	}
	if (document.frmWork.strWork.value.length < 2 || document.frmWork.strWork.value.length > 40)
	{
		document.frmWork.strWork.style.backgroundColor='#FFF0B3';
		errorMess += '# Yrket måste innehålla 2-40 bokstäver.\n';
	}
	else
	{
		document.frmWork.strWork.style.backgroundColor='#FFFFFF';
	}
	if (document.frmWork.intProtect.value.length < 1)
	{
		document.frmWork.intProtect.style.backgroundColor='#FFF0B3';
		errorMess += '# Du har inte angivit svaret på frågan.\n';
	}
	else
	{
		document.frmWork.intProtect.style.backgroundColor='#FFFFFF';
	}
	
	if (errorMess.length >1)
	{
		alert(errorMess);
		return false
	}
	else
	{
		return true;
	}
}

function checkSearch()
{
	var errorMess = "";
	if (document.frmSearch.strSearch.value.length < 2 || document.frmSearch.strSearch.value.length > 30)
	{
		document.frmSearch.strSearch.style.backgroundColor='#FFF0B3';
		errorMess += '# Ditt sökord måste bestå av 2-30 bokstäver.\n';
	}
	else
	{
		document.frmSearch.strSearch.style.backgroundColor='#FFFFFF';
	}
	
	if (errorMess.length >1)
	{
		alert(errorMess);
		return false
	}
	else
	{
		return true;
	}
}

function checkSalary()
{
	var errorMess = "";
	if (document.frmSalary.intArea.value == 0)
	{
		document.frmSalary.intArea.style.backgroundColor='#FFF0B3';
		errorMess += '# Du har inte angivit något län.\n';
	}
	else
	{
		document.frmSalary.intArea.style.backgroundColor='#FFFFFF';
	}
	if (document.frmSalary.intWorkArea.value == 0)
	{
		document.frmSalary.intWorkArea.style.backgroundColor='#FFF0B3';
		errorMess += '# Du har inte angivit någon yrkeskategori.\n';
	}
	else
	{
		document.frmSalary.intWorkArea.style.backgroundColor='#FFFFFF';
	}
	if (document.frmSalary.intWork.value == 0)
	{
		document.frmSalary.intWork.style.backgroundColor='#FFF0B3';
		errorMess += '# Du har inte angivit ditt yrke.\n';
	}
	else
	{
		document.frmSalary.intWork.style.backgroundColor='#FFFFFF';
	}
	if ((document.frmSalary.intSalary.value.length < 4) || (document.frmSalary.intSalary.value.length > 5))
	{
		document.frmSalary.intSalary.style.backgroundColor='#FFF0B3';
		errorMess += '# Din månadslön måste bestå av 4-5 siffror.\n';
	}
	else
	{
		if ((document.frmSalary.intSalary.value < 7000) || (document.frmSalary.intSalary.value > 90000))
		{
			document.frmSalary.intSalary.style.backgroundColor='#FFF0B3';
			errorMess += '# Din månadslön måste vara mellan 7000-90000 kr.\n  Kontakta oss om du har en lön utanför spannet.\n';
		}
		else
		{
			document.frmSalary.intSalary.style.backgroundColor='#FFFFFF';
		}
	}
	if (parseInt(document.frmSalary.intExperience.value) > parseInt(document.frmSalary.intAge.value - 10))
	{
		document.frmSalary.intExperience.style.backgroundColor='#FFF0B3';
		errorMess += '# Erfarenheten är för stor i förhållandet till din ålder.\n';
	}
	else
	{
		document.frmSalary.intExperience.style.backgroundColor='#FFFFFF';
	}
	if (document.frmSalary.intSector.value == 0)
	{
		document.frmSalary.intSector.style.backgroundColor='#FFF0B3';
		errorMess += '# Du har inte angivit någon sektor.\n';
	}
	else
	{
		document.frmSalary.intSector.style.backgroundColor='#FFFFFF';
	}
	if (document.frmSalary.intSex.value == 0)
	{
		document.frmSalary.intSex.style.backgroundColor='#FFF0B3';
		errorMess += '# Du har inte angivit något kön.\n';
	}
	else
	{
		document.frmSalary.intSex.style.backgroundColor='#FFFFFF';
	}
	if (document.frmSalary.intProtect.value.length < 1)
	{
		document.frmSalary.intProtect.style.backgroundColor='#FFF0B3';
		errorMess += '# Du har inte angivit svaret på frågan.\n';
	}
	else
	{
		document.frmSalary.intProtect.style.backgroundColor='#FFFFFF';
	}
	
	if (errorMess.length >1)
	{
		alert(errorMess);
		return false
	}
	else
	{
		return true;
	}
}

function onlyLettersNewWork()
{
	if (!(/^[\D]*$/.test(document.frmWork.strWork.value)))
	{
		document.frmWork.strWork.value = "";
	}
}

function onlyLettersSalary()
{
	if (!(/^[\D]*$/.test(document.frmSearch.strSearch.value)))
	{
		document.frmSearch.strSearch.value = "";
	}
}

function onlyDigitsNewWork()
{
	if (!(/^\d+$/.test(document.frmWork.intProtect.value)))
	{
		document.frmWork.intProtect.value = "";
	}
}

function onlyDigitsContact()
{
	if (!(/^\d+$/.test(document.frmMessage.intProtect.value)))
	{
		document.frmMessage.intProtect.value = "";
	}
}

function onlyDigitsCompare()
{
	if (!(/^\d+$/.test(document.frmCompare.strSearch.value)))
	{
		document.frmCompare.strSearch.value = "";
	}
}

function onlyDigitsYourSalary()
{
	if (!(/^\d+$/.test(document.frmSalary.intSalary.value)))
	{
		document.frmSalary.intSalary.value = "";
	}
	if (!(/^\d+$/.test(document.frmSalary.intProtect.value)))
	{
		document.frmSalary.intProtect.value = "";
	}
}

function popup(URL,width,height,scroll){
	if (parseInt(navigator.appVersion) >= 3){
		if (navigator.appName == "Netscape" && parseInt(navigator.appVersion)<5){
			var tools = new Packages.java.awt.Toolkit.getDefaultToolkit();
			screen=tools.getScreenSize();
		}
		x = screen.width;
		y = screen.height;
	}
	window.open(URL,"dummy","top=" + parseInt(y/2-height/2-16) + ",left=" + parseInt(x/2-width/2-5) + ",width=" + width + ",height=" + height + ",scrollbars=" + scroll);
}

// -->