

// declare new variables for each new div that you add, and link to the div by ID
var subcatdiv = document.getElementById("subcat_div");
var loaderdiv = document.getElementById("showloader");


function getSelect(selType,str, destination,mlevel){
	loaderdiv.style.display = "block";
	if(str!=''){

	 var doc = null; 

    if (mlevel=='1')
    {
        //town_div.innerHTML = '<select><option value=""> --  --</option></select>';
    }
    if (mlevel=='1')
    {
        members_div.innerHTML = '';
    }

// Make a new XMLHttp object

   if (typeof window.ActiveXObject != 'undefined' ) 
   { 
       doc = new ActiveXObject("Microsoft.XMLHTTP"); 
   } 
   else 
   { 
       doc = new XMLHttpRequest(); 
   }
	 

		if (doc){ 	 
		 doc.open("GET", "dyn_response.asp?search="+selType+"&str=" + str, false);
	   doc.send(null);

// Write the response to the div 		
			destination.innerHTML = doc.responseText;

		}else{
		
			destination.innerHTML = 'Browser unable to create XMLHttp Object';
		}
		
}else{
// Return the next select box back to the default
		destination.innerHTML= '<select><option value=""> -- --</option></select>' ;
}

loaderdiv.style.display = "none";
}



	 
	 
	 
	 


