//script for reloading results

var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}





//pass this the id u want it to load results in
//make sure its a string
function load_dropdown(cat,container_id){
	
	container = document.getElementById(container_id);
	final_html = container.innerHTML;
	
	get = "cat="+cat;	
    file = "/inc/loaders/dropdown_loader.php?"+get;
	
	xmlhttp.open("GET", file,true);
	 xmlhttp.onreadystatechange=function() {
	  if (xmlhttp.readyState==2) {
	  	//product_container.innerHTML = '<br><br><center><h2>Loading Results...</h2></center><br><br>';
	  }
	  if (xmlhttp.readyState==4) {
		   results = xmlhttp.responseText;
		   final_html = final_html + results;
		   container.innerHTML = final_html
	  }
	 }
	 xmlhttp.send(null)	

}

function generate_dropdowns(){
	setTimeout("load_dropdown(1,'treadmills-list-item');",200);
	setTimeout("load_dropdown(2,'ellipticals-list-item');",500);
	setTimeout("load_dropdown(5,'accessories-list-item');",850);	
}


//actual funtion calls
window.onload = generate_dropdowns;

