function contact()
	{
		if(document.form.name.value=='')
		{
			alert("Enter your Name");
			document.form.name.focus();
			document.form.name.select();
			return false;
		}
		else if(document.form.name.value.substring(0, 1)==' ')
		{
			alert("First character of a Name should not be space");
			document.form.name.focus();
			document.form.name.select();
			return false;
		}

		if(document.form.companyname.value=='')
		{
			alert("Enter your Company Name");
			document.form.companyname.focus();
			document.form.companyname.select();
			return false;
		}
		else if(document.form.companyname.value.substring(0, 1)==' ')
		{
			alert("First character of a Company Name should not be space");
			document.form.companyname.focus();
			document.form.companyname.select();
			return false;
		}


		if(document.form.phonenumber.value=='')
		{
			alert("Enter your Phone Number");
			document.form.phonenumber.focus();
			document.form.phonenumber.select();
			return false;
		}
		else if(document.form.phonenumber.value.substring(0, 1)==' ')
		{
			alert("First character of a Phone Number should not be space");
			document.form.phonenumber.focus();
			document.form.phonenumber.select();
			return false;
		}


			var m=document.form.emailaddress;
			var n=document.form.emailaddress.value;
			if ((n==null)||(n==""))
				{
					alert("Please Enter your Email Address")
					m.select()
					return false
				}
			if (echeck(n)==false)
				{
					alert('Please enter valid email Address');
					m.select();
					return false;
				}


		if(document.form.security_code.value=='')
		{
			alert("Enter your Security Code");
			document.form.security_code.focus();
			document.form.security_code.select();
			return false;
		}
		else if(document.form.security_code.value.substring(0, 1)==' ')
		{
			alert("First character of a Security Code should not be space");
			document.form.security_code.focus();
			document.form.security_code.select();
			return false;
		}



		if(document.form.message.value=='')
		{
			alert("Enter your Message");
			document.form.message.focus();
			document.form.message.select();
			return false;
		}
		else if(document.form.message.value.substring(0, 1)==' ')
		{
			alert("First character of a Message should not be space");
			document.form.message.focus();
			document.form.message.select();
			return false;
		}




	}
	function echeck(str) 
		{
			at = str.indexOf("@");
			dot = str.lastIndexOf(".");
			lengt = str.length;
			con1 = str.substring(0,at);
			con2 = str.substring(at+1,dot);
			con3 = str.substring(dot+1,lengt);

			if(con1=='' || con2=='' || con3=='') return false;

			if(str.indexOf("  ") > -1 || str.indexOf("..") > -1 || str.indexOf("__") > -1 || str.indexOf("--") > -1) return false;
			
			if(at==-1 || dot==-1) return false;

			x = con1.substring(0,1);
			if ((x < "a" || "z" < x) && (x < "A" || "Z" < x) && isNaN(x)) return false;

			x = con1.substring((con1.length)-1,(con1.length));
			if ((x < "a" || "z" < x) && (x < "A" || "Z" < x) && isNaN(x)) return false;

			x = con1.substring(1,(con1.length)-1);
			for(i=0, y=0; i<con1.length-2; i++, y=x.substring(i, i+1)) if ((y < "a" || "z" < y) && (y < "A" || "Z" < y) && isNaN(y) && y!='.' && y!='_' && y!='-') return false;
			
			x = con2.substring(0,1);
			if ((x < "a" || "z" < x) && (x < "A" || "Z" < x) && isNaN(x)) return false;

			x = con2.substring((con2.length)-1,(con2.length));
			if ((x < "a" || "z" < x) && (x < "A" || "Z" < x) && isNaN(x)) return false;
			
			x = con2.substring(1,(con2.length)-1);
			for(i=0, y=0; i<con2.length-2; i++, y=x.substring(i, i+1)) if ((y < "a" || "z" < y) && (y < "A" || "Z" < y) && isNaN(y) && y!='.' && y!='_' && y!='-') return false;		
			
			for(i=0, x=0; i<con3.length; i++, x = con3.substring(i, i+1)) if ((x < "a" || "z" < x) && (x < "A" || "Z" < x)) return false;
			if ((con3.length)<2 || (con3.length)>4)  return false;
		}


 

function frmcall()
{

 // NAME
	var l=document.Mailall.name.value.length;
	var m=document.Mailall.name.value;
	var p=document.Mailall.name;
	for(var i=0; i<l-1; i++)
		{
		n=m.substring(i, i+2);
		if(n=="  " || n==".." || n=="''")
			{
			alert("Invalid name, Please re-enter")
			p.select();
			return false;
			}
		}
		
	if(m=='') {
		alert(" Please Enter your  Name");
		p.select();
		return false;
	}       
	
	for (var i=0; i<l; i++)
		{
		var q=m.substring(i, i + 1);
		if (((q < "a" || "z" < q) && (q < "A" || "Z" < q)) && q != ' ' && q!='.' && q!="'") {
			alert("\nThe Name field only accepts letters & spaces.\n\nPlease re-enter your Name.");
			p.select();
			return false;
		}
	}

	//EMAIL
	var m=document.Mailall.email;
	var n=document.Mailall.email.value;
	if ((n==null)||(n=="")){
		alert("Please Enter your Email ID")
		m.select()
		return false
	}
	if (echeck(n)==false){
		alert('Please enter Proper email ID');
		m.select();
		return false;
	}
	function echeck(str) {
	at = str.indexOf("@");
	dot = str.lastIndexOf(".");
	lengt = str.length;
	con1 = str.substring(0,at);
	con2 = str.substring(at+1,dot);
	con3 = str.substring(dot+1,lengt);

	if(con1=='' || con2=='' || con3=='') return false;

	if(str.indexOf("  ") > -1 || str.indexOf("..") > -1 || str.indexOf("__") > -1 || str.indexOf("--") > -1) return false;
	
	if(at==-1 || dot==-1) return false;

	x = con1.substring(0,1);
	if ((x < "a" || "z" < x) && (x < "A" || "Z" < x) && isNaN(x)) return false;

	x = con1.substring((con1.length)-1,(con1.length));
	if ((x < "a" || "z" < x) && (x < "A" || "Z" < x) && isNaN(x)) return false;

	x = con1.substring(1,(con1.length)-1);
	for(i=0, y=0; i<con1.length-2; i++, y=x.substring(i, i+1)) if ((y < "a" || "z" < y) && (y < "A" || "Z" < y) && isNaN(y) && y!='.' && y!='_' && y!='-') return false;
	
	x = con2.substring(0,1);
	if ((x < "a" || "z" < x) && (x < "A" || "Z" < x) && isNaN(x)) return false;

	x = con2.substring((con2.length)-1,(con2.length));
	if ((x < "a" || "z" < x) && (x < "A" || "Z" < x) && isNaN(x)) return false;
	
	x = con2.substring(1,(con2.length)-1);
	for(i=0, y=0; i<con2.length-2; i++, y=x.substring(i, i+1)) if ((y < "a" || "z" < y) && (y < "A" || "Z" < y) && isNaN(y) && y!='.' && y!='_' && y!='-') return false;		
	
	for(i=0, x=0; i<con3.length; i++, x = con3.substring(i, i+1)) if ((x < "a" || "z" < x) && (x < "A" || "Z" < x)) return false;
	if ((con3.length)<2 || (con3.length)>4)  return false;
}

// NAME
	var l=document.Mailall.phone.value.length;
	var m=document.Mailall.phone.value;
	var p=document.Mailall.phone;
	 
		
	if(m=='') {
		alert(" Please Enter your Phone Number");
		p.select();
		return false;
	}       
	 
}



