// JavaScript Document
function Validate()
{
	if (document.getElementById("aName").value=="Name")
	{
		alert("Enter Name!");
		document.getElementById("aName").focus();
		return false;
	}
	else if(!isValidEmail(document.getElementById("aEmail").value))
	{
		alert("Enter Valid Email ID!");
		document.getElementById("aEmail").focus();
		return false;
	}
	else if (document.getElementById("aPhone").value=="Phone")
	{
		alert("Enter Phone No.");
		document.getElementById("aPhone").focus();
		return false;
	}
	else if (document.getElementById("comments").value=="Comments")
	{
		alert("Enter Comments!");
		document.getElementById("comments").focus();
		return false;
	}
	
	else if (document.getElementById("BotBootInput").value!=specimanSignature)
	{
		alert("Spam Validation Failed!");
		document.getElementById("BotBootInput").focus();
		newSpeciman();
		return false;
	}
	else
	{
		return true;
	}
}
var specimanSignature=0;

function newSpeciman()
{
	specimanSignature = Math.ceil(Math.random() * 100000);
	document.getElementById('BotBootInputImage').innerHTML = specimanSignature;
}
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)
{
	//exp="^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,4}(\.[a-zA-Z]{2,3})?(\.[a-zA-Z]{2,3})?$";
exp="^[a-z0-9][a-z0-9_\.-]{0,}[a-z0-9]@[a-z0-9][a-z0-9_\.-]{0,}[a-z0-9][\.][a-z0-9]{2,4}$";
	
	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 CheckExtension(fld)
{
    if (valid_extensions.test(fld.value)) return true;
    alert('The selected file is of the wrong type.');
    fld.select();
    fld.focus();
    return false;
}
  function valid1(f) {
!(/^[ñ0-9( )+\/#-]*$/i).test(f.value)?f.value = f.value.replace(/[^ñ0-9( )+#\/-]/ig,''):null;
} 
