
function checkNumber(component)
{
	c = component;
	if ((c.value - 0) < 0 || isNaN(c.value - 0) || c.value == "")
	{
		alert("   Värdet måste vara ett positivt tal!   ");
		c.value = c.defaultValue;
		return false;
	}
	return true;
}

function checkapplicationform()
{
	if (applicationform.competition.value == "" || applicationform.name.value == "" || applicationform.club.value == "" || applicationform.gender.value == "" || applicationform.dateofbirth.value == "" )
	{
		alert("   Du måste fylla i alla fält.   ");
		return false;
	}
	if (applicationform.name.value.indexOf(" ") < 0 )
	{
		alert("   Du måste fylla i både förnamn och efternamn.   ");
		return false;
	}
	if (applicationform.dateofbirth.value.indexOf("-") != 4 )
	{
		alert("   Födelsedatum måste anges i formatet ÅÅÅÅ-MM-DD, t ex 1979-08-16   ");
		return false;
	}
	return true;
}

function ensureWindow()
{
	if (top.location.href != location.href)
	{
	   top.location.href = location.href;
	}
}

function submitForm(form)
{
	if (form.onsubmit())
	{
		form.submit();
	}
}


