var xmlHttp

function getProducts(product,size,homeaway,sleeve,period,hero)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="/AJAX/getProducts.asp";
url=url+"?product="+product;
url=url+"&size="+size;
url=url+"&homeaway="+homeaway;
url=url+"&sleeve="+sleeve;
url=url+"&period="+period;
url=url+"&hero="+hero;

xmlHttp.onreadystatechange=stateChangedgetProducts;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);

}

function stateChangedgetProducts() 
{ 
if (xmlHttp.readyState==4)
	{ 	
		//alert (xmlHttp.responseText);
		document.getElementById('SearchResults').innerHTML = xmlHttp.responseText;
		
		$(document).ready(function(){
	
	$(".toggle_container").hide();
 
	$("span.trigger").toggle(function(){
		$(this).addClass("active"); 
		}, function () {
		$(this).removeClass("active");
	});
	
	$("span.trigger").click(function(){
		$(this).next(".toggle_container").slideToggle("slow,");
	});
 
});
	}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}
