// JavaScript Document

function reg_validation()
{
	if(document.articleregistration.category.value==0)
	{
		alert("Please enter the category");
		document.articleregistration.category.focus();
		return false;
	}
	if(document.articleregistration.long_description.value==0)
	{
		alert("Please enter the long description");
		document.articleregistration.long_description.focus();
		return false;
	}
	if(document.articleregistration.long_description.value.length>10000)
	{
		alert("Long description should contain maximum 10000 characters");
		document.articleregistration.long_description.focus();
		return false;
	}
	if(document.articleregistration.title.value==0)
	{
		alert("Please select the country");
		document.articleregistration.title.focus();
		return false;
	}
	if(document.articleregistration.url.value==0)
	{
		alert("Please enter the company website url");
		document.articleregistration.url.focus();
		return false;
	}
	var url_filter=/(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,4})$/;
	if(url_filter.test(document.articleregistration.url.value)==false)
	{
		alert("Please enter the valid url");
		document.articleregistration.url.focus();
		return false;			
	}
	if(document.articleregistration.author_name.value==0)
	{
		alert("Please enter the author name");
		document.articleregistration.author_name.focus();
		return false;
	}
	if(document.articleregistration.type.checked==false)
	{
		alert("Please select the type");
		//document.registration.type.focus();
		return false;
	}
	var filter=/^([a-zA-Z0-9_\.\-]{2,})+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,4})+$/;
	if(document.articleregistration.email.value==0)
	{
		alert("Please enter the email");
		document.articleregistration.email.focus();
		return false;
	}
	if(filter.test(document.articleregistration.email.value)==false)
	{
		alert("Please enter the valid email");
		document.articleregistration.email.value="";
		document.articleregistration.email.focus();
		return false;
	}
	
	if(document.articleregistration.secure_text.value==0)
	{
		alert("Please enter the code shown in the image");
		document.articleregistration.secure_text.focus();
		return false;
	}
	if(document.articleregistration.secure_text.value.length!=7)
	{
		alert("Please check the code shown in the image");
		document.articleregistration.secure_text.focus();
		return false;
	}
		
}

function is_number(val)
{
	if(val!="")
	{
		if(!isNaN(val))
		{
			alert("Please enter the character");
		}else
		return;
	}
}
