var specimanSignature=0;
function isblank(s)
{
    for(var i = 0; i < s.length; i++) {
        var c = s.charAt(i);
        if ((c != ' ') && (c != '\n') && (c != '\t')) return false;
    }
    return true;
}
function isValidEmail(e)
{
	var alnum="a-zA-Z0-9";
	exp="^[^@\\s]+@(["+alnum+"+\\-]+\\.)+["+alnum+"]["+alnum+"]["+alnum+"]?$";
	emailregexp = new RegExp(exp);

	result = e.match(emailregexp);
	if (result != null)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function isValidNumber(numval)
{
	if (numval==""){return false;}
	var myRegExp = new RegExp("^[/+|/-]?[0-9]*[/.]?[0-9]*$");
	return myRegExp.test(numval);
}

function Validate()
{
	if (isblank(document.getElementById("name").value))
	{
		alert("Enter Name!");
		document.getElementById("name").focus();
		return false;
	}
	else if (document.match.dd.selectedIndex == 0)
  {
    alert("Please select Day of Birth.");
    match.dd.focus();
    return (false);
  }

else  if (document.match.mm.selectedIndex == 0)
  {
    alert("Please select Month of Birth.");
    match.mm.focus();
    return (false);
  }

else if (document.match.yy.selectedIndex == 0)
  {
    alert("Please select Year of Birth.");
    match.yy.focus();
    return (false);
  }

else if (document.match.hh.selectedIndex == 0)
  {
    alert("Please select Hour of birth.");
    match.hh.focus();
    return (false);
  }
else  if (document.match.mi.selectedIndex == 0)
  {
    alert("Please select Minute of Birth.");
    match.mi.focus();
    return (false);
  }
else  if (document.match.ss.selectedIndex == 0)
  {
    alert("Please select Seconds.");
    match.ss.focus();
    return (false);
  }
  
else if (document.match.tob1.selectedIndex == 0)
  {
    alert("Please select one of the options AM or PM.");
    match.tob1.focus();
    return (false);
  }
else  if (document.match.cob.selectedIndex == 0)
  {
    alert("Please select Country of Birth.");
    match.cob.focus();
    return (false);
  }
else if (isblank(document.getElementById("city").value))
	{
		alert("Please Enter City or Birth");
		document.getElementById("city").focus();
		return false;
	}
else if (isblank(document.getElementById("state").value))
	{
		alert("Please Enter State or Birth!");
		document.getElementById("state").focus();
		return false;
	}



else  if (isblank(document.getElementById("fname").value))
	{
		alert("Please Enter Name of Female");
		document.getElementById("fname").focus();
		return false;
	}
	
else  if (document.match.fdd.selectedIndex == 0)
  {
    alert("Please select Day of Birth of Female.");
    match.fdd.focus();
    return (false);
  }

 else  if (document.match.fmm.selectedIndex == 0)
  {
    alert("Please select Month of Birth of Female.");
    match.fmm.focus();
    return (false);
  }

 else  if (document.match.fyy.selectedIndex == 0)
  {
    alert("Please select Year of Birth of Female.");
    match.fyy.focus();
    return (false);
  }

 else if (document.match.fhh.selectedIndex == 0)
  {
    alert("Please select Hour of birth of Female.");
    match.fhh.focus();
    return (false);
  }
else if (document.match.fmi.selectedIndex == 0)
  {
    alert("Please select Minute of Birth of Female.");
    match.fmi.focus();
    return (false);
  }
  
 else  if (document.match.fss.selectedIndex == 0)
  {
    alert("Please select Seconds of Birth of Female.");
    match.fss.focus();
    return (false);
  }

 else  if (document.match.ftob1.selectedIndex == 0)
  {
    alert("Please select one of the options AM or PM  of Female.");
    match.ftob1.focus();
    return (false);
  }
  
	else if (document.match.fcob.selectedIndex == 0)
  {
    alert("Please select Country of Birth  of Female.");
    match.fcob.focus();
    return (false);
  }
	else if (isblank(document.getElementById("fcity").value))
	{
		alert("Please Enter City or Birth  of Female.");
		document.getElementById("fcity").focus();
		return false;
	}else if (isblank(document.getElementById("fstate").value))
	{
		alert("Please Enter State or Birth  of Female.");
		document.getElementById("fstate").focus();
		return false;
	}


	else if (document.match.country.selectedIndex == 0)
  {
    alert("Please select your Country of Residing  .");
    match.country.focus();
    return (false);
  }
	else if (!isValidEmail(document.getElementById("email").value))
	{
		alert("Enter Valid Email ID!");
		document.getElementById("email").focus();
		return false;
	}
	else if (document.match.BotBootInput.value!=specimanSignature)
	{
		alert("Spam Validation Failed!");
		document.match.BotBootInput.focus();
		newSpeciman();
		return false;
	}
	else
	{
		return true;
	}
}
function newSpeciman()
{
	specimanSignature = Math.ceil(Math.random() * 100000);
	document.getElementById('BotBootInputImage').innerHTML = specimanSignature;
}
