function checkValidation()
{
	var error_msg = "";

//**********************CITY VALIDATION********************************
 	if (document.form_signup.city.value=="")
	{
		error_msg = "Please select your city of residence";
        alert(error_msg);
		document.form_signup.city.focus();
		return false;
	}
	else
	{
	}

//**********************CITY VALIDATION********************************

//**********************USERNAME VALIDATION********************************
 	if (document.form_signup.username.value=="")
	{
		error_msg = "Please enter a username";
        alert(error_msg);
		document.form_signup.username.focus();
		return false;
	}
	else
	{
	   var x = document.form_signup.username.value.indexOf(" ")
	   if (x>=0)
	   {
		alert("Username cannot have blank space")
		document.form_signup.username.focus()
		return false
	   }
		
	}

//**********************USERNAME VALIDATION********************************

//**********************WORK EMAIL VALIDATION********************************
    var str = document.form_signup.email.value;
	if (str=="" )
	{
		error_msg = "Please enter your office Email Address";
		alert(error_msg);
		document.form_signup.email.focus();
		return false
	}
	else
	{
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
        var address = form_signup.email.value;
        if(reg.test(address) == false)
        {
	        error_msg = 'Please enter a valid Email Address';
       		alert(error_msg);
	        document.form_signup.email.focus();
	        return false;        
        }
		else
		{
		  str = str.toLowerCase(); 
		  if ( (str.search("bol.net")!=-1) || (str.search("live.com")!=-1) || (str.search("@mail.com")!=-1) || (str.search("rock.com")!=-1) || (str.search("lycos")!=-1) || (str.search("live.in")!=-1) || (str.search("airtelmail")!=-1) || (str.search("ymail")!=-1) || (str.search("rediff")!=-1) || (str.search("yahoo")!=-1) || (str.search("hotmail")!=-1) || (str.search("gmail")!=-1) || (str.search("fastmail")!=-1) || (str.search("sify")!=-1) || (str.search("gawab")!=-1) || (str.search("@in.com")!=-1) || (str.search("aol")!=-1) || (str.search("zapak")!=-1) || (str.search("bigstring")!=-1) || (str.search("excite")!=-1) || (str.search("hotpop")!=-1) || (str.search("gmx")!=-1) || (str.search("myway")!=-1) || (str.search("indya")!=-1) || (str.search("sifymail")!=-1) || (str.search("webduniya")!=-1) || (str.search("indiainfo")!=-1) || (str.search("vsnl")!=-1) || (str.search("airtelbroadband")!=-1) || (str.search("hathway")!=-1) || (str.search("mtnl")!=-1) || (str.search("bsnl")!=-1) || (str.search("hotfrog")!=-1)  )
		  {
 	        error_msg = 'It appears that you are entering your personal email address. Please enter your Office Email Address.';
	        alert(error_msg);
	        document.form_signup.email.focus();
	        return false;        
		  }
		  
		}

	}
//**********************WORK EMAIL VALIDATION********************************

//**********************PASSWORD VALIDATION********************************
	if (document.form_signup.password1.value=="" )
	{
		error_msg = "Please enter a password.";
		alert(error_msg);
		document.form_signup.password1.focus();
		return false;
	}
	else
	{
		var y = document.form_signup.password1.value.indexOf(" ")
	    if (y>=0)
	    {
			alert("Password cannot have blank space.")
			document.form_signup.password1.focus()
			return false
	    }
	}

//**********************PASSWORD VALIDATION********************************

//**********************RE-PASSWORD VALIDATION********************************
	if (document.form_signup.password2.value=="")
	{
		error_msg = "Please re-type your password";
		alert(error_msg);
		document.form_signup.password2.focus();
		return false;
	}
	else
	{

	}
    if(document.form_signup.password1.value != document.form_signup.password2.value)
	{
   		error_msg = "The two passwords do not match. Please try again.";
		alert(error_msg);
		document.form_signup.password1.focus();
		return false;
	}
	else
	{

	}

//**********************RE-PASSWORD VALIDATION********************************

//**********************ALTERNATE EMAIL VALIDATION********************************
	if (document.form_signup.alt_email.value=="" )
	{
		
	}
	else
	{
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
        var address = form_signup.alt_email.value;
        if(reg.test(address) == false)
        {
	        error_msg = 'This is not a valid Email Address. Please try again.';
	        alert(error_msg);
	        document.form_signup.alt_email.focus();
	        return false;        
        }
		
	}
//**********************ALTERNATE EMAIL VALIDATION********************************

//**********************FIRST NAME VALIDATION********************************
	
	if (form_signup.name.value=="")
	{
		error_msg = "Please enter your Name";
		alert(error_msg);
		document.form_signup.name.focus();
		return false;
	}
	else 
	{
       var reg = /(\d)+/;
       var name1 = form_signup.name.value;
	   if(reg.test(name1) == true)
	   {
		   error_msg = "Please enter a valid Name (should contain only alphabets)";
		   alert(error_msg);
		   document.form_signup.name.focus();
		   return false;

	   }

	 }
//**********************FIRST NAME VALIDATION********************************

//**********************OFFICE NAME VALIDATION********************************	
	if (document.form_signup.place_work.value=="")
	{
		error_msg = "Please select your Place of Work";
        alert(error_msg);
		document.form_signup.place_work.focus();
		return false;
	}
	else
	{
		if(document.form_signup.place_work.value == "other"){
			if (document.form_signup.work_other.value==""){
				error_msg = "Please enter your Place of Work";
		        alert(error_msg);
				document.form_signup.work_other.focus();
				return false;
			}
			
		}
	}
//**********************OFFICE NAME VALIDATION********************************

//**********************DESIGNATION VALIDATION********************************	
	if (document.form_signup.designation.value=="")
	{
		error_msg = "Please enter your designation";
	   alert(error_msg);
		document.form_signup.designation.focus();
		return false;
	}
	else
	{

	}
//**********************DESIGNATION VALIDATION********************************

//**********************EMPLOYEE ID VALIDATION********************************	
	if ((document.form_signup.place_work.value=="TCS" || document.form_signup.place_work.value=="Keane India") && document.form_signup.employeeid.value=="")
	{
		error_msg = "It is mandatory for "+document.form_signup.place_work.value+" employees to enter their Employee ID for HR Verification";
	   alert(error_msg);
		document.form_signup.employeeid.focus();
		return false;
	}
	else
	{
	}
//**********************EMPLOYEE ID VALIDATION********************************
//**********************TERMS & CONDITIONS VALIDATION********************************
	if(document.form_signup.agree.checked)
	{ }
	else
	{
		alert("You need to agree to the Terms & Conditions for registering on this site!");
		document.form_signup.agree.focus();
		return false;
	}

//**********************TERMS & CONDITIONS VALIDATION********************************

return true;
} // end of validations

function addZero(s){
	if(s.length ==1) 
		s = "0" + s;
	return s;
}
