function submitMail()
{
//	alert("test");
//	var emailID=document.contactUs.email;

	var name = document.getElementById('cName').value;
	var emailID = document.getElementById('email').value;
	var msg = document.getElementById('message').value;

	var compName = document.getElementById('cCompany').value;
	var indstry = document.getElementById('cIndustry').value;
	var city = document.getElementById('cCity').value;
	var cntry = document.getElementById('cCountry').value;

	/*if ((name==null)||(name=="")){
		alert("Please Enter your Name")
		document.getElementById('cName').focus()
		return false
	}*/

	if ((emailID==null)||(emailID=="")){
		alert("Please Enter your Email ID")
		document.getElementById('email').focus()
		return false
	}
	if (echeck(emailID)==false){
		alert("Invalid E-mail ID");
		document.getElementById('email').value=""
		document.getElementById('email').focus()
		return false
	}
	if ((msg==null)||(msg=="")){
		alert("Please Enter Message")
		document.getElementById('message').focus()
		return false
	}




 http = getHTTPObject(); // We create the HTTP Object


    //document.getElementById("loading").style.display="";


    http.open("POST", './amt/php/sendMail.php', true);


params="cName="+name+"&";
		params += "compName="+compName+"&";
		params += "indstry="+indstry+"&";
		params += "city="+city+"&";
		params += "cntry="+cntry+"&";
		params += "email="+emailID+"&";
		params += "message="+msg;



    //With the below lines we are basically saying that the data send is in the format of a form submission.
    http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    http.setRequestHeader("Content-length", params.length);//We also give the length of the parameters we are sending.
    http.setRequestHeader("Connection", "close");

  http.onreadystatechange=function()
    {
    if(http.readyState==4)
      {
         document.getElementById('msg').innerHTML ='Thank you for your interest in AMT';
		 resetForm()
      }
    }




 /*   http.onreadystatechange = function (){HttpProductResponse(prodImgPath),HttpProductImagesResponse(prodImgPath),HttpOptionResponse(prodImgPath),HttpPriceResponse(),HttpInShoppingCartResponse()};*/
    http.send(params);





//	document.contactUs.submit();
	//document.getElementById('msg').innerHTML ='Thank you for your interest in AMT';

  //
}


function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false
		 }

		 if (str.indexOf(" ")!=-1){
		    return false
		 }

 		 return true
	}
function resetForm(){

		document.getElementById('cName').value=""
		document.getElementById('email').value=""
		document.getElementById('message').value=""

		document.getElementById('cCompany').value=""
		document.getElementById('cIndustry').options[0].selected = true
		document.getElementById('cCity').value=""
		document.getElementById('cCountry').options[0].selected = true
 }

 //USED FOR AJAX
function getHTTPObject()
{
  var xmlhttp;
   /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try
	{
      xmlhttp = new XMLHttpRequest();
    }
	catch (e)
	{
      xmlhttp = false;
    }
  }
 // console.debug(xmlhttp);
  return xmlhttp;

}


// google map

