function bakgrund(a, changeTo)
{
	a.style.backgroundColor = changeTo;
}

function textfarg(a, changeTo)
{
	a.style.color = changeTo;
}
 
function visagom(vad)  // Funktion som visar/döljer de olika menyerna.
{
	//alert('visagom');
	if (vad.style.display=='none')
	{
		vad.style.display='';
	} else {
		vad.style.display='none';
	}
}

function hideAll()  // Funtion som kollapsar alla menyobjekt.
{
	//alert('HideAll()');
	document.all['Meny1'].style.display = 'none';
	document.all['Meny2'].style.display = 'none';
	document.all['Meny3'].style.display = 'none';
	document.all['Meny4'].style.display = 'none';
	document.all['Meny5'].style.display = 'none';
}

function reg_privat(reg)
{
	if (document.reg.epost.value.length == 0) 
	{
		alert("Du glömde skriva in en Emailaddress!");
		reg.epost.focus();
		return false;
	}
	if (document.reg.epost.value.indexOf("@") == -1)
	{
		alert("Du skrev inte in en giltig Emailaddress!");
		reg.epost.focus();
		return false;
	}
	if (document.reg.epost.value.indexOf(".") == -1)
	{
		alert("Du skrev inte in en giltig Emailaddress!");
		reg.epost.focus();
		return false;
	}
	if (reg.losen1.value.length == 0) 
	{
		alert("Du glömde skriva in ett Lösenord!");
		reg.losen1.focus();
		return false;
	}
	if (reg.losen2.value.length == 0) 
	{
		alert("Du glömde repetera ditt Lösenord!");
		reg.losen2.focus();
		return false;
	}
	if (reg.losen1.value != reg.losen2.value) 
	{
		alert("Lösenorden du skrev in är inte likadana!");
		reg.losen1.focus();
		return false;
	}
	if (!reg.avtal.checked) 
	{
		alert("Du måste godkänna medlemsavtalet för att bli medlem.");
		//reg.avtal.focus();
		return false;
	}
	return true;
}

function reg_foretag(reg)
{
	if (reg.organisationsnummer.value.length == 0) 
	{
		alert("Du glömde skriva in Organisationsnummer / Personnummer!");
		reg.organisationsnummer.focus();
		return false;
	}
	if (reg.foretag.value.length == 0) 
	{
		alert("Du glömde skriva in Företagets namn!");
		reg.foretag.focus();
		return false;
	}
	if (reg.kontaktperson.value.length == 0) 
	{
		alert("Du glömde skriva in en Kontaktperson!");
		reg.kontaktperson.focus();
		return false;
	}
	if (reg.adress.value.length == 0) 
	{
		alert("Du glömde skriva in en Adress!");
		reg.adress.focus();
		return false;
	}
	if (reg.postnummer.value.length == 0) 
	{
		alert("Du glömde skriva in ett Postnummer!");
		reg.postnummer.focus();
		return false;
	}
	if (reg.ort.value.length == 0) 
	{
		alert("Du glömde skriva in en Ort!");
		reg.ort.focus();
		return false;
	}
	if (reg.land.value.length == 0) 
	{
		alert("Du glömde skriva in ett Land!");
		reg.land.focus();
		return false;
	}
	if (document.reg.epost.value.length == 0) 
	{
		alert("Du glömde skriva in en Emailaddress!");
		reg.epost.focus();
		return false;
	}
	if (document.reg.epost.value.indexOf("@") == -1)
	{
		alert("Du skrev inte in en giltig Emailaddress!");
		reg.epost.focus();
		return false;
	}
	if (document.reg.epost.value.indexOf(".") == -1)
	{
		alert("Du skrev inte in en giltig Emailaddress!");
		reg.epost.focus();
		return false;
	}
	if (reg.losen1.value.length == 0) 
	{
		alert("Du glömde skriva in ett Lösenord!");
		reg.losen1.focus();
		return false;
	}
	if (reg.losen2.value.length == 0) 
	{
		alert("Du glömde repetera ditt Lösenord!");
		reg.losen2.focus();
		return false;
	}
	if (reg.losen1.value != reg.losen2.value) 
	{
		alert("Lösenorden du skrev in är inte likadana!");
		reg.losen1.focus();
		return false;
	}
	if (!reg.avtal.checked) 
	{
		alert("Ni måste godkänna medlemsavtalet för att bli medlem.");
		//reg.avtal.focus();
		return false;
	}
	return true;
}

