<!-- Mandatory Field Checking Part 1-->
function registrationPart1(formName)
{	

	if(formName.firstname.value=='')
	{
		alert("Please enter first name");
		formName.firstname.focus();
		return false;
	}
	if(!isValidAlphabet(formName.firstname,'Please enter the valid First Name'))	return false;
		
	if(formName.lastname.value=='')
	{
		alert("Please enter last name");
		formName.lastname.focus();
		return false;
	}
	if(!isValidAlphabet(formName.lastname,'Please enter the valid Last Name'))	return false;	
	if(formName.email.value=='')
	{
		alert("Please enter email id");
		formName.email.focus();
		return false;
	}	
	
	<!-- Email Validation -->
	if (! isValidEmail(formName.email)) 
	{
	//	alert("Please enter a valid email address");
		return false;
	}		
	
	if(formName.loginid.value=='')
	{	
		alert("Please enter preferred user id");
		formName.loginid.focus();
		return false;
	}		
	
//	if(!loginIdCheck(formName.loginid.value))
//	{
//		alert("Please enter the valid preferred id");
//		formName.loginid.focus();
//		return false;
//	}
	
	if(formName.loginid.value.length < 5 )
	{
		alert("Preferred user id can not be less than 6 characters");
	//	formName.loginid.value="";
		formName.loginid.focus();
		return false;
	}
	
	if(formName.loginid.value.length > 50 )
	{	
		alert("Preferred user id can not be more than 30 characters");
	//	formName.loginid.value="";
		formName.loginid.focus();
		return false;
	}	
//	if(formName.yearofexp.value=='')
//	{
//		alert("Please select year of experience");
//		formName.yearofexp.focus();
//		return false;
//	}	
//	if(formName.yearofexp.value!='Fresher' && formName.yearofexp.value!='above30' )
//	{	
//		if(formName.monthofexp.value=='')
//		{
//			alert("Please select the months of experience");
//			formName.monthofexp.focus();
//			return false;
//		}
//	}		
//	if(formName.keyskills.value=='')
//	{
//		alert("Please enter your area of expertise");
//		formName.keyskills.focus();
//		return false;
//	}
	
	if (formName.industry.value == '') {
		alert("Please select industry");
		formName.industry.focus();
		return false;
	}
	if (formName.industry.value == 'other') {
		if (formName.otherIndustry.value == '') {
			alert("Please enter the other industry");
			formName.otherIndustry.focus();
			return false;
		}
	}
		
	if(formName.password.value=='')
	{
		alert("Please enter password");
		formName.password.focus();
		return false;
	}	
	if(formName.confirmpassword.value=='')
	{
		alert("Please enter confirm password");
		formName.confirmpassword.focus();
		return false;
	}		
	<!-- Password and Confirm Password must more than 6 character checking -->
	if(formName.password.value.length <6)
	{
		alert("Password can not be less than 6 characters");
		formName.password.value="";
		formName.password.focus();
		return false;
	}
	if(formName.confirmpassword.value.length <6)
	{
		alert("Confirm Password can not be less than 6 characters");
		formName.confirmpassword.value="";
		formName.confirmpassword.focus();
		return false;
	}	
	if(formName.password.value != formName.confirmpassword.value)
	{
		alert("Password and Confirm Password are not matching");
		formName.password.focus();
		return false;		
	}	
	if(formName.currentLocation.value=='')
	{
		alert("Please select current location");
		formName.currentLocation.focus();
		return false;
	}	
	if(formName.currentLocation.value=="other")
	if(formName.otherLocation.value=="")
	{
		alert("Please enter other location");
		formName.otherLocation.focus();
		return false;
	}	
	
	return true;
}

