function getXMLHttp()
{
  var xmlHttp

  try
  {
    //Firefox, Opera 8.0+, Safari
    xmlHttp = new XMLHttpRequest();
  }
  catch(e)
  {
    //Internet Explorer
    try
    {
      xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e)
    {
      try
      {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
      }
      catch(e)
      {
        alert("Your browser does not support AJAX!")
        return false;
      }
    }
  }
  return xmlHttp;
}

function ProdRequest(prodcat, brand)
{
  var xmlHttp = getXMLHttp();

  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4)
    {
      RangeResponse(xmlHttp.responseText);
    }
  }
  
  xmlHttp.open("GET", "product-ajax.php?prodcat=" + prodcat + "&brand=" + brand , true); 
  xmlHttp.send(null);
}


function ProdTypeRequest(prodcat,type)
{
  var xmlHttp = getXMLHttp();

  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4)
    {
      RangeResponse(xmlHttp.responseText);
    }
  }
  
  xmlHttp.open("GET", "product-ajax.php?prodcat=" + prodcat + "&type=" + type , true); 
  xmlHttp.send(null);
}

function ProdDetailRequest(prodcat,id)
{
  var xmlHttp = getXMLHttp();
  //alert(id);
  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4)
    {
      RangeResponse(xmlHttp.responseText);
    }
  }
  
  xmlHttp.open("GET", "product-ajax.php?prodcat=" + prodcat + "&id=" + id , true); 
  xmlHttp.send(null);
}

function RangeResponse(response)
{
  document.getElementById('ResponseDiv').innerHTML = response;
}

