/****************** FUNCTION STARTS*************************/

/*
* METHOD II: To define HTTP REQUEST METHOD AJAX FUNCTION
*
*/

/***********************************************************************
  AJAX Function
************************************************************************/
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();
	  xmlhttp.async = false;
    } 
    catch (e) 
    { 
      xmlhttp = false; 
    } 
  } 
  return xmlhttp; 
} 
var http = getHTTPObject(); // We create the HTTP Object 
/****************** FUNCTION ENDS***************************/
function ajax_submitquote(sCompany,sName,sEmail,sTechnology,sBudget,sQuote)
{
  http.open('POST', 'submitquote.html'); // here you need to use asp page instead of php
  http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  http.onreadystatechange = handleHttpResponseSubmitQuote; // this is the function which receives the HTTP AJAX response from database
  http.send('param1=' + sCompany + '&param2=' + sName + '&param3=' + sEmail + '&param4=' + sTechnology + '&param5=' + sBudget + '&param6=' + sQuote);
}

function handleHttpResponseSubmitQuote()
{
	if(http.readyState == 4 && http.status == 200)
	{
		var output = http.responseText;
		alert(output);
		fade('demoPopup1',false,this.id);
	}
}

function ajax_submithosting(sType,sCompany,sName,sEmail,sReq)
{
  http.open('POST', 'submithosting.html'); // here you need to use asp page instead of php
  http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  http.onreadystatechange = handleHttpResponseSubmitHosting; // this is the function which receives the HTTP AJAX response from database
  http.send('param1=' + sType + '&param2=' + sCompany + '&param3=' + sName + '&param4=' + sEmail + '&param5=' + sReq);
}

function handleHttpResponseSubmitHosting()
{
	if(http.readyState == 4 && http.status == 200)
	{
		var output = http.responseText;
		alert(output);
		fade('bhpopup',false,this.id);
	}
}
