	function getListBoxes()
	{ 
	    var material1 = document.getElementsByName('material1')[0].options[document.getElementsByName('material1')[0].selectedIndex].value;
	    var material2 = document.getElementsByName('material2')[0].options[document.getElementsByName('material2')[0].selectedIndex].value;
	    var material3 = document.getElementsByName('material3')[0].options[document.getElementsByName('material3')[0].selectedIndex].value;
        var processing = document.getElementsByName('processing')[0].options[document.getElementsByName('processing')[0].selectedIndex].value;
        var keyword1 = document.getElementsByName('keyword1')[0].options[document.getElementsByName('keyword1')[0].selectedIndex].value;
        var keyword2 = document.getElementsByName('keyword2')[0].options[document.getElementsByName('keyword2')[0].selectedIndex].value;
        var keyword3 = document.getElementsByName('keyword3')[0].options[document.getElementsByName('keyword3')[0].selectedIndex].value;
        var keyword4 = document.getElementsByName('keyword4')[0].options[document.getElementsByName('keyword4')[0].selectedIndex].value;
        
		var url = '/technology/api/getListBoxes.php';
		var pars = '&material1=' + encodeURL(material1) + '&material2=' + encodeURL(material2) + '&material3=' + encodeURL(material3) + '&processing=' + encodeURL(processing) + '&keyword1=' + encodeURL(keyword1) + '&keyword2=' + encodeURL(keyword2) + '&keyword3=' + encodeURL(keyword3) + '&keyword4=' + encodeURL(keyword4);
		
		var myAjax = new Ajax.Request(
			url, 
			{
				method: 'get', 
				parameters: pars, 
				on200: on_loadedXML,
				onFailure: function(){
				return;
				}
			});
	}
	
	function on_loadedXML(obj){
	   var xml = obj.responseXML;
	   
	   //Read selectbox
	   var selectBox = xml.getElementsByTagName("selectbox");
	   
	   for(var i=0;i<selectBox.length;i++){
	       var selectBoxName = selectBox[i].getAttribute("name");
	       var options = selectBox[i].getElementsByTagName("option");
	       clearOption(selectBoxName);
	       makeOption(selectBoxName, options);
	   }
	}
	
	function clearOption(ojName){
	    var oj = document.getElementsByName(ojName)[0];
	    if (oj){
	        var optionIndex = oj.options.length;
	        if (optionIndex){
		        for (var i=0;i<optionIndex;i++){
		            oj.removeChild(oj.options[0]);
		        }
	        }
        }
    }
    
    function makeOption(ojName, options){
        var oj = document.getElementsByName(ojName)[0];
        if (oj){
            var optionIndex = options.length;
            if (optionIndex){
	            for (var i=0;i<optionIndex;i++){
	                var newchild = document.createElement("option");
	                newchild.value = options[i].getAttribute("key");
	                newchild.innerHTML = options[i].getAttribute("value");
	                
	                if (options[i].getAttribute("selected") == 'true'){
	                newchild.selected = true;
	                }
	                oj.appendChild(newchild);
	            }
            }
        }
    }
