function Validation()
{
	var	obj = document.getElementById('txtTitle');
 	if(obj.options[obj.options.selectedIndex].value == "-1")
    {
              alert("Please Select Title");
              obj.focus();
              return false;
    }
    
	obj = document.getElementById('txtname');
   if(!(chkEmpty(obj,"Full name") && chkLength(obj,"Full name",3,25,"Please enter a minimum of 3 and a maximum of 25 characters for full name") && isSplChar(obj.value, " for full name") && 	isNumber(obj.value," for full name") &&  chkPattern(obj,"Full name",/^\s*([A-Z]|[a-z])/)))
    {
			obj.focus();
           return false;
    }   

	obj = document.getElementById('txtmob');
	if(!(chkEmpty(obj,"Mobile Number") && chkLength(obj,"Mobile Number",7,7,"Please enter seven digits only ")  && chkPattern(obj,"Mobile Number",/^\d*[0-9]?$/)))
    {
			obj.focus();
		   return false;
    } 
	
	obj = document.getElementById('txtemail');
	if(!(chkEmpty(obj,"email address") && chkPattern(obj,"email address",/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,"","Please provide email address in the format smith@sxbh.com or smith@sxbh.net")))
    {
			obj.focus();
           return false;
    }  
	return true;
 }

  function chkEmpty(obj,fieldName)
              {
				       if(obj.value =="")
                        {
                            alert("Please enter your "+fieldName);
                            obj.focus();
                            return false;
                        }
                        else
                        {
                            return true;
                        }
                }
				
    function chkLength(obj,fieldName,minLen,maxLen,message)
    {
                var min = parseInt(minLen);
                var max = parseInt(maxLen);
               
                if(obj.value.length < min || obj.value.length > max)
                {
                    alert(message);
                    obj.focus();
                    return false;
                }
                else
                {
                    return true;
                }             
    }
    
	function chkPattern(obj,fieldName,pattern,type,message)
    {
		var filter  = pattern;
		if(!filter.test(obj.value))
           {
             if(message!=undefined)
				alert(message);
             else
				alert("Please provide a proper "+fieldName);
            obj.focus();
            return false;
            }
            else
            {
                return true;
            }
    }

function isSplChar(str, fieldValue){	
	var spchar, getChar, SpecialChar;	
	spchar="`()(\\~!@^&*+\"|%:=,<>";
	getChar='Empty';
	SpecialChar='No';
	var spchars =" ` ( )  \\ ~ ! @ ^ & * + \" | : =  , < > ";
	for(var i=0; i<str.length; i++)	{
	for(var j=0; j<spchars.length; j++)		{	
	if(str.charAt(i)== spchar.charAt(j)){
		SpecialChar='Yes';
		break;
		}
		else
		{
		if (str.charAt(i)!=' ')
		 getChar='Normal';
		 	}
		 }
		 }
		 if (SpecialChar == 'Yes')	{
		 	alert('Please delete special characters' + fieldValue);	
		 			return false;	
		 			}
		 	else if (SpecialChar == 'No'){	
		 	return true;	}
		 	
		 	}
		 	
		 	
	function isNumber(str,fieldValue){	
	var spchar, getChar, SpecialChar;	
	spchar="0123456789";
	getChar='Empty';
	SpecialChar='No';
	var spchars =" 0 1 2 3 4 5 6 7 8 9 ";
	for(var i=0; i<str.length; i++)	{
	for(var j=0; j<spchars.length; j++)		{	
	if(str.charAt(i)== spchar.charAt(j)){
		SpecialChar='Yes';
		break;
		}
		else
		{
		if (str.charAt(i)!=' ')
		 getChar='Normal';
		 	}
		 }
		 }
		 if (SpecialChar == 'Yes')	{
		 	alert('Please delete numeric characters'+ fieldValue);	
		 			return false;	
		 			}
		 	else if (SpecialChar == 'No'){	
		 	return true;	}
		 	
	}
