// JavaScript Document

function reg_validation()
{
	if(document.registration.name.value==0)
	{
		alert("Please enter the company name");
		document.registration.name.focus();
		return false;
	}
	if(document.registration.country.value==0)
	{
		alert("Please select the country");
		document.registration.country.focus();
		return false;
	}

	if(document.registration.category.value==0)
	{
		alert("Please enter the category");
		document.registration.category.focus();
		return false;
	}
	
	if(document.registration.short_description.value.length>50)
	{
		alert("Short description should contain maximum 50 characters");
		document.registration.short_description.focus();
		return false;
	}
	if(document.registration.long_description.value==0)
	{
		alert("Please enter the long description");
		document.registration.long_description.focus();
		return false;
	}
	if(document.registration.long_description.value.length>500)
	{
		alert("Long description should contain maximum 500 characters");
		document.registration.long_description.focus();
		return false;
	}
	if(document.registration.url.value==0)
	{
		alert("Please enter the company website url");
		document.registration.url.focus();
		return false;
	}
	if(document.registration.type.value==0)
	{
		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.registration.email.value==0)
	{
		alert("please enter the email");
		document.registration.email.focus();
		return false;
	}
	if(filter.test(document.registration.email.value)==false)
	{
		alert("please enter the valid email");
		document.registration.email.value="";
		document.registration.email.focus();
		return false;
	}
	
	
}

function is_number(val)
{
	if(val!="")
	{
		if(!isNaN(val))
		{
			alert("Please enter the character");	
		}else
		return;
	}
}
