function validateForm(formObj)
{
	var isValid = true;
	if(document.getElementById('emailSpan')) document.getElementById('emailSpan').innerHTML="";
	if(document.getElementById('phoneSpan')) document.getElementById('phoneSpan').innerHTML="";
	


	// CHECKBOX 
	var len = formObj.elements.length;
	
 	var hasCheck = false;
	var cc=0;
	for(i=0; i<len; i++) 
	{
		var e = formObj.elements[i];
		if(e.type == 'checkbox')
		{
			cc++;
			if(e.checked == true) hasCheck = true;
		}
		
	} 
	
	
	if( (hasCheck == false)&&(cc !=0) )
	{
	 	if(document.getElementById('checkboxSpan')) document.getElementById('checkboxSpan').innerHTML="Please select at least one item from the list below";
 	isValid = false;
 	}
 	else if(document.getElementById('checkboxSpan')) document.getElementById('checkboxSpan').innerHTML="";
	


	//First Name
	if(formObj.first_name)
	{
		if(formObj.first_name.value == "")
		{
			 document.getElementById('firstNameSpan').innerHTML="First Name is required";
			 isValid = false;
		}
		else document.getElementById('firstNameSpan').innerHTML="";
	}
	
	
	//Last Name
	if(formObj.last_name)
	{
		if(formObj.last_name.value=="")
		{
			 document.getElementById('lastNameSpan').innerHTML="Last Name is required";
			 isValid = false;
		}
		else document.getElementById('lastNameSpan').innerHTML="";
	}
	
	
	//Job Title
	if(formObj.title)
	{
		if(formObj.title.value=="")
		{
			document.getElementById('titleSpan').innerHTML="Job Title is required";
			isValid = false;
		}
		else document.getElementById('titleSpan').innerHTML="";
	}
	

	//Company
	if(formObj.company)
	{
		if(formObj.company.value=="")
		{
			 document.getElementById('companySpan').innerHTML="Company is required";
			 isValid = false;
		}
		else document.getElementById('companySpan').innerHTML="";
	}
	

	//State/Province
	if(formObj.state)
	
	{
		//alert('sel obj is enabled'+ formObj.stateSelect.enabled);
		if(formObj.state.value=="" && formObj.state.disabled==false)
		{
			 
			 document.getElementById('stateSpan').innerHTML="State/Province is required";
			 isValid = false;
		}
		else document.getElementById('stateSpan').innerHTML="";
	}
	
	//Country
	if(formObj.country)
	{
		if(formObj.country.value=="")
		{
			 document.getElementById('countrySpan').innerHTML="Country is required";
			 isValid = false;
		}
		else document.getElementById('countrySpan').innerHTML="";
	}
	
	
	//Address
	if(formObj.street)
	{
		if(formObj.street.value=="")
		{
			 document.getElementById('streetSpan').innerHTML="Address, is required";
			 isValid = false;
		}
		else document.getElementById('streetSpan').innerHTML="";
	}
	
	
	//City
	if(formObj.city)
	{
		if(formObj.city.value=="")
		{
			 document.getElementById('citySpan').innerHTML="City is required";
			 isValid = false;
		}
		else document.getElementById('citySpan').innerHTML="";
	}
	
	
	//Zip/Postal Code
	if(formObj.zip)
	{
		if(formObj.zip.value=="")
		{
			 document.getElementById('zipSpan').innerHTML="Zip/Postal Code is required";
			 isValid = false;
		}
		else document.getElementById('zipSpan').innerHTML="";
	}
	

	//PHONE
	if(formObj.phone)
	{
		if ( (formObj.phone.value=="") || (formObj.phone.value== null) )
		{
				document.getElementById('phoneSpan').innerHTML="Phone is required";
				isValid = false;
		}
		else {
				var tfld = trim(formObj.phone.value); // value of field with whitespace trimmed off
				var telnr = /^\+?[0-9 ()-]+[0-9]$/ ;
				if( (telnr.test(tfld) == false) || (tfld.length < 10) ) 
				{
					formObj.phone.value="";
					formObj.phone.focus();
					document.getElementById('phoneSpan').innerHTML="Please enter valid phone number";
					isValid = false;
				}
			 }	
	}


	//EMAIL
	if(formObj.email)
	{
		if ( (formObj.email.value == "") || (formObj.email.value == null) )
		{
			document.getElementById('emailSpan').innerHTML="E-mail is required";
			isValid = false;
		}
		else if (echeck(formObj.email.value)==false)
		{
			 formObj.email.value="";
			 formObj.email.focus();
			 document.getElementById('emailSpan').innerHTML="Please enter valid business E-mail";
			 isValid = false;
		 }
	}
	return isValid;
}

