function validateForm(theForm)
{
	if(theForm.vchFirstName.value == '')
	{
		alert('Please specify the First Name.');
		theForm.vchFirstName.select();
		return false;
	}
	if(theForm.vchLastName.value == '')
	{
		alert('Please specify the Last Name.');
		theForm.vchLastName.select();
		return false;
	}
	if(theForm.vchEmail.value == '')
	{
		alert('Please specify the Email Address.');
		theForm.vchEmail.select();
		return false;
	}
	re = new RegExp("([A-Za-z0-9_.-]){2,}@([A-Za-z0-9_.-]){2,}\.([A-Za-z0-9_.-]){2,}")
	if (document.all('vchEmail').value.match(re) == null) 
	  {
			alert("Please specify a valid Email address.");
			document.all('vchEmail').select();
			return false;
	  }
	if(theForm.txtComments.value == '')
	{
		alert('Please specify your comments.');
		theForm.txtComments.select();
		return false;
	}
	
	return true;
}

function validateForm2(theForm)
{
	if(theForm.vchFirstName.value == '')
	{
		alert('Please specify the First Name.');
		theForm.vchFirstName.select();
		return false;
	}
	if(theForm.vchLastName.value == '')
	{
		alert('Please specify the Last Name.');
		theForm.vchLastName.select();
		return false;
	}
	if(theForm.vchEmail.value == '')
	{
		alert('Please specify the Email Address.');
		theForm.vchEmail.select();
		return false;
	}
	re = new RegExp("([A-Za-z0-9_.-]){2,}@([A-Za-z0-9_.-]){2,}\.([A-Za-z0-9_.-]){2,}")
	if (document.all('vchEmail').value.match(re) == null) 
	  {
			alert("Please specify a valid Email address.");
			document.all('vchEmail').select();
			return false;
	  }
	if(theForm.vchCondition.value == '0')
	{
		alert('Please specify the type of Condition.');
		theForm.vchCondition.focus();
		return false;
	}
	if(theForm.vchManufacturer.value == '0')
	{
		alert('Please specify a Manufacturer.');
		theForm.vchCondition.focus();
		return false;
	}
	if(theForm.vchPartNumber.value == '')
	{
		alert('Please specify the Part Number.');
		theForm.vchPartNumber.focus();
		return false;
	}
	if((theForm.intQuantity.value == '')||(theForm.intQuantity.value <= 0))
	{
		alert('Please specify a valid number for quantity.');
		theForm.intQuantity.focus();
		return false;
	}
	/*if(theForm.txtComments.value == '')
	{
		alert('Please specify your comments.');
		theForm.txtComments.select();
		return false;
	}*/
	
	return true;
}

function chkLinkForm(theForm)
{
	if(theForm.intManufID.value == 0)
	{
		alert('Please select a manufacturer.');
		theForm.intManufID.focus();
		return false;
	}
	flgChecked = false;
	for(ctr=0;ctr<document.all('intCatID').length;ctr++)
	{
		if(theForm.intCatID[ctr].selected == true)
		{
			flgChecked = true;
			break;
		}

	}
	if(flgChecked == false)
	{
		alert('Please select atleast one category.');
		document.all('intCatID').focus();
		return false;
	}
	return true;
}