// JavaScript Document
var xmlHttp;
function develop_validation1()
{
  
  var name=document.getElementById("name").value;
 //alert(name);
  if(name==""){   
  alert("Please enter Your Name");document.getElementById("name").focus();return false;  
  }
  
  var emailid=document.getElementById("emailid").value;
  if(emailid==""){   
  alert("Please enter Your Email Id");document.getElementById("emailid").focus();return false;  
  }    
  if(emailid!=""){     
  if (valemail(emailid,"Please enter valid Email ID!") == false)
  {return false;}   }  
  
  var phone1=document.getElementById("phone1").value;
  if(phone1==""){   
  alert("Please enter your Phone Number");document.getElementById("phone1").focus();return false;  
  } 
  var phone2=document.getElementById("phone2").value;
  if(phone2==""){   
  alert("Please enter your Phone Number");document.getElementById("phone2").focus();return false;  
  } 
  var phone3=document.getElementById("phone3").value;
  if(phone3==""){   
  alert("Please enter your Phone Number");document.getElementById("phone3").focus();return false;  
  } 
  var solutions=document.getElementById("solutions").value;
   var products_info=document.getElementById("products_info").value;
    var web=document.getElementById("web").value;
	var products=document.getElementById("products").value;
	 var budget=document.getElementById("budget").value;
	 var requirements=document.getElementById("requirements").value;
	 var market_tech1=document.getElementById("market_tech1").checked;
	 var market_tech2=document.getElementById("market_tech2").checked;
	 var market_tech3=document.getElementById("market_tech3").checked;
	 var market_tech4=document.getElementById("market_tech4").checked;	 
	 var tech_cap1=document.getElementById("tech_cap1").checked;
	 var tech_cap2=document.getElementById("tech_cap2").checked;
	 var tech_cap3=document.getElementById("tech_cap3").checked;
	 var tech_cap4=document.getElementById("tech_cap4").checked;
	 var tech_cap5=document.getElementById("tech_cap5").checked;
	 var tech_cap6=document.getElementById("tech_cap6").checked;
	 var tech_cap7=document.getElementById("tech_cap7").checked;
	 var tech_cap8=document.getElementById("tech_cap8").checked;
	 var tech_cap9=document.getElementById("tech_cap9").checked;
	 var tech_cap10=document.getElementById("tech_cap10").checked;
	 var tech_cap11=document.getElementById("tech_cap11").checked;
	 var tech_cap12=document.getElementById("tech_cap12").checked;
	 var usale1=document.getElementById("usale1").checked;
	 var usale2=document.getElementById("usale2").checked;
	 var usale3=document.getElementById("usale3").checked;
	 var usale4=document.getElementById("usale4").checked;
	 var usale5=document.getElementById("usale5").checked;
	 var usale6=document.getElementById("usale6").checked;
	 /*alert(market_tech1);
	 alert(market_tech2);
	 var market="";
	 if(market_tech1 == " true")
	 {
		market += " Wish list ,"; 
	 }
	 if(market_tech2 == "true")
	 {
		market += " Promotions campaign (Coupons),"; 
	 }
	alert(market);*/
/*	 alert(name);
	 alert(emailid);
	 alert(phone1);
	 alert(phone2);
	 alert(phone3);
	 alert(solutions);
	 alert(products_info);
	 alert(web);
	 alert(products);
	 alert(budget);
	 alert(requirements);*/
	 
	 
	 //alert(market_tech3);
	 //alert(market_tech4);
	 /*alert(tech_cap1);
	 alert(tech_cap2);
	 alert(tech_cap3);
	 alert(tech_cap4);
	 alert(tech_cap5);
	 alert(tech_cap6);
	 alert(tech_cap7);
	 alert(tech_cap8);
	 alert(tech_cap9);
	 alert(tech_cap10);
	 alert(tech_cap11);
	 alert(tech_cap12);
	 alert(usale1);
	 alert(usale2);
	 alert(usale3);
	 alert(usale4);
	 alert(usale5);
	 alert(usale6);*/

  /*var country=document.scart_quote_form.country.value;
  if(country=="0"){   
  alert("Please select Your Country");document.scart_quote_form.country.focus();return false;  
  }
  var requirement=document.scart_quote_form.requirement.value;
  if(requirement==""){   
  alert("Please eneter your Requirement");document.scart_quote_form.requirement.focus();return false;  
  }  */
 	 function valemail(field,alerttxt)
  {
  with (field)
  {
   var atpos = field.indexOf("@")
   var dotpos = field.lastIndexOf(".")
   var lastpos = field.length - 1
    if (atpos < 2 || dotpos - atpos < 2 || lastpos-dotpos > 4 || lastpos-dotpos < 2 )
	{
	   alert(alerttxt)		
	   return false
	} 
	
   }
  }
  //alert("ok");
	//alert(name);
	//alert(emailid);
	xmlHttpenqiry=GetXmlHttpObject();
	var url="webdesignquote.php?name="+name+"&emailid="+emailid+"&phone1="+phone1+"&phone2="+phone2+"&phone3="+phone3+"&solutions="+solutions+"&products_info="+products_info+"&web="+web+"&budget="+budget+"&products="+products+"&requirements="+requirements+"&market_tech1="+market_tech1+"&market_tech2="+market_tech2+"&market_tech3="+market_tech3+"&market_tech4="+market_tech4+"&tech_cap1="+tech_cap1+"&tech_cap2="+tech_cap2+"&tech_cap3="+tech_cap3+"&tech_cap4="+tech_cap4+"&tech_cap5="+tech_cap5+"&tech_cap6="+tech_cap6+"&tech_cap7="+tech_cap7+"&tech_cap8="+tech_cap8+"&tech_cap9="+tech_cap9+"&tech_cap10="+tech_cap10+"&tech_cap11="+tech_cap11+"&tech_cap12="+tech_cap12+"&usale1="+usale1+"&usale2="+usale2+"&usale3="+usale3+"&usale4="+usale4+"&usale5="+usale5+"&usale6="+usale6;
	
	//var url="webdesignquote.php?name="+name+"&emailid="+emailid+"&phone1="+phone1+"&phone2="+phone2+"&phone3="+phone3+"&solutions="+solutions+"&products_info="+products_info+"&web="+web+"&budget="+budget+"&products="+products+"&requirements="+requirements+"&market_tech1="+market_tech1+"&market_tech2="+market_tech2+"&market_tech3="+market_tech3+"&market_tech4="+market_tech4+"&usale1="+usale1+"&usale2="+usale2+"&usale3="+usale3+"&usale4="+usale4+"&usale5="+usale5+"&usale6="+usale6+"&tech_cap1="+tech_cap1+"&tech_cap2="+tech_cap2+"&tech_cap3="+tech_cap3+"&tech_cap4="+tech_cap4+"&tech_cap5="+tech_cap5+"&tech_cap6="+tech_cap6+"&tech_cap7="+tech_cap7+"&tech_cap8="+tech_cap8+"&tech_cap9="+tech_cap9+"&tech_cap10="+tech_cap10+"&tech_cap11="+tech_cap11+"&tech_cap12="+tech_cap12;	

	//alert(url);
	xmlHttpenqiry.onreadystatechange=xmlHttpenqiryResult;//alert("transer");
	xmlHttpenqiry.open("post",url,true);//alert("last");
	xmlHttpenqiry.send(null);//alert("end");
  	document.getElementById("ajaximage").style.display="block";
 
  
}	




