//Affliate Content Units Check
function checkAffiliateContentUnits()
{
	if(document.aff_form.affcode.value.length <= 0)
	{
		alert('Please Enter Your Affiliate ID');
		document.aff_form.affcode.focus();
		document.aff_form.affcode.style.backgroundColor='yellow';
		return false;				
	}
	else if(document.aff_form.afuture.checked)
	{
		var checkDigit = "1234567890";
		var affCode = document.aff_form.affcode.value;
		
		for(i=1; i<=affCode.length; i++)
		{
			if(checkDigit.indexOf(affCode.charAt(i)) == -1)
			{
				alert("Affiliate code should be a numeric value");
				document.aff_form.affcode.focus();
				document.aff_form.affcode.style.backgroundColor='yellow';
				return false;
			} 
        }			
	}
	else 
	{
		return true;
	}
}

function checkAffiliateDealOfTheDay()
{
	if(document.aff_form.affcode.value.length <= 0)
	{
		alert('Please Enter Your Affiliate ID');
		document.aff_form.affcode.focus();
		document.aff_form.affcode.style.backgroundColor='yellow';
		return false;				
	}
	else if(!document.aff_form.heading.checked 
			&& !document.aff_form.title.checked 
			&& !document.aff_form.text.checked 
			&& !document.aff_form.banner.checked 
			&& !document.aff_form.video.checked 
			&& !document.aff_form.link.checked)
	{
		alert('Please Tick Your Required Display Options');
		document.aff_form.heading.focus();
		document.aff_form.heading.style.backgroundColor='yellow';
		return false;
	}
	else if(document.aff_form.afuture.checked)
	{
		var checkDigit = "1234567890";
		var affCode = document.aff_form.affcode.value;
		
		for(i=1; i<=affCode.length; i++)
		{
			if(checkDigit.indexOf(affCode.charAt(i)) == -1)
			{
				alert("Affiliate code should be a numeric value");
				document.aff_form.affcode.focus();
				document.aff_form.affcode.style.backgroundColor='yellow';
				return false;
			} 
        }			
	}
	else 
	{
		return true;
	}
}

function openBlock(elementA)
{
	 document.getElementById(elementA).style.display="block";
}

function closeBlock(elementA)
{
	 document.getElementById(elementA).style.display="none";
}
