function formvalidator(checkform){

var validchar = "abcdefghijklmnopqrstuvwxyz~!@#$%^&*()_+=-`{}|\][;':,./?><* ";
var Invalidchar = "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ~!@#$%^&*()_+=-`{}|\][;':,./?><*";
var ValidEmail = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@-._";
var validnum = "0123456789";
var ValidNAME = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";

if (checkform["title"].value == "Title"){
	alert('Please select title.');
	checkform["title"].focus();
	return false;
	}

if (checkform["firstname"].value == ""){
	alert('Please enter your first name.');
	checkform["firstname"].focus();
	return false;
	}
	
if (checkform["lastname"].value == ""){
	alert('Please enter your last name.');
	checkform["lastname"].focus();
	return false;
	}
	
if (checkform["industry"].value == ""){
	if (checkform["others"].value == ""){
	alert('Please enter your industry.');
	checkform["industry"].focus();
	return false;
	}
	}

if (checkform["industry"].value != ""){
	if (checkform["others"].value != ""){
	alert('Please enter one industry only.');
	checkform["others"].focus();
	return false;
	}
	}
	
if (checkform["company"].value == ""){
	alert('Please enter your company name.');
	checkform["company"].focus();
	return false;
	}
	
if (checkform["department"].value == ""){
	alert('Please enter your department.');
	checkform["department"].focus();
	return false;
	}
	
if (checkform["country"].value == ""){
	alert('Please enter your country.');
	checkform["country"].focus();
	return false;
	}
	
if (checkform["telephone"].value == ""){
	alert('Please enter your telephone No.');
	checkform["telephone"].focus();
	return false;
	}
	
if (checkform["fax"].value == ""){
	alert('Please enter your fax No.');
	checkform["fax"].focus();
	return false;
	}

if (checkform["email"].value == ""){
	alert('Please enter your email.');
	checkform["email"].focus();
	return false;
	}
	

if (checkform.email.value == ""){
	alert('Please enter your email address.');
	checkform.email.focus();
	return false;
	}
	
if (checkform.email.value != ""){
if (!IsValidEmail(checkform.email.value)){
	alert('Please enter a valid email address.');
	checkform.email.focus();
	return false;
	}
}


return true;
}


function IsValidEmail(str){
  var filter=/^.+@.+\..{2,3}$/
  return (filter.test(str))
}

