//**********************************************************************************************************************************************************************
// COMMENTS CHECK
//**********************************************************************************************************************************************************************


function CommentsCheck()
{

	// name
	if (document.AddComments.txt_name.value=='')
	{	
		alert("Ange ett namn"); 
		document.AddComments.txt_name.focus();
		 return false;
	}
	
	// title
	if (document.AddComments.txt_title.value=='')
	{	
		alert("Ange en rubrik"); 
		document.AddComments.txt_title.focus();
		 return false;
	}
	
	// body
	if (document.AddComments.txt_body.value=='')
	{	
		alert("Ange en kommentar"); 
		document.AddComments.txt_body.focus();
		 return false;
	}
	
	// code
	if (document.AddComments.strCAPTCHA.value=='')
	{	
		alert("Du måste skriva in koden"); 
		document.AddComments.strCAPTCHA.focus();
		 return false;
	}
	
	
	document.AddComments.submit();
		
}


//**********************************************************************************************************************************************************************
// BLOG COMMENTS CHECK
//**********************************************************************************************************************************************************************


function BlogCommentsCheck()
{

	// name
	if (document.AddBlogComments.txt_name.value=='')
	{	
		alert("Ange ett namn"); 
		document.AddBlogComments.txt_name.focus();
		 return false;
	}
	
	// title
	if (document.AddBlogComments.txt_headline.value=='')
	{	
		alert("Ange en rubrik"); 
		document.AddBlogComments.txt_headline.focus();
		 return false;
	}
	
	// body
	if (document.AddBlogComments.txt_message.value=='')
	{	
		alert("Ange en kommentar"); 
		document.AddBlogComments.txt_message.focus();
		 return false;
	}
	
	// code
	if (document.AddBlogComments.strCAPTCHA.value=='')
	{	
		alert("Du måste skriva in koden"); 
		document.AddBlogComments.strCAPTCHA.focus();
		 return false;
	}
	
	
	document.AddBlogComments.submit();
		
}

//**********************************************************************************************************************************************************************
// QA COMMENTS CHECK
//**********************************************************************************************************************************************************************


function AddQACheck()
{

	// name
	if (document.AddQA.txt_name.value=='')
	{	
		alert("Ange ett namn"); 
		document.AddQA.txt_name.focus();
		 return false;
	}
	
	// city
	if (document.AddQA.txt_city.value=='')
	{	
		alert("Ange vilken stad du kommer ifrån"); 
		document.AddQA.txt_city.focus();
		 return false;
	}
	
	// body
	if (document.AddQA.txt_body.value=='')
	{	
		alert("skriv din fråga"); 
		document.AddQA.txt_body.focus();
		 return false;
	}
	

	
	
	document.AddQA.submit();
		
}


//**********************************************************************************************************************************************************************
// TIP A FRIEND CHECK
//**********************************************************************************************************************************************************************


function TipCheck()
{

	// name
	if (document.tip.your_name.value=='')
	{	
		alert("Ange ditt namn"); 
		document.tip.your_name.focus();
		 return false;
	}
	
	// email
	if (document.tip.your_email.value=='')
	{	
		alert("Ange din e-postadress"); 
		document.tip.your_email.focus();
		 return false;
	}
	
	// friends email
	if (document.tip.friend_email.value=='')
	{	
		alert("Ange din väns e-postadress"); 
		document.tip.friend_email.focus();
		 return false;
	}
	

	
	
	document.tip.submit();
		
}

//**********************************************************************************************************************************************************************
// COMPETITION CHECK
//**********************************************************************************************************************************************************************


function CompetitionCheck()
{
	
	// svar
	if(!document.tavling.CompetitionAnswer[0].checked &&! document.tavling.CompetitionAnswer[1].checked &&! document.tavling.CompetitionAnswer[2].checked)
	{
		alert("Kryssa i ditt svar på tävlingsfrågan"); 
		return false;
	} 
	
	// förnamn
	if (document.tavling.FirstName.value=='')
	{	
		alert("Ange ditt namn"); 
		document.tavling.FirstName.focus();
		 return false;
	}
	
	// efternamn
	if (document.tavling.SurName.value=='')
	{	
		alert("Ange ditt efternamn"); 
		document.tavling.SurName.focus();
		 return false;
	}
	
	// adress
	if (document.tavling.Address.value=='')
	{	
		alert("Ange din adress"); 
		document.tavling.Address.focus();
		 return false;
	}
	
	// postnummer
	if (document.tavling.PostCode.value=='')
	{	
		alert("Ange din postnummer"); 
		document.tavling.PostCode.focus();
		 return false;
	}
	
	// ort
	if (document.tavling.City.value=='')
	{	
		alert("Ange vilken ort du kommer ifrån"); 
		document.tavling.City.focus();
		 return false;
	}
	
	
	// ålder
	var sel=document.getElementById('DateOfBirth');
	
	if (sel) 
	{
		if (sel.options[sel.selectedIndex].value.length==0) 
		{
			alert('Ange födelseår');
			return false;
		}
	}
	
	// epost-adress
	if (document.tavling.Email.value=='')
	{	
		alert("Ange din e-postadress"); 
		document.tavling.Email.focus();
		 return false;
	}
	

	

	
	document.tavling.submit();
		
}