// JavaScript Document

function check()
{
	if(document.f1.Name.value=="")
	{
		alert("Please enter the user name");
		document.f1.Name.focus();
		return false;
	}	
	if(document.f1.email.value=="")
	{
		alert("Please enter the email address");
		document.f1.email.focus();
		return false;
	}
	if((document.f1.email.value.indexOf('@') < 0)||(document.f1.email.value.indexOf('.') < 0))
	{
		alert("Please enter a valid email address");
		document.f1.email.focus();
		return false;
	}
	if(!IsOfficialEmailCheck(document.f1.email.value))
	{
		alert("Please enter your official email ID. \n Avoid personal email IDs ")
		document.f1.email.focus();
		return false;
	}
	if(document.f1.phone.value=="")
	{
		alert("Please enter the phone number");
		document.f1.phone.focus();
		return false;
	}
	return true;
}

function IsOfficialEmailCheck(strEmail)
{
  if(strEmail.toLowerCase().indexOf("hotmail.com") != -1)
    return false;
  
  if(strEmail.toLowerCase().indexOf("gmail.com") != -1)
    return false;
    
  if(strEmail.toLowerCase().indexOf("yahoo.co") != -1)
    return false;
    
  if(strEmail.toLowerCase().indexOf("aol.com") != -1)
    return false;
	
      if(strEmail.toLowerCase().indexOf("gawab.com") != -1)
    return false;
	
	  if(strEmail.toLowerCase().indexOf("inbox.com") != -1)
    return false;
	
	  if(strEmail.toLowerCase().indexOf("gmx.com") != -1)
    return false;
	
	   if(strEmail.toLowerCase().indexOf("rediffmail.com") != -1)
    return false;
	
	   if(strEmail.toLowerCase().indexOf("in.com") != -1)
    return false;
	
	   if(strEmail.toLowerCase().indexOf("mail.com") != -1)
    return false;
	
  if(strEmail.toLowerCase().indexOf("live.com") != -1)
    return false;
 
 return true;   
}
