// JavaScript Document
function checkForm()
{
	var spm_nm = document.getElementById("name").value;
	var spm_ml = document.getElementById("email").value;
	if(spm_nm.length > 0   ||  spm_ml.length > 0)
	{
		alert("Dont try to spam");
		return;
	}
	else
	{
		var real_name = document.getElementById("name1").value;
		var real_email= document.getElementById("actual_mail_box").value;
		if(real_name.length <= 0   ||   real_email.length <= 0)
		{
			alert("You must enter your name and email");
			return;
		}
		else
		{
			requestCustomerInfo();
		}
		
	}
}

function checkForm(inputvalue,inputvalue1){	
		var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
		var inputvalue1;
		
		var spm_nm = document.getElementById("name").value;
		var spm_ml = document.getElementById("email").value;
		if(spm_nm.length > 0   ||  spm_ml.length > 0)
		{
			alert("Dont try to spam");
			return;
		}
		else
		{
			if(inputvalue1.length <= 0 && inputvalue.length <= 0)
			{
				alert("Please write name and mail address");
			}else if(inputvalue1.length <= 0)
			{   
				alert("Please write name"); 
			}else if(pattern.test(inputvalue) && inputvalue1.length > 0)
			{
				<!---alert("You have entered correct mail and name. Thank you!");--->
				requestCustomerInfo();
			}else
			{
				alert("Please entered correct mail address");
			}
		}
	}
	function validate_large_form()
	{
		f_name  = document.getElementById("FirstName").value;
		//l_name  = document.getElementById("LastName").value;
		address = document.getElementById("address").value;
		city	= document.getElementById("city").value;
		state	= document.getElementById("state").value;
		zip		= document.getElementById("zip").value;
		//phone	= document.getElementById("phoneNo").value;
		
		if(f_name.length <= 0 || address.length <= 0 || city.length <= 0 || state.length <= 0 || zip.length <= 0 )
		{
			alert("You must enter your Name, Address, City, State and Zip");
			return false; 
		}
		else
		{
			return true;
		}
	}
	function requestCustomerInfo() 
   {     
      /*var sId = document.getElementById("txtCustomerId").value;*/
	  
	  /*var sId = document.getElementById("select1").value;*/
	  
	  var u_name = document.getElementById("name1").value;
	  var u_email= document.getElementById("actual_mail_box").value; 
	  var u_prob = document.getElementById("list").value; 
	  var u_phone= document.getElementById("phone").value;
	  var phone_len = u_phone.length; 

	  if(phone_len > 0)
	  {
	      http.open("GET", url + escape(u_name) + "&ml=" + escape(u_email) + "&prob=" + escape(u_prob) + "&phone=" + escape(u_phone), true);
	  }
	  else
	  {
	  	  http.open("GET", url + escape(u_name) + "&ml=" + escape(u_email) + "&prob=" + escape(u_prob) , true);
	  }
      http.onreadystatechange = handleHttpResponse;
      http.send(null);
	  //alert(url);
   }
   
	function getHTTPObject() 
	{
	  var xmlhttp;
	  if(window.XMLHttpRequest)
	  {
		xmlhttp = new XMLHttpRequest();
	  }
	  else if (window.ActiveXObject)
	  {
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		if (!xmlhttp)
		{
			xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  }
	  return xmlhttp;
	}
	var http = getHTTPObject(); // We create the HTTP Object