// JavaScript Document
function containsdigit(param)
{
	mystrLen=param.length;
	for(i=0;i<mystrLen;i++)
	{
		if((param.charAt(i)=="0") || (param.charAt(i)=="1") || (param.charAt(i)=="2") || (param.charAt(i)=="3") || (param.charAt(i)=="4") || (param.charAt(i)=="5") || (param.charAt(i)=="6") || (param.charAt(i)=="7") || (param.charAt(i)=="8") || (param.charAt(i)=="9"))
		{
			return true;
		}
	}
	return false;
}

function containscharacters(param)
{
	mystrLen=param.length;
	flag=false;
	for(i=0;i<mystrLen;i++)
	{
		if(((param.charAt(i)>="A") && (param.charAt(i)<="Z")) || ((param.charAt(i)>="a") && (param.charAt(i)<="z")) || ((param.charAt(i)==".")||(param.charAt(i)==" ")))
		{
			flag=true;
		}
	else 
		return false
	}
	return flag
}
function containscharactersmobile(param)
{
	mystrLen=param.length;
	flag=false;
	for(i=0;i<=mystrLen;i++)
	{
		if(((param.charAt(i)>="A") && (param.charAt(i)<="Z")) || ((param.charAt(i)>="a") && (param.charAt(i)<="z")) || ((param.charAt(i)==".")))
		{
			flag=true;
			break;
		}
	}
	return flag
}


function getquerystring()
{
	var referer = document.referrer;
	document.form1.referer.value=referer;
}


function validation()
{
    var chk=true;
    if((document.form1.txtfname.value=="First Name") || (document.form1.txtfname.value==""))
    {
        alert("Please enter your First Name");
        document.form1.txtfname.focus();
        chk=false;
    }
    else if((document.form1.txtlname.value=="Last Name")||(document.form1.txtlname.value==""))
    {
        alert("Please enter your Last Name");
        document.form1.txtlname.focus();
        chk=false;
    }    
    else if(document.form1.txtage.value=="Age")
    {
        alert("Please enter your Age");
        document.form1.txtage.focus();
        chk=false;
    }
   else if(containscharacters(document.form1.txtage.value)==true)
		{
			alert("Age must be a number");
			document.form1.txtage.select();
			chk=false;
		}	
else if(isNaN(document.form1.txtage.value) == true)		
{
			alert("Age must be a number");
			document.form1.txtage.select();
			chk=false;
}
    else if(document.form1.ddlcity.value=="City")
    {
        alert("Please select a City");
        document.form1.ddlcity.focus();
        chk=false;
    }
     else if(document.form1.txtmobile.value=="Mobile [+91]")
    {
        alert("Please enter your 10 digit mobile number");
        document.form1.txtmobile.focus();
        chk=false;
    }
     else if(document.form1.txtmobile.value=="9886656590")
    {
        alert("Above Number is blocked.");
        document.form1.txtmobile.focus();
        chk=false;
    }
     else if(document.form1.txtmobile.value=="9880674120")
    {
        alert("Above Number is blocked.");
        document.form1.txtmobile.focus();
        chk=false;
    }
    else if(isWhitespace(document.form1.txtmobile.value) || isEmpty(document.form1.txtmobile.value))
		{
			alert("Please enter your 10 digit mobile number");
			document.form1.txtmobile.focus();
			chk=false;
		}
	else if(isNaN(document.form1.txtmobile.value))
		{
			alert("Please enter your 10 digit mobile number");
			document.form1.txtmobile.select();
			chk=false;
		}
	else if((document.form1.txtmobile.value.length !=10))
		{
			alert("Please enter a valid mobile number");
			document.form1.txtmobile.select();
			chk=false;
		}
	 else if(document.form1.txtemailid.value=="Email ID")
        {
            alert("Please enter your Email-ID");
            document.form1.txtemailid.focus();
            chk=false;
        }
	else if (isWhitespace(document.form1.txtemailid.value) || isEmpty(document.form1.txtemailid.value))
		{
			alert("Please enter your Email-ID");
			document.form1.txtemailid.focus();
			chk=false;
		}
	else if (isEmail(document.form1.txtemailid.value) != true)
		{
			alert("Please enter a valid Email-ID");
			document.form1.txtemailid.select();
			chk=false;
		}
	else if(document.getElementById('chkagree').checked == false) 
	{
			alert("Please check DND authorization for Proceed.");
			document.form1.chkagree.select();
			chk=false;	
	}
    return chk;
}