function xmlHttpenqiryResult()
{
	if (xmlHttpenqiry.readyState==4)
	{ 
		//alert("sdfgdg");
		//alert(xmlHttpenqiry.responseText);
		if(xmlHttpenqiry.responseText==1)
		{
			document.getElementById("ajaximage").style.display="none";
			alert(" Thank You for enquiring. We wil get back to you within 24 hours.");
			document.scart_quote_form.emailid.value="";
			document.scart_quote_form.name.value="";
			document.scart_quote_form.phone1.value="";
			document.scart_quote_form.phone2.value="";
			document.scart_quote_form.phone3.value="";
			/*document.getElementById("market_tech1").checked;
	document.getElementById("market_tech2").checked;
	 document.getElementById("market_tech3").checked;
	 document.getElementById("market_tech4").checked;	 
	 document.getElementById("tech_cap1").checked;
	 document.getElementById("tech_cap2").checked;
	 document.getElementById("tech_cap3").checked;
	document.getElementById("tech_cap4").checked;
	 document.getElementById("tech_cap5").checked;
	 document.getElementById("tech_cap6").checked;
	 document.getElementById("tech_cap7").checked;
	 document.getElementById("tech_cap8").checked;
	 document.getElementById("tech_cap9").checked;
	 document.getElementById("tech_cap10").checked;
	 document.getElementById("tech_cap11").checked;
	 document.getElementById("tech_cap12").checked;
	 document.getElementById("usale1").checked;
	 document.getElementById("usale2").checked;
	document.getElementById("usale3").checked;
	 document.getElementById("usale4").checked;
	 document.getElementById("usale5").checked;
	 document.getElementById("usale6").checked;*/
		}
		return true;	
	}	
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    var aVersions = [ "MSXML2.XMLHttp.5.0",
        "MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0",
        "MSXML2.XMLHttp","Msxm12.XMLHTTP","Microsoft.XMLHttp"];

    for (var i = 0; i < aVersions.length; i++) 
	 {
        try {
            var xmlHttp = new ActiveXObject(aVersions[i]);
            return xmlHttp;
            } 
		catch (oError) 
		   {
            //Do nothing
           }
    }
    }
  catch (e)
    {
    }
  }
  if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
return xmlHttp;
}