function trim(str)
{
 return str.replace(/^\s+|\s+$/g, '');
}

function echeck(str) {
 var fat=str.indexOf("@");
 var lat=str.lastIndexOf("@");
 

	if (lat != fat) return false;

	var company = str.substr(fat+1);
	
	
	var fdot = company.indexOf(".");
	var ldot=company.lastIndexOf(".");
	

 var patt=new RegExp("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?");
 if (patt.test(str) == false) return false; //here checking the email pattern is ok or not
 var personalEmailsListWithoutIndustry = [
				'aarete',
				'abacistgroup',
				'aberdeen',
				'accenture',
				'accesswave',
				'acd',
				'adlittle',
				'advisory',
				'advisoryboardcompany',
				'alice-dsl',
				'alixpartners',
				'alphanet',
				'alvarezandmarsal',
				'ameritech',
				'analysisgroup',
				'ansrsource',
				'aol',
				'aonconsulting',
				'apqc',
				'aptmetrics',
				'archstoneconsulting',
				'astadia',
				'atkearney',
				'bah',
				'bain',
				'bankersacademy',
				'bcg',
				'bearingpoint',
				'beasonnalley',
				'bellsouth',
				'bigpond',
				'bluewin',
				'booz',
				'boozallen',
				'brainware',
				'brightlinecompliance',
				'bscinc',
				'btinternet',
				'buckconsultants',
				'businessethics',
				'cablespeed',
				'caci',
				'cambridgeassociates',
				'capacent',
				'capgemini',
				'cartus',
				'cas-inc',
				'cdcsoftware',
				'celerantconsulting',
				'charter',
				'chazeypartners',
				'circlemconsulting',
				'city',
				'ck-consulting',
				'codeofconduct',
				'comcast',
				'conference-board',
				'corpedia',
				'corpu',
				'cox',
				'csc',
				'customatrix',
				'cvhaynes',
				'dc.ibm',
				'deloitte',
				'detecon',
				'diamondconsultants',
				'directbox',
				'earthlink',
				'eastlink',
				'eds',
				'eduneering',
				'eftel',
				'elt-inc',
				'epicor',
				'erols',
				'ethicalleadershipgroup',
				'ethics',
				'ethicscoach',
				'ethisphere',
				'everestgrp',
				'everis',
				'everymind',
				'exectgroup',
				'executiveboard',
				'ey',
				'eyeon',
				'fas-ag',
				'fmcg',
				'forwardcast',
				'free',
				'freenet',
				'frontierstrategygroup',
				'fticonsulting',
				'futurestep',
				'gallup',
				'gartner',
				'gawab',
				'gci',
				'gc-usa',
				'g-intl',
				'globalcompliance',
				'globalcomplianceservices',
				'globaleprocure',
				'gmail',
				'gmx',
				'googlemail',
				'hack',
				'hacker',
				'hacket',
				'hacketgroup',
				'hackets',
				'hacketts',
				'hackettt',
				'hackgroup',
				'hacks',
				'harland',
				'haygroup',
				'hbci',
				'hcl',
				'here',
				'hitachiconsulting',
				'horvath-partners',
				'hotmail',
				'hrsmart',
				'hrtarchitect',
				'huronconsultinggroup',
				'ibm',
				'ibm/services',
				'ieee',
				'imail',
				'in',
				'inbox',
				'ineum',
				'informatica',
				'infotech',
				'infreight',
				'insight',
				'insightbb',
				'insomnia',
				'integrityatwork',
				'integrity-interactive',
				'integritypreview',
				'integrityweb',
				'internode',
				'invensys',
				'ips',
				'ips.invensys',
				'iqgroup',
				'juno',
				'k2sg',
				'katzenbach',
				'kaygen',
				'kea-partners',
				'kellyocg',
				'knowledgeinfusion',
				'kpmg',
				'kurtsalmon',
				'lek',
				'leonardandassociates',
				'lexis',
				'lexisone',
				'linkageinc',
				'live',
				'loa',
				'loma',
				'mac',
				'mail',
				'mailinator',
				'markmillar',
				'marsandco',
				'mckinsey',
				'me',
				'mercer',
				'microdea',
				'midicorp',
				'millwardbrown',
				'mindkey',
				'minelightsolutions',
				'mitchellmadison',
				'monitor',
				'mranet',
				'msn',
				'mvcioni',
				'my',
				'navigantconsulting',
				'netcologne',
				'netg',
				'netpartners',
				'nexis',
				'northcore',
				'nthorbit',
				'occstrategy',
				'ocgroup',
				'oliverwyman',
				'online',
				'onlinehome',
				'openpages',
				'operasolutions',
				'optonline',
				'orange',
				'p3si',
				'pacbell',
				'paconsulting',
				'pandora',
				'parthenon',
				'planet',
				'planview',
				'pli',
				'pli-corpedia',
				'pmlg',
				'pollenware',
				'princetowncable',
				'prodigy',
				'prosum',
				'proudfootconsulting',
				'prtm',
				'purchasingpractice',
				'pwc',
				'qinetiq',
				'quantimetrics',
				'qwert',
				'radding',
				'rbsc',
				'rcn',
				'redced',
				'rediffmail',
				'resources-usa',
				'risklexisnexis',
				'rocketmail',
				'rolandberger',
				'rr',
				'sbcglobal',
				'scca',
				'shawgrp',
				'sify',
				'skillsoft',
				'sky',
				'sms',
				'sogeti',
				'solutionsmanaged',
				'sourcemedia',
				'SourceMedia',
				'starhub',
				'strategicbenefitssolutionsllc',
				'supply-chainassociates',
				'swbell',
				'talentleaders',
				'talktalk',
				'tatumllc',
				'tcs',
				'techteam',
				'techworkers',
				'tele2',
				'telecom',
				'telia',
				'thehacgroup',
				'thehackegroup',
				'thehacketg',
				'thehacketgr',
				'thehacketgro',
				'thehacketgrou',
				'thehacketgroups',
				'thehackettg',
				'thehackettgr',
				'thehackettgro',
				'thehackettgrou',
				'thehackettgroups',
				'thehackgroup',
				'thehagroup',
				'thehgroup',
				'themagisgroup',
				'tnwinc',
				'tocashasociados',
				't-online',
				'tosolco',
				'trainingfromthecore',
				'tstt',
				'uk.ibm',
				'uk.pwc',
				'us.axway',
				'us.fujitsu',
				'us.ibm',
				'us.pwc',
				'verizon',
				'virtusa',
				'vodamail',
				'watsonwyatt',
				'wccltd',
				'web',
				'wecomply',
				'wideopenwest',
				'workingvalues',
				'workplaceanswers',
				'wowway',
				'xtra',
				'yahoo',
				'ymail',
				'zerochaos',
				'ziggo',
				'xx',
				'xxx',
				'xxxx',
				'xxxxx'];
	
	var domName1 = company.substring(0,fdot);

	if(fdot != ldot) 
	{ 
		var domName2 = company.substring(fdot+1,ldot);
	}
	
	
	
	
	for (i=0; i<personalEmailsListWithoutIndustry.length; i++) //here checking the above domain is included or not
 {
		if (personalEmailsListWithoutIndustry[i] == domName1) {
			return false;
		}
		
		if (domName2){
			if (personalEmailsListWithoutIndustry[i] == domName2) {
				return false;
			}
		}
		
 }
 return true;
}