<!-- Mandatory Field Checking Part 2-->
function registrationPart2(formName)
{

	if(formName.password.value=='')
	{
		alert("Please enter password");
		formName.password.focus();
		return false;
	}	
	if(formName.confirmpassword.value=='')
	{
		alert("Please enter confirm password");
		formName.confirmpassword.focus();
		return false;
	}		
	<!-- Password and Confirm Password must more than 6 character checking -->
	if(formName.password.value.length <6)
	{
		alert("Password can not be less than 6 characters");
		formName.password.value="";
		formName.password.focus();
		return false;
	}
	if(formName.confirmpassword.value.length <6)
	{
		alert("Confirm Password can not be less than 6 characters");
		formName.confirmpassword.value="";
		formName.confirmpassword.focus();
		return false;
	}	
	if(formName.password.value != formName.confirmpassword.value)
	{
		alert("Password and Confirm Password are not matching");
		formName.password.focus();
		return false;		
	}	
	if(formName.currentLocation.value=='')
	{
		alert("Please select current location");
		formName.currentLocation.focus();
		return false;
	}	
	if(formName.currentLocation.value=="other")
	if(formName.otherLocation.value=="")
	{
		alert("Please enter other location");
		formName.otherLocation.focus();
		return false;
	}	
	if(formName.category.value=='')
	{
		alert("Please select category");
		formName.category.focus();
		return false;
	}
	if(formName.category.value=='other')
	{
		if(formName.otherCategory.value=='')
		{
			alert("Please enter the other category");
			formName.otherCategory.focus();
			return false;
		}
	}		
	if(formName.yearofexp.value!='Fresher')
	{
		if(formName.currentCompany.value=='')
		{
			alert("Please enter the current organisation");
			formName.currentCompany.focus();
			return false;
		}	
		if(formName.designation.value=='')
		{
			alert("Please enter the your designation");
			formName.designation.focus();
			return false;
		}			
	}
	if(formName.yearofexp.value=='')
	{
		alert("Please select year of experience");
		formName.yearofexp.focus();
		return false;
	}		
	
	if(formName.degree.value=='')
	{
		alert("Please select the degree");
		formName.degree.focus();
		return false;
	}
	if(formName.degree.value=='other')
	{	
		if(formName.otherDegree.value=='')
		{
			alert("Please enter the other degree");
			formName.otherDegree.focus();
			return false;
		}		
	}
	if(formName.institute.value=='')
	{
		alert("Please select the institute");
		formName.institute.focus();
		return false;
	}	
		
	if(formName.institute.value=='other')
	{	
		if(formName.otherInstitute.value=='')
		{
			alert("Please enter the other institute");
			formName.otherInstitute.focus();
			return false;
		}		
	}	
	if(formName.instituteLocation.value=='')
	{
		alert("Please select the location");
		formName.instituteLocation.focus();
		return false;
	}	
		
	if(formName.instituteLocation.value=='other')
	{	
		if(formName.instituteLocation.value=='')
		{
			alert("Please enter the other location");
			formName.otherInstitute.focus();
			return false;
		}		
	}	
	if(formName.intStartYear.value=='')
	{
		alert("Please select start year");
		formName.intStartYear.focus();
		return false;
	}
	if(formName.intStartMonth.value=='')
	{
		alert("Please select start month");
		formName.intStartMonth.focus();
		return false;
	}	
	if(formName.intEndYear.value=='')
	{
		alert("Please select end year");
		formName.intEndYear.focus();
		return false;
	}
	if(formName.intEndMonth.value=='')
	{
		alert("Please select end month");
		formName.intEndMonth.focus();
		return false;
	}	
	
	if(!twoDateCompare('1',formName.intStartMonth.value,formName.intStartYear.value,'1',formName.intEndMonth.value,formName.intEndYear.value))
	{
		return false;
	}

	return true;		
}

function displayMe(val1,val2)
{
	if(val1.value=='other')
	{
		document.getElementById(val2).style.display='block';
	}
	else
	{
		document.getElementById(val2).style.display='none';
	}
}

function disableWorkDetails(formName)
{
	if(formName.yearofexp.value=='Fresher')
	{
		formName.monthofexp.value='';
		formName.currentCompany.value='';
		formName.designation.value='';
	
		formName.monthofexp.disabled=true;
		formName.currentCompany.disabled=true;
		formName.designation.disabled=true;
	}
	else
	{
		formName.monthofexp.disabled=false;
		formName.currentCompany.disabled=false;
		formName.designation.disabled=false;
	}
	if(formName.yearofexp.value=='above30')
	{
		formName.monthofexp.disabled=true;
	}
}

function validatePhone(validateMe)
{
	var i;
	var Char;
	var flag1=true;
	var flag2=true;
	var status;
	var ValidChars = "0123456789+-";
	var validphone1=validateMe;
	
	for (i = 0; i < validphone1.length && flag1==true; i++) 
	{ 
	      Char = validphone1.charAt(i);
		  if (ValidChars.indexOf(Char) == -1) 
	      {
	        	flag1=false;
	      }
	}
	if(flag1==false)
		status =false;
	else
		status= true;
	return status;
}
function validatePin(validateMe)
{
	var i;
	var Char;
	var flag1=true;
	var flag2=true;
	var status;
	var ValidChars = "0123456789";
	var validphone1=validateMe;
	
	for (i = 0; i < validphone1.length && flag1==true; i++) 
	{ 
	      Char = validphone1.charAt(i);
		  if (ValidChars.indexOf(Char) == -1) 
	      {
	        	flag1=false;
	      }
	}
	if(flag1==false)
		status =false;
	else
		status= true;
	return status;
}
