/*
 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("subcatdiv");
var special = document.getElementById("special");



function getSelect(selType,str,str2,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", "includes/dyn_response.php?search="+selType+"&str=" + str + "&str2=" + str2, false);

  		//alert (destination);
 	 	//alert (selType);	
        //alert (str);
        // alert (str2);

	   	doc.send(null);

// Write the response to the div 		
                 document.getElementById(destination).innerHTML = doc.responseText;


		}else{
		
			document.getElementById(destination).innerHTML = 'Browser unable to create XMLHttp Object';
		}
		
}else{
// Return the next select box back to the default
		document.getElementById(destination).innerHTML= '<select><option value=""> -- --</option></select>' ;
}


}



	 
	 
	 
	 

