/*
 Script (c) David Henderson 2005
 http://www.greatasp.co.uk
 Feel free to use this in your projects, but leave this reference intact
*/

// declare new variables for each new div that you add, and link to the div by ID
var subcatdiv = document.getElementById("subcat_div");



function getSelect(selType,str, destination){
	
	if(str!=''){

	 var doc = null; 

// Make a new XMLHttp object

   if (typeof window.ActiveXObject != 'undefined' ) 
   { 
       doc = new ActiveXObject("Microsoft.XMLHTTP"); 
   } 
   else 
   { 
       doc = new XMLHttpRequest(); 
   }
	 
// Load the result from the response page
// Note the response page can be any page that returns the right result. 
// I used ASP. PHP, PERL... etc could acheive the same result

// ** As far a I know firefox will only load a document on the SAME domain!!

		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>' ;
}


}



	 
	 
	 
	 