function visaAlla(vad, hur)
{
	if (hur == true)
	{
		vad.style.display='';
	} else {
		vad.style.display='none';
	}
}

function Tabort(text)
{
	if (confirm("Är det säkert at du vill ta bort denna post?"))
	{
		return true;
	}
	else
	{
		return false;
	}
}

function visa2004foretag()
{
	document.all['2005foretag'].style.display = 'none';
	document.all['2004foretag'].style.display = '';
	document.all['2006foretag'].style.display = 'none';
	document.all['2007foretag'].style.display = 'none';
	document.all['2008foretag'].style.display = 'none';
}

function visa2005foretag()
{
	document.all['2004foretag'].style.display = 'none';
	document.all['2005foretag'].style.display = '';
	document.all['2006foretag'].style.display = 'none';
	document.all['2007foretag'].style.display = 'none';
	document.all['2008foretag'].style.display = 'none';
}

function visa2006foretag()
{
	document.all['2004foretag'].style.display = 'none';
	document.all['2005foretag'].style.display = 'none';
	document.all['2006foretag'].style.display = '';
	document.all['2007foretag'].style.display = 'none';
	document.all['2008foretag'].style.display = 'none';
}

function visa2007foretag()
{
	document.all['2004foretag'].style.display = 'none';
	document.all['2005foretag'].style.display = 'none';
	document.all['2006foretag'].style.display = 'none';
	document.all['2007foretag'].style.display = '';
	document.all['2008foretag'].style.display = 'none';
}

function visa2008foretag()
{
	document.all['2004foretag'].style.display = 'none';
	document.all['2005foretag'].style.display = 'none';
	document.all['2006foretag'].style.display = 'none';
	document.all['2007foretag'].style.display = 'none';
	document.all['2008foretag'].style.display = '';
}

function visa2004privat()
{
	document.all['2005privat'].style.display = 'none';
	document.all['2004privat'].style.display = '';
	document.all['2006privat'].style.display = 'none';
	document.all['2007privat'].style.display = 'none';
	document.all['2008privat'].style.display = 'none';
}

function visa2005privat()
{
	document.all['2004privat'].style.display = 'none';
	document.all['2005privat'].style.display = '';
	document.all['2006privat'].style.display = 'none';
	document.all['2007privat'].style.display = 'none';
	document.all['2008privat'].style.display = 'none';
}

function visa2006privat()
{
	document.all['2004privat'].style.display = 'none';
	document.all['2005privat'].style.display = 'none';
	document.all['2006privat'].style.display = '';
	document.all['2007privat'].style.display = 'none';
	document.all['2008privat'].style.display = 'none';
}

function visa2007privat()
{
	document.all['2004privat'].style.display = 'none';
	document.all['2005privat'].style.display = 'none';
	document.all['2006privat'].style.display = 'none';
	document.all['2007privat'].style.display = '';
	document.all['2008privat'].style.display = 'none';
}

function visa2008privat()
{
	document.all['2004privat'].style.display = 'none';
	document.all['2005privat'].style.display = 'none';
	document.all['2006privat'].style.display = 'none';
	document.all['2007privat'].style.display = 'none';
	document.all['2008privat'].style.display = '';
}

function visa2009()
{
	document.all['ar2009'].style.display = '';
	document.all['ar2010'].style.display = 'none';
}

function visa2010()
{
	document.all['ar2009'].style.display = 'none';
	document.all['ar2010'].style.display = '';
}