function valid_email(email)
{
		at_position = email.indexOf("@",1)
        if (at_position != -1)
		{
       		at_position = email.indexOf(".",1)
            if (at_position == -1)
            {
                      return false;
            }//if	
	   }//if
       else
       {
            	return false;
       } //else
		return true;
}//email check
function IsString(strString)
 {
   var strValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;


   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
}

function IsNumeric1(strString)
{
	var strValidChars = "0123456789";
   var strChar;
   var blnResult = true;

   if (strString.length == 0)
   {
    return false;
   }
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
}




function validate()
 {

   if(document.proposalfrm.company.value=="")
    {
	  alert("Enter Company Name");
	  document.proposalfrm.company.focus();
	  document.proposalfrm.company.select();
	  return false;
	}
	 if(IsNumeric1(document.proposalfrm.company.value))
	{
	 alert("Enter Only charecter value");
	 document.proposalfrm.company.select();
	document.proposalfrm.company.focus();
	return false;
	}
	if(document.proposalfrm.full_name.value=="")
    {
	  alert("Enter Full  Name");
	  document.proposalfrm.full_name.focus();
	  document.proposalfrm.full_name.select();
	  return false;
	}
	 if(IsNumeric1(document.proposalfrm.full_name.value))
	{
	 alert("Enter Only charecter value");
	 document.proposalfrm.full_name.select();
	document.proposalfrm.full_name.focus();
	return false;
	}
	if(document.proposalfrm.phone.value=="")
    {
	  alert("Enter Phone Number  ");
	  document.proposalfrm.phone.focus();
	  document.proposalfrm.phone.select();
	  return false;
	}
	if(document.proposalfrm.email.value=="")
    {
	  alert("Enter Email Address ");
	  document.proposalfrm.email.focus();
	  document.proposalfrm.email.select();
	  return false;
	}
	 if(!valid_email(document.proposalfrm.email.value))
	{
		alert('Please Enter Valid Email ,Try again!');
		document.proposalfrm.email.select();
		document.proposalfrm.email.focus();
		return false;
	}
	if(document.proposalfrm.country.value=="")
	{
	alert("Please  Enter  Country ");
	document.proposalfrm.country.select();
	document.proposalfrm.country.focus();
		return false;
	}
	
	
	if(document.proposalfrm.comment.value=="")
	{
	alert("Please  Enter  Comment ");
	document.proposalfrm.comment.select();
	document.proposalfrm.comment.focus();
		return false;
	}
	
		if(document.proposalfrm.project_type.value=="")
	    {
	     alert("Please  Enter  Project Type ");
	     document.proposalfrm.project_type.select();
	     document.proposalfrm.project_type.focus();
		 return false;
	    }
		
		if(document.proposalfrm.info.value=="")
	    {
	     alert("Please  Enter  Background information ");
	     document.proposalfrm.info.select();
	     document.proposalfrm.info.focus();
		 return false;
	    }
		
		/*if(document.proposalfrm.budget.value=="")
	    {
	     alert("Please  Select  Budget Allocated ");
	     document.proposalfrm.budget.select();
	     document.proposalfrm.budget.focus();
		 return false;
	    }*/
		
		if(document.proposalfrm.project_obj.value=="")
	    {
	     alert("Please  Select  Project Objective ");
	     document.proposalfrm.project_obj.select();
	     document.proposalfrm.project_obj.focus();
		 return false;
	    }
		if(!ParseUSNumber(document.proposalfrm.phone.value))
        {
	  
	     document.proposalfrm.phone.focus();
	    document.proposalfrm.phone.select();
	     alert("Enter Valid Contact");
	     return false;
	    }

}


