function ValidateForm(theform) {
	
	if (theform.contact_person.value == '') {
		alert('Please provide Contact Name')
		theform.contact_person.focus()
		return false
	}
	
	if (theform.company_name.value == '') {
		alert('Please provide Company Name')
		theform.company_name.focus()
		return false
	}

	if (theform.company_add.value == '') {
		alert('Please provide Company Address')
		theform.company_add.focus()
		return false
	}

	if (theform.contact_no.value == '') {
		alert('Please provide contact number')
		theform.contact_no.focus()
		return false
	}
	

	if ( (theform.contact_no.value.search && theform.contact_no.value.search(new RegExp("^[0-9 \-]*$","g"))<0) ) {
		alert('Only numerics, space and dash allowed for contact number')
		theform.contact_no.focus()
		return false
	}

	if (theform.useremail.value == '') {
		alert('Email address cannot be empty.')
		theform.useremail.focus()
		return false
	}

	if ((checkForValidEmailAddress(theform.useremail)==false)) {
		alert('Please enter a valid e-mail address')
		theform.useremail.focus()
		return false
	}

	if (theform.comments.value == '') {
		alert('Please specify your comments.')
		theform.comments.focus()
		return false
	}

	return true
}

function checkForValidEmailAddress(theinput)
{
	s=theinput.value

	if(s.search) {
		return (s.search(new RegExp("^([a-z0-9_]|\-|\.)+@(([a-z0-9_]|\-)+\.)+[a-z]{2,4}$","gi"))>=0)
	}

	if(s.indexOf) {
		at_character=s.indexOf('@')
		if(at_character<=0 || at_character+4>s.length)
			return false
	}

	if(s.length<6)
		return false
	else
		return true
}
