function email_validate(fieldID)
{
	var email = document.getElementById(fieldID);
	if(!email.value.match(/^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$/))
	{
		alert("Invalid email address.");
		email.select();
		return false;
	}
	return true;
}

function num_validate(fieldID)
{
	var num = document.getElementById(fieldID);
	if(!num.value.match( /^[0-9]+$/ ))
	{
		alert("Only number is allowed for this field.");
		num.select();
		return false;
	}
	return true;
}

function phonenum_validate(fieldID)
{
	var num = document.getElementById(fieldID);
	if(!num.value.match( /^[0-9-]+$/ ))
	{
		alert("Contact number must consisted of number only.");
		num.select();
		return false;
	}
	return true;
}

function is_empty(fieldID)
{
	var emp = document.getElementById(fieldID);
	if(emp.value == "")return true;
	return false;
}

function price_validate(fieldID)
{
	var price = document.getElementById(fieldID);
	if(!price.value.match( /^[0-9.]+$/ ))
		{
			alert("Price - integer only.");
			price.select();
			return false;
		}
	return true;
}

function name_validate(fieldID)
{
	var name = document.getElementById(fieldID);
	if(!name.value.match( /^[a-z/.]+$/i ))
	{
		alert("Name must be alphabet.");
		name.select();
		return false;
	}
	return true;
}
